FeatureRank 0.1.1__tar.gz → 0.1.2__tar.gz

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.
Files changed (49) hide show
  1. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank/GUI.py +47 -34
  2. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank/__init__.py +1 -1
  3. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank.egg-info/PKG-INFO +3 -2
  4. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank.egg-info/requires.txt +1 -0
  5. {featurerank-0.1.1 → featurerank-0.1.2}/PKG-INFO +3 -2
  6. featurerank-0.1.1/Readme.md → featurerank-0.1.2/README.md +1 -1
  7. {featurerank-0.1.1 → featurerank-0.1.2}/pyproject.toml +2 -1
  8. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank/__main__.py +0 -0
  9. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank.egg-info/SOURCES.txt +0 -0
  10. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank.egg-info/dependency_links.txt +0 -0
  11. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank.egg-info/entry_points.txt +0 -0
  12. {featurerank-0.1.1 → featurerank-0.1.2}/FeatureRank.egg-info/top_level.txt +0 -0
  13. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/EvaluatePaperDimensionReduction.py +0 -0
  14. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/FeatureBlockDatasetTools.py +0 -0
  15. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/FeatureRank.py +0 -0
  16. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateAccuracyBoxplotFromList.py +0 -0
  17. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateClassificationFigure.py +0 -0
  18. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateClusterClassificationSummaryFigure.py +0 -0
  19. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateClusterFigure1.py +0 -0
  20. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateConfusionMatrixPanel.py +0 -0
  21. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreatePrecisionRecallPanel.py +0 -0
  22. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateRegressionFigure2.py +0 -0
  23. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Figure_Scripts/CreateRocPanel.py +0 -0
  24. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/GeneratePaperDimensionReduction.py +0 -0
  25. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/PaperDimensionReductionCommon.py +0 -0
  26. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/RunAutoencoder.py +0 -0
  27. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/RunBlockFeatureSelection.py +0 -0
  28. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/RunDimensionReduction.py +0 -0
  29. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/RunFeatureRankCV.py +0 -0
  30. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/Simple.py +0 -0
  31. {featurerank-0.1.1 → featurerank-0.1.2}/scripts/__init__.py +0 -0
  32. {featurerank-0.1.1 → featurerank-0.1.2}/setup.cfg +0 -0
  33. {featurerank-0.1.1 → featurerank-0.1.2}/src/AutoencoderFeatureSelection.py +0 -0
  34. {featurerank-0.1.1 → featurerank-0.1.2}/src/Classification.py +0 -0
  35. {featurerank-0.1.1 → featurerank-0.1.2}/src/Clustering.py +0 -0
  36. {featurerank-0.1.1 → featurerank-0.1.2}/src/Config.py +0 -0
  37. {featurerank-0.1.1 → featurerank-0.1.2}/src/DataLoader.py +0 -0
  38. {featurerank-0.1.1 → featurerank-0.1.2}/src/DivideCombine.py +0 -0
  39. {featurerank-0.1.1 → featurerank-0.1.2}/src/Experiment.py +0 -0
  40. {featurerank-0.1.1 → featurerank-0.1.2}/src/Models.py +0 -0
  41. {featurerank-0.1.1 → featurerank-0.1.2}/src/OutputPaths.py +0 -0
  42. {featurerank-0.1.1 → featurerank-0.1.2}/src/Preprocessing.py +0 -0
  43. {featurerank-0.1.1 → featurerank-0.1.2}/src/Regression.py +0 -0
  44. {featurerank-0.1.1 → featurerank-0.1.2}/src/Reporting.py +0 -0
  45. {featurerank-0.1.1 → featurerank-0.1.2}/src/Runtime.py +0 -0
  46. {featurerank-0.1.1 → featurerank-0.1.2}/src/Utils.py +0 -0
  47. {featurerank-0.1.1 → featurerank-0.1.2}/src/Workflow.py +0 -0
  48. {featurerank-0.1.1 → featurerank-0.1.2}/src/__init__.py +0 -0
  49. {featurerank-0.1.1 → featurerank-0.1.2}/tests/test_feature_rank_refactor.py +0 -0
@@ -6,8 +6,6 @@ still performed by ``scripts.FeatureRank`` and the existing ``src`` modules.
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import contextlib
10
- import io
11
9
  import os
