Documentation ¶
Index ¶
- func Items(dataSet ...core.DataSetInterface) map[uint32]bool
- func Top(items map[uint32]bool, userId uint32, n int, exclude *core.MarginalSubSet, ...) ([]uint32, []float64)
- type BPR
- type IModel
- type ItemPop
- type ModelBase
- type ParamName
- type Params
- func (parameters Params) Copy() Params
- func (parameters Params) GetBool(name ParamName, _default bool) bool
- func (parameters Params) GetFloat64(name ParamName, _default float64) float64
- func (parameters Params) GetInt(name ParamName, _default int) int
- func (parameters Params) GetInt64(name ParamName, _default int64) int64
- func (parameters Params) GetString(name ParamName, _default string) string
- func (parameters Params) Merge(params Params) Params
- type SVD
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BPR ¶
type BPR struct { ModelBase UserFactor [][]float64 // p_u ItemFactor [][]float64 // q_i UserRatings []*core.MarginalSubSet ItemPop *ItemPop // contains filtered or unexported fields }
贝叶斯个性化推荐 模型
func (*BPR) Fit ¶
func (bpr *BPR) Fit(trainSet core.DataSetInterface)
type ItemPop ¶
func NewItemPop ¶
func (*ItemPop) Fit ¶
func (pop *ItemPop) Fit(set core.DataSetInterface)
type ModelBase ¶
type ModelBase struct { Params Params UserIndexer *core.Indexer // Users' ID set ItemIndexer *core.Indexer // Items' ID set // contains filtered or unexported fields }
func (*ModelBase) Init ¶
func (model *ModelBase) Init(trainSet core.DataSetInterface)
type ParamName ¶
type ParamName string
const ( Lr ParamName = "Lr" // learning rate 学习率 Reg ParamName = "Reg" // regularization strength 正则化强度 NEpochs ParamName = "NEpochs" // number of epochs 纪元数 NFactors ParamName = "NFactors" // number of factors 因素数量 RandomState ParamName = "RandomState" // random state (seed) 随机状态(种子) UseBias ParamName = "UseBias" // use bias 使用偏见 InitMean ParamName = "InitMean" // mean of gaussian initial parameter 高斯初始参数的平均值 InitStdDev ParamName = "InitStdDev" // standard deviation of gaussian initial parameter 高斯初始参数的标准偏差 InitLow ParamName = "InitLow" // lower bound of uniform initial parameter 统一初始参数的下界 InitHigh ParamName = "InitHigh" // upper bound of uniform initial parameter 统一初始参数的上限 NUserClusters ParamName = "NUserClusters" // number of user cluster 用户集群数 NItemClusters ParamName = "NItemClusters" // number of item cluster 项目群数 Type ParamName = "Type" // type for KNN KNN类型 UserBased ParamName = "UserBased" // user based if true. otherwise item based. 基于用户(如果为true)。 否则基于项目。 Similarity ParamName = "Similarity" // similarity metrics 相似性指标 K ParamName = "K" // number of neighbors 邻居数 MinK ParamName = "MinK" // least number of neighbors 邻居最少 Optimizer ParamName = "Optimizer" // optimizer for optimization (SGD/ALS/BPR) 用于优化的优化器(SGD / ALS / BPR) Shrinkage ParamName = "Shrinkage" // shrinkage strength of similarity 相似收缩强度 Alpha ParamName = "Alpha" // alpha value, depend on context alpha值,取决于上下文 )
type Params ¶
type Params map[ParamName]interface{}
func (Params) GetBool ¶
GetBool gets a bool parameter by name. Returns _default if not exists or type doesn't match.
func (Params) GetFloat64 ¶
GetFloat64 gets a float parameter by name. Returns _default if not exists or type doesn't match. The type will be converted if given int.
func (Params) GetInt ¶
GetInt gets a integer parameter by name. Returns _default if not exists or type doesn't match.
func (Params) GetInt64 ¶
GetInt64 gets a int64 parameter by name. Returns _default if not exists or type doesn't match. The type will be converted if given int.
type SVD ¶
type SVD struct { ModelBase UserFactor [][]float64 // p_u ItemFactor [][]float64 // q_i UserBias []float64 // b_u ItemBias []float64 // b_i GlobalMean float64 // mu // Fallback model UserRatings []*core.MarginalSubSet ItemPop *ItemPop // contains filtered or unexported fields }
func (*SVD) Fit ¶
func (svd *SVD) Fit(trainSet core.DataSetInterface)
Click to show internal directories.
Click to hide internal directories.