Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(126)  |  Call(126)  |  Derive(0)  |  Import(0)

src/a/z/AZOrange-HEAD/azorange/AZutilities/getUnbiasedAccuracy.py   AZOrange(Download)
                #Test the model
                if self.responseType == "Classification":
                    results[ml].append((evalUtilities.getClassificationAccuracy(testData, model), evalUtilities.getConfMat(testData, model) ) )
                else:
                    local_exp_pred = []
                    #Test the model
                    if self.responseType == "Classification":
                        Cresults.append((evalUtilities.getClassificationAccuracy(testData, model), evalUtilities.getConfMat(testData, model) ) )
                    else:
                        local_exp_pred = []

src/a/z/AZOrange-HEAD/azorange/AZutilities/competitiveWorkflow.py   AZOrange(Download)
 
                    if responseType == "Classification":
                        results[ml].append((evalUtilities.getClassificationAccuracy(testData, model), evalUtilities.getConfMat(testData, model) ) )
                        if foldStat[ml]["selected"]:
                            results["selectedML"].append(results[ml][-1])

src/a/z/AZOrange-HEAD/azorange/trainingMethods/AZorngCvANN.py   AZOrange(Download)
                break
            if cleanedData.domain.classVar.varType == orange.VarTypes.Discrete:
                Acc = evalUtilities.getClassificationAccuracy(validationSet, model)
            else:
                Acc = -evalUtilities.getRMSE(validationSet, model)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvSVMTest.py   AZOrange(Download)
 
        # Calculate classification accuracy 
        Acc = evalUtilities.getClassificationAccuracy(self.inDataD, CvSVMmodel)
 
        # Save the model 
 
        # Calculate classification accuracy 
        savedAcc = evalUtilities.getClassificationAccuracy(self.inDataD, CvSVMmodel)
 
        # Test that the accuracy of the two classifiers is the exact same
    def test_SVMD(self):
 
        # Train a svm
        svm = AZorngCvSVM.CvSVMLearner(self.inDataD,scaleData = False,gamma=4,C = 1,nu=0.5,p=0.1,eps=0.001, coef0=0, degree=3)
        trainedAcc = evalUtilities.getClassificationAccuracy(self.inDataD, svm)
        # Load the saved model
        loadedsvm = AZorngCvSVM.CvSVMread(self.modelPath)
        loadedAcc = evalUtilities.getClassificationAccuracy(self.inDataD, loadedsvm)
        # Assure equal accuracy
        self.assertEqual(trainedAcc, loadedAcc)
 
        newSVM=svmLearner(self.inDataD)
        trainedAcc = evalUtilities.getClassificationAccuracy(self.inDataD, newSVM)
        # Save model 
        rc = newSVM.write(self.modelPath)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvANNTest.py   AZOrange(Download)
 
        # Calculate classification accuracy 
        Acc = evalUtilities.getClassificationAccuracy(self.irisData, CvANNmodel)
 
        # Save the model 
 
        # Calculate classification accuracy 
        savedAcc = evalUtilities.getClassificationAccuracy(self.irisData, CvANNmodel)
        NoPAcc = evalUtilities.getClassificationAccuracy(self.irisData, CvANNmodelNoP)
 
 
        # Calculate classification accuracy for the classifier trained in one step
        oneStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, ann)
 
        # Two step ann creation
        learner = AZorngCvANN.CvANNLearner(randomWeights = False ,stopUPs=0)
        ann = learner(self.train_data)
 
        # Calculate classification accuracy for the classifier trained in two steps
        twoStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, ann) 

src/a/z/AZOrange-HEAD/tests/source/AZorngRFTest.py   AZOrange(Download)
        rf = RFlearner(self.noBadDataTrain)
        #using from index 3 o the end of data, because we know that from 0 to 2 the examples are not compatible
        Acc2 = evalUtilities.getClassificationAccuracy(self.noBadDataTest[3:],rf)
        Acc1 = evalUtilities.getClassificationAccuracy(self.badVarTypeData[3:],rf)
        self.assertRoundedToExpectedArray(Acc1, expectedAccValues, 9)
        rf = RFlearner(self.noBadDataTrain)
        #using from index 3 o the end of data, because we know that from 0 to 2 the examples are not compatible
        Acc1 = evalUtilities.getClassificationAccuracy(self.noBadDataTest,rf)
        Acc2 = evalUtilities.getClassificationAccuracy(self.badVarOrderData,rf)
        self.assertRoundedToExpectedArray(Acc1, expectedAccValues, 9)
        rf = RFlearner(self.noBadDataTrain)
        #using from index 3 o the end of data, because we know that from 0 to 2 the examples are not compatible
        Acc1 = evalUtilities.getClassificationAccuracy(self.noBadDataTest,rf)
        self.assertRoundedToExpectedArray(Acc1, expectedAccValues, 9)
        self.assertEqual(rf(self.badVarTypeData[0]),"NEG","This example could still be predicted")

