Ejemplo n.º 1
0
def test_BasisfunctionRegression_simple():
    x = np.arange(10.).reshape((10, 1))
    y = np.arange(10.) + 1
    dy = 1

    mu = np.arange(11.)[:, None]
    sigma = 1.0

    clf = BasisFunctionRegression(mu=mu, sigma=sigma).fit(x, y, dy)
    y_true = clf.predict(x)

    assert_allclose(y, y_true, atol=1E-10)
Ejemplo n.º 2
0
def test_BasisfunctionRegression_simple():
    x = np.arange(10.).reshape((10, 1))
    y = np.arange(10.) + 1
    dy = 1

    mu = np.arange(11.)[:, None]
    sigma = 1.0

    clf = BasisFunctionRegression(mu=mu, sigma=sigma).fit(x, y, dy)
    y_true = clf.predict(x)

    assert_allclose(y, y_true, atol=1E-10)
Ejemplo n.º 3
0
def fit_BasisFunction(features_train, labels_train, features_pred, kernel='gaussian', mu=mu0, sigma=0.1):
	model = BasisFunctionRegression(kernel, mu=mu, sigma=sigma)
	model.fit(features_train, labels_train)
	labels_pred = model.predict(features_pred)
	return labels_pred