Issues on the translation of MATLAB machine learning model to Python
Dear community,
I had training a Machine Learning model using the classification learner, that as the following characteristics:
% This code specifies all the classifier options and trains the classifier.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
I managed to get an accuracy of around 98%.
But when I tried to translate this code to Python, as follows and with the same training set, but I am not able to find the same accuracy, its a lot lower in Python. I would like to know if and what are the differences between both languages so I can adjust the parameters accordingly.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
Thank you in advance.Dear community,
I had training a Machine Learning model using the classification learner, that as the following characteristics:
% This code specifies all the classifier options and trains the classifier.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
I managed to get an accuracy of around 98%.
But when I tried to translate this code to Python, as follows and with the same training set, but I am not able to find the same accuracy, its a lot lower in Python. I would like to know if and what are the differences between both languages so I can adjust the parameters accordingly.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
Thank you in advance. Dear community,
I had training a Machine Learning model using the classification learner, that as the following characteristics:
% This code specifies all the classifier options and trains the classifier.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
I managed to get an accuracy of around 98%.
But when I tried to translate this code to Python, as follows and with the same training set, but I am not able to find the same accuracy, its a lot lower in Python. I would like to know if and what are the differences between both languages so I can adjust the parameters accordingly.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
Thank you in advance. machine learning, classification learner, python, ensemble MATLAB Answers — New Questions