Here you can find the source of normalize(double[] w)
Parameter | Description |
---|---|
w | a parameter |
public static double[] normalize(double[] w)
//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; } }