// FeatureScaling normalizes every columns with "feature scaling".
FeatureScaling normalizes every columns with "feature scaling".
// FeatureScaling normalizes every columns with " feature scaling " .
func FeatureScaling(data [][]float64) [][]float64 {
	if len(data) == 0 {
		return [][]float64{}
	}
	out := make([][]float64, len(data))
	for i := 0; i < len(out); i++ {
		out[i] = make([]float64, len(data[0]))
	}
	for k := 0; k < len(data[0]); k++ {
		max, min := data[0][k], data[0][k]
		for i := 0; i < len(data); i++ {
			if data[i][k] > max {
				max = data[i][k]
			} else if data[i][k] < min {
				min = data[i][k]
			}
		}
		for i := 0; i < len(data); i++ {
			out[i][k] = (data[i][k] - min) / (max - min)
		}
	}
	return out
}
func FeatureScaling ( data [ ] [ ] float64 ) [ ] [ ] float64 { if len ( data ) == 0 { return [ ] [ ] float64 { } } out := make ( [ ] [ ] float64 , len ( data ) ) for i := 0 ; i < len ( out ) ; i ++ { out [ i ] = make ( [ ] float64 , len ( data [ 0 ] ) ) } for k := 0 ; k < len ( data [ 0 ] ) ; k ++ { max , min := data [ 0 ] [ k ] , data [ 0 ] [ k ] for i := 0 ; i < len ( data ) ; i ++ { if data [ i ] [ k ] > max { max = data [ i ] [ k ] } else if data [ i ] [ k ] < min { min = data [ i ] [ k ] } } for i := 0 ; i < len ( data ) ; i ++ { out [ i ] [ k ] = ( data [ i ] [ k ] - min ) / ( max - min ) } } return out }
FeatureScaling normalizes every columns with "feature scaling".
FeatureScaling normalizes every columns with " feature scaling " .
// check size // find max and min // normalization