How can i plot the predicted linear model ?
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Linear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!