Last active
October 4, 2023 00:03
-
-
Save petrosDemetrakopoulos/8bcb0b649b7caaea34e4326c84b66ed4 to your computer and use it in GitHub Desktop.
Revisions
-
petrosDemetrakopoulos revised this gist
Oct 4, 2023 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ from matplotlib import pyplot as plt import numpy as np import pandas as pd from scipy.stats import skew, kurtosis from sklearn.decomposition import PCA from sklearn.cluster import KMeans def main(): data = read_data() normalized_data = normalize(data) -
petrosDemetrakopoulos created this gist
Oct 3, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ def main(): data = read_data() normalized_data = normalize(data) # time related columns are not needed after this point normalized_data = normalized_data.drop(['time','seconds_elapsed'],axis=1) extracted_features = feature_extraction(normalized_data) # dimensionality reduction using PCA plot_pca(extracted_features) # fit K-Means kmeans = KMeans(n_clusters=2) kmeans.fit(extracted_features) predictions = kmeans.predict(extracted_features) # plot the results plot_pca(extracted_features, predictions) plot_out_signal(predictions)