|
23 | 23 | import khiops.core.internals.filesystems as fs |
24 | 24 | from khiops.core.internals.runner import KhiopsLocalRunner |
25 | 25 | from khiops.extras.docker import KhiopsDockerRunner |
26 | | -from khiops.sklearn import KhiopsClassifier, KhiopsCoclustering |
27 | 26 | from tests.test_helper import KhiopsTestHelper |
28 | 27 |
|
29 | 28 |
|
@@ -190,90 +189,6 @@ def test_train_predictor_with_remote_access(self): |
190 | 189 | self.assertTrue(fs.exists(report_file_path)) |
191 | 190 | self.assertTrue(fs.exists(model_file_path)) |
192 | 191 |
|
193 | | - def test_khiops_classifier_with_remote_access(self): |
194 | | - """Test the training of a khiops_classifier with remote resources""" |
195 | | - |
196 | | - # Setup paths |
197 | | - # note : the current implementation forces the khiops.log file |
198 | | - # to be created in the output_dir (thus local) |
199 | | - # (any attempt to override it as an arg |
200 | | - # for the fit method will be ignored) |
201 | | - |
202 | | - # ask for folder cleaning during tearDown |
203 | | - self.folder_name_to_clean_in_teardown = output_dir = ( |
204 | | - self._khiops_temp_dir + f"/KhiopsClassifier_output_dir_{uuid.uuid4()}/" |
205 | | - ) |
206 | | - iris_data_dir = fs.get_child_path(kh.get_runner().samples_dir, "Iris") |
207 | | - iris_data_file_path = fs.get_child_path(iris_data_dir, "Iris.txt") |
208 | | - iris_dataset = { |
209 | | - "tables": {"Iris": (iris_data_file_path, None)}, |
210 | | - "format": ("\t", True), |
211 | | - } |
212 | | - |
213 | | - # Test if the 'fit' output files were created |
214 | | - classifier = KhiopsClassifier(output_dir=output_dir) |
215 | | - classifier.fit(iris_dataset, "Class") |
216 | | - self.assertTrue( |
217 | | - fs.exists( |
218 | | - fs.get_child_path( |
219 | | - output_dir, f"{iris_dataset.main_table.name}AnalysisResults.khj" |
220 | | - ) |
221 | | - ) |
222 | | - ) |
223 | | - self.assertTrue( |
224 | | - fs.exists( |
225 | | - fs.get_child_path( |
226 | | - output_dir, |
227 | | - f"{iris_dataset.main_table.name}AnalysisResults.model.kdic", |
228 | | - ) |
229 | | - ) |
230 | | - ) |
231 | | - |
232 | | - # Test if the 'predict' output file was created |
233 | | - with io.BytesIO(fs.read(iris_data_file_path)) as iris_data_file: |
234 | | - iris_df = pd.read_csv(iris_data_file, sep="\t") |
235 | | - iris_df.pop("Class") |
236 | | - classifier.predict(iris_df) |
237 | | - predict_path = fs.get_child_path(output_dir, "predict.txt") |
238 | | - self.assertTrue(fs.exists(predict_path), msg=f"Path: {predict_path}") |
239 | | - |
240 | | - def test_khiops_coclustering_with_remote_access(self): |
241 | | - """Test the training of a khiops_coclustering with remote resources""" |
242 | | - |
243 | | - # Setup paths |
244 | | - # note : the current implementation forces the khiops.log file |
245 | | - # to be created in the output_dir (thus local) |
246 | | - # (any attempt to override it as an arg |
247 | | - # for the fit method will be ignored) |
248 | | - |
249 | | - # ask for folder cleaning during tearDown |
250 | | - self.folder_name_to_clean_in_teardown = output_dir = ( |
251 | | - self._khiops_temp_dir |
252 | | - + f"/KhiopsCoclustering_output_dir_{uuid.uuid4()}/" |
253 | | - ) |
254 | | - splice_data_dir = fs.get_child_path( |
255 | | - kh.get_runner().samples_dir, "SpliceJunction" |
256 | | - ) |
257 | | - splice_data_file_path = fs.get_child_path( |
258 | | - splice_data_dir, "SpliceJunctionDNA.txt" |
259 | | - ) |
260 | | - |
261 | | - # Read the splice junction secondary datatable |
262 | | - with io.BytesIO(fs.read(splice_data_file_path)) as splice_data_file: |
263 | | - splice_df = pd.read_csv(splice_data_file, sep="\t") |
264 | | - |
265 | | - # Fit the coclustering |
266 | | - khcc = KhiopsCoclustering(output_dir=output_dir) |
267 | | - khcc.fit(splice_df, id_column="SampleId") |
268 | | - |
269 | | - # Test if the 'fit' files were created |
270 | | - self.assertTrue( |
271 | | - fs.exists(fs.get_child_path(output_dir, "Coclustering.kdic")) |
272 | | - ) |
273 | | - self.assertTrue( |
274 | | - fs.exists(fs.get_child_path(output_dir, "Coclustering.khcj")) |
275 | | - ) |
276 | | - |
277 | 192 | def test_train_predictor_fail_and_log_with_remote_access(self): |
278 | 193 | """Test train_predictor failure and access to a remote log""" |
279 | 194 | log_file_path = fs.get_child_path( |
|
0 commit comments