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

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

src/a/z/AZOrange-HEAD/tests/source/AZorngRFTest.py   AZOrange(Download)
            c = RF(ex,resultType = orange.GetBoth,returnDFV = RDFV)
            #All must return tuples    
            self.assert_(type(a)==type(b)==type(c)==tuple)
            # Second element of the tupple must be the DFV
            self.assert_(type(a[1])==type(b[1])==type(c[1])==float)
            self.assert_(a[1]==b[1]==c[1])
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            #asking for GetProbabilities
            self.assert_(type(b[0])==orange.DiscDistribution)

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)
 
 
            c = CvANN(ex,resultType = orange.GetBoth,returnDFV = RDFV)
            #All must return tuples  
            self.assert_(type(a)==type(b)==type(c)==tuple)
            # Second element of the tupple must be the DFV
            self.assert_(type(a[1])==type(b[1])==type(c[1])==float)
            self.assert_(a[1]==b[1]==c[1])
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            #asking for GetProbabilities
            self.assert_(type(b[0])==orange.DiscDistribution)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvBayes.py   AZOrange(Download)
            c = CvBayes(ex,resultType = orange.GetBoth,returnDFV = RDFV)
            #All must return tuples  
            self.assert_(type(a)==type(b)==type(c)==tuple)
            # Second element of the tupple must be the DFV
            self.assert_(type(a[1])==type(b[1])==type(c[1])==float)
            self.assert_(a[1]==b[1]==c[1])
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            #asking for GetProbabilities
            self.assert_(type(b[0])==orange.DiscDistribution)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvSVMTest.py   AZOrange(Download)
            c = CvSVM(ex,resultType = orange.GetBoth,returnDFV = RDFV)
            #All must return tuples    
            self.assert_(type(a)==type(b)==type(c)==tuple)
            # Second element of the tupple must be the DFV
            self.assert_(type(a[1])==type(b[1])==type(c[1])==float)
            self.assert_(a[1]==b[1]==c[1])
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            #asking for GetProbabilities
            self.assert_(type(b[0])==orange.DiscDistribution)

src/a/z/AZOrange-HEAD/tests/source/AZorngCvBoost.py   AZOrange(Download)
            c = CvBoost(ex,resultType = orange.GetBoth,returnDFV = RDFV)
            #All must return tuples  
            self.assert_(type(a)==type(b)==type(c)==tuple)
            # Second element of the tupple must be the DFV
            self.assert_(type(a[1])==type(b[1])==type(c[1])==float)
            self.assert_(a[1]==b[1]==c[1])
            self.assertEqual(predictedClass,guessedClass)
            #asking for GetValue
            self.assert_(type(a[0])==orange.Value)
            #asking for GetProbabilities
            self.assert_(type(b[0])==orange.DiscDistribution)

src/a/z/AZOrange-HEAD/tests/source/AZorngPLSTest.py   AZOrange(Download)
        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")
        self.assert_(('Vars needing type fix' in pls.examplesFixedLog) and (pls.examplesFixedLog['Vars needing type fix']['[Br]([C])']=="EnumVariable to FloatVariable"), "No report of fixing in classifier class")
 
        ex1=self.trainImpData[0]
        ex2=self.trainImpData[3]
        self.assert_(ex1["DiscAttr2"]!="?","The var DiscAttr2 shouldn't be missing!")
        self.assert_(ex2["Level"]!="?","The var Level shouldn't be missing!")
 
        ex1["DiscAttr2"]="?"
        ex2["Level"]="?"
        self.assert_(ex1["DiscAttr2"]=="?","The var DiscAttr2 should be missing now!")
        self.assert_(ex2["Level"]=="?","The var Level should be missing now!")
 

src/a/z/AZOrange-HEAD/tests/source/AZorngParamOptTest.py   AZOrange(Download)
        # The original templateProfile created at installation is needed in order to call the runScript of optimizer from 
        #appspack with proper environment.
        self.assert_(os.path.isfile(os.path.join(os.environ["AZORANGEHOME"], "templateProfile")),"Missing file: "+os.path.join(os.environ["AZORANGEHOME"], "templateProfile"))
 
        self.contTestDataPath = os.path.join(AZOC.AZORANGEHOME,"tests/source/data/Reg_No_metas_Test.tab")
 
        #Check if the number of results remain equal
        self.assert_(len(dataUtilities.DataTable(os.path.join(runPath,"optimizationLog.txt")))>=5)
 
        #Check that all points were evaluated
        self.assert_(opt.GSRes["nFailedPoints"]==0)
        self.assert_(opt.GSRes["nPoints"]==3)
        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
        miscUtilities.removeDir(runPath)
 

src/a/z/AZOrange-HEAD/tests/source/AZorngParamOptMPITest.py   AZOrange(Download)
    def setUp(self):
        """Creates the training and testing data set attributes. """
        # The original templateProfile created at installation is needed in order to call the runScript of optimizer from 
        # appspack with proper environment.
        self.assert_(os.path.isfile(os.path.join(os.environ["AZORANGEHOME"], "templateProfile")),"Missing file: "+os.path.join(os.environ["AZORANGEHOME"], "templateProfile"))
 
        # Check the number of optimized parameters
        self.assert_(len(verbTunedPars["optParam"]) in [8,9,10])
 
        # Check the accuracy
        self.assert_(round(verbTunedPars["bestRes"],3) in [round(x,3) for x in ExpectedCA],"Got:" + str(verbTunedPars["bestRes"]))
        self.assert_(len(dataUtilities.DataTable(os.path.join(runPath,"optimizationLog.txt")))>=3) #  Must be > 2
 
        # Check the accuracy
        self.assert_(round(verbTunedPars["bestRes"],3) in [round(x,3) for x in ExpectedCA],"Got:" + str(verbTunedPars["bestRes"]))
        self.assert_(len(dataUtilities.DataTable(os.path.join(runPath,"optimizationLog.txt")))>=5) # Must be > 2
 

src/a/z/AZOrange-HEAD/tests/source/AZorngGetAccWOptParam.py   AZOrange(Download)
        evaluator = getUnbiasedAccuracy.UnbiasedAccuracyGetter(data = self.irisData, learner = learner, paramList = paramList, nExtFolds = 3, nInnerFolds = 3)
        res = evaluator.getAcc()
        self.assert_(abs(res["CA"]-0.96666666666666667) < 0.01)
        expected =  [[50.0, 0.0, 0.0], [0.0, 48.0, 2.0], [0.0, 3.0, 47.0]]
        for i,c in enumerate(res["CM"]):
            for j,l in enumerate(c):
                self.assert_(abs(l-expected[i][j]) < 3)
        self.log.info("expected=" + str(expected))
        self.log.info("actual  =" + str(actual))
        self.assert_( actual in expected,"Got: "+str(res["RMSE"]))
 
 

src/a/z/AZOrange-HEAD/tests/source/AZorngCompetitiveWorkflowTest.py   AZOrange(Download)
        res = competitiveWorkflow.competitiveWorkflow(self.Dtrain_data)
        print "Results :  ",res
        self.assert_("statistics" in res)
        self.assert_("model" in res)
        self.assert_("selectedML" in res["statistics"])
        self.assert_(res["model"][res["model"].keys()[0]] is not None)
        self.assertEqual(res["statistics"]["selectedML"]["responseType"], "Classification")
        self.assert_(res["statistics"]["selectedML"]["CA"] > 0 )

  1 | 2  Next