result

package
v0.0.0-...-b2170da Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

This package contains data types for the training results representation. Each training for Bayes algorithm provides these data:

  • Classes frequencies
  • Features per classes frequencies
  • Total number of samples processed during the training

This package contains data types for the training results representation. Each training for Bayes algorithm provides these data:

  • Classes frequencies
  • Features per classes frequencies
  • Total number of samples processed during the training

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassFrequency

type ClassFrequency map[int64]int64

This map contains classes frequencies in the training dataset. The key of map is a Class ID and values is a count of samples with this class.

type TextClassFrequency

type TextClassFrequency map[string]int64

This map contains classes frequencies in the training dataset. The key of map is a Class ID and values is a count of samples with this class.

type TextTokenFrequency

type TextTokenFrequency map[string]map[string]int64

This map contains tokens (or features) frequencies for classes in the training dataset. The first-level key is a Class ID, the second-level key is Token ID, and the value is a number of sample which have the corresponding class and token.

type TextTrainingResult

type TextTrainingResult struct {
	SamplesCount       int64 // The total number of samples seen in dataset
	TextClassFrequency TextClassFrequency
	TextTokenFrequency TextTokenFrequency
}

func NewTextTrainingResult

func NewTextTrainingResult() *TextTrainingResult

func (*TextTrainingResult) IncClassCount

func (t *TextTrainingResult) IncClassCount(class string)

func (*TextTrainingResult) IncSamplesCount

func (t *TextTrainingResult) IncSamplesCount()

func (*TextTrainingResult) IncTokenCount

func (t *TextTrainingResult) IncTokenCount(class, token string)

type TokenFrequency

type TokenFrequency map[int64]map[int64]int64

This map contains tokens (or features) frequencies for classes in the training dataset. The first-level key is a Class ID, the second-level key is Token ID, and the value is a number of sample which have the corresponding class and token.

type TrainingResult

type TrainingResult struct {
	SamplesCount   int64 // The total number of samples seen in dataset
	ClassFrequency ClassFrequency
	TokenFrequency TokenFrequency
}

func NewTrainingResult

func NewTrainingResult() *TrainingResult

func (*TrainingResult) IncClassCount

func (t *TrainingResult) IncClassCount(classID int64)

func (*TrainingResult) IncSamplesCount

func (t *TrainingResult) IncSamplesCount()

func (*TrainingResult) IncTokenCount

func (t *TrainingResult) IncTokenCount(classID, tokenID int64)

Jump to

Keyboard shortcuts

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