Coder Social home page Coder Social logo

suraggupta / coursera-machine-learning-solutions-python Goto Github PK

View Code? Open in Web Editor NEW
278.0 8.0 148.0 22.36 MB

A repository with solutions to the assignments on Andrew Ng's machine learning MOOC on Coursera

Jupyter Notebook 98.90% Python 1.10%

coursera-machine-learning-solutions-python's Introduction

coursera-machine-learning-solutions-python

A repository with solutions to the assignments on Andrew Ng's machine learning MOOC on Coursera. The credits for template for the python submission goes to @dibgerge[https://github.com/dibgerge]

coursera-machine-learning-solutions-python's People

Contributors

suraggupta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coursera-machine-learning-solutions-python's Issues

Typo in err_array

the function dataset3Params on Excercice6 declares an array calls 'my_array' but uses another undeclared one called 'err_array'

`def dataset3Params(X, y, Xval, yval):
C = 1
sigma = 0.3
# ====================== YOUR CODE HERE ======================

C_array = np.array([0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30])
sigma_array = np.array([0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30])

**my_array** = np.zeros([C_array.size, sigma_array.size])

for i in np.arange(C_array.size):
    for j in np.arange(sigma_array.size):
        model= utils.svmTrain(X, y, C_array[i], gaussianKernel, args=(sigma_array[j],))
        predictions = utils.svmPredict(model, Xval)
        pred_error = np.mean(predictions != yval)
        
        **err_array**[i, j] = pred_error
    
ind = np.unravel_index(np.argmin(err_array, axis = None), err_array.shape)
C = C_array[ind[0]]
sigma = sigma_array[ind[1]]

# ============================================================
return C, sigma`

The sigmoidGradient function isn't defined

I was writing the nnCostFunction function, but the sigmoidGradient function isn't defined?

NameError Traceback (most recent call last)
in
1 lambda_ = 0
2 J, _ = nnCostFunction(nn_params, input_layer_size, hidden_layer_size,
----> 3 num_labels, X, y, lambda_)
4 print('Cost at parameters (loaded from ex4weights): %.6f ' % J)
5 print('The cost should be about : 0.287629.')

in nnCostFunction(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y, lambda_)
42
43 delta_3 = a3 - y_matrix
---> 44 delta_2 = delta_3.dot(Theta2)[:, 1:] * sigmoidGradient(a1.dot(Theta1.T))
45
46 Delta1 = delta_2.T.dot(a1)

NameError: name 'sigmoidGradient' is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.