How can I define a certain weight for prediction variables?
2 次查看(过去 30 天)
显示 更早的评论
Hey, I just started using Matlab machine learning toolbox and I already have some issues. First, after creating a model that provides a suitable fitting, I can obviously either export it directly (as a 1x1 struct) or generate a code from it. I would like to integrate the model as a code into a script, run the script and automatically get the 1x1 struct in my workspace without opening regression learner app every time. Is that possible? Second, Is there any chance I can give certain input variables (predictors) a weight if some are more or less important then others? Any help would be highly appreciated!
0 个评论
回答(1 个)
Ameer Hamza
2018-5-8
For the first question. After you have trained the model and have a 1x1 struct in your workspace. You can save it in a mat file and load it again when you want to use it. No need to train each time you need to use it,
save('filename.mat', 'variableName');
to load the data back
data = load('filename.mat')
you trained model will be inside struct data.
For your second question. If you have already trained the dataset, the training algorithm has already determined the weights based on the training dataset. You don't need to do it yourself.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!