Esempio n. 1
0
    def create_gaussiannb(self, override=False):
        """Creates a GaussianNB classifier,
        and exports the json file.

        Parameters
        ----------
        override : bool
            Overrides an existing export.

        Returns
        -------
        None

        Raises
        ------
        FileExists
        """
        clf = self.create_classifier("GaussianNB")
        path = f"{TESTPATH}/GaussianNB.json"
        ex = LazyExport(clf)
        return ex.save(path, force_override=override)
Esempio n. 2
0
 def test_exportlinearsvc(self):
     """Attempts to export a LinearSVC classifier"""
     ex = LazyExport(self.create_classifier("LinearSVC"))
     self.assertIsNone(ex.save(f"{TESTPATH}/linearsvc.json"))
Esempio n. 3
0
 def test_testdecisiontree(self):
     """Attempts to export a DecisionTreeClassifier classifier"""
     ex = LazyExport(self.create_classifier("DecisionTreeClassifier"))
     self.assertIsNone(ex.save(f"{TESTPATH}/decisiontree.json"))
Esempio n. 4
0
 def test_exprtmlp(self):
     """Attempts to export a MLPClassifier classifier"""
     ex = LazyExport(self.create_classifier("MLPClassifier"))
     self.assertIsNone(ex.save(f"{TESTPATH}/mlp.json"))
Esempio n. 5
0
 def test_exportkneighbors(self):
     """Attempts to export a KNeighborsClassifier classifier"""
     ex = LazyExport(self.create_classifier("KNeighborsClassifier"))
     self.assertIsNone(ex.save(f"{TESTPATH}/knn.json"))
Esempio n. 6
0
 def test_exportbernoullinb(self):
     """Attempts to export a BernoulliNB classifier"""
     clf = self.create_classifier("BernoulliNB")
     ex = LazyExport(clf)
     self.assertIsNone(ex.save(f"{TESTPATH}/bnb.json"))
Esempio n. 7
0
 def test_randomrandomforest(self):
     """Attempts to export a random forest classifier."""
     ex = LazyExport(self.create_classifier("RandomForestClassifier"))
     self.assertIsNone(ex.save(f"{TESTPATH}/rf.json"))
Esempio n. 8
0
 def test_exportgaussiannb(self):
     """Exports a GaussianNB model."""
     clf = self.create_classifier("GaussianNB")
     path = f"{TESTPATH}/GaussianNB.json"
     ex = LazyExport(clf)
     self.assertIsNone(ex.save(path))