Multioutput Regression models in MATLAB

조회 수: 60 (최근 30일)
Alejandro Plata
Alejandro Plata 2023년 6월 5일
편집: Ive J 2023년 6월 8일
I am working on a project where I need to predict multiple response variables for a given data set likely using random forests or boositng. Are there any functions I could use that might provide what I am looking for. Basically, what I mean is:
data = (2-D matrix of regressors)
regression model = regression_function(data,response variables)

채택된 답변

Ive J
Ive J 2023년 6월 6일
I'm not aware of such a function in MATLAB, but you can loop over your target/response variables, and each time fit a new model. Something like this:
models = cell(numel(responseVars), 1);
for k = 1:numel(models)
models{k} = fitrensemble(data(:, [features, responseVars(k)], responseVars(k)); % data table contains all features + outcomes
end
  댓글 수: 7
the cyclist
the cyclist 2023년 6월 8일
fitcecoc doesn't fit multiple response variables. It fits a single (categorical) response variable that has more than two categories.
Ive J
Ive J 2023년 6월 8일
편집: Ive J 2023년 6월 8일
Yes, that's correct and I didn't mean fitcecoc is multivariate. For multivariate SVM one could check sklearn. But for this specific problem of OP, I meant something like this by aggregating different responses to see how one label vs others could differ compared to separate SVMs:
y1 = ["y1-1", "y1-2", "y1-3"];
y2 = ["y2-1", "y2-2"];
y_multi = y1' + "_" + y2;
y_multi = categorical(y_multi(:))
y_multi = 6×1 categorical array
y1-1_y2-1 y1-2_y2-1 y1-3_y2-1 y1-1_y2-2 y1-2_y2-2 y1-3_y2-2

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

the cyclist
the cyclist 2023년 6월 6일
The only MATLAB function (that I know of) that can handle multiple response variables is mvregress. Take a look at my answer here for examples with some common design matrices. There are of course examples in the documentation page I linked, as well.

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by