def testWarmUp():
    assert_array_equal(warmUpExercise(), eye(5))
Esempio n. 2
0
from matplotlib.pyplot import *
from mpl_toolkits.mplot3d import axes3d, Axes3D

from exerciseOne import warmUpExercise
from exerciseOne import plotData
from exerciseOne import computeCost
from exerciseOne import gradientDescent


# is there any equivalent to "clear all; close all; clc"?

## ==================== Part 1: Basic Function ====================
# Complete warmUpExercise.py
print 'Running warmUpExercise ... '
print '5x5 Identity Matrix: '
print warmUpExercise()

print('Program paused. Press enter to continue.')
raw_input()


## ======================= Part 2: Plotting =======================
print 'Plotting Data ...'
data = loadtxt('./ex1data1.txt', delimiter=',')
X = data[:, 0]
y = data[:, 1]
n,m = shape(matrix(X))
# m: number of training examples
# n: number of features

# Plot Data