Пример #1
0
func (algo *LinearRegression) SaveModel(path string) {
	sb := util.StringBuilder{}
	for f, g := range algo.Model {
		sb.Int64(f)
		sb.Write("\t")
		sb.Float(g)
		sb.Write("\n")
	}
	sb.WriteToFile(path)
}
Пример #2
0
func (lr *LROWLQN) SaveModel(path string) {
	sb := util.StringBuilder{}
	for key, val := range lr.Model.Data {
		sb.Int64(key)
		sb.Write("\t")
		sb.Float(val)
		sb.Write("\n")
	}
	sb.WriteToFile(path)
}
Пример #3
0
func (self *LinearSVM) SaveModel(path string) {
	sb := util.StringBuilder{}
	for f, g := range self.w.Data {
		sb.Int64(f)
		sb.Write("\t")
		sb.Float(g)
		sb.Write("\n")
	}
	sb.WriteToFile(path)
}
Пример #4
0
func (algo *EPLogisticRegression) SaveModel(path string) {
	sb := util.StringBuilder{}
	for f, g := range algo.Model {
		sb.Int64(f)
		sb.Write("\t")
		sb.Float(g.Mean)
		sb.Write("\t")
		sb.Float(g.Vari)
		sb.Write("\n")
	}
	sb.WriteToFile(path)
}