2
$\begingroup$

Take a car price predictor for an example. If you know the model and year of a car, you can extrapolate facts ("engineer features") about the car. For example: city and highway mpg, number of doors, horsepower, engine size, weight, factory recalls, popularity, etc... Of course, this assumes a non-customized car.

So assuming these things stay constant for cars, is there any value in using a dozen or so features that have the same value for all cars of a certain model and year, or would simply using some representation of the model and year of the car provide the same amount of signal to an ml model?

For example: all 2015 Honda Civics will have the same weight, number of doors, mpg, fuel type, etc...

Concrete Example

Original dataset

| price  | make_id | model_id | year | miles  |
|:-------|:--------|:---------|:-----|:-------|
| 1000   | 15      | 4        | 2015 | 250000 |
| 25000  | 16      | 8        | 2016 | 75000  |
| 45000  | 23      | 42       | 2018 | 10000  |

After feature engineering:

| price  | make_id | model_id | year | miles  | horse_power | city_mpg | hw_mpg | doors | engine_size |
|:-------|:--------|:---------|:-----|:-------|:------------|:---------|:-------|:------|:------------|
| 1000   | 15      | 4        | 2015 | 250000 | 160         | 18       | 23     | 4     | 1.5         |
| 800    | 15      | 4        | 2015 | 720000 | 160         | 18       | 23     | 4     | 1.5         |
| 500    | 15      | 4        | 2015 | 928300 | 160         | 18       | 23     | 4     | 1.5         |
| 3200   | 15      | 4        | 2015 | 268300 | 160         | 18       | 23     | 4     | 1.5         |
| 2600   | 15      | 4        | 2015 | 236200 | 160         | 18       | 23     | 4     | 1.5         |
| 26000  | 15      | 4        | 2015 | 1320   | 160         | 18       | 23     | 4     | 1.5         |
| 40000  | 15      | 4        | 2015 | 3250   | 160         | 18       | 23     | 4     | 1.5         |

Note that the example with the features expanded, for a given make/model/year, every feature is the same except for the mileage.

Is this redundant?

$\endgroup$
4
$\begingroup$

Given that car model is a categorical variable, replacing it with some numerical variables such as horsepower or mpg can have advantages depending on the scope of your prediction model.

If you only want to predict prices for car models (and years) for which you have sufficent individual data, then you can just estimate with binary variables for all car models. Adding mpg, horsepower, etc. will probably not help a whole lot.

However, this kind of model breaks down as soon as you try to make predictions for prices of car models you have no (or too few) observations to train on. A model based on horsepower, mpg, etc. on the other side would still work in that scenario.

$\endgroup$
0
$\begingroup$

Yes, highly correlated values can be very useful.

Have a look at Feature Selection: Correlation and Redundancy

EDIT:

After you added a sample dataset to your question, it becomes clear that you are not actually talking about linear correlation but rather mean mutual information.

The so called engineering features do not add any relevant information to your dataset since their mutual information with the model_id feature is 1.

Yet in real life, for a single model_id there are possible customizations such as an increased horse_power.

$\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.