Documentation ¶
Overview ¶
Package cache provides caching. All data that can be loaded once into memory is dealt with in this package. To use it, a call to LoadCache() shall be made once at the start of the application. After the data is loaded into memory, it can be accessed with the getters functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFeatures ¶
GetFeatures returns a slice containing all features.
func GetFeaturesNames ¶
func GetFeaturesNames() map[string]struct{}
GetFeaturesNames returns a map of features names. It can be used to check in O(1) if a feature exists by providing its name as a key to the map.
func GetScoresMatrix ¶
GetScoresMatrix returns the scores matrix from cache. Each row of the matrix corresponds to a user whereas each column corresponds to a feature. The scores matrix is closely related to the users vector. Row 'i' of the scores matrix corresponds to the scores for each feature for the user at row 'i' in the users vector.
func GetUsersVector ¶
GetUsersVector returns the vector of users from cache. Important: the vector is sorted, matching the rows of the scores matrix. In other words, user at position 'i' in the slice corresponds as the scores for each feature at row 'i' of the scores matrix.
Types ¶
This section is empty.