Including identifier in machine learning model as feature vs separate model for every identifier I am new to machine learning and i am building a model to predict number of customers for the model branch at specific  hour/season/other feature.

I know it will be bad idea to pit id(branch_id in my case) into model but customer count in this case hugely depend on which branch it is so i cannot exclude it.

I can think of two solutions, i am not sure which one is right and what is the best practice.


Create dummy variable(one hot encoding to avoid wieghing one id more than other) for all branch ids,but since i have 600 unique branch ids my features will go up-to 600+rest_of_features.
Learn a separate model for each of the branch(600 models), i am not sure if it is right approach and also i am not very familiar with this approach and it will be very time consuming.


Looking for the suggestion

Example of the data is below    

    +-----------+------+-----------+-----------+-------------------+
    | branch_id | hour | feature_2 | feature_3 | Count of customer |
    +-----------+------+-----------+-----------+-------------------+
    |         1 |   12 |        .. |        .. |                19 |
    |         1 |   01 |        .. |        .. |                25 |
    |         2 |   23 |        .. |        .. |                14 |
    |         2 |   01 |        .. |        .. |                 5 |
    +-----------+------+-----------+-----------+-------------------+
In my opinion including id as a feature will not make sense at all, because the model will treat the id as a numeric value which will decrease the model performance, because there should be no connection how big the id is and how many customers there are for that id.

Option 2 can make sense if you have enough data for every branch.

My suggestion will be to look deep into your features and try to find a feature which will replace the branch id. Let's say the number of supporting desks in a branch or the location of a branch as a categorical value. If you find enough features that can describe the specifics of branches, then no need to include ids or to do it separately.