필터 지우기
필터 지우기

bug in plotPartialDependence for categorical predictors ?

조회 수: 1 (최근 30일)
Vincent Moron
Vincent Moron 2020년 2월 12일
편집: Vincent Moron 2020년 2월 12일
Hello
I am using regression tree with two predictors : one real and one categorical (10 categories from 0 to 9). When I plot the partial dependence for the categorical predictors, the estimates are given for 20 categories instead of 10 (at 0, 0.5, 1 etc. till 9 then NaN). I know that we can not use "query point" option to change these values but I do not understand how a partial dependence can be computed for a category that does not exist (as 0.5 or 1.5). Is it a bug ? My matlab version is 2018a and my script is
T=fitrtree(MODEL(train,2:npred),MODEL(train,1),'CategoricalPredictors',2);
plotPartialDependence(T,2);
[X,Y]=extract_fig2D(gcf); % this code simply extracts graphical values from a 2D plot
>> X
X =
Columns 1 through 14
0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000 5.0000 5.5000 6.0000 6.5000
Columns 15 through 20
7.0000 7.5000 8.0000 8.5000 9.0000 NaN
Thank you in advance
Vincent M.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by