results output ridge_regression_batch
@@ -38,10 +38,13 @@ if __name__ == "__main__":
predict_algo = d4p.ridge_regression_prediction()
# read test data (with same #features)
pdata = loadtxt("./data/batch/linear_regression_test.csv", delimiter=',', usecols=range(10))
+ ptdata = loadtxt("./data/batch/linear_regression_test.csv", delimiter=',', usecols=range(10,12))
# now predict using the model from the training above
predict_result = predict_algo.compute(pdata, train_result.model)
# The prediction result provides prediction
assert predict_result.prediction.shape == (pdata.shape[0], dep_data.shape[1])
+ print("\nRidge Regression prediction results: (first 10 rows):\n", predict_result.prediction[0:10])
+ print("\nGround truth (first 10 rows):\n", ptdata[0:10])
print('All looks good!')
