def _analyze(self):
output = defaultdict(list)<EOL>output_by_name = defaultdict(list)<EOL>scores = self.anomaly_detector.get_all_scores()<EOL>if self.anomalies:<EOL><INDENT>for anomaly in self.anomalies:<EOL><INDENT>metrix_scores = scores<EOL>start_t, end_t = anomaly.get_time_window()<EOL>t = anomaly.exact_timestamp<EOL>room = (end_t - start_t) / <NUM_LIT:2><EOL>if not room:<EOL><INDENT>room = <NUM_LIT:30><EOL><DEDENT>extended_start_t = start_t - room<EOL>extended_end_t = end_t + room<EOL>metrix_scores_cropped = metrix_scores.crop(extended_start_t, extended_end_t)<EOL>while len(metrix_scores_cropped) < <NUM_LIT:2>:<EOL><INDENT>extended_start_t = extended_start_t - room<EOL>extended_end_t = extended_end_t + room<EOL>metrix_scores_cropped = metrix_scores.crop(extended_start_t, extended_end_t)<EOL><DEDENT>for entry in self.related_metrices:<EOL><INDENT>try:<EOL><INDENT>entry_correlation_result = Correlator(self.metrix, entry, time_period=(extended_start_t, extended_end_t),<EOL>use_anomaly_score=True).get_correlation_result()<EOL>record = extended_start_t, extended_end_t, entry_correlation_result.__dict__, entry<EOL>record_by_name = extended_start_t, extended_end_t, entry_correlation_result.__dict__<EOL>output[t].append(record)<EOL>output_by_name[entry].append(record_by_name)<EOL><DEDENT>except exceptions.NotEnoughDataPoints:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.output = output<EOL>self.output_by_name = output_by_name<EOL>
Analyzes if a matrix has anomalies.
If any anomaly is found, determine if the matrix correlates with any other matrixes.
To be implemented.