Created
October 28, 2011 03:21
-
-
Save marcelcaraciolo/1321551 to your computer and use it in GitHub Desktop.
linear regression
This file contains 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, zeros, ones, array, linspace, logspace | |
from pylab import scatter, show, title, xlabel, ylabel, plot, contour | |
#Load the dataset | |
data = loadtxt('ex1data1.txt', delimiter=',') | |
#Plot the data | |
scatter(data[:, 0], data[:, 1], marker='o', c='b') | |
title('Profits distribution') | |
xlabel('Population of City in 10,000s') | |
ylabel('Profit in $10,000s') | |
show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment