Skip to content

Commit

Permalink
cleanup 2
Browse files Browse the repository at this point in the history
  • Loading branch information
JKomorniczak committed Oct 25, 2023
1 parent 519498f commit 7379adf
Show file tree
Hide file tree
Showing 25 changed files with 27 additions and 43 deletions.
5 changes: 1 addition & 4 deletions E1P_vis_real.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""
E1 - scatterplot - rzeczywiste
E1 - scatterplot - real-world streams
"""

import matplotlib.pyplot as plt
import numpy as np
from sklearn.feature_selection import SelectKBest
from sklearn.neural_network import MLPClassifier
import utils
import matplotlib
from sklearn.decomposition import PCA
Expand Down Expand Up @@ -67,7 +65,6 @@
X = X[perm]
y = np.array(y)[perm]

#EH
X[np.isnan(X)]=1
X[np.isinf(X)]=1
names = [n[:6] for n in utils.measure_labels[m_id]]
Expand Down
3 changes: 1 addition & 2 deletions E1P_vis_semi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E1 - scatterplot - semi
E1 - scatterplot - semi-synthetic streams
"""

import utils
Expand Down Expand Up @@ -45,7 +45,6 @@
for drf_id, drf in enumerate(['nearest', 'cubic']):
X, y = res_iter[drf_id,:,:-1], res_iter[drf_id,:,-1]

#EH
X[np.isnan(X)]=1
names = [n[:6] for n in utils.measure_labels[m_id]]

Expand Down
4 changes: 1 addition & 3 deletions E1P_vis_synthetic.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"""
E1 - scatterplot - syntetyczne
E1 - scatterplot - synthetic streams
"""

import matplotlib.pyplot as plt
import numpy as np
from sklearn.feature_selection import SelectKBest
from sklearn.neural_network import MLPClassifier
import utils
import matplotlib
from sklearn.decomposition import PCA
Expand Down Expand Up @@ -40,7 +39,6 @@
for drf_id, drf in enumerate(['sudd', 'inc', 'grad']):
X, y = res_iter[drf_id,:,:-1], res_iter[drf_id,:,-1]

#EH
X[np.isnan(X)]=1
names = [n[:6] for n in utils.measure_labels[m_id]]

Expand Down
2 changes: 1 addition & 1 deletion E1_extract_real.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Experiment 1 -- collect streams and metafetaures -- real-world
Experiment 1 -- collect streams and metafetaures -- real-world streams
"""
import numpy as np
from pymfe.mfe import MFE
Expand Down
2 changes: 1 addition & 1 deletion E1_extract_semi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Experiment 1 -- collect streams and metafetaures -- semi-synthetic
Experiment 1 -- collect streams and metafetaures -- semi-synthetic streams
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion E1_extract_synthetic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Experiment 1 -- collect streams and metafetaures -- synthetic
Experiment 1 -- collect streams and metafetaures -- synthetic streams
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion E2P_analyze_real.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Plot E2 - real
Plot E2 - Visualize classification results for real-world streams
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion E2P_analyze_semi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Plot E2 - semi
Plot E2 - Visualize classification results for semi-synthetic streams
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion E2P_analyze_synthetic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Plot E2 - synthetic
Plot E2 - Visualize classification results for synthetic streams
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion E2_clf_real.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E2 - klasyfikacja rzeczywistych
E2 - classification for real-world streams
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion E2_clf_semi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E2 - klasyfikacja semi
E2 - classification for semi-synthetic streams
"""

