ddi-fw 0.0.176__py3-none-any.whl → 0.0.177__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.
- ddi_fw/datasets/core.py +23 -2
- {ddi_fw-0.0.176.dist-info → ddi_fw-0.0.177.dist-info}/METADATA +1 -1
- {ddi_fw-0.0.176.dist-info → ddi_fw-0.0.177.dist-info}/RECORD +5 -5
- {ddi_fw-0.0.176.dist-info → ddi_fw-0.0.177.dist-info}/WHEEL +0 -0
- {ddi_fw-0.0.176.dist-info → ddi_fw-0.0.177.dist-info}/top_level.txt +0 -0
ddi_fw/datasets/core.py
CHANGED
@@ -74,6 +74,21 @@ class BaseDataset(BaseModel):
|
|
74
74
|
arbitrary_types_allowed = True
|
75
75
|
|
76
76
|
def produce_inputs(self):
|
77
|
+
items = []
|
78
|
+
if self.X_train is None or self.X_test is None:
|
79
|
+
raise Exception("There is no data to produce inputs")
|
80
|
+
y_train_label, y_test_label = np.array(self.y_train), np.array(self.y_test)
|
81
|
+
|
82
|
+
for index,column in enumerate(self.columns):
|
83
|
+
train_data, test_data = self.X_train[:,index], self.X_test[:,index]
|
84
|
+
items.append([f'{column}', np.nan_to_num(train_data),
|
85
|
+
y_train_label, np.nan_to_num(test_data), y_test_label])
|
86
|
+
|
87
|
+
# items.append([f'{column}_embedding', train_data,
|
88
|
+
# y_train_label, test_data, y_test_label])
|
89
|
+
return items
|
90
|
+
|
91
|
+
def produce_inputs_ex(self):
|
77
92
|
items = []
|
78
93
|
if self.X_train is None or self.X_test is None:
|
79
94
|
raise Exception("There is no data to produce inputs")
|
@@ -130,15 +145,21 @@ class BaseDataset(BaseModel):
|
|
130
145
|
train = self.dataframe[self.dataframe.index.isin(train_idx_all)]
|
131
146
|
test = self.dataframe[self.dataframe.index.isin(test_idx_all)]
|
132
147
|
|
133
|
-
self.X_train =
|
148
|
+
self.X_train = train.drop(self.class_column, axis=1)
|
134
149
|
self.y_train = train[self.class_column]
|
135
150
|
self.X_test = test.drop(self.class_column, axis=1)
|
136
151
|
self.y_test = test[self.class_column]
|
137
|
-
|
152
|
+
|
138
153
|
self.train_indexes = self.X_train.index
|
139
154
|
self.test_indexes = self.X_test.index
|
140
155
|
self.train_idx_arr = train_idx_arr
|
141
156
|
self.val_idx_arr = val_idx_arr
|
157
|
+
|
158
|
+
# Dataframe to numpy array conversion
|
159
|
+
self.X_train = np.array(self.X_train)
|
160
|
+
self.y_train = np.array(self.y_train)
|
161
|
+
self.X_test = np.array(self.X_test)
|
162
|
+
self.y_test = np.array(self.y_test)
|
142
163
|
|
143
164
|
return self.X_train, self.X_test, self.y_train, self.y_test, self.train_indexes, self.test_indexes, self.train_idx_arr, self.val_idx_arr
|
144
165
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
ddi_fw/datasets/__init__.py,sha256=_I3iDHARwzmg7_EL5XKtB_TgG1yAkLSOVTujLL9Wz9Q,280
|
2
|
-
ddi_fw/datasets/core.py,sha256=
|
2
|
+
ddi_fw/datasets/core.py,sha256=k5rxauXCNWcUW_RHfswB4oTSz-EZyWHboH64o3x8mjg,10328
|
3
3
|
ddi_fw/datasets/dataset_splitter.py,sha256=8H8uZTAf8N9LUZeSeHOMawtJFJhnDgUUqFcnl7dquBQ,1672
|
4
4
|
ddi_fw/datasets/db_utils.py,sha256=OTsa3d-Iic7z3HmzSQK9UigedRbHDxYChJk0s4GfLnw,6191
|
5
5
|
ddi_fw/datasets/setup_._py,sha256=khYVJuW5PlOY_i_A16F3UbSZ6s6o_ljw33Byw3C-A8E,1047
|
@@ -97,7 +97,7 @@ ddi_fw/utils/zip_helper.py,sha256=YRZA4tKZVBJwGQM0_WK6L-y5MoqkKoC-nXuuHK6CU9I,55
|
|
97
97
|
ddi_fw/vectorization/__init__.py,sha256=LcJOpLVoLvHPDw9phGFlUQGeNcST_zKV-Oi1Pm5h_nE,110
|
98
98
|
ddi_fw/vectorization/feature_vector_generation.py,sha256=Z1A_DOBqDFPqLN4YB-3oYlOQWJK-X6Oes6UFjpzR47Q,4760
|
99
99
|
ddi_fw/vectorization/idf_helper.py,sha256=_Gd1dtDSLaw8o-o0JugzSKMt9FpeXewTh4wGEaUd4VQ,2571
|
100
|
-
ddi_fw-0.0.
|
101
|
-
ddi_fw-0.0.
|
102
|
-
ddi_fw-0.0.
|
103
|
-
ddi_fw-0.0.
|
100
|
+
ddi_fw-0.0.177.dist-info/METADATA,sha256=LVa6DvyGtARYgDpsqlekfEqeg3nj6uPALn10NKB2eE0,2542
|
101
|
+
ddi_fw-0.0.177.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
102
|
+
ddi_fw-0.0.177.dist-info/top_level.txt,sha256=PMwHICFZTZtcpzQNPV4UQnfNXYIeLR_Ste-Wfc1h810,7
|
103
|
+
ddi_fw-0.0.177.dist-info/RECORD,,
|
File without changes
|
File without changes
|