Multivariant regression, fitting the curve with multiple variables .

조회 수: 4 (최근 30일)
Koustubh Shirke
Koustubh Shirke 2020년 2월 27일
답변: Puru Kathuria 2020년 3월 4일
I have a data sets where, one response variable is dependant on three other variables... how can I make model which can predict the response variable with new three variables in matlab ?

답변 (1개)

Puru Kathuria
Puru Kathuria 2020년 3월 4일
Hi,
I understand that you want to fit a line/curve to your dataset. Assuming X is your data matrix with NxM dimensions where N is the number of data samples, M is the number of variables (3 in your case)[MA1] and Y is your target variable(to be predicted). You can use Linear Regression to fit a line to the data or other polynomial regression techniques to fit a curve to your data and predict the value of your target variable Y.
Example:
% Fit linear Regression Model
% Xtrain: Matrix of training data
% Ytrain: Target/Predicted variable
model = fitlm(Xtrain,ytrain);
% Xtest: test dataset whose corresponding Y is to be predicted
Ypredicted = model.predict(Xtest);
% To fetch the coefficients computed by your model
model.Coefficients
% Metrics to judge your fit/model
model.Rsquared.Adjusted
model.Rsquared.Ordinary
Go through the following links to see more about line fitting and polynomial fitting:

카테고리

Help CenterFile Exchange에서 Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by