Skip to content

Commit

Permalink
added mean_ptp_distance features
Browse files Browse the repository at this point in the history
  • Loading branch information
technocreep committed Sep 29, 2023
1 parent c744591 commit 9047c31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fedot_ind/core/architecture/preprocessing/DatasetLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ def extract_data(self, dataset_name: str, data_path: str):
y_test = y_test.astype(str)

# Save data to tsv files
new_path = os.path.join(PROJECT_PATH, 'data', dataset_name)
new_path = os.path.join(PROJECT_PATH, 'fedot_ind','data', dataset_name)
os.makedirs(new_path, exist_ok=True)

self.logger.info(f'Saving {dataset_name} data files')
Expand Down
7 changes: 6 additions & 1 deletion fedot_ind/core/models/quantile/stat_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ def kurtosis(array: np.array) -> float:


def n_peaks(array: np.array) -> int:
return len(find_peaks(array))
return len(find_peaks(array)[0])


def mean_ptp_distance(array: np.array):
peaks, _ = find_peaks(array)
return np.mean(np.diff(peaks))


def slope(array: np.array) -> float:
Expand Down
1 change: 1 addition & 0 deletions fedot_ind/core/models/quantile/stat_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# 'base_entropy_': base_entropy,
'shannon_entropy_': shannon_entropy,
'ptp_amplitude_': ptp_amp,
'mean_ptp_distance_': mean_ptp_distance,
'crest_factor_': crest_factor,
'mean_ema_': mean_ema,
'mean_moving_median_': mean_moving_median,
Expand Down

0 comments on commit 9047c31

Please sign in to comment.