1
$\begingroup$

I have to train a classification model to predict if a customer will buy a product or not. I have multiple (eg. 3 or 4) data sources. The variable distributions among the different data sources is quite different (eg. in the first one I have a vast majority of young people, while in the second one there are many adults). When the model will be used in production, the test dataset will be made of records from only one data sources (I don't know in advance which one).

My question is: which is the best way to combine these different sources? The data are not so much, so I cannot train an independent model for each data source. Can I just concatenate the data frame or do I have to perform some other kind of step?

Thank you!

$\endgroup$
1
$\begingroup$

Add all data together, and make sure you have features representing all possible insights. In your case one feature with age/maturity (young, adults...). Lets say you fit a decision tree (or Random Forest, gradient boosting...) the model will decide whether to do a split or not on this feature if it contains meaningful information.

If you combine you should be able to have more data and the models will work better.

In case you have different columns in data1 than in data2, consider leaving them as NaN, and then treating them properly.

| improve this answer | |
$\endgroup$
1
$\begingroup$

I can think of these possible solutions:

  1. The basic one, club the whole data and try different algorithms and evaluate the results.
  2. If Age distribution among the different samples(data set) are not proportionally distributed, i.e. if your dataset have huge samples of 'Young' in comparison to 'Adult' one or vice-versa, then I definitely try to tune my model without considering 'Age' as a feature. Trained model can be biased towards majority class, that's why good to drop such features.
  3. Ensemble based approach can also be explore. Train model for 'young' and 'adult' group separately. During testing, instead of giving equal score's to each model in ensemble, I will decide the contribution factor based upon the age values.
| improve this answer | |
$\endgroup$
0
$\begingroup$

Seems to me the best way to do this is to train a single model on all of your data and let it sort out the features that distinguish one data set from another.

If you don't know in advance which set you're getting data from, you can't know which model to choose so having more than one would limit you

| improve this answer | |
$\endgroup$
0
$\begingroup$

Hope this link would help you. It is always better to have more data, so concatenating the data sources would at least slightly increase the performance of you model than it used to be.

| improve this answer | |
$\endgroup$

Your Answer

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

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