Git Product home page Git Product logo

ml-class-assignments's Issues

Wrong matrix manipulation

*[cost, grad] = costFunction(initial_theta, X, y); error: costFunction: operator : nonconformant arguments (op1 is 1x100, op2 is 1x100) error: called from costFunction at line 16 column 3

Predict Logic

Hi,
I am wondering how to derive the logic for prediction

p = sigmoid(X*theta)>=0.5;

is there any standard formula?

Code Updated!

J = (1/2) * sum(sum((R .* ((Theta * X')' ) - Y).^2)) + (lambda/2) * sum(sum(Theta.^2)) + (lambda/2) * sum(sum(X.^2));

X_grad = (R .* ((Theta * X')' ) - Y) * Theta + (lambda * X );
Theta_grad = (R .* ((Theta * X')' ) - Y)' * X + (lambda * Theta);

Decision boundary line

Pardon me for asking a trivial question.

Can you help me on calculating the decision boundary line. How it has been "plot_y = (-1./theta(3)).*(theta(2).*plot_x + theta(1));"

Issue with my logic

Guys request your help!!

Instead of using the code mentioned in code section :

p=sigmoid(X*theta)>=0.5;

which is running perfectly fine. Im using my logic :

z=sigmoid(X*theta);
if z>=0.5:
p=1;
else
p=0;
endif

The above code is not running.

Please let me know the difference and is there any error in my logic.

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.