C# Class NReco.CF.Taste.Impl.Model.GenericDataModel

Inheritance: NReco.CF.Taste.Impl.Model.AbstractDataModel
Mostrar archivo Open project: nreco/recommender Class Usage Examples

Public Methods

Method Description
GenericDataModel ( FastByIDMap userData ) : System

Creates a new GenericDataModel from the given users (and their preferences). This IDataModel retains all this information in memory and is effectively immutable.

GenericDataModel ( FastByIDMap userData, FastByIDMap timestamps ) : System

Creates a new GenericDataModel from the given users (and their preferences). This IDataModel retains all this information in memory and is effectively immutable.

GenericDataModel ( IDataModel dataModel ) : System

Creates a new GenericDataModel containing an immutable copy of the data from another given IDataModel.

GetItemIDs ( ) : IEnumerator
GetItemIDsFromUser ( long userID ) : FastIDSet
GetNumItems ( ) : int
GetNumUsers ( ) : int
GetNumUsersWithPreferenceFor ( long itemID ) : int
GetNumUsersWithPreferenceFor ( long itemID1, long itemID2 ) : int
GetPreferenceTime ( long userID, long itemID ) : DateTime?
GetPreferenceValue ( long userID, long itemID ) : float?
GetPreferencesForItem ( long itemID ) : IPreferenceArray
GetPreferencesFromUser ( long userID ) : IPreferenceArray
GetRawItemData ( ) : FastByIDMap

This is used mostly internally to the framework, and shouldn't be relied upon otherwise.

GetRawUserData ( ) : FastByIDMap

This is used mostly internally to the framework, and shouldn't be relied upon otherwise.

GetUserIDs ( ) : IEnumerator
HasPreferenceValues ( ) : bool
Refresh ( IList alreadyRefreshed ) : void
RemovePreference ( long userID, long itemID ) : void
SetPreference ( long userID, long itemID, float value ) : void
ToDataMap ( FastByIDMap data, bool byUser ) : FastByIDMap

Swaps, in-place, ILists for arrays in map values.

ToDataMap ( IDataModel dataModel ) : FastByIDMap

Exports the simple user IDs and preferences in the data model.

ToString ( ) : string

Method Details

GenericDataModel() public method

Creates a new GenericDataModel from the given users (and their preferences). This IDataModel retains all this information in memory and is effectively immutable.
public GenericDataModel ( FastByIDMap userData ) : System
userData FastByIDMap userData users to include; (see also )
return System

GenericDataModel() public method

Creates a new GenericDataModel from the given users (and their preferences). This IDataModel retains all this information in memory and is effectively immutable.
public GenericDataModel ( FastByIDMap userData, FastByIDMap timestamps ) : System
userData FastByIDMap users to include; (see also )
timestamps FastByIDMap timestamps optionally, provided timestamps of preferences as milliseconds since the epoch. User IDs are mapped to maps of item IDs to long timestamps.
return System

GenericDataModel() public method

Creates a new GenericDataModel containing an immutable copy of the data from another given IDataModel.
public GenericDataModel ( IDataModel dataModel ) : System
dataModel IDataModel dataModel to copy
return System

GetItemIDs() public method

public GetItemIDs ( ) : IEnumerator
return IEnumerator

GetItemIDsFromUser() public method

public GetItemIDsFromUser ( long userID ) : FastIDSet
userID long
return FastIDSet

GetNumItems() public method

public GetNumItems ( ) : int
return int

GetNumUsers() public method

public GetNumUsers ( ) : int
return int

GetNumUsersWithPreferenceFor() public method

public GetNumUsersWithPreferenceFor ( long itemID ) : int
itemID long
return int

GetNumUsersWithPreferenceFor() public method

public GetNumUsersWithPreferenceFor ( long itemID1, long itemID2 ) : int
itemID1 long
itemID2 long
return int

GetPreferenceTime() public method

public GetPreferenceTime ( long userID, long itemID ) : DateTime?
userID long
itemID long
return DateTime?

GetPreferenceValue() public method

public GetPreferenceValue ( long userID, long itemID ) : float?
userID long
itemID long
return float?

GetPreferencesForItem() public method

public GetPreferencesForItem ( long itemID ) : IPreferenceArray
itemID long
return IPreferenceArray

GetPreferencesFromUser() public method

public GetPreferencesFromUser ( long userID ) : IPreferenceArray
userID long
return IPreferenceArray

GetRawItemData() public method

This is used mostly internally to the framework, and shouldn't be relied upon otherwise.
public GetRawItemData ( ) : FastByIDMap
return FastByIDMap

GetRawUserData() public method

This is used mostly internally to the framework, and shouldn't be relied upon otherwise.
public GetRawUserData ( ) : FastByIDMap
return FastByIDMap

GetUserIDs() public method

public GetUserIDs ( ) : IEnumerator
return IEnumerator

HasPreferenceValues() public method

public HasPreferenceValues ( ) : bool
return bool

Refresh() public method

public Refresh ( IList alreadyRefreshed ) : void
alreadyRefreshed IList
return void

RemovePreference() public method

public RemovePreference ( long userID, long itemID ) : void
userID long
itemID long
return void

SetPreference() public method

public SetPreference ( long userID, long itemID, float value ) : void
userID long
itemID long
value float
return void

ToDataMap() public static method

Swaps, in-place, ILists for arrays in map values.
public static ToDataMap ( FastByIDMap data, bool byUser ) : FastByIDMap
data FastByIDMap
byUser bool
return FastByIDMap

ToDataMap() public static method

Exports the simple user IDs and preferences in the data model.
public static ToDataMap ( IDataModel dataModel ) : FastByIDMap
dataModel IDataModel
return FastByIDMap

ToString() public method

public ToString ( ) : string
return string