Package weka.classifiers.functions

Examples of weka.classifiers.functions.LinearRegression


    reducedInst = Filter.useFilter(reducedInst, attributeFilter);
   
    // build a linear regression for the training data using the
    // tested attributes
    LinearRegression temp = new LinearRegression();
    temp.buildClassifier(reducedInst);

    double [] lmCoeffs = temp.coefficients();
    double [] coeffs = new double [m_instances.numAttributes()];

    for (int i = 0; i < lmCoeffs.length - 1; i++) {
      if (indices[i] != m_classIndex) {
  coeffs[indices[i]] = lmCoeffs[i];
View Full Code Here


        insample_ACC = new double[1];
        insample_ROC = new double[1];
        validation_ACC = new double[1];
        validation_ROC = new double[1];
           
        Classifier linReg = new LinearRegression();
        Evaluation eval = new Evaluation(learn);
        eval.crossValidateModel(Classifier.makeCopy(linReg), learn, 5, new Random(42));
            insample_ACC[0] = eval.pctCorrect();
            insample_ROC[0] = eval.weightedAreaUnderROC();
       
View Full Code Here

TOP

Related Classes of weka.classifiers.functions.LinearRegression

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.