src/a/z/AZOrange-HEAD/tests/source/AZorngPLSTest.py   AZOrange(Download)
 
        # Calculate classification accuracy for the classifier trained in one step
        oneStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, pls)
 
        # Two step pls creation
        learner = AZorngPLS.PLSLearner()
        pls = learner(self.train_data)
 
        # Calculate classification accuracy for the classifier trained in two steps
        twoStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, pls) 
 
        # Calculate classification accuracy 
        ClassifierAcc = evalUtilities.getClassificationAccuracy(self.NoMetaTest, PLSClassifier)
 
        # Check that the accuracy is what it used to be
 
        # Calculate classification accuracy 
        Acc = evalUtilities.getClassificationAccuracy(self.test_data, pls)
 
        # Save the model 
 
        # Calculate classification accuracy 
        savedAcc = evalUtilities.getClassificationAccuracy(self.test_data, plsM)
 
        # Test that the accuracy of the two classifiers is the exact same

src/a/z/AZOrange-HEAD/tests/source/AZorngCvBayes.py   AZOrange(Download)
 
        # Calculate classification accuracy for the classifier trained in one step
        oneStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, Bayes)
 
        # Two step Bayes creation
        learner = AZorngCvBayes.CvBayesLearner()
        Bayes = learner(self.train_data)
 
        # Calculate classification accuracy for the classifier trained in two steps
        twoStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, Bayes) 
 
        # Calculate classification accuracy 
        Acc = evalUtilities.getClassificationAccuracy(self.test_data, Bayes)
 
        # Save the model
 
        # Calculate classification accuracy 
        savedAcc = evalUtilities.getClassificationAccuracy(self.test_data, Bayes)
 
        # Test that the accuracy of the two classifiers is the exact same
        self.assertEqual(Acc, savedAcc)
 
        #Test using the global read functionality
        Bayes2 = AZBaseClasses.modelRead(modelPath)
        savedAcc2 = evalUtilities.getClassificationAccuracy(self.test_data, Bayes2)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvBoost.py   AZOrange(Download)
 
        # Calculate classification accuracy for the classifier trained in one step
        oneStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, Boost)
 
        # Two step Boost creation
        learner = AZorngCvBoost.CvBoostLearner()
        Boost = learner(self.train_data)
 
        # Calculate classification accuracy for the classifier trained in two steps
        twoStepAcc = evalUtilities.getClassificationAccuracy(self.test_data, Boost) 
 
        # Calculate classification accuracy 
        Acc = evalUtilities.getClassificationAccuracy(self.test_data, Boost)
 
        # Save the model
 
        # Calculate classification accuracy 
        savedAcc = evalUtilities.getClassificationAccuracy(self.test_data, Boost)
 
        # Test that the accuracy of the two classifiers is the exact same
        Boost = BoostLearner(self.missingTrain)
 
        Acc = evalUtilities.getClassificationAccuracy(self.missingTest, Boost)
 
        self.assertEqual(round(0.74241999999999997,5),round(Acc,5)) 

src/a/z/AZOrange-HEAD/tests/source/AZorngParamOptTest.py   AZOrange(Download)
        #The learner is now with its optimized parameters already set, so we can now make a classifier out of it
        classifier = learner(self.discTrain)
        CA = evalUtilities.getClassificationAccuracy(self.discTest,classifier)
        self.assertEqual(round(CA,2),round(0.56999999999999995,2)) #Ver 0.3
        self.assert_(len(dataUtilities.DataTable(os.path.join(runPath,"optimizationLog.txt")))>=5) # Must be > 2
        #The learner is now with its optimized parameters already set, so we can now make a classifier out of it
        classifier = learner(self.discTrain)
        CA = evalUtilities.getClassificationAccuracy(self.discTest,classifier)
        expectedCA = [0.58999999999999997,2 ,0.57999999999999996] # Artifact: Second value expected in UBUNTU 10.10
        self.assert_(round(CA,2) in [round(ca,2) for ca in expectedCA]) # Ver 0.3
        learner.NumThreads = 1 
        classifier = learner(self.discTrain)
        CA = evalUtilities.getClassificationAccuracy(self.discTest,classifier)
        print "CA of optimized Learner: ",CA 
 

  1 | 2  Next