cv partition for categorical values

2 次查看(过去 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 CenterFile Exchange 中查找有关 Gaussian Process Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by