Пример #1
0
    def test_vcl_returning_for_boston_linear_regression(self):
        boston = load_boston()
        X, y = boston.data, boston.target
        estimator = LinearRegression()
        estimator.fit(X, y)

        self.assertNotEqual(m2vcl.export_to_vcl(estimator), "")
Пример #2
0
 def test_vcl_returning_for_nusvr(self):
     n_samples, n_features = 10, 5
     np.random.seed(0)
     y = np.random.randn(n_samples)
     X = np.random.randn(n_samples, n_features)
     regr = NuSVR(C=1.0, nu=0.1)
     regr.fit(X, y)
     self.assertNotEqual(m2vcl.export_to_vcl(regr), "")
Пример #3
0
    def test_vcl_returning_for_iris_decision_tree(self):
        iris = load_iris()
        X = iris.data
        y = iris.target
        X_train, X_test, y_train, y_test = train_test_split(
            X, y, random_state=0)

        clf = DecisionTreeClassifier(max_leaf_nodes=3, random_state=0)
        clf.fit(X_train, y_train)
        self.assertNotEqual(m2vcl.export_to_vcl(clf), "")
Пример #4
0
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier

import m2vcl

iris = load_iris()
X = iris.data
y = iris.target
X_train, X_test, y_train, y_test = train_test_split(
    X, y, random_state=0)

clf = DecisionTreeClassifier(max_leaf_nodes=3, random_state=0)
clf.fit(X_train, y_train)
print(m2vcl.export_to_vcl(clf))
Пример #5
0
from sklearn.datasets import load_boston
from sklearn.linear_model import LinearRegression

import m2vcl

boston = load_boston()
X, y = boston.data, boston.target
estimator = LinearRegression()
estimator.fit(X, y)
print(m2vcl.export_to_vcl(estimator))