algorithm

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAlgo

func AddAlgo(conf recconf.AlgoConfig)

func Load

func Load(config *recconf.RecommendConfig)

init algorithm from the config, and add to the algoFactory

func RegistRequestDataFunc

func RegistRequestDataFunc(name string, f RequestDataFunc)

func RegisterAlgorithm

func RegisterAlgorithm(name string, algo IAlgorithm)

func Run

func Run(name string, algoData interface{}) (interface{}, error)

Types

type AlgorithmFactory

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

func NewAlgorithmFactory

func NewAlgorithmFactory() *AlgorithmFactory

func (*AlgorithmFactory) Init

func (a *AlgorithmFactory) Init(algoConfs []recconf.AlgoConfig)

func (*AlgorithmFactory) Run

func (a *AlgorithmFactory) Run(name string, algoData interface{}) (interface{}, error)

type IAlgorithm

type IAlgorithm interface {
	Init(conf *recconf.AlgoConfig) error
	Run(algoData interface{}) (interface{}, error)
}

type LookupPolicy

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

func NewLookupPolicy

func NewLookupPolicy() *LookupPolicy

func (*LookupPolicy) Init

func (m *LookupPolicy) Init(conf *recconf.AlgoConfig) error

func (*LookupPolicy) Run

func (m *LookupPolicy) Run(algoData interface{}) (interface{}, error)

type LookupResponse

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

func (*LookupResponse) GetModuleType

func (r *LookupResponse) GetModuleType() bool

func (*LookupResponse) GetScore

func (r *LookupResponse) GetScore() float64

func (*LookupResponse) GetScoreMap

func (r *LookupResponse) GetScoreMap() map[string]float64

type RequestDataFunc

type RequestDataFunc func(string, interface{}) interface{}

Directories

Path Synopsis
eas

Jump to

Keyboard shortcuts

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