-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
42 lines (36 loc) · 919 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"fmt"
"github.com/kaidoj/file-deleter-ai/ai"
)
func main() {
// define input cols in data
iCols := []int{2} //3
// define output cols in data
oCols := []int{3}
// define hidden layers and neurons
hiddenLayerNeurons := 5 // 3
// setup data
inp, outp := ai.Read("data/train500.csv", iCols, oCols)
config := &ai.ModelConfig{
0.0002,
35000,
hiddenLayerNeurons,
len(iCols),
len(oCols),
inp,
outp,
}
model := ai.NewModel(config)
_, _, weights, outputWeights := ai.Train(model)
ai.Save(weights, outputWeights)
// setup data
in, out := ai.Read("data/train_keep_large.csv", iCols, oCols)
//weights, outputWeights := ai.Load()
predictions := ai.Predict(weights, outputWeights, in)
fmt.Println("Test results")
ai.MatPrint(predictions)
fmt.Println("predictions")
fmt.Println("Accuracy")
ai.Accuracy(predictions, in, out)
}