Java Array Normalize normalize(double[] w)

Here you can find the source of normalize(double[] w)

Description

Normalize the values of the array

License

Open Source License

Parameter

Parameter Description
w a parameter

Declaration

public static double[] normalize(double[] w) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  w  w  w.j av a  2 s. c om
     * Normalize the values of the array
     * @param w
     * @return
     */
    public static double[] normalize(double[] w) {
        double[] vector = w;
        for (int i = 0; i < w.length; i++) {
            // .4 is the mid-point
            if (w[i] > 0.4)
                vector[i] -= .005;
            else if (w[i] < 0.4)
                vector[i] += .005;
            else
                vector[i] = 0.4;
        }
        return vector;
    }
}

Related

  1. normalize(double[] vals)
  2. normalize(double[] values)
  3. normalize(double[] values)
  4. normalize(double[] vector)
  5. normalize(double[] vector)
  6. normalize(double[] weights)
  7. normalize(double[] weights)
  8. normalize(double[] x)
  9. normalize(double[] xs)