def __init__(self, time_series_a, time_series_b, time_period=None, use_anomaly_score=False, algorithm_name=None, algorithm_params=None):
self.time_series_a = self._load(time_series_a)<EOL>self.time_series_b = self._load(time_series_b)<EOL>if use_anomaly_score:<EOL><INDENT>self.time_series_a = self._get_anomaly_scores(self.time_series_a)<EOL>self.time_series_b = self._get_anomaly_scores(self.time_series_b)<EOL><DEDENT>if time_period:<EOL><INDENT>start_p, end_p = time_period<EOL>try:<EOL><INDENT>self.time_series_a = self.time_series_a.crop(start_p, end_p)<EOL>self.time_series_b = self.time_series_b.crop(start_p, end_p)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise exceptions.NotEnoughDataPoints<EOL><DEDENT><DEDENT>self._sanity_check()<EOL>self.algorithm_params = {'<STR_LIT>': self.time_series_a, '<STR_LIT>': self.time_series_b}<EOL>self._get_algorithm_and_params(algorithm_name, algorithm_params)<EOL>self._correlate()<EOL>
Initializer
:param time_series_a: a TimeSeries, a dictionary or a path to a csv file(str).
:param time_series_b: a TimeSeries, a dictionary or a path to a csv file(str).
:param time_period: a tuple (start, end) representing a data period for considering correlation.
:param str algorithm_name: name of the algorithm to use.
:param dict algorithm_params: additional params for the specific algorithm.