필터 지우기
필터 지우기

cv partition for categorical values

조회 수: 3 (최근 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에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by