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)
}
Example #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)
}
Example #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)
}
Example #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)
}