How to specify loss function when using 'fitrensemble' function?
7 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2021 年 3 月 26 日
編集済み: MathWorks Support Team
2024 年 8 月 29 日
I am using "fitrensemble" function from MATLAB Statistics and Machine Learning Toolbox for a machine learning application. In the documentation, the default loss function is set to mean square error, how can I specify a different loss function?
採用された回答
MathWorks Support Team
2024 年 7 月 29 日
編集済み: MathWorks Support Team
2024 年 8 月 29 日
"fitrensemble" function has different algorithms/solvers and the loss depends on the type of algorithm/solver you select for the training. Please run the below command in the command window of installed MATLAB R2019a version to read more about details on the ensemble algorithms:
>> web(fullfile(docroot, 'stats/ensemble-algorithms.html'))
For example, you can use the following code to specify algorithm/solver:
>> fitrensemble(model, 'Method', 'Bag')
Once a model is trained, you can evaluate the model with different loss functions via "resubLoss" function. However, this function cannot change the loss function for training.
Please run the below command in the command window of installed MATLAB R2019a version to get release specific documentation on "resubLoss" function:
>> web(fullfile(docroot, 'stats/regressionensemble.resubloss.html'))
Please follow the below link to search for the required information regarding the current release:
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Regression Tree Ensembles についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!