Examples of crossValidateModel()


Examples of weka.classifiers.Evaluation.crossValidateModel()

            // TODO: make a chart here.

//            bnCopy = Classifier.makeCopy(bn);
//            bnCopyEv = Classifier.makeCopy(bn);
            ev = new Evaluation(learnPostSelNaive);
            ev.crossValidateModel(Classifier.makeCopy(bn), learnPostSelNaive,Math.min(CVfoldNum,learn.numInstances()),new Random(removeNaive_counter));
//            bnCopy.buildClassifier(learnPostSelNaive);   //this only gives the bayes score.. is that interesting?

            accuracyRes[removeNaive_counter] = ev.pctCorrect();
            ROCRes[removeNaive_counter] = ev.weightedAreaUnderROC();
        }
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

            Instances holdPreRandRemove = rm.useFilter(holdPostSel, rm);

            wrep.BGS_midAttributeSelectionNumberOfFeatures = learnPreRandRemove.numAttributes();
           
            ev = new Evaluation(learnPreRandRemove);
            ev.crossValidateModel(Classifier.makeCopy(bn), learnPreRandRemove,Math.min(CVfoldNum,learn.numInstances()),new Random(winningNaiveRemove));
//            bnCopy.buildClassifier(learnPostSelNaive);   //this only gives the bayes score.. is that interesting?

            double midAttACC = ev.pctCorrect();
            double midAttROC = ev.weightedAreaUnderROC();
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()


                    Classifier yBNcopy = Classifier.makeCopy(yBN);

                    Evaluation evPostRand = new Evaluation(learnPostRandRemove);
                    evPostRand.crossValidateModel(yBNcopy, learnPostRandRemove,Math.min(CVfoldNum,learn.numInstances()),new Random(winningNaiveRemove));

                    accPostRandRemove[numToRem_counter][iteration_counter] = evPostRand.pctCorrect();
                    rocPostRandRemove[numToRem_counter][iteration_counter] = evPostRand.weightedAreaUnderROC();
//                    if ((numToRem_counter % 100)==0){System.out.print(numToRem_counter);System.out.println("RandomRemovalLoop: ".concat(String.valueOf(evPostRand.weightedAreaUnderROC())));}
                }
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()


                    Classifier zBNcopy = Classifier.makeCopy(zBN);

                    Evaluation evFinalRound = new Evaluation(learnFinalRound);
                    evFinalRound.crossValidateModel(zBNcopy, learnFinalRound,Math.min(CVfoldNum,learn.numInstances()),new Random(winningNaiveRemove));

                    accFinalRound[winningPostRandRemove] = evFinalRound.pctCorrect();
                    rocFinalRound[winningPostRandRemove] = evFinalRound.weightedAreaUnderROC();

                    if (evFinalRound.weightedAreaUnderROC() > rocFinal){
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

                                Instances randData = new Instances(shuffledInstances);
                                Classifier cpyCls1 = Classifier.makeCopy(currentClassifier);
                                Classifier cpyCls2 = Classifier.makeCopy(currentClassifier);
                                Evaluation eval = new Evaluation(randData;

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

                                avgRoc += eval.weightedAreaUnderROC();
                                avgAcc += eval.pctCorrect();
                               
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

        validation_ROC = new double[2];
           
        //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);
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

        validation_ROC[0] = loggy_eval_validation.weightedAreaUnderROC();
       
        // 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);
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

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

Examples of weka.classifiers.Evaluation.crossValidateModel()

               

                bnCopy = Classifier.makeCopy(bn);
                ev = new Evaluation(setOf2);
            ev.crossValidateModel(bnCopy, setOf2,Math.min(data.numInstances(),5),rnd)//5 fold CV

                m_ROCs[att_counter] = ev.weightedAreaUnderROC();
    //            System.out.println(m_ROCs[att_counter]);
        }} /// END LOOP - RELOAD ALL ATTRIBUTES
    }
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.