Documentation
¶
Index ¶
- Constants
- Variables
- func BatchPredict(ctx context.Context, recSys Predictor, userAndItems [][2]int) (y *mat.Dense, err error)
- func GetItemEmbeddingModelFromUb(ctx context.Context, iSeq ItemEmbedding) (mod model.Model, err error)
- func GetSample(recSys RecSys, ctx context.Context) (sample ps.Samples, err error)
- func StartHttpApi(predict Predictor, path string, addr string, efs *embed.FS) (err error)
- type DashboardOverviewResult
- type FeatureOverview
- type ItemEmbedding
- type ItemFeaturer
- type ItemOverView
- type ItemOverviewResult
- type ItemScore
- type PreRanker
- type PreTrainer
- type Predictor
- type RecApiRequest
- type RecApiResponse
- type RecSys
- type Sample
- type Stage
- type Tensor
- type Trainer
- type UserFeaturer
- type UserItemOverview
- type UserItemOverviewResult
Constants ¶
View Source
const ( StageKey = "stage" ItemEmbDim = 10 ItemEmbWindow = 5 )
Variables ¶
View Source
var ( DebugUserId int DebugItemId int )
Functions ¶
func BatchPredict ¶
func StartHttpApi ¶
StartHttpApi starts the http api for recommendation Query by:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"userId":107,"itemIdList":[1,2,39]}' \
http://localhost:8080/api/v1/recommend
Types ¶
type DashboardOverviewResult ¶
type FeatureOverview ¶
type FeatureOverview interface {
// offset and size use for paging query
GetUsersFeatureOverview(ctx context.Context, offset, size int, opts map[string][]string) (UserItemOverviewResult, error)
// offset and size use for paging query
GetItemsFeatureOverview(ctx context.Context, offset, size int, opts map[string][]string) (ItemOverviewResult, error)
// GetDashboardOverview
GetDashboardOverview(ctx context.Context) (DashboardOverviewResult, error)
}
type ItemEmbedding ¶
ItemEmbedding is an interface used to generate item embedding with item2vec model by just providing a behavior based item sequence. Example: user liked items sequence, user bought items sequence, user viewed items sequence
type ItemFeaturer ¶
type ItemOverView ¶
type ItemOverviewResult ¶
type ItemOverviewResult struct {
Items []ItemOverView `json:"items"`
}
type PreTrainer ¶
type Predictor ¶
type Predictor interface {
UserFeaturer
ItemFeaturer
base.Predicter
}
type RecApiRequest ¶
type RecApiResponse ¶
type RecApiResponse struct {
ItemScoreList []ItemScore `json:"itemScoreList"`
}
type RecSys ¶
type RecSys interface {
UserFeaturer
ItemFeaturer
Trainer
FeatureOverview
}
type UserFeaturer ¶
type UserItemOverview ¶
type UserItemOverviewResult ¶
type UserItemOverviewResult struct {
Users []UserItemOverview `json:"users"`
}
Click to show internal directories.
Click to hide internal directories.