Package org.encog.ml.fitting.linear

Examples of org.encog.ml.fitting.linear.TrainLinearRegression


    double[][] INPUT = { {3}, {6}, {4}, {5} };
    double[][] IDEAL = { {0}, {-3}, {-1}, {-2} };
   
    MLDataSet data = new BasicMLDataSet(INPUT,IDEAL);
    LinearRegression lin = new LinearRegression(1);
    TrainLinearRegression train = new TrainLinearRegression(lin,data);
    train.iteration();
   
    System.out.println("w0 = " + Format.formatDouble(lin.getWeights()[0],2));
    System.out.println("w1 = " + Format.formatDouble(lin.getWeights()[1],2));
    System.out.println("Error: " + lin.calculateError(data));
  }
View Full Code Here


    double[][] INPUT = { {2}, {4}, {6}, {8} };
    double[][] IDEAL = { {2}, {5}, {5}, {8} };
   
    MLDataSet data = new BasicMLDataSet(INPUT,IDEAL);
    LinearRegression lin = new LinearRegression(1);
    TrainLinearRegression train = new TrainLinearRegression(lin,data);
    train.iteration();
    System.out.println("w0 = " + Format.formatDouble(lin.getWeights()[0],2));
    System.out.println("w1 = " + Format.formatDouble(lin.getWeights()[1],2));
    System.out.println("Error: " + lin.calculateError(data));
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.fitting.linear.TrainLinearRegression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.