autofuzzts 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autofuzzts/config.py +17 -17
- autofuzzts/data/data_loader.py +7 -7
- autofuzzts/data_validation/validate.py +41 -41
- autofuzzts/models/fuzzy_classifier.py +82 -82
- autofuzzts/models/mlp_nas.py +90 -90
- autofuzzts/partition/{fuzzy_clust_fun.py → fuzzy_part_fun.py} +107 -107
- autofuzzts/partition/partition.py +109 -109
- autofuzzts/partition/visualize_partition.py +32 -32
- autofuzzts/pipeline.py +469 -469
- autofuzzts/preprocess/prep_for_model.py +70 -70
- autofuzzts/preprocess/preprocess.py +62 -62
- {autofuzzts-0.1.2.dist-info → autofuzzts-0.1.3.dist-info}/METADATA +161 -146
- autofuzzts-0.1.3.dist-info/RECORD +23 -0
- {autofuzzts-0.1.2.dist-info → autofuzzts-0.1.3.dist-info}/WHEEL +1 -1
- {autofuzzts-0.1.2.dist-info → autofuzzts-0.1.3.dist-info}/licenses/LICENSE +21 -21
- autofuzzts/partition/fuzzy_clust_fun_orig.py +0 -129
- autofuzzts/utils.py +0 -1
- autofuzzts-0.1.2.dist-info/RECORD +0 -25
- {autofuzzts-0.1.2.dist-info → autofuzzts-0.1.3.dist-info}/top_level.txt +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
## Functions for fuzzy clustering
|
|
2
|
-
import numpy as np
|
|
3
|
-
import pandas as pd
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def fuzzy_partition_cosine(X: pd.Series, n:float):
|
|
7
|
-
'''
|
|
8
|
-
|
|
9
|
-
Midsteps of the calculation:
|
|
10
|
-
|
|
11
|
-
D - distance vector (D) represents the relative position of each data point within the partition
|
|
12
|
-
h - height, spread of the fuzzy sets
|
|
13
|
-
|
|
14
|
-
'''
|
|
15
|
-
|
|
16
|
-
n_rows = len(X)
|
|
17
|
-
x_spread = X.max() - X.min() # spread of the data
|
|
18
|
-
|
|
19
|
-
D = np.zeros((n,1))
|
|
20
|
-
for i in range(0,n):
|
|
21
|
-
D[i] = i/(n-1)*x_spread # D is adjusted by the x_spread
|
|
22
|
-
h = (D[-1]-D[0])/(n-1)
|
|
23
|
-
|
|
24
|
-
A = np.zeros((n_rows,n))
|
|
25
|
-
|
|
26
|
-
x_sorted = np.sort(X) # sort the data
|
|
27
|
-
|
|
28
|
-
for k in range(0,n_rows):
|
|
29
|
-
if (D[0] <= x_sorted[k]) and (x_sorted[k] <= D[1]):
|
|
30
|
-
A[k, 0] = 0.5*(np.cos(np.pi*(x_sorted[k]-D[0])/h)+1)
|
|
31
|
-
else:
|
|
32
|
-
if (D[n - 2] <= x_sorted[k]) and (x_sorted[k] <= D[n-1]):
|
|
33
|
-
A[k, n-1] = 0.5*(np.cos(np.pi*(x_sorted[k]-D[n-1])/h)+1)
|
|
34
|
-
for j in range(1,n-1):
|
|
35
|
-
if (D[j - 1] <= x_sorted[k]) and (x_sorted[k] <= D[j+1]):
|
|
36
|
-
A[k,j]=0.5*(np.cos(np.pi*(x_sorted[k]-D[j])/h)+1)
|
|
37
|
-
|
|
38
|
-
return D,A
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def fuzzy_partition_triangle(X: pd.Series, n:float):
|
|
45
|
-
'''
|
|
46
|
-
|
|
47
|
-
Midsteps of the calculation:
|
|
48
|
-
|
|
49
|
-
D - distance vector (D) represents the relative position of each data point within the partition
|
|
50
|
-
h - height, spread of the fuzzy sets
|
|
51
|
-
|
|
52
|
-
'''
|
|
53
|
-
|
|
54
|
-
n_rows = len(X)
|
|
55
|
-
x_spread = X.max() - X.min() # spread of the data
|
|
56
|
-
|
|
57
|
-
D = np.zeros((n,1))
|
|
58
|
-
for i in range(0,n):
|
|
59
|
-
D[i] = i/(n-1)*x_spread # D is adjusted by the x_spread
|
|
60
|
-
h = (D[-1]-D[0])/(n-1)
|
|
61
|
-
|
|
62
|
-
A = np.zeros((n_rows,n))
|
|
63
|
-
|
|
64
|
-
x_sorted = np.sort(X) # sort the data
|
|
65
|
-
|
|
66
|
-
for k in range(0,n_rows):
|
|
67
|
-
|
|
68
|
-
# First column
|
|
69
|
-
if (D[0] <= x_sorted[k]) and (x_sorted[k] <= D[1]):
|
|
70
|
-
A[k, 0] = (D[1]-x_sorted[k])/h
|
|
71
|
-
|
|
72
|
-
# Last column
|
|
73
|
-
else:
|
|
74
|
-
if (D[n - 2] <= x_sorted[k]) and (x_sorted[k] <= D[n-1]):
|
|
75
|
-
A[k, n-1] = (x_sorted[k]-D[n-2])/h
|
|
76
|
-
|
|
77
|
-
# All other columns
|
|
78
|
-
for j in range(1,n-1):
|
|
79
|
-
if (D[j - 1] <= x_sorted[k]) and (x_sorted[k]<= D[j]):
|
|
80
|
-
A[k,j] = (x_sorted[k]-D[j-1])/h
|
|
81
|
-
|
|
82
|
-
if (D[j] <= x_sorted[k]) and (x_sorted[k] <= D[j+1]):
|
|
83
|
-
A[k,j] = (D[j+1]-x_sorted[k])/h
|
|
84
|
-
|
|
85
|
-
return D,A
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
def fuzzy_partition_gauss(X: pd.Series, n:float, sigma:float = 1):
|
|
89
|
-
'''
|
|
90
|
-
|
|
91
|
-
Midsteps of the calculation:
|
|
92
|
-
|
|
93
|
-
D - distance vector (D) represents the relative position of each data point within the partition
|
|
94
|
-
h - height, spread of the fuzzy sets
|
|
95
|
-
|
|
96
|
-
'''
|
|
97
|
-
|
|
98
|
-
n_rows = len(X)
|
|
99
|
-
x_spread = X.max() - X.min() # spread of the data
|
|
100
|
-
|
|
101
|
-
D = np.zeros((n,1))
|
|
102
|
-
for i in range(0,n):
|
|
103
|
-
D[i] = i/(n-1)*x_spread # D is adjusted by the x_spread
|
|
104
|
-
h = (D[-1]-D[0])/(n-1)
|
|
105
|
-
|
|
106
|
-
A = np.zeros((n_rows,n))
|
|
107
|
-
|
|
108
|
-
x_sorted = np.sort(X) # sort the data
|
|
109
|
-
|
|
110
|
-
for k in range(0,n_rows):
|
|
111
|
-
|
|
112
|
-
# First column
|
|
113
|
-
if (D[0] <= x_sorted[k]) and (x_sorted[k] <= D[1]):
|
|
114
|
-
A[k, 0] = np.exp(-(x_sorted[k] - D[0]) ** 2 / (2 * sigma ** 2))
|
|
115
|
-
|
|
116
|
-
# Last column
|
|
117
|
-
else:
|
|
118
|
-
if (D[n - 2] <= k) and (x_sorted[k] <= D[n-1]):
|
|
119
|
-
A[k, n-1] = np.exp(-(x_sorted[k] - D[n-1]) ** 2 / (2 * sigma ** 2))
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# All other columns
|
|
123
|
-
for j in range(1,n-1):
|
|
124
|
-
if (D[j - 1] <= x_sorted[k]) and (x_sorted[k] <= D[j+1]):
|
|
125
|
-
A[k,j] = np.exp(-(x_sorted[k] - D[j]) ** 2 / (2 * sigma ** 2))
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return D,A
|
|
129
|
-
|
autofuzzts/utils.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# utils.py
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
autofuzzts/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
2
|
-
autofuzzts/config.py,sha256=rzwULHfKKtf5Rdpm8pk-zwuXrkKc0dckF-xIfz1UVcY,392
|
|
3
|
-
autofuzzts/pipeline.py,sha256=wwaVXBvnoAvd3MDvEaj4xKqPlBWMSyOHSR5TOTP2jTo,16189
|
|
4
|
-
autofuzzts/utils.py,sha256=lywC_KhHuYgjUmXjj-ay9vZYTKUSxFgWXY2q6EdWf9s,10
|
|
5
|
-
autofuzzts/data/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
6
|
-
autofuzzts/data/data_loader.py,sha256=VO8V9O3WgXffyktUMSmbGTiXWBJ2kgN5wLqgFgvkE6w,266
|
|
7
|
-
autofuzzts/data_validation/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
8
|
-
autofuzzts/data_validation/validate.py,sha256=ttK3nnvfTfxFF_GKyfxuU168oqmA6MEemB1dP06mL7g,1453
|
|
9
|
-
autofuzzts/evaluation/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
10
|
-
autofuzzts/models/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
11
|
-
autofuzzts/models/fuzzy_classifier.py,sha256=mU0t91n-8mTJQs-_XDYbrix9oa6EQP_3UvGDCw-GmJY,3363
|
|
12
|
-
autofuzzts/models/mlp_nas.py,sha256=OCFtrd47IhesAqtaHpBTOwKPdFly9yjl7O-25msXXGE,3048
|
|
13
|
-
autofuzzts/partition/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
14
|
-
autofuzzts/partition/fuzzy_clust_fun.py,sha256=NlpkI8s7N4ebdHWbGECsQZqk1Xf8v0c15cA27JEMJ-A,3097
|
|
15
|
-
autofuzzts/partition/fuzzy_clust_fun_orig.py,sha256=JlXYw-MxiNAcIasYTyWiQHaHhJuY8h_BRy3jLo2efOA,3653
|
|
16
|
-
autofuzzts/partition/partition.py,sha256=f5nTHjrJJYKjtzMFxsdfPL_CGBb12HOR0hkGi4L_WLY,4410
|
|
17
|
-
autofuzzts/partition/visualize_partition.py,sha256=F31yovGfosqa-EmtuQdIIuF61XejHEGGdALfHHAtDu0,909
|
|
18
|
-
autofuzzts/preprocess/__init__.py,sha256=2k_ZeqU7FvqZMFqGm-EYRiV98uxUxmiy5wXygvIobPU,13
|
|
19
|
-
autofuzzts/preprocess/prep_for_model.py,sha256=mp19PGo_p8YWezSny__qKnuTREhAldSlxCzIutrisGk,2565
|
|
20
|
-
autofuzzts/preprocess/preprocess.py,sha256=QZ0h4bZslwOrjTUyvPQaXDT_lBlnL8nKdp545Qy3xdk,2786
|
|
21
|
-
autofuzzts-0.1.2.dist-info/licenses/LICENSE,sha256=bjnZy7iTBVYeRcAPI9NVlXeQGx62R13_t8xwoLq44Ms,1087
|
|
22
|
-
autofuzzts-0.1.2.dist-info/METADATA,sha256=XuLUJuUcurF9DZE0YLGwFzkdJbIEZMXdJ3MI2KFztNk,3764
|
|
23
|
-
autofuzzts-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
-
autofuzzts-0.1.2.dist-info/top_level.txt,sha256=YHgbVRUPg-x2WX7FKyJMUAeI9o46c8XFiR_eYKtXIxc,11
|
|
25
|
-
autofuzzts-0.1.2.dist-info/RECORD,,
|
|
File without changes
|