func (m *LabelBinarizer) Fit(Xmatrix, Ymatrix mat.Matrix) base.Fiter {
	Y := base.ToDense(Ymatrix)
	if m.PosLabel == m.NegLabel {
		m.PosLabel += 1.
	}
	y := Y.RawMatrix()
	m.Classes = make([][]float64, y.Cols)
	for j := 0; j < y.Cols; j++ {
		cmap := make(map[float64]bool)
		for i, yi := 0, 0; i < y.Rows; i, yi = i+1, yi+y.Stride {
			yval := y.Data[yi+j]
			if _, present := cmap[yval]; present {
				continue
			}
			cmap[yval] = true
			m.Classes[j] = append(m.Classes[j], yval)
		}
		sort.Float64s(m.Classes[j])
	}
	return m
}
Fit for binarizer register classes
package preprocessing
import (
	"math"
	"sort"
	"github.com/pa-m/sklearn/base"
	"gonum.org/v1/gonum/floats"
	"gonum.org/v1/gonum/mat"
)
type LabelBinarizer struct {
	NegLabel, PosLabel float64
	Classes            [][]float64
}
func NewLabelBinarizer(NegLabel, PosLabel float64) *LabelBinarizer {
	return &LabelBinarizer{NegLabel: NegLabel, PosLabel: PosLabel}
}
func (m *LabelBinarizer) TransformerClone() base.Transformer {
	clone := *m
	return &clone
}