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

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

src/a/z/AZOrange-HEAD/tests/source/AZorngRFTest.py   AZOrange(Download)
 
 
        self.assertEqual(TopVarImportanceTest(self.irisData, True), True, "Failed testing with uncompatible data (class with 3 values)")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/irisCont.tab"))
        self.assertEqual(TopVarImportanceTest(data), True,"Failed testing with Regression data.")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/iris2.tab"))
        self.assertEqual(TopVarImportanceTest(data), True, "Failed testing with Binary Classifier")
        for var in RF.domain.attributes:
            sum += RF.varImportance[var.name]
        self.assertEqual(round(sum,6),1.0)
 
 
            else:
                guessedClass = ex.domain.classVar[1]
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvSVMTest.py   AZOrange(Download)
 
 
        self.assertEqual(TopVarImportanceTest(self.inDataD, True), True, "Failed testing with uncompatible data (class with 3 values)")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/irisCont.tab"))
        self.assertEqual(TopVarImportanceTest(data), True,"Failed testing with Regression data.")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/iris2.tab"))
        self.assertEqual(TopVarImportanceTest(data), True, "Failed testing with Binary Classifier")
            else:
                guessedClass = ex.domain.classVar[1]
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            self.assert_(type(c[0][1])==orange.DiscDistribution)
            # Although, SVM does always return fake probabilities
            self.assertEqual(CvSVM.isRealProb(),False)
        expectedExtremes = {'max': 1.0, 'min': -1.11053}
        self.assertEqual([round(x,5) for x in CvSVM.getDFVExtremes().values()],[round(x,5) for x in expectedExtremes.values()])

src/a/z/AZOrange-HEAD/tests/source/AZorngCvANNTest.py   AZOrange(Download)
 
        # Test that the accuracy of the two classifiers is the exact same
        self.assertEqual(Acc, savedAcc)
        self.assert_(Acc != NoPAcc)
 
 
 
        self.assertEqual(TopVarImportanceTest(self.train_data, True), True, "Failed testing with uncompatible data (class with 3 values)")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/irisCont.tab"))
        self.assertEqual(TopVarImportanceTest(data), True,"Failed testing with Regression data.")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/iris2.tab"))
        self.assertEqual(TopVarImportanceTest(data), True, "Failed testing with Binary Classifier")
            else:    
                guessedClass = ex.domain.classVar[1]
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvBoost.py   AZOrange(Download)
 
 
        self.assertEqual(TopVarImportanceTest(self.train_data, True), True, "Failed testing with uncompatible data (class with 3 values)")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/irisCont.tab"))
        self.assertEqual(TopVarImportanceTest(data), True,"Failed testing with Regression data.")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/iris2.tab"))
        self.assertEqual(TopVarImportanceTest(data), True, "Failed testing with Binary Classifier")
            else:    
                guessedClass = ex.domain.classVar[1]
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            self.assert_(type(c[0][1])==orange.DiscDistribution)
            # CvBoost does always return real probabilities on binary classification
            self.assertEqual(CvBoost.isRealProb(),True)
        expectedExtremes = {'max': 0.5, 'min':-0.5 }
        self.assertEqual([round(x,5) for x in CvBoost.getDFVExtremes().values()],[round(x,5) for x in expectedExtremes.values()])

src/a/z/AZOrange-HEAD/tests/source/AZorngPLSTest.py   AZOrange(Download)
 
        # Test that the accuracy of the classifiers created in different ways is the exact same
        self.assertEqual(oneStepAcc, twoStepAcc)
 
 
 
        # Check that the accuracy is what it used to be
        self.assertEqual(round(0.66666666699999999,9),round(ClassifierAcc,9))
 
    def testPersistentRegAcc(self):
 
        # Check that RMSE is what it used to be
        self.assertEqual(round(4.39715452,8),round(RegressorRMSE,8))
 
 
 
        # Test that the accuracy of the two classifiers is the exact same
        self.assertEqual(Acc, savedAcc)
 
        # Remove the scratch directory
        Acc2 = evalUtilities.getClassificationAccuracy(self.noBadDataTest[3:],pls)
        Acc1 = evalUtilities.getClassificationAccuracy(self.badVarTypeData[3:],pls)
        self.assertEqual(round(Acc1,4),round(expectedAcc,4),"The Accuracy is not the expected. Got: "+ str(Acc1))
        self.assertEqual(round(Acc2,4),round(expectedAcc,4),"The Accuracy is not the expected")    
        self.assert_(('Fixed Types of variables' in pls.examplesFixedLog) and (pls.examplesFixedLog['Fixed Types of variables']==27), "No report of fixing in classifier class")

