recom

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fit

func Fit()

func OnInit

func OnInit(config map[string]interface{}, option ...Option) (err error)

func RecommendItems

func RecommendItems(uId uint32, howmany int) (itemIds []uint32)

func Wait

func Wait()

Types

type IRecom

type IRecom interface {
	Fit()
	Wait()
	RecommendItems(uId uint32, howmany int) (itemIds []uint32)
}

推荐系统 协同过滤算法

func NewSys

func NewSys(option ...Option) (sys IRecom, err error)

type Option

type Option func(*Options)

func SetItemIds

func SetItemIds(v []uint32) Option

func SetItemIdsScore

func SetItemIdsScore(v map[uint32]map[uint32]float64) Option

func SetRatings

func SetRatings(v []float64) Option

func SetRecomModel

func SetRecomModel(v RecomModel) Option

func SetUserIds

func SetUserIds(v []uint32) Option

type Options

type Options struct {
	RecomModel   RecomModel                    //推荐模型
	ItemIdsScore map[uint32]map[uint32]float64 //物品评分模型
	ItemIds      []uint32
	UserIds      []uint32
	Ratings      []float64
}

type Recom

type Recom struct {
	// contains filtered or unexported fields
}

func (*Recom) Fit

func (this *Recom) Fit()

func (*Recom) RecommendItems

func (this *Recom) RecommendItems(uId uint32, howmany int) (itemIds []uint32)

func (*Recom) Wait

func (this *Recom) Wait()

type RecomModel

type RecomModel uint8

推荐系统 协同过滤算法

const (
	BPRModel RecomModel = iota
	SVD
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL