harness

package
v0.0.0-...-ed6d74d Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Accuracy  float64
	Recall    float64
	Precision float64
	F1        float64
}

Metrics represents a collection of performance metrics to evaluate a machine learning classifier.

func Evaluate

func Evaluate(datasetPath string, algo Predictor) (Metrics, error)

Evaluate takes a path to the dataset CSV file and an algorithm that implements the Predictor interface. The function returns performance scores measuring the skill of the algorithm at correctly predicting the class of observations or an error if one occurs. This function assumes that labels are the last column in the dataset.

type Predictor

type Predictor interface {
	// Fit the model to the training data.  This trains the model learning
	// associations between each feature vector (row vector) within matrix
	// X and it's associated ground truth class label in slice Y.
	Fit(X *mat.Dense, Y []string)
	// Predict will classify the feature vectors (row vectors) within
	// matrix X, predicting the correct class for each based upon what
	// what the model learned during training.
	Predict(X *mat.Dense) []string
}

Predictor implementations define specific machine learning algorithms to classify data. The interface contains Fit and Predict methods to Fit the model to training data and Predict classes of previously unseen observations respectively.

Jump to

Keyboard shortcuts

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