// StandardScoreSingle normalizes the first row with "Standard Score".
//
// (usually only one row in input)
StandardScoreSingle normalizes the first row with "Standard Score".

(usually only one row in input)
// StandardScoreSingle normalizes the first row with " Standard Score " . // // ( usually only one row in input )
func (d CustomData) StandardScoreSingle() []float64 {
	col := make([]float64, 0)
	out := make([]float64, 0)
	for i := 0; i < d.RawData.ColSize(); i++ {
		col = append(col, d.RawData.Value(0, i))
	}
	mean, err := stats.Mean(col)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	stderv, err := stats.StandardDeviationPopulation(col)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	for i := 0; i < d.RawData.ColSize(); i++ {
		out = append(out, (d.RawData.Value(0, i)-mean)/stderv)
	}
	return out
}
func ( d CustomData ) StandardScoreSingle ( ) [ ] float64 { col := make ( [ ] float64 , 0 ) out := make ( [ ] float64 , 0 ) for i := 0 ; i < d . RawData . ColSize ( ) ; i ++ { col = append ( col , d . RawData . Value ( 0 , i ) ) } mean , err := stats . Mean ( col ) if err != nil { fmt . Println ( err ) os . Exit ( 1 ) } stderv , err := stats . StandardDeviationPopulation ( col ) if err != nil { fmt . Println ( err ) os . Exit ( 1 ) } for i := 0 ; i < d . RawData . ColSize ( ) ; i ++ { out = append ( out , ( d . RawData . Value ( 0 , i ) - mean ) / stderv ) } return out }
StandardScoreSingle normalizes the first row with "Standard Score".
StandardScoreSingle normalizes the first row with " Standard Score " .