12
10
  from pathlib import Path
13
11
  import queue
@@ -33,22 +31,6 @@ TASK_LABELS = {
33
31
  _WINDOW_OPENED = False
34
32
 
35
33
 
36
- class _QueueWriter(io.TextIOBase):
37
- """Forward workflow output to the GUI queue without changing the workflow."""
38
-
39
- def __init__(self, messages: queue.Queue[tuple[str, object]]) -> None:
40
- super().__init__()
41
- self.messages = messages
42
-
43
- def write(self, text: str) -> int:
44
- if text:
45
- self.messages.put(("log", text))
46
- return len(text)
47
-
48
- def flush(self) -> None:
49
- return None
50
-
51
-
52
34
  def _dataset_choices() -> list[str]:
53
35
  """Find the repository's paired raw datasets for the dropdown."""
54
36
  project_root = Path(__file__).resolve().parent.parent
@@ -308,14 +290,12 @@ class FeatureRankGUI:
308
290
  self, dataset: str, percent: float, task: str, mode: str, block_count: int
309
291
  ) -> None:
310
292
  started_at = time.perf_counter()
311
- writer = _QueueWriter(self.messages)
312
293
  try:
313
- # These imports intentionally stay inside the worker. Importing
314
- # FeatureRank remains quick, and all computation reuses the CLI
315
- # orchestration and task implementations already in the project.
316
- from scripts.FeatureRank import metric_name_for_task, run_workflow
294
+ # Keep TensorFlow out of the Tk process. On macOS, loading a model
295
+ # from a GUI thread can terminate the native Python process. The
296
+ # existing FeatureRank CLI runs in a separate worker instead; its
297
+ # stdout is streamed back into this window.
317
298
  from src.Config import ExperimentConfig
318
- from src.OutputPaths import metric_runs_path
319
299
 
320
300
  config = ExperimentConfig(
321
301
  dataset_name=dataset,
@@ -328,16 +308,49 @@ class FeatureRankGUI:
328
308
  cluster_k=None,
329
309
  save_details=False,
330
310
  )
