How historian compression distorts machine learning
The series in a historian is not the series the sensor saw. Compression settings change what features and models learn.
Keep the raw file first, then check the delimiter, decimal separator, encoding, header, timestamps, time zone and units. Mark sentinel codes such as -999 as missing, remove only exact duplicates, review outliers before touching them, and log every change so the cleaning can be audited.
Sensor exports vary with the software and regional settings that produced them. A file may use semicolons as separators and commas as decimal marks, which a default import can read wrongly. Check the delimiter and decimal separator before anything else. A value written as '4,20' can be read as 420 if the parser takes the comma as a thousands separator. Then confirm the encoding, the header row, the timestamp format and time zone, and that each column has one unit, stated in the header or a data dictionary.
Before any change, keep an untouched copy of the file. Every later step should be a logged rule applied to that copy, so the result can be reproduced and questioned.
Hypothetical pressure log with semicolon separators and comma decimals. Three rows: 08:00:00;4,20, 08:00:01;-999, 08:00:02;4,25.
If -999 is left in, the mean becomes (4.20 − 999 + 4.25) / 3 ≈ −330.18 bar, which is physically meaningless for this sensor. The raw file still holds all three rows, so the step can be checked later.
The first mistake is confusing missing with zero. If a gap was filled with 0, the data now claims the sensor read exactly zero. The second is deleting outliers without looking at them, when a spike may be a real event such as a fast pressure surge. The third is treating every row with a repeated timestamp as junk. If the values differ, find the cause first. The last is overwriting the raw file, which removes the ability to undo or audit a cleaning step.
Load the file and read its data profile. Column types, missing counts and value distributions show many of these problems at once. Compare the profile before and after cleaning. A column that should be numeric but is still text usually means a separator or decimal rule was missed.
Rarely, and only after finding its cause. If there is an error code, a calibration problem or a maintenance record, flag the value in a separate column. Keep it if it reflects a real event. Record the reason for every removal and who made it.
Example numbers are hypothetical, not measured field results.