How do I get ridge regression tuning parameters from fitrtree and crossval?
7 次查看(过去 30 天)
显示 更早的评论
I was wondering if I could use fitrtree to create a regression tree to then run crossval on to find the tuning parameters to then use in the Matlab ridge function.
0 个评论
回答(1 个)
Asvin Kumar
2020-4-13
crossval finds the k-fold cross validation loss of a given model with respect to a given dataset. I don’t see how you can use fitrtree along with that to find the optimal ridge parameter ‘k’ for ridge. It is a model that you’re seeking to find in the first place.
Have a look at the methods mentioned on this page: https://www.mathworks.com/help/stats/bayesian-optimization-workflow.html. They describe the many options available to optimize the hyperparameter for a wide variety of problems, including ridge regression.
Here’s an example at https://www.mathworks.com/help/stats/fitrlinear.html#bu5tqz1-1 if you want to test the performance of your model over a range of possible choices for the ridge parameter (‘Lambda’ Regularization Term Strength).
On the other hand, you can have the function optimize for the ridge parameter. Have a look at the example at https://www.mathworks.com/help/stats/fitrlinear.html#bvevent-1. This might be best suited for you. Set the name-value pair ‘OptimizeHyperparameters’ to {‘Lambda’}.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Regression Trees 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!