Examples of Regression


Examples of flanagan.analysis.Regression

                     // overdetermined equations - least squares used - must be used with care
                     int n = bvec.length;
                     if(this.numberOfRows!=n)throw new IllegalArgumentException("Overdetermined equation solution - vector length is not equal to matrix column length");
                     Matrix avecT = this.transpose();
                     double[][] avec = avecT.getArrayCopy();
                     Regression reg = new Regression(avec, bvec);
                    reg.linearGeneral();
                    xvec = reg.getCoeff();
                 }
                 else{
                     throw new IllegalArgumentException("This class does not handle underdetermined equations");
                 }
             }
View Full Code Here

Examples of flanagan.analysis.Regression

           
            xArray[i] = (resultFileSize / factor) * 100.0;
            yArray[i] = ((INumericValue)elapsedTimeMeasurements.getList().get(i).getValue()).value();
        }
       
        Regression reg = new Regression(xArray, yArray);
        reg.linear();
        double[] bestEstimates = reg.getBestEstimates();
       
        // y = k*x + d
        // y = bestEstimate[1]*x + bestEstimate[0]
        double startUpTime = bestEstimates[0];

View Full Code Here

Examples of flanagan.analysis.Regression

        am = new ArrayMaths(yTransform);
        am = am.sort();
        yTransform = am.array();

        // Calculate and return probability plot correlation coefficient
        reg = new Regression(gaussianOrderMedians, yTransform);
        reg.linear();
        return reg.getSampleR();

    }
View Full Code Here

Examples of flanagan.analysis.Regression

        // Calculate Gaussian N[0,1] order statistic medians
        this.gaussianOrderMedians = Stat.gaussianOrderStatisticMedians(this.nData);

        // calculate the correlation coefficient of the probability plot for the untransformed data
        Regression reg = new Regression(this.gaussianOrderMedians, ((new ArrayMaths(this.standardizedOriginalData)).sort().array()));
        reg.linear();
        this.originalSampleR = reg.getSampleR();
        double[] coeff = reg.getBestEstimates();
        this.originalIntercept = coeff[0];
        this.originalGradient = coeff[1];
    }
View Full Code Here

Examples of flanagan.analysis.Regression

        // Obtain the intercept and gradient of the Gaussian probabilty plot
        Stat st4 = new Stat(this.standardizedTransformedData);
        st4 = st4.sort();
        double[] ordered = st4.array();
        Regression reg = new Regression(this.gaussianOrderMedians, ordered);
        reg.linear();
        coeff = reg.getBestEstimates();
        this.transformedIntercept = coeff[0];
        this.transformedGradient = coeff[1];

        // Adust mean and standard deviation of the transformed data to match those of the entered data
        this.scaledTransformedData = Stat.scale(this.standardizedTransformedData, this.originalMean, this.originalStandardDeviation);
View Full Code Here

Examples of flanagan.analysis.Regression

            xArray[i] = (resultFileSize / factor) * 100.0;
            yArray[i] = ((INumericValue) elapsedTimeMeasurements.getList().get(i).getValue()).value();
        }

        Regression reg = new Regression(xArray, yArray);
        reg.linear();
        double[] bestEstimates = reg.getBestEstimates();

        // y = k*x + d
        // y = bestEstimate[1]*x + bestEstimate[0]
        double startUpTime = bestEstimates[0];

View Full Code Here

