I asked it here as well: https://datascience.stackexchange.com/questions/19998/why-is-my-tree-showing-only-one-node

Hello, I have $N=1520=19*80$ samples, each of which are $p=1764$-dimensional. So $N < p$ here. I want to perform a $19$-class classification of these samples. The training data consists of $80$ samples from each of the $19$ classes. I performed classification tree in matlab (sorry but this is the only language I know well) using fitctree$(X,Y)$ where $X=$matrix of covariates of size $N \times p$, $Y=$ vector of responses of size $N \times 1$.I'm getting only one node each time.

Just to see if the problem solves when I reduce the number of features significantly, I tried to take the first $100$ features by $X=X(:, 1:100)$, but still got only one node.

Next, my knn and naive Bayes classifiers are also predicting all samples to be in one class, just like the tree above.

What could be the problem, and how could I possibly solve it? Am I making a syntactical mistake?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.