Code Monkey home page Code Monkey logo

courseraml's People

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  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

courseraml's Issues

Regularization Problem

Hello
In Ex 3, Neural networks, in the part with multiclass classification I think there is a problem with regularization in Logistic regression problem. I am talking particularly about part : 1.3 Vectorizing Logistic Regression.

right_hand = mytheta.T.dot( mytheta ) * mylambda / (2*m)
Here the first element of theta (theta_0 if you'd like) is also included in regularization. It should not be included.

Bug in normalizeRatings function?

There seems to be a subtle difference between your normalization function and the original Matlab version. As a result, the unrated zeros in myY become negative when Ymean is subtracted from them.

def normalizeRatings(myY, myR):
    ...
    Ymean = np.sum(myY,axis=1)/np.sum(myR,axis=1)  # Unrated elements are ignored here...
    Ymean = Ymean.reshape((Ymean.shape[0],1))

    # ...but not here. The zero elements in myY become negative after subtracting Ymean
    return myY-Ymean, Ymean

I think this will yield odd results and possibly prevent convergence. One way to address this would be to also zero out the unrated elements after the subtraction:

    return np.multiply(myY-Ymean, myR), Ymean

License

Hello,

I would like to know the license of the code in the repository.

Thanks,
Nicolás

Hi Kaleko

Thx for your sharing

When I review ext1, I have a question about below code

        tmptheta[j] = theta[j] - (alpha/m)*np.sum((h(initial_theta,X) - y)*np.array(X[:,j]).reshape(m,1))

here why always use initial_theta instead of newest "theta"

ex7 PCA

I was able to reproduce the graph of the two principal components, but they were not orthogonal. Prinicpal components should be orthogonal (pc1.dot(pc2) == 0) no?

Edit: I think it doesn't look perpendicular/orthogonal due to rounding.

ex6_spam bug

in the last of the file,
sorted_indices = np.argsort( linear_svm.coef_, axis=None )[::-1]
should be
sorted_indices = np.argsort( linear_svm.coef_, axis=None )[::-1] + 1
beause argsort values start at 0

Request to use portions of code

Hi,

Great work !,
Im gonna do something on similar lines but less pythonic ,
the only thing i wanna use are your plot modules (To plot the data as im a noob in matplot lib),
i will give credits but still do i have your permission to include the portions of your code?

It would save me a lot of time by doing so . :)

The descendGradient function code has bug in ex1. The parameters in theta are not being updated simultaneously.

the line
tmptheta = theta
should be updated to
tmptheta = np.copy(theta) // create a deep copy of theta instead of a new reference!

Otherwise the below statement will update theta also while the tmptheta is being updated (as both are references to same object!). theta should NOT change during an iteration of gradient descent!
tmptheta[j] = theta[j] - (alpha/m)*np.sum((h(theta,X) - y)*np.array(X[:,j]).reshape(m,1))

Logistic Regression - No contour levels were found"

When running the "def plotBoundary(mytheta, myX, myy, mylambda=0.):"

I got the following error: "contour.py:1173: UserWarning: No contour levels were found within the data range."

Is there a bug in the code or is it a mistake on my side?

Thanks!

ex_1.py

There is list that name is 'thetahistory' in function 'descendGradient'.

if you print it, you can find out all of element in thetahistory are same.
so graph is like
image

after change code like

thetahistory.append(list(theta[:,0]))

image

therefore, final graph is below
image

some code need to refine

ex1 folder, ex1.ipynb file, the method descentGradient,when compute the tmptheta[j], it should be tmptheta[j] = theta[j] - (alpha/m)*np.sum((h(theta,X)-y)*np.array(X[:,j]).reshape(m,1)), instead of current code tmptheta[j] = theta[j] - (alpha/m)*np.sum((h(**initial_**theta,X)-y)*np.array(X[:,j]).reshape(m,1))

About Commit

Hello, Thanks for your helps! It's awesome guide to me and really helpful.
If I would like to make suggest or find error, Is it possible to commit?
If it is possible, How can I commit? just clone & make new branch & commit?

Thanks

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.