Skip to content

Commit

Permalink
Re-factoring
Browse files Browse the repository at this point in the history
  • Loading branch information
menouarazib committed Jul 10, 2023
1 parent e3c0f76 commit b92bb3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions eventdetector/data/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,12 @@ def get_dataset_within_events_times(data_set: pd.DataFrame, events_times: pd.Dat
def op(dataset_as_overlapping_partitions: np.ndarray, events_as_intervals: list[Interval]) -> \
tuple[np.ndarray, np.ndarray]:
"""
Calculates the "op" value for each overlapping partition in the dataset, based on the overlapping parameter between the
partition and a set of events.
Calculates the "op" value for each overlapping partition in the dataset, based on the overlapping parameter
between the partition and a set of events.
Args:
dataset_as_overlapping_partitions: A numpy ndarray containing the overlapping partitions for the dataset, where each overlapping
partition is a 2D numpy ndarray containing the data points for the partition and their timestamps.
events_as_intervals: A list of Interval objects representing the events in the dataset.
Args: dataset_as_overlapping_partitions: A numpy ndarray containing the overlapping partitions for the dataset,
where each overlapping partition is a 2D numpy ndarray containing the data points for the partition and their
timestamps. events_as_intervals: A list of Interval objects representing the events in the dataset.
Returns:
A tuple containing two values:
Expand Down
4 changes: 2 additions & 2 deletions eventdetector/metamodel/meta_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ def prepare_data_and_computing_op(self) -> None:
and convert the remaining events to intervals. If a time partition is specified, it will get the union of
event times and extract the corresponding portion of the dataset.
The dataset will then be converted to overlapping partitions using the specified width and step size, and the $op$
(overlapping parameter) values will be computed for each partition based on the given intervals.
The dataset will then be converted to overlapping partitions using the specified width and step size,
and the $op$ (overlapping parameter) values will be computed for each partition based on the given intervals.
Finally, the learning data (overlapping partitions and corresponding $op$ values) will be stored in
the instance variables x and y.
Expand Down

0 comments on commit b92bb3a

Please sign in to comment.