0
$\begingroup$

I have some data that are training data. the feature size of training data is n but feature size of my test data is m. which one of classifiers can do classify this data?

$\endgroup$
  • 1
    $\begingroup$ Hi kian, welcome to Cross validated. Please do the tour before to ask any question. Could you add more details on your question? $\endgroup$ – YCR Feb 3 '16 at 11:21
2
$\begingroup$

The bottom line is that you can only use the features that are common to both the training and test data sets. Example:

  • Train: x1, x2, x3, x4, x5
  • Test: x2, x3, x5

Then you can only train and test using x2, x3, x5. You will remove features x1 and x4 when you are training. In R x[,-c(1,4)]

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Something bug me, here. Don't you need the same feature on your training and testing dataset? $\endgroup$ – YCR Feb 3 '16 at 11:17
  • $\begingroup$ Yes, of course! Example. Train: x1, x2, x3, x4, x5. Test: x2,x3,x5. Then you can only train and test using x2, x3, x5. You will remove features x1 and x4 when you are training. In R x[,-c(1,4)] $\endgroup$ – stan Feb 3 '16 at 11:24
  • $\begingroup$ In that case, whatever the number of feature in the training and testing data set, what count is the feature which are in both, ain't it? Basically, could you expand your answer? $\endgroup$ – YCR Feb 3 '16 at 11:28
  • 1
    $\begingroup$ So the fact that I don't understand why your answer use the number of feature, which is not a good reference to pick the features for training a model. If m < n but in the m feature, some are not in the training dataset, and the final number of feature should be described in ensemblist terms, with include or intersection, not less or more. $\endgroup$ – YCR Feb 3 '16 at 11:49
  • 1
    $\begingroup$ @stan: You've explained what you mean better in your comments than in your answer: if you edit your answer to include these points it'll be much improved. $\endgroup$ – Scortchi - Reinstate Monica Feb 3 '16 at 11:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.