Multioutput Regression models in MATLAB

32 ビュー (過去 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 Center および File ExchangeSupport Vector Machine Regression についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by