import numpy as np
from sklearn import datasets, linear_model
from homework2_rent import score_rent

# Load the diabetes dataset
testData = datasets.load_diabetes()

# Load the diabetes dataset
# testData = datasets.load_diabetes()


# Use only one feature
data_X = testData.data[:, np.newaxis, 2]

# Split the data into training/testing sets
X_train = data_X[:-20]
X_test = data_X[-20:]
y_train = testData.target[:-20]
y_test = testData.target[-20:]

print("Mean squared error is: %.2f" % score_rent(X_test,y_test,X_train,y_train))
示例#2
0
def test_rent():
	R2 = score_rent()
	assert  R2> 0.5
示例#3
0
def test_rent():
    assert score_rent() > 0.25
示例#4
0
def test_rent():
    assert (h.score_rent() < 0.3)
示例#5
0
import homework2_rent as p

if __name__ == "__main__":
assert(p.score_rent()>0.5)
示例#6
0
def test_rent():
    if (h.score_rent() < 0.2):
        return 1
    else:
        return 0
示例#7
0
def test_rent():
    """Run test to check accuracy
    """

    accuracy = score_rent()
    assert accuracy >= 0.42
示例#8
0
def test_rent():

    p = score_rent()
    assert p >= 0.59
示例#9
0
def test_rent():
    r2_value, _, _, _ = score_rent()
    assert r2_value > 0.5