Reduce outliers in motion data to ensure consistent scaling

This commit is contained in:
Nicolas Mowen 2024-03-14 08:27:18 -06:00
parent a660e3ae27
commit fe942961be

View File

@ -407,6 +407,8 @@ def motion_activity():
mean = df["motion"].mean() mean = df["motion"].mean()
std = df["motion"].std() std = df["motion"].std()
df["motion"] = (df["motion"] - mean) / std df["motion"] = (df["motion"] - mean) / std
outliers = df.quantile(0.999)["motion"]
df[df > outliers] = outliers
df["motion"] = ( df["motion"] = (
(df["motion"] - df["motion"].min()) (df["motion"] - df["motion"].min())
/ (df["motion"].max() - df["motion"].min()) / (df["motion"].max() - df["motion"].min())