To train a new classifier you should create two files and pass it to params. After train the classifier, two files are created to speed up the training fase, (model.bin and categories.bin)
120#Pago Pesos TEF
26#COMISION MENSUAL POR MANTENCION
109#COMPRAS APL* ITUNES.COM/BILL
89#PAGO EN LINEA AUTOPISTA VESPUCIO SUR
89#Compra Internet COSTANERA NORTE
...
94#Ajuste por cierre de cuenta
12#Gimnasio
2#Bonos
86#Intereses
35#Jardín
13#Ropa Deportiva
...
type Samples struct {
Ngram string
Freq float64
Classes map[uint]float64
Probs map[uint]float64
Maximum float64
Minimum float64
Weighted bool
}
type Lucky struct {
Model map[string]*model.Samples
CatNum map[uint]float64
CatStr map[uint]string
LabelsPath string
TrainingDataPath string
URL string
}
type BestCategory struct {
ID uint // category id
Name string // category name
Score float64 // category probability
}
Fit() void
Predict(test string) (*model.BestCategory)
To see the classifier in action see lucky_test.go