Classification learner is slow to train other than Decision Tree

2 ビュー (過去 30 日間)
Ismat Mohd Sulaiman
Ismat Mohd Sulaiman 2021 年 2 月 26 日
編集済み: Prince Kumar 2021 年 11 月 25 日
I have 19MB size file with binary predictor.
I've fit several models (kNN, tree, svm, NB) using the Live editor and took between several seconds to less than 30 seconds.
When I try to use classification learner and train using decision tree, it took me about 60 seconds. But when I try other classifier, I had to stop the training after 60 minute (still didn't complete) and stopping also took a very long time (I had to close the application to stop it).
What could be the problem?
  1 件のコメント
Dulanjana Perera
Dulanjana Perera 2021 年 5 月 29 日
Same here. It gets worse when optimizing them.

サインインしてコメントする。

回答 (1 件)

Prince Kumar
Prince Kumar 2021 年 11 月 25 日
編集済み: Prince Kumar 2021 年 11 月 25 日
Hi,
There are two important things to take care here :
  1. Please check whether k-fold cross validation is happening or not in Classification learner app as k-fold cross validation takes time to execute. The app by default performs 5 fold cross validation.
  2. Please make sure that the model parameters in Classification learner app and model script are same. Different set of parameters take different amount of time to train.
If we keep these two things in mind, then training approximately takes same amount of time. Please have look at code below for better understanding
tic
SVMModel = fitcsvm(C,B,'KernelFunction','linear',...
'KernelScale', 0.23, ...
'KernelOffset', 0, ...
'Standardize', 1, ...
'Solver', 'SMO', ...
'NumPrint', 0, ...
'Verbose', 1);
toc
tic
CVSVMModel = crossval(SVMModel,'KFold',5);
toc

カテゴリ

Help Center および File ExchangeClassification Learner App についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by