1
$\begingroup$

I am preparing a data for machine learning model. I want to deal with time series data as normal supervised learning prediction. Let's say I have a data for car speed and I have several cars models such as

+-----+---------+-------------+
| day |  Model  |   Speed     |
+-----+---------+-------------+
|   1 | Bentley | 20.47 km/h  |
|   2 | Bentley | 32.22 km/h  |
|   3 | Bentley | 23.11 km/h  |
|   1 | BMW     | 37.60 km/h  |
|   2 | BMW     | 27.90 km/h  |
|   3 | BMW     | 40.47 km/h  |

so I want to deal with several model in training so that predict the speed for Bentley and BMW.

I have converted the data for training like this :

+---------+------------+------------+-------------------+
|  Model  |   day_1    |     day_2  |    label == day_3 |
+---------+------------+------------+-------------------+
| Bentley | 20.47 km/h | 32.22 km/h | 23.11 km/h        |
| BMW     | 37.60 km/h | 27.90 km/h | 40.47 km/h        |
+---------+------------+------------+-------------------+

Is it a correct approach?

New contributor
angela is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
  • $\begingroup$ Do you always have the same number of days, like 3 in your example? And I assume that your training set would have several instances with the same car model right? $\endgroup$ – Erwan Dec 3 at 1:28
  • $\begingroup$ @Erwan yes always have the same days for all cars , and yes I have several other instances like mode_year, model_type like this . But I'm not sure if my above approach is correct or not ? $\endgroup$ – angela Dec 3 at 6:26
0
$\begingroup$

Since you always have a fixed number of days, I think your approach is good. In order to help the learning algorithm you might consider adding some statistics as features for every instance, for example:

  • mean of the last N days
  • difference dayN-day(N-1) (evolution)
  • ...

Of course this can work only if there is actually a dependency between the features and the predicted speed.

$\endgroup$
  • $\begingroup$ I have a question about difference dayN-day(N-1), so basically you mean I have to subtract day_2 speed from day_1 and then add it as feature. But what if I have 10 days , in that case I have to add 10 extra variables ? $\endgroup$ – angela 2 days ago
  • $\begingroup$ @angela Yes I would try it this way. it might or might not improve the performance, it's usually good to do a few experiments with different options for the features. $\endgroup$ – Erwan 2 days ago

Your Answer

angela is a new contributor. Be nice, and check out our Code of Conduct.

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.