2019-04-16
阅读量:
416
python如何测试机器学习数据
测试是手动完成的。可以使用一些随机数据进行测试,并测试模型是否为输入数据提供了正确的结果。
# Random Test data
X_TEST = [[ 10, 20, 30 ]]
# Predict the result of X_TEST which holds testing data
outcome = predictor.predict(X = X_TEST)
# Predict the coefficients
coefficients = predictor.coef_
# Print the result obtained for the test data
print('Outcome : {}\nCoefficients : {}'.format(outcome, coefficients))
上述测试数据的结果应为10 + 20 * 2 + 30 * 3 = 140.
输出
结果:[140.]
系数:[1. 2. 3.]






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论