feat: Add absolute value option to time feature extraction

This commit is contained in:
nuluh
2024-09-03 15:39:44 +07:00
parent 758255a24e
commit 2f54e91197
2 changed files with 670 additions and 638 deletions

File diff suppressed because one or more lines are too long

View File

@@ -36,9 +36,12 @@ class FeatureExtractor:
result += f"{feature}: {value:.4f}\n" result += f"{feature}: {value:.4f}\n"
return result return result
def ExtractTimeFeatures(object): def ExtractTimeFeatures(object, absolute):
data = pd.read_csv(object, skiprows=1) # Skip the header row separator char info data = pd.read_csv(object, skiprows=1) # Skip the header row separator char info
extractor = FeatureExtractor(data.iloc[:, 1].values) # Assuming the data is in the second column if absolute:
extractor = FeatureExtractor(np.abs(data.iloc[:, 1].values)) # Assuming the data is in the second column
else:
extractor = FeatureExtractor(data.iloc[:, 1].values)
features = extractor.features features = extractor.features
return features return features
# Save features to a file # Save features to a file