How can I define a certain weight for prediction variables?

1 view (last 30 days)
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!

Answers (1)

Ameer Hamza
Ameer Hamza on 8 May 2018
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.

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!