331
- metric_path = metric_runs_path(config.task, Path(dataset).stem, percent)
332
- with contextlib.redirect_stdout(writer), contextlib.redirect_stderr(writer):
333
- values, average = run_workflow(
334
- config=config,
335
- mode=mode,
336
- repeat_runs=1,
337
- metric_name=metric_name_for_task(config.task),
338
- metric_path=metric_path,
339
- block_count=block_count,
340
- )
311
+ python_executable = Path(sys.executable).with_name("python")
312
+ if not python_executable.exists():
313
+ python_executable = Path(sys.executable)
314
+ command = [
315
+ str(python_executable),
316
+ "-m",
317
+ "scripts.FeatureRank",
318
+ "--dataset-name",
319
+ dataset,
320
+ "--task",
321
+ task,
322
+ "--feature-percent",
323
+ str(percent),
324
+ "--random-state",
325
+ "42",
326
+ "--dc" if mode == "dc" else "--global",
327
+ ]
328
+ if mode == "dc":
329
+ command.extend(["--block-count", str(block_count)])
330
+
331
+ process = subprocess.Popen(
332
+ command,
333
+ cwd=Path.cwd(),
334
+ stdout=subprocess.PIPE,
335
+ stderr=subprocess.STDOUT,
336
+ text=True,
337
+ bufsize=1,
338
+ )
339
+ assert process.stdout is not None
340
+ for line in process.stdout:
341
+ self.messages.put(("log", line))
342
+ return_code = process.wait()
343
+ if return_code != 0:
344
+ if return_code in {139, -11}:
345
+ raise RuntimeError(
346
+ "TensorFlow Anaconda ortaminda baslatilamadi (native crash). "
347
+ "Anaconda TensorFlow paketini guncelleyin veya uyumlu bir "
348
+ "Python yorumlayicisi kullanin."
349
+ )
350
+ raise RuntimeError(f"FeatureRank worker stopped with code {return_code}.")
351
+
352
+ average = 0.0
353
+ values: list[float] = []
341
354
  summary = self._read_summary(
342
355
  config,
343
356
  mode,
@@ -11,7 +11,7 @@ import sys
11
11
 
12
12
  from .GUI import Launch
13
13
 
14
- __version__ = "0.1.1"
14
+ __version__ = "0.1.2"
15
15
 
16
16
 
17
17
  def _run_cli(arguments: list[str] | None = None) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: FeatureRank
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Autoencoder-based feature ranking and selection workflows
5
5
  Author: Sercan
6
6
  License: MIT
@@ -8,6 +8,7 @@ Requires-Python: >=3.13
8
8
  Description-Content-Type: text/markdown
9
9
  Requires-Dist: numpy>=2.0
10
10
  Requires-Dist: pandas>=2.0
11
+ Requires-Dist: numexpr>=2.10.2
11
12
  Requires-Dist: scikit-learn>=1.4
12
13
  Requires-Dist: matplotlib>=3.8
13
14
  Requires-Dist: tensorflow>=2.21
@@ -57,7 +58,7 @@ GPU-specific dependencies are listed in
57
58
  [`requirements-gpu.txt`](requirements-gpu.txt). Hardware notes are available in
58
59
  [`GPU_SETUP.md`](GPU_SETUP.md).
59
60
 
60
- The repository metadata is version `0.1.1`. Because PyPI releases cannot be
61
+ The repository metadata is version `0.1.2`. Because PyPI releases cannot be
61
62
  replaced in place, publish this version (or a newer one) to the existing
62
63
  `FeatureRank` project when you release the refactor. If an environment still
63
64
  shows `FeatureRank==0.1.0`, upgrade it with the command above or use the local
@@ -1,5 +1,6 @@
1
1
  numpy>=2.0
2
2
  pandas>=2.0
3
+ numexpr>=2.10.2
3
4
  scikit-learn>=1.4
4
5
  matplotlib>=3.8
5
6
  tensorflow>=2.21
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: FeatureRank
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Autoencoder-based feature ranking and selection workflows
5
5
  Author: Sercan
6
6
  License: MIT
@@ -8,6 +8,7 @@ Requires-Python: >=3.13
8
8
  Description-Content-Type: text/markdown
9
9
  Requires-Dist: numpy>=2.0
10
10
  Requires-Dist: pandas>=2.0
11
+ Requires-Dist: numexpr>=2.10.2
11
12
  Requires-Dist: scikit-learn>=1.4
12
13
  Requires-Dist: matplotlib>=3.8
13
14
  Requires-Dist: tensorflow>=2.21
@@ -57,7 +58,7 @@ GPU-specific dependencies are listed in
57
58
  [`requirements-gpu.txt`](requirements-gpu.txt). Hardware notes are available in
58
59
  [`GPU_SETUP.md`](GPU_SETUP.md).
59
60
 
60
- The repository metadata is version `0.1.1`. Because PyPI releases cannot be
61
+ The repository metadata is version `0.1.2`. Because PyPI releases cannot be
61
62
  replaced in place, publish this version (or a newer one) to the existing
62
63
  `FeatureRank` project when you release the refactor. If an environment still
63
64
  shows `FeatureRank==0.1.0`, upgrade it with the command above or use the local
@@ -43,7 +43,7 @@ GPU-specific dependencies are listed in
43
43
  [`requirements-gpu.txt`](requirements-gpu.txt). Hardware notes are available in
44
44
  [`GPU_SETUP.md`](GPU_SETUP.md).
45
45
 
46
- The repository metadata is version `0.1.1`. Because PyPI releases cannot be
46
+ The repository metadata is version `0.1.2`. Because PyPI releases cannot be
47
47
  replaced in place, publish this version (or a newer one) to the existing
48
48
  `FeatureRank` project when you release the refactor. If an environment still
49
49
  shows `FeatureRank==0.1.0`, upgrade it with the command above or use the local
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "FeatureRank"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Autoencoder-based feature ranking and selection workflows"
9
9
  readme = "Readme.md"
10
10
  authors = [{ name = "Sercan" }]
@@ -13,6 +13,7 @@ requires-python = ">=3.13"
13
13
  dependencies = [
14
14
  "numpy>=2.0",
15
15
  "pandas>=2.0",
16
+ "numexpr>=2.10.2",
16
17
  "scikit-learn>=1.4",
17
18
  "matplotlib>=3.8",
18
19
  "tensorflow>=2.21",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes