简体   繁体   中英

Plotting Decision Bounday in Octave

原始数据图

I am working on a basic Machine Learning problem, trying to predict how much the battery will last according to the time it was charged for. Above is the raw data plot I have. I've written the code to compute the cost function and the gradient descent step using Logistic Regression. Now I need to plot a decision boundary for my solution. How do I do that in Octave?

Suppose your logistic regression function is

cost = sigmoid (theta' * X);

where size(theta)=[1 3] , and X(1) = 1 (bias). You solved and obtained the final theta vector. Then the decision function is theta(2) * x2 + theta(3) * x3 + theta(1) = 0

x2 , and x3 is your axis of Charged, Battery Time, respectively

You may find this page helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM