Labeling classes conditionally 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!
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.