src/a/z/AZOrange-HEAD/tests/source/AZorngCvBayes.py   AZOrange(Download)
 
 
        self.assertEqual(TopVarImportanceTest(self.train_data, True), True, "Failed testing with uncompatible data (class with 3 values)")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/irisCont.tab"))
        self.assertEqual(TopVarImportanceTest(data), True,"Failed testing with Regression data.")
        data = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/iris2.tab"))
        self.assertEqual(TopVarImportanceTest(data), True, "Failed testing with Binary Classifier")
            else:    
                guessedClass = ex.domain.classVar[1]
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            self.assert_(type(c[0][1])==orange.DiscDistribution)
            # CvBayes does always return real probabilities on binary classification
            self.assertEqual(CvBayes.isRealProb(),True)
        expectedExtremes = {'max': 0.5, 'min':-0.5 }
        self.assertEqual([round(x,5) for x in CvBayes.getDFVExtremes().values()],[round(x,5) for x in expectedExtremes.values()])

src/a/z/AZOrange-HEAD/tests/source/AZorngConsensus.py   AZOrange(Download)
 
        # Assert
        self.assertEqual(learner.learners, None)
        self.assertEqual(learner.expression, None)
        self.assertEqual(learner.name, "Consensus learner")
        self.assertEqual(learner.verbose, 0)
        self.assertEqual(learner.imputeData, None)

src/a/z/AZOrange-HEAD/tests/source/AZorngParamOptTest.py   AZOrange(Download)
        print "Running Path:",runPath
        # Check that the learner was optimized
        self.assertEqual(learner.optimized,True)
 
        self.log.info("")
        self.log.info("tunedPars[0]=" + str(tunedPars[0]))
 
        # Check the accuracy
        self.assertEqual(round(tunedPars[0],2), round(0.621,2)) # Ver 0.3
        #Check if the best result was not the one with numThreads different of 1 since that way we can get 
        #different results among runs
        self.assertEqual(int(tunedPars[1]["NumThreads"]),1)
 
        miscUtilities.removeDir(runPath)
        print "Best optimization result = ", tunedPars[0]
        print "check the file intRes.txt to see the intermediate results of optimizer!"
        self.assertEqual(opt.usedMPI,False)
        self.assertEqual(learner.optimized,True)
        self.assertEqual(round(tunedPars[0],2),round(0.59999999999999998,2)) #Ver 0.3

src/a/z/AZOrange-HEAD/tests/source/AZorngParamOptMPITest.py   AZOrange(Download)
 
        # Check that the learner was optimized
        self.assertEqual(learner.optimized,True)
 
        #Check if the number of processors used are all the core available
        notUsed, out = commands.getstatusoutput("cat /proc/cpuinfo | grep processor")
        self.assertEqual(optimizer.np, len(out.split("\n")))
 
        # Check if the MPI version was used
        self.assertEqual(optimizer.usedMPI, True)
 
        # Check that the learner was optimized
        self.assertEqual(learner.optimized,True)
 
        # Check if the MPI version was used
        self.assertEqual(optimizer.usedMPI, True)

src/a/z/AZOrange-HEAD/tests/source/AZorngGetAccWOptParam.py   AZOrange(Download)
        evaluator = getUnbiasedAccuracy.UnbiasedAccuracyGetter(data = self.iris2Data, learner = learner, paramList = paramList, nExtFolds = 3, nInnerFolds = 3)
        res = evaluator.getAcc()
        self.assertEqual(round(res["CA"],5),round(0.96666666666666667,5))
        self.assertEqual(res["CM"],  [[98.0, 2.0], [3.0, 47.0]])
 

  1 | 2  Next