Documentation
¶
Index ¶
- type Dataset
- type FitInfo
- type Id
- type Option
- type Rec
- type Recommender
- func FitEvalExplicit[T Id, U Id](trainSet *Dataset[T, U], validSet *Dataset[T, U], options ...Option) (*Recommender[T, U], error)
- func FitExplicit[T Id, U Id](trainSet *Dataset[T, U], options ...Option) (*Recommender[T, U], error)
- func FitImplicit[T Id, U Id](trainSet *Dataset[T, U], options ...Option) (*Recommender[T, U], error)
- func (r *Recommender[T, U]) GlobalMean() float32
- func (r *Recommender[T, U]) ItemFactors(itemId U) []float32
- func (r *Recommender[T, U]) ItemIds() []U
- func (r *Recommender[T, U]) ItemRecs(itemId U, count int) []Rec[U]
- func (r *Recommender[T, U]) Predict(userId T, itemId U) float32
- func (r *Recommender[T, U]) Rmse(data *Dataset[T, U]) float32
- func (r *Recommender[T, U]) SimilarUsers(userId T, count int) []Rec[T]
- func (r *Recommender[T, U]) UserFactors(userId T) []float32
- func (r *Recommender[T, U]) UserIds() []T
- func (r *Recommender[T, U]) UserRecs(userId T, count int) []Rec[U]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dataset ¶
A dataset.
func LoadMovieLens ¶
Loads the MovieLens 100K dataset.
type FitInfo ¶
type FitInfo struct {
// The iteration.
Iteration int
// The training loss.
TrainLoss float32
// The validation loss.
ValidLoss float32
}
Information about a training iteration.
type Id ¶
type Id interface {
string | int | uint | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
}
An id.
type Option ¶
type Option func(*config)
A recommender option.
type Recommender ¶
A recommender.
func FitEvalExplicit ¶
func FitEvalExplicit[T Id, U Id](trainSet *Dataset[T, U], validSet *Dataset[T, U], options ...Option) (*Recommender[T, U], error)
Creates a recommender with explicit feedback and performs cross-validation.
func FitExplicit ¶
func FitExplicit[T Id, U Id](trainSet *Dataset[T, U], options ...Option) (*Recommender[T, U], error)
Creates a recommender with explicit feedback.
func FitImplicit ¶
func FitImplicit[T Id, U Id](trainSet *Dataset[T, U], options ...Option) (*Recommender[T, U], error)
Creates a recommender with implicit feedback.
func (*Recommender[T, U]) GlobalMean ¶
func (r *Recommender[T, U]) GlobalMean() float32
Returns the global mean.
func (*Recommender[T, U]) ItemFactors ¶
func (r *Recommender[T, U]) ItemFactors(itemId U) []float32
Returns factors for a specific item.
func (*Recommender[T, U]) ItemRecs ¶
func (r *Recommender[T, U]) ItemRecs(itemId U, count int) []Rec[U]
Returns recommendations for an item.
func (*Recommender[T, U]) Predict ¶
func (r *Recommender[T, U]) Predict(userId T, itemId U) float32
Returns the predicted rating for a specific user and item.
func (*Recommender[T, U]) Rmse ¶
func (r *Recommender[T, U]) Rmse(data *Dataset[T, U]) float32
Calculates the root mean square error for a dataset.
func (*Recommender[T, U]) SimilarUsers ¶
func (r *Recommender[T, U]) SimilarUsers(userId T, count int) []Rec[T]
Returns similar users.
func (*Recommender[T, U]) UserFactors ¶
func (r *Recommender[T, U]) UserFactors(userId T) []float32
Returns factors for a specific user.
func (*Recommender[T, U]) UserRecs ¶
func (r *Recommender[T, U]) UserRecs(userId T, count int) []Rec[U]
Returns recommendations for a user.
Click to show internal directories.
Click to hide internal directories.