Examples of weka.classifiers.pmml.consumer.Regression

                                              Instances dataDictionary,
                                              MiningSchema miningSchema) throws Exception {
    PMMLModel pmmlM = null;
    switch (modelType) {
    case REGRESSION_MODEL:
      pmmlM = new Regression(model, dataDictionary, miningSchema);
      //System.out.println(pmmlM);
      break;
    case GENERAL_REGRESSION_MODEL:
      pmmlM = new GeneralRegression(model, dataDictionary, miningSchema);
      //System.out.println(pmmlM);
View Full Code Here

Examples of weka.test.Regression

   * @throws Exception   if something goes wrong
   */
  public void testRegression() throws Exception {
    int    i;
    boolean  succeeded;
    Regression   reg;
    Instances   train;
    int    type;
   
    // don't bother if not working correctly
    if (m_Tester.hasClasspathProblems())
      return;
   
    reg = new Regression(this.getClass());
    succeeded = false;
    train = null;
   
    for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE + 1; i++) {
      // does the Associator support this type of class at all?
      if (!canPredict(i))
        continue;
       
      if (i == LAST_CLASSTYPE + 1)
  type = CheckAssociator.NO_CLASS;
      else
  type = i;

      train = m_Tester.makeTestDataset(
          42, m_Tester.getNumInstances(),
      m_NominalPredictors[i] ? 2 : 0,
      m_NumericPredictors[i] ? 1 : 0,
          m_StringPredictors[i] ? 1 : 0,
          m_DatePredictors[i] ? 1 : 0,
          m_RelationalPredictors[i] ? 1 : 0,
          2,
          type,
          m_multiInstanceHandler);
 
      try {
        m_RegressionResults[i] = useAssociator(train);
        succeeded = true;
        reg.println(m_RegressionResults[i]);
      }
      catch (Exception e) {
  String msg = e.getMessage().toLowerCase();
  if (msg.indexOf("not in classpath") > -1)
    return;

  m_RegressionResults[i] = null;
      }
    }
   
    if (!succeeded) {
      fail("Problem during regression testing: no successful predictions for any class type");
    }

    try {
      String diff = reg.diff();
      if (diff == null) {
        System.err.println("Warning: No reference available, creating.");
      } else if (!diff.equals("")) {
        fail("Regression test failed. Difference:\n" + diff);
      }
View Full Code Here

Examples of weka.test.Regression

   * run without any pre-existing reference output, the reference version
   * is created.
   */
  public void testRegression() throws Exception {
    boolean  succeeded;
    Regression   reg;
    Instances   train;
   
    // don't bother if not working correctly
    if (m_Tester.hasClasspathProblems())
      return;
   
    reg       = new Regression(this.getClass());
    train     = null;
    succeeded = false;
   
    train = m_Tester.makeTestDataset(
  42, m_Tester.getNumInstances(),
  m_NominalPredictors ? 2 : 0,
  m_NumericPredictors ? 1 : 0,
  m_StringPredictors ? 1 : 0,
  m_DatePredictors ? 1 : 0,
  m_RelationalPredictors ? 1 : 0,
  m_multiInstanceHandler);
   
    try {
      m_RegressionResults = useClusterer(train);
      succeeded = true;
      reg.println(m_RegressionResults);
    }
    catch (Exception e) {
      String msg = e.getMessage().toLowerCase();
      if (msg.indexOf("not in classpath") > -1)
  return;
     
      m_RegressionResults = null;
    }
   
    if (!succeeded) {
      fail("Problem during regression testing: no successful output generated");
    }

    try {
      String diff = reg.diff();
      if (diff == null) {
        System.err.println("Warning: No reference available, creating.");
      } else if (!diff.equals("")) {
        fail("Regression test failed. Difference:\n" + diff);
      }
View Full Code Here

Examples of weka.test.Regression

   * is created.
   */
  public void testRegression() throws Exception {
    int    i;
    boolean  succeeded;
    Regression   reg;
    Instances   train;
   
    // don't bother if not working correctly
    if (m_Tester.hasClasspathProblems())
      return;
   
    reg = new Regression(this.getClass());
    succeeded = false;
    train = null;
   
    for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) {
      // does the scheme support this type of class at all?
      if (!canPredict(i))
        continue;
       
      train = m_Tester.makeTestDataset(
          42, m_Tester.getNumInstances(),
      m_NominalPredictors[i] ? 2 : 0,
      m_NumericPredictors[i] ? 1 : 0,
          m_StringPredictors[i] ? 1 : 0,
          m_DatePredictors[i] ? 1 : 0,
          m_RelationalPredictors[i] ? 1 : 0,
          2,
          i,
          m_multiInstanceHandler);
 
      try {
        m_RegressionResults[i] = useScheme(train);
        succeeded = true;
        reg.println(m_RegressionResults[i]);
      }
      catch (Exception e) {
  String msg = e.getMessage().toLowerCase();
  if (msg.indexOf("not in classpath") > -1)
    return;

  m_RegressionResults[i] = null;
      }
    }
   
    if (!succeeded) {
      fail("Problem during regression testing: no successful predictions for any class type");
    }

    try {
      String diff = reg.diff();
      if (diff == null) {
        System.err.println("Warning: No reference available, creating.");
      } else if (!diff.equals("")) {
        fail("Regression test failed. Difference:\n" + diff);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.