1
$\begingroup$

I am working with a time series predicting whether web traffic will increase or decrease each day compared to the previous day for a given user.

Initially I used binary classes: labeled 1 for next day traffic increases and 0 for traffic decreases (which distributed into 60/40 split). Next I tried something conditionally: if the user has increased traffic for 3 previous days in a row and they increase tomorrow, that is labeled 1, else 0. Otherwise, if the user has decreased traffic the previous 3 days and decreases traffic tomorrow, that is labeled 1, else 0. So 1 doesn't always/necessarily correspond to traffic increases, it depends on the condition which can easily be observed when using this algorithm for real life predictions (by simply looking at the data).

With this 'conditional' dependent label encoding I have gotten much better results. The new binary classes are split 55/45 and accuracy and f1 have greatly improved for testing and training sets.

Is this kind of class labeling acceptable and/or good practice? I think it is positive as I am introducing more data without increasing dimensions but I am worried about mixing up the classes with this approach.

Thank you for your help!

$\endgroup$
0
$\begingroup$

There is no problem doing that, you can define your variable in every way. Just make sure you don't use the variables used to define your Y as predictors.

The only problem is that, after you defined your new variable, your model could be facing nonlinearities which are difficult to model (meaning: I can get a true from Decrease,Decrease,Decrease and from Increase,Increase,Increase, so some variables could be working for the first case, but not for the second).

If you have obtained better results with this new Y variable, I think you are fine.

$\endgroup$
  • $\begingroup$ Thanks, that is what I was worried about but couldn't verbalize- the nonlinearities and how the features are represented for each class. $\endgroup$ – Joe Thomson Apr 12 '19 at 3:46
0
$\begingroup$

Understand data is time series, instead of classifying the data as increase or decrease, why don't you forecast how many no. of user are going to visit the site in future. If you show a trend line for predict and test data and you can easily analyze model performance.

It will give clear picture on model performance and at which particular day there is decrease or increase in visits.

$\endgroup$
  • $\begingroup$ Yes the data is a time series. Good idea for number of users visit the site, thank you I will try this out. $\endgroup$ – Joe Thomson Apr 12 '19 at 3:47
  • $\begingroup$ Please share your response.. $\endgroup$ – Muralidhar A Apr 16 '19 at 8:03

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.