Lineargo 数据线性分类器 Lineargo

xuanbao2016-03-20 16:00:00 • 1771 次点击    
这是一个分享于 2016-03-20 16:00:00 的项目,其中的信息可能已经有所发展或是发生改变。

* L2-正规化分类

* L2-SVM线性损耗,L1-SVM线性损耗和logistic回归(LR)

* L1-正规化分类(版本1.4)

* L2-SVM线性损耗和logistic回归(LR)

* L2-支持正规化向量回归(版本1.9)

* L2-SVR线性损耗和L1-SVR线性损耗。

安装:

这个软件包依赖LIBLINEAR2.1+和Go 1.6+。请通过自制软件或操作系统上的其他软件包管理器先安装这些:

brew update
brew info liblinear # make sure your formula will install version higher than 2.1
brew install liblinear

brew info go # make sure version 1.6+
brew install go

用法:

import linear "github.com/lazywei/lineargo"
// ReadLibsvm(filepath string, oneBased bool) (X, y *mat64.Dense)
X, y := linear.ReadLibsvm("heart_scale", true)
// Train(X, y *mat64.Dense, bias float64, solverType int,
//  C_, p, eps float64,//  classWeights map[int]float64) (*Model)
// Please checkout liblinear's doc for the explanation for these parameters.
model := linear.Train(X, y, -1, linear.L2R_LR, 1.0, 0.1, 0.01, map[int]float64{1: 1, -1: 1})
y_pred:= linear.Predict(model, X)

fmt.Println(linear.Accuracy(y, y_pred))

LinearGo (Go wrapper for LIBLINEAR): A Library for Large Linear ClassificationRead More

Latest commit to the master branch on 12-6-2019
Download as zip
授权协议:
开发语言:
Google Go 查看源码»
操作系统:
跨平台
1771 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传