TransWikia.com

Include time as a variable in regression model

Data Science Asked by Justin Messi on September 25, 2021

I am currently working on a regression problem which requires me to predict the costs of a fixed asset. I have used several variables to do so and derived a predicted cost. However, my superior has wanted me to incorporate time as a variable in the regression model which I am at a loss on how to do so. My data set looks something like this which does not resemble a time series dataset.

Name    Capacity    OEM      Country   Date of valuation  MONTH   YEAR   Cost
A1       220        JAPAN    JAPAN     1/1/2012            1      2012   300,000,000 
A2       220        JAPAN    JAPAN     1/1/2012            1      2012   300000000
B1       400        CHINA    CHINA     1/3/2013            3      2013   475000000
B2       400        CHINA    CHINA     1/3/2013            3      2013   475000000   
B3       400        CHINA    CHINA     1/3/2013            3      2013   475000000
B4       400        CHINA    CHINA     1/3/2013            3      2013   475000000
C1       750        INDIA    USA       1/5/2016            5      2016   268000000
C2       750        INDIA    USA       1/5/2016            5      2016   268000000  

The variables that I have used are capacity, OEM and country. Any help on how to incorporate time to my regression problem is welcomed.

One Answer

Theres an approach I'd take which consists of two steps. The second is optional buy highly recommended.

  1. create variables for day, month, year separately.
  2. process those numbers as cyclic features (day 31 is as close to day 1 as to day 30, for example. If you don't do anything about that, and store days from 1 to 31, there's no place considering the cyclic nature of the feature). This post exaplins this in detail.

Hope this helps.

EDIT1: Also, not asked, but depending on the algorithm you're using, you may want to normalize the numerical features you have.

Answered by 89f3a1c on September 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP