NReco.CF.Taste.Impl.Model AbstractDataModel
NReco.CF.Taste.Impl.Model.File FileDataModel
Namespace: NReco.CF.Taste.Impl.Model.File
Assembly: NReco.Recommender (in NReco.Recommender.dll) Version: 1.0.0.0 (1.0.0.0)
The FileDataModel type exposes the following members.
Name | Description | |
---|---|---|
FileDataModel(String) | Initializes a new instance of the FileDataModel class | |
FileDataModel(String, String) | Initializes a new instance of the FileDataModel class | |
FileDataModel(String, Boolean, Int64, Boolean, String) | Initializes a new instance of the FileDataModel class |
Name | Description | |
---|---|---|
DEFAULT_MIN_RELOAD_INTERVAL_MS |
userID,itemID[,preference[,timestamp]]
Preference value is optional to accommodate applications that have no notion of a preference value (that is, the user simply expresses a preference for an item, but no degree of preference).
The preference value is assumed to be parseable as a
double
123,456,,129050099059
But this isn't:
123,456,129050099059
It is also acceptable for the lines to contain additional fields. Fields beyond the third will be ignored. An empty line, or one that begins with '#' will be ignored as a comment.
This class will reload data from the data file when Refresh(IList IRefreshable ) is called, unless the file has been reloaded very recently already.
This class will also look for update "delta" files in the same directory, with file names that start the same way (up to the first period). These files have the same format, and provide updated data that supersedes what is in the main data file. This is a mechanism that allows an application to push updates to FileDataModel without re-copying the entire data file.
One small format difference exists. Update files must also be able to express deletes. This is done by ending with a blank preference value, as in "123,456,".
Note that it's all-or-nothing -- all of the items in the file must express no preference, or the all must. These cannot be mixed. Put another way there will always be the same number of delimiters on every line of the file!
This class is not intended for use with very large amounts of data (over, say, tens of millions of rows). For that, a JDBC-backed {@link DataModel} and a database are more appropriate.
It is possible and likely useful to subclass this class and customize its behavior to accommodate application-specific needs and input formats.