scorer

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Name                      string
	Tokens                    []*Token
	AttributesFrequencyCounts map[string]map[string]int
}

Collection.

func NewCollection

func NewCollection(name string, tokens []*Token) *Collection

func (*Collection) DeriveNormalizedAttributesFrequencyCounts

func (collection *Collection) DeriveNormalizedAttributesFrequencyCounts() map[string]map[string]int

func (*Collection) ExtractCollectionAttributeEntropy

func (collection *Collection) ExtractCollectionAttributeEntropy() map[string]float64

func (*Collection) ExtractCollectionAttributeFrequencyCounts

func (collection *Collection) ExtractCollectionAttributeFrequencyCounts() map[string]map[string]int

func (*Collection) ExtractCollectionAttributes

func (collection *Collection) ExtractCollectionAttributes() map[string][]CollectionAttribute

func (*Collection) ExtractNullAttributes

func (collection *Collection) ExtractNullAttributes() map[string]*CollectionAttribute

func (*Collection) TotalTokensWithAttribute

func (collection *Collection) TotalTokensWithAttribute(attribute TokenAttribute) int

type CollectionAttribute

type CollectionAttribute struct {
	Attribute   TokenAttribute
	TotalTokens int
}

type InformationContentScorer

type InformationContentScorer struct{}

func NewInformationContentScorer

func NewInformationContentScorer() *InformationContentScorer

func (*InformationContentScorer) GetCollectionEntropy

func (scorer *InformationContentScorer) GetCollectionEntropy(collection *Collection, collectionAttributes map[string][]CollectionAttribute, collectionNullAttributes map[string]*CollectionAttribute) float64

func (*InformationContentScorer) GetICScore

func (scorer *InformationContentScorer) GetICScore(collection *Collection, token *Token, collectionNullAttributes map[string]*CollectionAttribute) (float64, error)

func (*InformationContentScorer) GetTokenAttributesScoresAndWeights

func (scorer *InformationContentScorer) GetTokenAttributesScoresAndWeights(collection *Collection, token *Token, _ bool, collectionNullAttributes map[string]*CollectionAttribute) ([]float64, []float64)

func (*InformationContentScorer) ScoreCollection

func (scorer *InformationContentScorer) ScoreCollection(collection *Collection) ([]float64, error)

func (*InformationContentScorer) ScoreToken

func (scorer *InformationContentScorer) ScoreToken(collection *Collection, token *Token, collectionNullAttributes map[string]*CollectionAttribute, collectionEntropy float64) (float64, error)

type Scorer

type Scorer interface {
	// contains filtered or unexported methods
}

type Token

type Token struct {
	ContractAddress common.Address
	TokenID         int64
	Metadata        []TokenAttribute
}

type TokenAttribute

type TokenAttribute struct {
	Name  string
	Value interface{}
}

Jump to

Keyboard shortcuts

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