// 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 (d CustomData) FeatureScalingSingle() []float64 {
	if d.RawData.RowSize() == 0 || d.RawData.ColSize() == 0 {
		return []float64{}
	}
	max, min := d.RawData.Value(0, 0), d.RawData.Value(0, 0)
	for i := 0; i < d.RawData.ColSize(); i++ {
		if d.RawData.Value(0, i) > max {
			max = d.RawData.Value(0, i)
		} else if d.RawData.Value(0, i) < min {
			min = d.RawData.Value(0, i)
		}
	}
	out := make([]float64, 0)
	for i := 0; i < d.RawData.ColSize(); i++ {
		out = append(out, (d.RawData.Value(0, i)-min)/(max-min))
	}
	return out
}
func ( d CustomData ) FeatureScalingSingle ( ) [ ] float64 { if d . RawData . RowSize ( ) == 0 || d . RawData . ColSize ( ) == 0 { return [ ] float64 { } } max , min := d . RawData . Value ( 0 , 0 ) , d . RawData . Value ( 0 , 0 ) for i := 0 ; i < d . RawData . ColSize ( ) ; i ++ { if d . RawData . Value ( 0 , i ) > max { max = d . RawData . Value ( 0 , i ) } else if d . RawData . Value ( 0 , i ) < min { min = d . RawData . Value ( 0 , i ) } } out := make ( [ ] float64 , 0 ) for i := 0 ; i < d . RawData . ColSize ( ) ; i ++ { out = append ( out , ( d . RawData . Value ( 0 , 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