How can i plot the predicted linear model ?

1 vue (au cours des 30 derniers jours)
Gorkem Akgul
Gorkem Akgul le 1 Mai 2021
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.

Réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by