Documentation ¶
Index ¶
- type AbsolutePearson
- type Accuracy
- type ConfusionMatrix
- func (cm ConfusionMatrix) Classes() []float64
- func (cm ConfusionMatrix) FalseNegatives(class float64) float64
- func (cm ConfusionMatrix) FalsePositives(class float64) float64
- func (cm ConfusionMatrix) NClasses() int
- func (cm ConfusionMatrix) String() string
- func (cm ConfusionMatrix) TrueNegatives(class float64) float64
- func (cm ConfusionMatrix) TruePositives(class float64) float64
- type DiffMetric
- type F1
- type LogLoss
- func (ll LogLoss) Apply(yTrue, yPred, weights []float64) (float64, error)
- func (ll LogLoss) BiggerIsBetter() bool
- func (ll LogLoss) Classification() bool
- func (ll LogLoss) Gradients(yTrue, yPred []float64) ([]float64, error)
- func (ll LogLoss) NeedsProbabilities() bool
- func (ll LogLoss) String() string
- type MAE
- type MSE
- type MacroF1
- type MacroPrecision
- func (precision MacroPrecision) Apply(yTrue, yPred, weights []float64) (float64, error)
- func (precision MacroPrecision) BiggerIsBetter() bool
- func (precision MacroPrecision) Classification() bool
- func (precision MacroPrecision) NeedsProbabilities() bool
- func (precision MacroPrecision) String() string
- type MacroRecall
- type Metric
- type MicroF1
- type MicroPrecision
- func (precision MicroPrecision) Apply(yTrue, yPred, weights []float64) (float64, error)
- func (precision MicroPrecision) BiggerIsBetter() bool
- func (precision MicroPrecision) Classification() bool
- func (precision MicroPrecision) NeedsProbabilities() bool
- func (precision MicroPrecision) String() string
- type MicroRecall
- type Negative
- type Precision
- type R2
- type RMSE
- type ROCAUC
- type Recall
- type WeightedF1
- type WeightedPrecision
- func (precision WeightedPrecision) Apply(yTrue, yPred, weights []float64) (float64, error)
- func (precision WeightedPrecision) BiggerIsBetter() bool
- func (precision WeightedPrecision) Classification() bool
- func (precision WeightedPrecision) NeedsProbabilities() bool
- func (precision WeightedPrecision) String() string
- type WeightedRecall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbsolutePearson ¶
type AbsolutePearson struct{}
AbsolutePearson measures the ROC AUC score.
func (AbsolutePearson) Apply ¶
func (ap AbsolutePearson) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply AbsolutePearson.
func (AbsolutePearson) BiggerIsBetter ¶
func (ap AbsolutePearson) BiggerIsBetter() bool
BiggerIsBetter method of AbsolutePearson.
func (AbsolutePearson) Classification ¶
func (ap AbsolutePearson) Classification() bool
Classification method of AbsolutePearson.
func (AbsolutePearson) NeedsProbabilities ¶
func (ap AbsolutePearson) NeedsProbabilities() bool
NeedsProbabilities method of AbsolutePearson.
func (AbsolutePearson) String ¶
func (ap AbsolutePearson) String() string
String method of AbsolutePearson.
type Accuracy ¶
type Accuracy struct{}
Accuracy measures the fraction of matches between true classes and predicted classes.
func (Accuracy) BiggerIsBetter ¶
BiggerIsBetter method of Accuracy.
func (Accuracy) Classification ¶
Classification method of Accuracy.
func (Accuracy) NeedsProbabilities ¶
NeedsProbabilities method of Accuracy.
type ConfusionMatrix ¶
A ConfusionMatrix stores true positives (TP), true negatives (TN), false positives (FP) and false negatives (FN).
func MakeConfusionMatrix ¶
func MakeConfusionMatrix(yTrue, yPred, weights []float64) (ConfusionMatrix, error)
MakeConfusionMatrix returns a ConfusionMatrix from a slice of true classes and another slice of predicted classes.
func (ConfusionMatrix) Classes ¶
func (cm ConfusionMatrix) Classes() []float64
Classes returns a slice of classes included in a ConfusionMatrix. The result is ordered in ascending order.
func (ConfusionMatrix) FalseNegatives ¶
func (cm ConfusionMatrix) FalseNegatives(class float64) float64
FalseNegatives returns the number of times a class was wrongly not predicted.
func (ConfusionMatrix) FalsePositives ¶
func (cm ConfusionMatrix) FalsePositives(class float64) float64
FalsePositives returns the number of times a class was wrongly predicted.
func (ConfusionMatrix) NClasses ¶
func (cm ConfusionMatrix) NClasses() int
NClasses returns the number of classes in a ConfusionMatrix.
func (ConfusionMatrix) String ¶
func (cm ConfusionMatrix) String() string
String returns a string that can easily be read by a human in a terminal.
func (ConfusionMatrix) TrueNegatives ¶
func (cm ConfusionMatrix) TrueNegatives(class float64) float64
TrueNegatives returns the number of times a class was correctly not predicted.
func (ConfusionMatrix) TruePositives ¶
func (cm ConfusionMatrix) TruePositives(class float64) float64
TruePositives returns the number of times a class was correctly predicted.
type DiffMetric ¶
A DiffMetric is a Metric that can compute element-wise gradients.
type F1 ¶
type F1 struct {
Class float64
}
F1 measures the F1-score.
func (F1) NeedsProbabilities ¶
NeedsProbabilities method of F1.
type LogLoss ¶
type LogLoss struct{}
LogLoss implementes logistic loss.
func (LogLoss) BiggerIsBetter ¶
BiggerIsBetter method of LogLoss.
func (LogLoss) Classification ¶
Classification method of LogLoss.
func (LogLoss) NeedsProbabilities ¶
NeedsProbabilities method of LogLoss.
type MAE ¶
type MAE struct{}
MAE measures the mean absolute error (MAE).
func (MAE) NeedsProbabilities ¶
NeedsProbabilities method of MAE.
type MSE ¶
type MSE struct{}
MSE measures the mean squared error (MSE).
func (MSE) NeedsProbabilities ¶
NeedsProbabilities method of MSE.
type MacroF1 ¶
type MacroF1 struct{}
MacroF1 measures the global F1 score.
func (MacroF1) BiggerIsBetter ¶
BiggerIsBetter method of MacroF1.
func (MacroF1) Classification ¶
Classification method of MacroF1.
func (MacroF1) NeedsProbabilities ¶
NeedsProbabilities method of MacroF1.
type MacroPrecision ¶
type MacroPrecision struct{}
MacroPrecision measures the unweighted average precision across all classes. This does not take class imbalance into account.
func (MacroPrecision) Apply ¶
func (precision MacroPrecision) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply MacroPrecision.
func (MacroPrecision) BiggerIsBetter ¶
func (precision MacroPrecision) BiggerIsBetter() bool
BiggerIsBetter method of MacroPrecision.
func (MacroPrecision) Classification ¶
func (precision MacroPrecision) Classification() bool
Classification method of MacroPrecision.
func (MacroPrecision) NeedsProbabilities ¶
func (precision MacroPrecision) NeedsProbabilities() bool
NeedsProbabilities method of MacroPrecision.
func (MacroPrecision) String ¶
func (precision MacroPrecision) String() string
String method of MacroPrecision.
type MacroRecall ¶
type MacroRecall struct{}
MacroRecall measures the unweighted average recall across all classes. This does not take class imbalance into account.
func (MacroRecall) Apply ¶
func (recall MacroRecall) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply MacroRecall.
func (MacroRecall) BiggerIsBetter ¶
func (recall MacroRecall) BiggerIsBetter() bool
BiggerIsBetter method of MacroRecall.
func (MacroRecall) Classification ¶
func (recall MacroRecall) Classification() bool
Classification method of MacroRecall.
func (MacroRecall) NeedsProbabilities ¶
func (recall MacroRecall) NeedsProbabilities() bool
NeedsProbabilities method of MacroRecall.
type Metric ¶
type Metric interface { Apply(yTrue, yPred, weights []float64) (float64, error) Classification() bool BiggerIsBetter() bool NeedsProbabilities() bool String() string }
A Metric metricuates the performance of a predictive model. yTrue, yPred, and weights should all have the same length. If weights is nil then uniform weights are used.
type MicroF1 ¶
type MicroF1 struct{}
MicroF1 measures the global F1 score.
func (MicroF1) BiggerIsBetter ¶
BiggerIsBetter method of MicroF1.
func (MicroF1) Classification ¶
Classification method of MicroF1.
func (MicroF1) NeedsProbabilities ¶
NeedsProbabilities method of MicroF1.
type MicroPrecision ¶
type MicroPrecision struct{}
MicroPrecision measures the global precision by using the total true positives and false positives.
func (MicroPrecision) Apply ¶
func (precision MicroPrecision) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply MicroPrecision.
func (MicroPrecision) BiggerIsBetter ¶
func (precision MicroPrecision) BiggerIsBetter() bool
BiggerIsBetter method of MicroPrecision.
func (MicroPrecision) Classification ¶
func (precision MicroPrecision) Classification() bool
Classification method of MicroPrecision.
func (MicroPrecision) NeedsProbabilities ¶
func (precision MicroPrecision) NeedsProbabilities() bool
NeedsProbabilities method of MicroPrecision.
func (MicroPrecision) String ¶
func (precision MicroPrecision) String() string
String method of MicroPrecision.
type MicroRecall ¶
type MicroRecall struct{}
MicroRecall measures the global recall by using the total true positives and false negatives.
func (MicroRecall) Apply ¶
func (recall MicroRecall) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply MicroRecall.
func (MicroRecall) BiggerIsBetter ¶
func (recall MicroRecall) BiggerIsBetter() bool
BiggerIsBetter method of MicroRecall.
func (MicroRecall) Classification ¶
func (recall MicroRecall) Classification() bool
Classification method of MicroRecall.
func (MicroRecall) NeedsProbabilities ¶
func (recall MicroRecall) NeedsProbabilities() bool
NeedsProbabilities method of MicroRecall.
type Negative ¶
type Negative struct {
Metric Metric
}
A Negative returns the negative output of a given Metric.
func (Negative) BiggerIsBetter ¶
BiggerIsBetter method of Negative.
func (Negative) Classification ¶
Classification method of Negative.
func (Negative) NeedsProbabilities ¶
NeedsProbabilities method of Negative.
type Precision ¶
type Precision struct {
Class float64
}
Precision measures the fraction of times a class was correctly predicted.
func (Precision) BiggerIsBetter ¶
BiggerIsBetter method of Precision.
func (Precision) Classification ¶
Classification method of Precision.
func (Precision) NeedsProbabilities ¶
NeedsProbabilities method of Precision.
type R2 ¶
type R2 struct{}
R2 measures the coefficient of determination.
func (R2) NeedsProbabilities ¶
NeedsProbabilities method of R2.
type RMSE ¶
type RMSE struct{}
RMSE measures the root mean squared error (RMSE).
func (RMSE) NeedsProbabilities ¶
NeedsProbabilities method of RMSE.
type ROCAUC ¶
type ROCAUC struct{}
ROCAUC measures the ROC AUC score.
func (ROCAUC) BiggerIsBetter ¶
BiggerIsBetter method of ROCAUC.
func (ROCAUC) Classification ¶
Classification method of ROCAUC.
func (ROCAUC) NeedsProbabilities ¶
NeedsProbabilities method of ROCAUC.
type Recall ¶
type Recall struct {
Class float64
}
Recall measures the fraction of times a true class was predicted.
func (Recall) BiggerIsBetter ¶
BiggerIsBetter method of Recall.
func (Recall) Classification ¶
Classification method of Recall.
func (Recall) NeedsProbabilities ¶
NeedsProbabilities method of Recall.
type WeightedF1 ¶
type WeightedF1 struct{}
WeightedF1 measures the weighted average F1 score across all classes. This does take class imbalance into account.
func (WeightedF1) Apply ¶
func (f1 WeightedF1) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply WeightedF1.
func (WeightedF1) BiggerIsBetter ¶
func (f1 WeightedF1) BiggerIsBetter() bool
BiggerIsBetter method of WeightedF1.
func (WeightedF1) Classification ¶
func (f1 WeightedF1) Classification() bool
Classification method of WeightedF1.
func (WeightedF1) NeedsProbabilities ¶
func (f1 WeightedF1) NeedsProbabilities() bool
NeedsProbabilities method of WeightedF1.
type WeightedPrecision ¶
type WeightedPrecision struct{}
WeightedPrecision measures the weighted average precision across all classes. This does take class imbalance into account.
func (WeightedPrecision) Apply ¶
func (precision WeightedPrecision) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply WeightedPrecision.
func (WeightedPrecision) BiggerIsBetter ¶
func (precision WeightedPrecision) BiggerIsBetter() bool
BiggerIsBetter method of WeightedPrecision.
func (WeightedPrecision) Classification ¶
func (precision WeightedPrecision) Classification() bool
Classification method of WeightedPrecision.
func (WeightedPrecision) NeedsProbabilities ¶
func (precision WeightedPrecision) NeedsProbabilities() bool
NeedsProbabilities method of WeightedPrecision.
func (WeightedPrecision) String ¶
func (precision WeightedPrecision) String() string
String method of WeightedPrecision.
type WeightedRecall ¶
type WeightedRecall struct{}
WeightedRecall measures the weighted average recall across all classes. This does take class imbalance into account.
func (WeightedRecall) Apply ¶
func (recall WeightedRecall) Apply(yTrue, yPred, weights []float64) (float64, error)
Apply WeightedRecall.
func (WeightedRecall) BiggerIsBetter ¶
func (recall WeightedRecall) BiggerIsBetter() bool
BiggerIsBetter method of WeightedRecall.
func (WeightedRecall) Classification ¶
func (recall WeightedRecall) Classification() bool
Classification method of WeightedRecall.
func (WeightedRecall) NeedsProbabilities ¶
func (recall WeightedRecall) NeedsProbabilities() bool
NeedsProbabilities method of WeightedRecall.
func (WeightedRecall) String ¶
func (recall WeightedRecall) String() string
String method of WeightedRecall.