def test_lightgbm_classifier(self):
     model = LGBMClassifier(n_estimators=3, min_child_samples=1)
     dump_binary_classification(
         model,
         allow_failure=
         "StrictVersion(onnx.__version__) < StrictVersion('1.3.0')")
     dump_multiple_classification(
         model,
         allow_failure=
         "StrictVersion(onnx.__version__) < StrictVersion('1.3.0')")
Esempio n. 2
0
    def test_xgb_classifier(self):
        iris = load_iris()
        X = iris.data[:, :2]
        y = iris.target
        y[y == 2] = 0

        xgb = XGBClassifier()
        xgb.fit(X, y)
        conv_model = convert_xgboost(xgb,
                                     initial_types=[
                                         ('input',
                                          FloatTensorType(shape=[1, 'None']))
                                     ])
        self.assertTrue(conv_model is not None)
        dump_binary_classification(xgb, verbose=True)
    def test_xgb_classifier_reglog(self):
        iris = load_iris()
        X = iris.data[:, :2]
        y = iris.target
        y[y == 2] = 0

        xgb = XGBClassifier(objective='reg:logistic')
        xgb.fit(X, y)
        conv_model = convert_xgboost(xgb,
                                     initial_types=[
                                         ('input',
                                          FloatTensorType(shape=[1, 2]))
                                     ])
        self.assertTrue(conv_model is not None)
        dump_binary_classification(xgb, suffix="RegLog")
 def test_gradient_boosting_classifier(self):
     model = GradientBoostingClassifier(n_estimators=3)
     dump_binary_classification(model)
 def test_extra_trees_classifier(self):
     model = ExtraTreesClassifier(n_estimators=3)
     dump_one_class_classification(model)
     dump_binary_classification(model)
     dump_multiple_classification(model)
 def test_random_forest_classifier(self):
     model = RandomForestClassifier(n_estimators=3)
     dump_one_class_classification(model)
     dump_binary_classification(model)
     dump_multiple_classification(model)
Esempio n. 7
0
 def test_decision_tree_classifier(self):
     model = DecisionTreeClassifier()
     dump_one_class_classification(model)
     dump_binary_classification(model)
     dump_multiple_classification(model)