recommender

package
v0.0.0-...-accb3fc Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultipleRecommendation

type MultipleRecommendation struct {
	Index           int         `json:"-"`
	Recommendation  []float64   `json:"recommendation"`
	Distance        float64     `json:"distance"`
	DistanceMeasure vm.Distance `json:"-"`
}

func (MultipleRecommendation) GetDistance

func (r MultipleRecommendation) GetDistance() float64

func (MultipleRecommendation) GetRecommendation

func (r MultipleRecommendation) GetRecommendation() []float64

func (MultipleRecommendation) String

func (r MultipleRecommendation) String() string

type NeighborhoodBasedRecommender

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

NeighborhoodBasedRecommender is a recommender system implemented using k-nearest neighbors

func NewNeighborhoodBasedRecommender

func NewNeighborhoodBasedRecommender(data [][]float64, k int) *NeighborhoodBasedRecommender

NewNeighborhoodBasedRecommender creates a new NeighborhoodBasedRecommender object

func (*NeighborhoodBasedRecommender) Recommend

func (nbr *NeighborhoodBasedRecommender) Recommend(items []float64, distanceMeasure vm.Distance, intercept, shuffle, serendipitous bool) ([]Recommendation, error)

Recommend recommends the n number of items that are closer to a given vector using a given distance measure

type Recommendation

type Recommendation interface {
	String() string
	GetDistance() float64
	GetRecommendation() []float64
}

type SerendipitousRecommendation

type SerendipitousRecommendation struct {
	Recommendation  []float64   `json:"recommendation"`
	DistanceMeasure vm.Distance `json:"-"`
}

func (SerendipitousRecommendation) GetDistance

func (r SerendipitousRecommendation) GetDistance() float64

func (SerendipitousRecommendation) GetRecommendation

func (r SerendipitousRecommendation) GetRecommendation() []float64

func (SerendipitousRecommendation) String

type SingleRecommendation

type SingleRecommendation struct {
	Recommendation  []float64   `json:"recommendation"`
	DistanceMeasure vm.Distance `json:"-"`
}

func (SingleRecommendation) GetDistance

func (r SingleRecommendation) GetDistance() float64

func (SingleRecommendation) GetRecommendation

func (r SingleRecommendation) GetRecommendation() []float64

func (SingleRecommendation) String

func (r SingleRecommendation) String() string

Jump to

Keyboard shortcuts

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