meta

package
v0.0.0-...-db086a8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 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 BaggedModel

type BaggedModel struct {
	base.BaseClassifier
	Models         []base.Classifier
	RandomFeatures int
	// contains filtered or unexported fields
}

BaggedModel trains base.Classifiers on subsets of the original Instances and combine the results through voting

func (*BaggedModel) AddModel

func (b *BaggedModel) AddModel(m base.Classifier)

AddModel adds a base.Classifier to the current model

func (*BaggedModel) Fit

func (b *BaggedModel) Fit(from base.FixedDataGrid)

Fit generates and trains each model on a randomised subset of Instances.

func (*BaggedModel) Predict

func (b *BaggedModel) Predict(from base.FixedDataGrid) base.FixedDataGrid

Predict gathers predictions from all the classifiers and outputs the most common (majority) class

IMPORTANT: in the event of a tie, the first class which achieved the tie value is output.

func (*BaggedModel) String

func (b *BaggedModel) String() string

String returns a human-readable representation of the BaggedModel and everything it contains

type OneVsAllModel

type OneVsAllModel struct {
	NewClassifierFunction func(string) base.Classifier
	// contains filtered or unexported fields
}

OneVsAllModel replaces class Attributes with numeric versions and trains n wrapped classifiers. The actual class is chosen by whichever is most confident. Only one CategoricalAttribute class variable is supported.

func NewOneVsAllModel

func NewOneVsAllModel(f func(string) base.Classifier) *OneVsAllModel

NewOneVsAllModel creates a new OneVsAllModel. The argument must be a function which returns a base.Classifier ready for training.

func (*OneVsAllModel) Fit

func (m *OneVsAllModel) Fit(using base.FixedDataGrid)

Fit creates n filtered datasets (where n is the number of values a CategoricalAttribute can take) and uses them to train the underlying classifiers.

func (*OneVsAllModel) Predict

Predict issues predictions. Each class-specific classifier is expected to output a value between 0 (indicating that a given instance is not a given class) and 1 (indicating that the given instance is definitely that class). For each instance, the class with the highest value is chosen. The result is undefined if several underlying models output the same value.

Jump to

Keyboard shortcuts

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