Supervised learning: setting labels on sliding windows of sensor data Suppose that I have a set of accelerometer data collected with one sensor and one label for each measured data point. These labels describe different states of my system e.g., $state_A, state_B, state_C$, etc., and I want to use this information to train a classifier to recognize these states mentioned earlier. 
Now, let's say that I want to use a fixed sliding window to extract some features rather than feeding the raw data to the classifier. The issue is, that some of these sliding windows could contain more than one unique label: e.g. the time window contains the transition from $state_A$ to $state_C$. What should I do with these kind of windows? Should I discard them? Should I set a threshold to determine if I use them or not (e.g. if 90% or more of the measured points cointain the same label, then it is ok to use the window)? Are there any best practices handling these kind of situations?
In the following figure I add an example of this issue: the image shows a plot of three different states that the system could have, and they are encoded as 1,2, and 3 for visualization purposes. Let's say that I want to take windows of every 25 samples without overlapping, so the vertical red lines show the beginning and the end of every time window.
There are windows that only possess one unique state, but some others contain more than one.

 A: Your sliding window will generate something at every time period, assuming you slide it by one time slice at a time. So the feature you're generating from the sliding window will have a value at each time point, which corresponds to your target state.
The question is: which time slice that's contained in your window is the one that you attach the value to? For example, say your time window is 10 wide. If the first time is time 0, you won't be able to generate a feature for times 0 through 8, but at time 9 your window will contain 0-9 and you generate a feature for time 9. Then slide it over one (to times 1-10), and calculate your feature again and assign that value to time 10. And so on.
If your feature were the mean of values in your window, this would be called a trailing mean. You may not want to use the centered mean, which is what most people mean when they say a "moving average". Why? Because a centered mean in a window that's 11-wide, at time 20 would use times 15-25, which would include five units of time that would have not yet happened.
If you're doing everything after you've gathered all of your data, peeking "into the future" might not be a problem, but if you're ever going to try to predict what comes next, you won't have access to the future. Also, I've used the example of a "moving average" or "running mean", and both of these can introduce artifacts into your calculations because things snap in and out of the window. You may want to use some kind of "falling off over time" in your window so that things don't pop out.
Or are you wanting to compress your data so that only the sensor readings and state at each jump are recorded/modeled? (Assuming your data is as jumpy as your example.)
