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.
GetFeatures returns a slice containing all features.
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.
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.
GetStats provides database statistics.
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.
LoadCache loads all cacheable data into memory.