import numpy as np
Expand Down
5 changes: 1 addition & 4 deletions E2_clf_synthetic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E2 - klasyfikacja syntetycznych
E2 - classification for synthetic streams
"""

import numpy as np
Expand Down Expand Up @@ -46,11 +46,8 @@

for m_id, m in enumerate(measures):
res = np.load('results/%s.npy' % m)
# print(res.shape) # drfs, reps, chunks, measures + label

for d_id, res_drift in enumerate(res):
# print(res_drift.shape) # reps, chunks, measures + label

for r_id, res_rep in enumerate(res_drift):
#shuffle
p = np.random.permutation(res_rep.shape[0])
Expand Down
5 changes: 1 addition & 4 deletions E3P_vis_selection_real.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Plot.
E3, E4 - selekcja k-best + ANOVA - real
E3, E4 - Visualize -- select k-best + classification + f-test anova --- Real-world streams
"""

import numpy as np
Expand Down Expand Up @@ -80,10 +79,8 @@ def sqspace(start, end, num):

labels_measures = np.array(sum(labels_measures, []))

# cols=np.array(['r','g','b','gold','purple'])
cols=c


fig, ax = plt.subplots(1,1,figsize=(9,9/1.618), sharex=True, sharey=True)

start = np.zeros_like(anovas[0])
Expand Down
2 changes: 1 addition & 1 deletion E3P_vis_selection_semi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Plot.
E3, E4 - selekcja k-best + ANOVA - semi
E3, E4 - Visualize -- select k-best + classification + f-test anova --- Semi-synthetic streams
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion E3P_vis_selection_synthetic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Plot.
E3, E4 - selekcja k-best + ANOVA - sythetic
E3, E4 - Visualize -- select k-best + classification + f-test anova --- Semi-synthetic streams
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion E3_clf_real_selection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E3, E4 - selekcja k-best + klasyfikacja + zapis f-test anova - real
E3, E4 - select k-best + classification + f-test anova --- Real-world streams
"""
import numpy as np
from sklearn import clone
Expand Down
2 changes: 1 addition & 1 deletion E3_clf_semi_selection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E3, E4 - selekcja k-best + klasyfikacja + zapis f-test anova - semi
E3, E4 - select k-best + classification + f-test anova --- semi-synthetic streams
"""
import numpy as np
from sklearn import clone
Expand Down
2 changes: 1 addition & 1 deletion E3_clf_synthetic_selection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E3, E4 - selekcja k-best + klasyfikacja + zapis f-test anova - syntetyczne
E3, E4 - select k-best + classification + f-test anova --- synthetic streams
"""

import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions E4P_vis_bar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Visualization for E4
"""
from matplotlib.lines import Line2D
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion E4_clf_real_v2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E4 - klasyfikacja rzeczywistych, ale tylko dla 17 wybranych metryk
E4 - classification with reduced number of measures -- real-world streams
"""
import numpy as np
from sklearn import clone
Expand Down
2 changes: 1 addition & 1 deletion E4_clf_semi_v2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E4 - klasyfikacja semi, ale tylko dla 17 wybranych metryk
E4 - classification with reduced number of measures -- semi-synthetic streams
"""
import numpy as np
from sklearn import clone
Expand Down
2 changes: 1 addition & 1 deletion E4_clf_synthetic_v2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
E4 - klasyfikacja syntetycznych, ale tylko dla 17 wybranych metryk
E4 - classification with reduced number of measures -- synthetic streams
"""

import numpy as np
Expand Down
4 changes: 1 addition & 3 deletions E5_cov_real.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""
Obliczenia + Plot.
E5 - real
E5 - experiment and presentation -- real-world streams
"""
import utils
import numpy as np
Expand Down
5 changes: 1 addition & 4 deletions E5_cov_semi.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
"""
Obliczenia + Plot.
E5 - semi
E5 - experiment and presentation -- semi-synthetic streams
"""
import utils
import numpy as np
import matplotlib.pyplot as plt
import time

indexes = utils.selected2_indexes
labels = utils.selected2_measure_names
Expand Down
4 changes: 1 addition & 3 deletions E5_cov_syn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""
Obliczenia + Plot.
E5 - sythetic
E5 - experiment and presentation -- synthetic streams
"""
import utils
import numpy as np
Expand Down

0 comments on commit 7379adf

Please sign in to comment.