// Save writes the current model to disk

Save writes the current model to disk
// Save writes the current model to disk
func (strat *AlphaStrategy) Save() {
	fp, err := os.Open(alphaStrategySaveFileName)
	if err != nil {
		log.Printf("Unable to save model to '%s'\n", alphaStrategySaveFileName)
		return
	}
	defer fp.Close()
	for _, w := range strat.weights {
		_, err = fp.WriteString(strconv.FormatFloat(w, 'f', -1, 64))
		if err != nil {
			log.Printf("Failed to save weight: %f\n", w)
			return
		}
	}
}
func ( strat * AlphaStrategy ) Save ( ) { fp , err := os . Open ( alphaStrategySaveFileName ) if err != nil { log . Printf ( " \n " , alphaStrategySaveFileName ) return } defer fp . Close ( ) for _ , w := range strat . weights { _ , err = fp . WriteString ( strconv . FormatFloat ( w , 'f' , - 1 , 64 ) ) if err != nil { log . Printf ( " \n " , w ) return } } }
Save writes the current model to disk
Save writes the current model to disk