Exemple #1
0
"""
=======================
Plotting Stub Estimator
=======================

An example plot of StubEstimator
"""
import numpy as np
from sklstub.stub import StubEstimator
from matplotlib import pyplot as plt

X = np.arange(100).reshape(100, 1)
y = np.zeros((100, ))
estimator = StubEstimator()
estimator.fit(X, y)
plt.plot(estimator.predict(X))
plt.show()
Exemple #2
0
def test_demo():
    X = np.random.random((100, 10))
    estimator = StubEstimator()
    estimator.fit(X, X[:, 0])
    assert_almost_equal(estimator.predict(X), X[:, 0])
Exemple #3
0
def test_demo():
    X = np.random.random((100, 10))
    estimator = StubEstimator()
    estimator.fit(X, X[:, 0])
    assert_almost_equal(estimator.predict(X), X[:, 0]**2)