0
$\begingroup$

I am pretty new to the data science game so pardon me, if the answer to my question should be a no-brainer.

We are looking at manufacturing / quality data where products are labeled 'okay' or 'not okay' based on different measurements. In our data set, we also have information on the product type, which machine was used to build it, at what time it was build, temperature, etc.

We are trying to train a classification model that will correctly classify 'okay' or 'not okay' products. At the point where the classification should be done, we do not have the measurements of the product, but all the other data I mentioned. Someone suggested using all data to train the model incl. the measurements, even though the test data will not have this information.

So the question is: is it feasible and does it make sense to train a model with more features than it can test on the test data? What ever the answer - please explain because I just can't seem to wrap my head around it.

Kind regards

Julia

$\endgroup$

2 Answers 2

1
$\begingroup$

The final purpose of a model is not the training but the actual application of it. If some features are not available during the final application and you cannot derive those features from other features, it is counter-productive to include these features during training.

Many classification methods will not even work if you don't give them the same set of features as they were trained on.

$\endgroup$
0
$\begingroup$

Features should be same for training and test/prediction sets. You should not use (actually can't for most packages) n features for training, n-k for test/prediction etc.

If the column you mentioned have NaNs for not all observations, you can try models that robust to null values. (ie: xgboost)

$\endgroup$
4
  • $\begingroup$ XGBoost may be able to handle null values, but only if they were also missing in the test dataset and only if the cause of why the values are missing is the same during training and testing (see here). This is clearly not the case in this scenario. Therefore, if they would use XGBoost with the measurement-values during training and null-values for prediction, at best, they would end up with the same performance as if they did not include the measurement values after all. $\endgroup$
    – georg.dev
    Commented Nov 28, 2019 at 11:49
  • $\begingroup$ "If the column you mentioned have NaNs for not all observations". read my answer again. especially for not all observations. It has a condition that there are some values that are not NaN. It was an extra information for the op. The first sentence clearly solves the problem. The second is additional information. $\endgroup$ Commented Nov 28, 2019 at 11:57
  • $\begingroup$ Alright, apologies. In this case, XGBoost can be good advice as long as there are either no missing values in the training data or if the missing values in the training data are missing completely at random. Otherwise, it depends on whether the fact that a value is missing or the actual measurement value holds higher explanatory power. $\endgroup$
    – georg.dev
    Commented Nov 28, 2019 at 12:31
  • 1
    $\begingroup$ That's alright, good point anyway. Thanks! $\endgroup$ Commented Nov 28, 2019 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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