Kfold remains 0 after fitting

조회 수: 1 (최근 30일)
Huyen Vu
Huyen Vu 2023년 2월 10일
댓글: Huyen Vu 2023년 3월 6일
why does my kfold be set to 0 after beeing trained and set like that?
mdl = fitctree(T,"HH_kW_01",KFold=7);
mdl
%kfLoss = kfoldLoss(mdl)
display("end");
mdl =
ClassificationPartitionedModel
CrossValidatedModel: 'Discriminant'
PredictorNames: {1×62 cell}
ResponseName: 'HH_kW_01'
NumObservations: 35136
KFold: 0
Partition: [1×1 cvpartition]
ClassNames: [0 0.0049 0.0097 0.0292 0.0312 0.0321 0.0331 0.0351 0.0360 … ]
ScoreTransform: 'none'
Properties, Methods

답변 (1개)

Piyush Patil
Piyush Patil 2023년 3월 3일
Hello Huyen,
It seems like the KFOLD property of your ClassificationPartitionedModel object is set to 0. Possible reasons for this to happen could be -
  1. The KFOLD argument was not correctly passed to the "fitctree" function when the model was trained. So, to ensure that the KFOLD argument was passed correctly to the "fitctree" function, you can refer to the following documentation - Fitctree Function
  2. The KFOLD property was modified after the model was trained or the model was not trained using cross-validation.
If the issue still persists, then please share the relevant code and information about data files. It will allow me to better understand the issue so that I can assist you in resolving it.
  댓글 수: 1
Huyen Vu
Huyen Vu 2023년 3월 6일
Thanks for your answer. It's not only the problem with fitctree but also with other classifier such as fitcdiscr or fitcensemble. The issue always exists when I try to use cross validation, seems like the Kfold property was changed after beeing trained. So, about the data: 3500x64 table containing time series data about electric power consume.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Classification Trees에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by