def _compute_anom_score_between_two_windows(self, i):
lag_window_chunk_dict = self.lag_dicts[i]<EOL>future_window_chunk_dict = self.fut_dicts[i]<EOL>score = <NUM_LIT:0><EOL>for chunk in lag_window_chunk_dict:<EOL><INDENT>if chunk in future_window_chunk_dict:<EOL><INDENT>score += math.pow(future_window_chunk_dict[chunk] - lag_window_chunk_dict[chunk], <NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>score += math.pow(lag_window_chunk_dict[chunk], <NUM_LIT:2>)<EOL><DEDENT><DEDENT>for chunk in future_window_chunk_dict:<EOL><INDENT>if chunk not in lag_window_chunk_dict:<EOL><INDENT>score += math.pow(future_window_chunk_dict[chunk], <NUM_LIT:2>)<EOL><DEDENT><DEDENT>return score<EOL>
Compute distance difference between two windows' chunk frequencies,
which is then marked as the anomaly score of the data point on the window boundary in the middle.
:param int i: index of the data point between two windows.
:return float: the anomaly score.