Can the number of Predictors be different for Train and Test data?

2 ビュー (過去 30 日間)
abhisrisai
abhisrisai 2019 年 7 月 3 日
回答済み: Greg Heath 2019 年 7 月 18 日
Can my train data have 6 predictors while test data have only 4?
The 4 predictors in my test data are the same as in my train data, just that 2 extra predictors of the train might not be present in my test data.
It's basic question, but I'm a bit confused. Any suggestion would be helpful thank you.
  2 件のコメント
Adam Danz
Adam Danz 2019 年 7 月 3 日
編集済み: Adam Danz 2019 年 7 月 3 日
Are you doing cross validation? Are you training a neural network? Generally the training and testing data are subsets of the same dataset.
abhisrisai
abhisrisai 2019 年 7 月 3 日
@Adam Danz
Hi,
I'm using the fitcknn methodology. For now, I'm not using NN. Regarding my dataset, My training data is a different table and my test data is a different table. In other words, 2 different .csv files.

サインインしてコメントする。

採用された回答

Sai Bhargav Avula
Sai Bhargav Avula 2019 年 7 月 17 日
No, You can not have different number of predictors for the train and test data. The model you have trained would require all the predictor that is trained on for an accurate prediction.

その他の回答 (1 件)

Greg Heath
Greg Heath 2019 年 7 月 18 日
Of course not. The ultimate purpose of training is to create a model that works well on non-training data.
Thank you for formally accepting my answer
Greg

カテゴリ

Help Center および File ExchangeGet Started with Statistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by