0
$\begingroup$

I would like to create a model in order to predict the demand of a certain variable according to some historical data. I am working with Python and I am facing some problems.

1) My time series does not have a defined frequency. I have been working with R and time series in the past, and I used to specify a frequency for the observation. How should I deal with my case? (I can have 50 entries one day, 0 another day, and so on)

2) I would like to forecast the demand of a given "Function Title". Do you advise me to use any machine learning technique? (my dataset is about 26000 entries)

Here a preview of my dataframe

import pandas as pd
import numpy as np

df = pd.read_csv('dataset.csv')

#Replace column with english label
df.columns = ['Work Experience', 'Function Profile', 'Function Title',
              'Occupation', 'Education', 'Company Name', 'Clean Company Name',
              'Sector (Industry)', 'Location', 'Salary Indication', 'Province',
              'Date Found', 'ISCO', 'SBI-Code']
ts = df.set_index(dates)
ts.head()

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

The thing that is called a "time series" in normal statistical parlance always has regular values. There are techniques for filling in missing values (e.g. you want to analyze a daily temperature record with time series techniques, but there are some days the guy recording them was out sick). But this looks like an inherently stochastic problem: the time at which entry appears is inherently random.

If I understand your problem correctly, you can transform this into a time series by counting the number of entries per day (or week, or whatever). This count is then a time series, in the usual understanding of the term, and can be analyzed as such. And since what you want to predict is itself a number of entries in some future time period, this is probably the right approach.

$\endgroup$
3
  • $\begingroup$ The OP gives very little to go on, but I suspect your approach is right. $\endgroup$
    – John
    Commented May 2, 2017 at 22:15
  • $\begingroup$ If I understood right, you advise me to group by the entries by month (therefore, frequency=12) and transform the dataset accordingly. In this case, in order to predict the "Function Title", I need to create a column for each "Function Title" in the dataset, and for each month count how many entries for the given function title I have. After, I can create the preditive model. Am I correct? $\endgroup$
    – Alex
    Commented May 3, 2017 at 9:27
  • $\begingroup$ Yes,that is correct. (The one thing I don't get in your response is what "frequency=12" means. Is that some setting in the tool you are using to analyze the data? You have correctly understood the procedure I have described, but I have no advice about how to implement that procedure in your tools.) $\endgroup$ Commented May 4, 2017 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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