フィルターのクリア

cv partition for categorical values

1 回表示 (過去 30 日間)
Ege
Ege 2015 年 1 月 4 日
I am trying to use k fold cross validation for my dataset which has categorical and numerical features.
% Create a cvpartition object that defined the folds
c = cvpartition(Y,'holdout',.5);
% I tried c = cvpartition(Y,'kFold',3); as well
% Create a training set
x = array2table(X(training(c,1),:));
y = array2table(Y(training(c,1)));
% test set
u=array2table(X(test(c,1),:));
v=array2table(Y(test(c,1),:));
y.Properties.VariableNames{1} = 'churn';
v.Properties.VariableNames{1} = 'churn';
x.Properties.VariableNames(1:12)=adjusted_dataset.Properties.VariableNames(1:12);
u.Properties.VariableNames(1:12)=adjusted_dataset.Properties.VariableNames(1:12);
TrainingData= [x y];
TestDatawChurn=[u v];
After I execute this, it changes the categorical values into some random numbers. For example I see value 127 where it supposed to be 'yes'. What is it that I am doing wrong?

回答 (0 件)

カテゴリ

Help Center および File ExchangeModel Building and Assessment についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by