Git Product home page Git Product logo

Comments (4)

nyck33 avatar nyck33 commented on July 24, 2024
<ipython-input-43-9bcabdbf6f18> in computeCostMulti(X, y, theta)
     33     # ======================= YOUR CODE HERE ===========================
     34     for i in range(m):
---> 35         cost += np.square(np.dot(X[i], theta) - y[i])
     36         J = cost * (1/(2*m))
     37     # ==================================================================

ValueError: shapes (3,) and (2,) not aligned: 3 (dim 0) != 2 (dim 0)

That concatenation of a colum to X or X_norm breaks everything. computeCost won't work now.

from ml-coursera-python-assignments.

nyck33 avatar nyck33 commented on July 24, 2024

Very weird. I found solutions online and noticed that the gradient descent code is exactly the same for univariate and multivariate. So I don't really understand the point of the exercise. Anyways, isn't the univariate question actually multivariate when you consider theta_0 and theta_1 as 2 features? I know theta_0 is just the y-intercept basis thing or whatever it is that gets a value of 1 assigned to it. I thought there would be more of a difference in the formula and code.

from ml-coursera-python-assignments.

satsgun avatar satsgun commented on July 24, 2024

@nyck33 just wondering if you ran into this issue, If you did, how did you solve it
#36 (comment)

from ml-coursera-python-assignments.

nyck33 avatar nyck33 commented on July 24, 2024

solved.

from ml-coursera-python-assignments.

Related Issues (20)

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.