How can i plot the predicted linear model ?

조회 수: 1 (최근 30일)
Gorkem Akgul
Gorkem Akgul 2021년 5월 1일
Hi, I have trained a linear regression model and plot it using the plot function.
plot(linearmodel)
The problem is that, i also want to plot the response for my test data. As it seems there is not only single linear line. There are couple of lines that is probably used inking each sequential point in the data set( i have learnt this thanks to someone on another platform). How can i reduce it into a single line ?
scatter(coviddataset.sum_Deaths,coviddataset.sum_Deaths); hold on
y=predict(linearModel,coviddataset);
line(coviddataset.sum_Deaths, y,'Color','r')
legend('Training data', 'Linear regression'); hold off
I used the code above and it gives the graph.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by