Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfusionMatrix ¶ added in v0.9.0
Types ¶
type Classifier ¶
Classifier models a classifier and its classes
type Config ¶
type Config struct { Classification dataset.DataSet `yaml:"classification"` Pipeline pipeline.Config `yaml:"pipeline"` Model ModelConfig `yaml:"model"` }
Config models a classification yaml file
type Model ¶ added in v0.8.1
type Model interface { // Learn takes a training dataset as input and trains the model // It returns the training accuracy for the model Learn(texts dataset.DataSet, pipe *pipeline.Config) float32 // Predict makes a class prediction based on the trained model Predict(text string, pipe *pipeline.Config) (predictedClass string, proba float32) // Save persists the model to a file Save(directory string) error }
Model interface contains the basic functions for a model to have
type ModelConfig ¶ added in v0.8.1
type ModelConfig struct { // Classifier is the type of classifier to be used Classifier string `mapstructure:"classifier"` // Parameters holds any other model parameters // TODO: improve this field Parameters map[string]interface{} `mapstructure:"parameters"` // Directory is the path to the saved model files Directory string `mapstructure:"directory"` // Whether to save the trained model or not Save bool `mapstructure:"save"` // Whether to load the saved model or not Load bool `mapstructure:"load"` // WordVectorsConfig contains configuration for fasttext word vectors WordVectorsConfig wordvectors.Config `mapstructure:"word_vectors"` }
ModelConfig defines the data for the model's operation
Click to show internal directories.
Click to hide internal directories.