Created
November 6, 2011 14:24
-
-
Save marcelcaraciolo/1342942 to your computer and use it in GitHub Desktop.
log_regression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import loadtxt, where | |
from pylab import scatter, show, legend, xlabel, ylabel | |
#load the dataset | |
data = loadtxt('ex2data1.txt', delimiter=',') | |
X = data[:, 0:2] | |
y = data[:, 2] | |
pos = where(y == 1) | |
neg = where(y == 0) | |
scatter(X[pos, 0], X[pos, 1], marker='o', c='b') | |
scatter(X[neg, 0], X[neg, 1], marker='x', c='r') | |
xlabel('Exam 1 score') | |
ylabel('Exam 2 score') | |
legend(['Not Admitted', 'Admitted']) | |
show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@arjunchatterjee196 and @sshaky2,
you can find the data in the coursera Machine Learning Course, or in this link:
https://github.com/vinipachecov/machine-learning-coursera-1/tree/master/Week%203%20Assignments/Logistic%20Regression%20and%20Regularization/mlclass-ex2