gBay
所属分类:聚类算法
开发工具:GO
文件大小:13KB
下载次数:0
上传日期:2018-04-19 09:02:43
上 传 者:
sh-1993
说明: 围棋中的朴素贝叶斯分类器
(Naive Bayes Classifier in Go)
文件列表:
.travis.yml (42, 2018-04-19)
data.csv (23279, 2018-04-19)
details.txt (3066, 2018-04-19)
fileOps.go (297, 2018-04-19)
mathOps.go (1120, 2018-04-19)
predictOps.go (1144, 2018-04-19)
sliceNDice.go (1347, 2018-04-19)
test.csv (27, 2018-04-19)
# Naive Bayes classifier implementation in Go
Takes in a dataset/CSV file, (resembling a numpy matrix) and returns predictions
and accuracy.
TODO:
Only used Gaussian PDF. Implement bernouli and multinomial as well (mathOPs.go change)
~~Fix floating point underflow~~ Not needed because IEEE 754's binary*** can go upto 2^1024.
Write an email spam example and link it here
Installation Instructions
```sh
go get github.com/sudsred/gBay
```
Usage Example:
```go
package main
import ( "github/sudsred/gBay"
"fmt"
)
func main(){
fmt.Println("Test")
//data.csv is a sample file. It is attached with this repo as
//a template example. Any similar file should work fine
snd := gBay.SliceNDice{FileName: "data.csv" , SplitRatio: 0.75}
snd.ReadCsv()
training , test := snd.Split()
//prepare model
summaries := snd.ByClass(training)
//predictions
predictions := gBay.GetPredictions(summaries, test)
fmt.Println(gBay.GetAccuracy(test, predictions))
}
```
Questions/Suggestions?
Email: sudar.theone@gmail.com
近期下载者:
相关文件:
收藏者: