maml
maml copied to clipboard
Create tests file to highlight usage
Is it possible to create a tests file to highlight basic usage scenarios? For example, in sklearn, a simple regression task looks like...
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
Xtrain = [[0,1],[0,2]]
ytrain = [1, 20]
Xtest = [[0,1],[0,2]]
ytest = [2, 30]
print(Xtrain, ytrain)
print(Xtest, ytest)
regr = LinearRegression()
regr.fit(Xtrain, ytrain)
print(regr.score(Xtest, ytest))
ypred = regr.predict(Xtest)
plt.scatter(range(len(ytest)), ytest, label='Observed')
plt.scatter(range(len(ytest)), ypred, label='Predicted')
plt.legend()
>> [[0, 1], [0, 2]] [1, 20]
>> [[0, 1], [0, 2]] [2, 30]
>> 0.7423469387755101
Thanks!