Skip to content

Instantly share code, notes, and snippets.

@ganprad
Created August 24, 2015 15:12
Show Gist options
  • Save ganprad/05c34877b7a69aae720e to your computer and use it in GitHub Desktop.
Save ganprad/05c34877b7a69aae720e to your computer and use it in GitHub Desktop.
def betas_prediction(X,Y):
Betas = dot(inv(dot(X_train.T,X_train)),dot(X_train.T,y_train).T)
#Generating predictions from Betas vector
y_predict = 1/(1+np.exp(-1*dot(X_test,Betas)))
return Betas,y_predict
Betas,y_predict = betas_prediction(X_train,y_train)
plt.scatter(X_test[:,0].ravel(),y_predict.ravel())
plt.show()
plt.close()
Betas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment