Exemple #1
0
    def unsupported(self):
        """Attempts to export an unsupported
        model.

        Raises
        ------
        UnsupportedModel
        """
        clf = self.create_classifier("GaussianProcessClassifier")
        LazyExport(clf)
Exemple #2
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)
Exemple #3
0
 def unfitted(self):
     """Creates an un-fitted model for export."""
     clf = getattr(sys.modules[__name__], "GaussianNB")()
     LazyExport(clf)
Exemple #4
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"))
Exemple #5
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"))
Exemple #6
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"))
Exemple #7
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"))
Exemple #8
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"))
Exemple #9
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"))
Exemple #10
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))