// FeatureScalingSingle normalizes the first row with "feature scaling".
//
// (Usually only one row in input)
FeatureScalingSingle normalizes the first row with "feature scaling".

(Usually only one row in input)
// FeatureScalingSingle normalizes the first row with " feature scaling " . // // ( Usually only one row in input )
func FeatureScalingSingle(data []float64) []float64 {
	if len(data) == 0 {
		return []float64{}
	}
	max, min := data[0], data[0]
	for i := 0; i < len(data); i++ {
		if data[i] > max {
			max = data[i]
		} else if data[i] < min {
			min = data[i]
		}
	}
	out := make([]float64, 0)
	for i := 0; i < len(data); i++ {
		out = append(out, (data[i]-min)/(max-min))
	}
	return out
}
func FeatureScalingSingle ( data [ ] float64 ) [ ] float64 { if len ( data ) == 0 { return [ ] float64 { } } max , min := data [ 0 ] , data [ 0 ] for i := 0 ; i < len ( data ) ; i ++ { if data [ i ] > max { max = data [ i ] } else if data [ i ] < min { min = data [ i ] } } out := make ( [ ] float64 , 0 ) for i := 0 ; i < len ( data ) ; i ++ { out = append ( out , ( data [ i ] - min ) / ( max - min ) ) } return out }
FeatureScalingSingle normalizes the first row with "feature scaling".
FeatureScalingSingle normalizes the first row with " feature scaling " .
// check size // find max and min // normalization