cv partition for categorical values
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!