Package weka.classifiers

Examples of weka.classifiers.Evaluation.pctCorrect()


                                eval.crossValidateModel(cpyCls1, randData, folds, rand);   // actual randomization happens here
                                cpyCls2.buildClassifier(randData);

                                avgRoc += eval.weightedAreaUnderROC();
                                avgAcc += eval.pctCorrect();
                               

                                ////////////OUTPUT/////////////////////////
                                singleLine.append(reportingCls (cpyCls2));
                                singleLine.append(classifier_count).append(",");
View Full Code Here


        Evaluation eval_validationE = new Evaluation(randData);
        Classifier eval_clas = Classifier.makeCopy(currentClassifier);
        eval_clas.buildClassifier(randData);
        eval_validationE.evaluateModel(eval_clas, validShuff);

        PhaseIwrep.res_pctCorrect_valid = eval_validationE.pctCorrect();
        PhaseIwrep.res_ROC_valid = eval_validationE.weightedAreaUnderROC();

        PhaseIwrep.PII_scoreTypeUsed = ((K2) ((BayesNet) currentClassifier).getSearchAlgorithm()).getScoreType().getSelectedTag().getID();
        PhaseIwrep.PII_initAsNaive = ((K2) ((BayesNet) currentClassifier).getSearchAlgorithm()).getInitAsNaiveBayes();
        PhaseIwrep.PII_maxParents = ((K2) ((BayesNet) currentClassifier).getSearchAlgorithm()).getMaxNrOfParents();
View Full Code Here

           
        //LOGISTIC REGRESSION  
        Classifier loggy_class = new Logistic();
        Evaluation loggy_eval = new Evaluation(learn);
        loggy_eval.crossValidateModel(Classifier.makeCopy(loggy_class), learn, 5, new Random(42));
            insample_ACC[0] = loggy_eval.pctCorrect();
            insample_ROC[0] = loggy_eval.weightedAreaUnderROC();
       
        Evaluation loggy_eval_validation = new Evaluation(learn);
        Classifier loggy_valid = Classifier.makeCopy(loggy_class);
        loggy_valid.buildClassifier(learn);
View Full Code Here

       
        Evaluation loggy_eval_validation = new Evaluation(learn);
        Classifier loggy_valid = Classifier.makeCopy(loggy_class);
        loggy_valid.buildClassifier(learn);
        loggy_eval_validation.evaluateModel(loggy_valid, hold);
        validation_ACC[0] = loggy_eval_validation.pctCorrect();
        validation_ROC[0] = loggy_eval_validation.weightedAreaUnderROC();
       
        // DECISION TABLE
        Classifier dtable_class = new DecisionTable();
        Evaluation dtable_eval = new Evaluation(learn);
View Full Code Here

       
        // DECISION TABLE
        Classifier dtable_class = new DecisionTable();
        Evaluation dtable_eval = new Evaluation(learn);
        dtable_eval.crossValidateModel(Classifier.makeCopy(dtable_class), learn, 5, new Random(52));
            insample_ACC[1] = dtable_eval.pctCorrect();
            insample_ROC[1] = dtable_eval.weightedAreaUnderROC();
           
        Evaluation dtable_eval_validation = new Evaluation(learn);
        Classifier dtable_valid = Classifier.makeCopy(dtable_class);
        dtable_valid.buildClassifier(learn);
View Full Code Here

           
        Evaluation dtable_eval_validation = new Evaluation(learn);
        Classifier dtable_valid = Classifier.makeCopy(dtable_class);
        dtable_valid.buildClassifier(learn);
        dtable_eval_validation.evaluateModel(dtable_valid, hold);
        validation_ACC[1] = dtable_eval_validation.pctCorrect();
        validation_ROC[1] = dtable_eval_validation.weightedAreaUnderROC();
       
        }
        else if (learn.classAttribute().isNumeric()) // run a linear regression
        {
View Full Code Here

        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();
       
        Evaluation eval_validation = new Evaluation(learn);
        Classifier valid_loggy = Classifier.makeCopy(linReg);
        valid_loggy.buildClassifier(learn);
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.