lecrapaud 0.18.2__tar.gz → 0.18.3__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.

Potentially problematic release.


This version of lecrapaud might be problematic. Click here for more details.

Files changed (46) hide show
  1. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/PKG-INFO +1 -1
  2. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/feature_engineering.py +1 -1
  3. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/model_selection.py +7 -4
  4. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/pyproject.toml +1 -1
  5. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/LICENSE +0 -0
  6. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/README.md +0 -0
  7. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/__init__.py +0 -0
  8. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/api.py +0 -0
  9. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/config.py +0 -0
  10. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/__init__.py +0 -0
  11. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/README +0 -0
  12. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/env.py +0 -0
  13. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/script.py.mako +0 -0
  14. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/versions/2025_06_23_1748-f089dfb7e3ba_.py +0 -0
  15. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/versions/2025_06_24_1216-c62251b129ed_.py +0 -0
  16. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/versions/2025_06_24_1711-86457e2f333f_.py +0 -0
  17. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/versions/2025_06_25_1759-72aa496ca65b_.py +0 -0
  18. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic/versions/2025_08_25_1434-7ed9963e732f_add_best_score_to_model_selection.py +0 -0
  19. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/alembic.ini +0 -0
  20. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/__init__.py +0 -0
  21. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/base.py +0 -0
  22. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/experiment.py +0 -0
  23. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/feature.py +0 -0
  24. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/feature_selection.py +0 -0
  25. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/feature_selection_rank.py +0 -0
  26. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/model.py +0 -0
  27. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/model_selection.py +0 -0
  28. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/model_training.py +0 -0
  29. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/score.py +0 -0
  30. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/target.py +0 -0
  31. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/models/utils.py +0 -0
  32. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/db/session.py +0 -0
  33. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/directories.py +0 -0
  34. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/experiment.py +0 -0
  35. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/feature_selection.py +0 -0
  36. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/integrations/openai_integration.py +0 -0
  37. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/jobs/__init__.py +0 -0
  38. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/jobs/config.py +0 -0
  39. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/jobs/scheduler.py +0 -0
  40. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/jobs/tasks.py +0 -0
  41. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/misc/tabpfn_tests.ipynb +0 -0
  42. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/misc/test-gpu-bilstm.ipynb +0 -0
  43. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/misc/test-gpu-resnet.ipynb +0 -0
  44. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/misc/test-gpu-transformers.ipynb +0 -0
  45. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/search_space.py +0 -0
  46. {lecrapaud-0.18.2 → lecrapaud-0.18.3}/lecrapaud/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lecrapaud
3
- Version: 0.18.2
3
+ Version: 0.18.3
4
4
  Summary: Framework for machine and deep learning, with regression, classification and time series analysis
5
5
  License: Apache License
6
6
  Author: Pierre H. Gallet
@@ -220,7 +220,7 @@ class FeatureEngineeringEngine:
220
220
  Returns:
221
221
  pd.DataFrame: Original dataframe with new encoded columns added
222
222
  """
223
-
223
+ # TODO: target encoding needs to be fit / transform based at inference time.
224
224
  df: pd.DataFrame = self.data
225
225
  columns_te_groupby: list[list[str]] = self.columns_te_groupby
226
226
  columns_te_target: list[str] = self.columns_te_target
@@ -12,6 +12,7 @@ import glob
12
12
  from pathlib import Path
13
13
  import pickle
14
14
  from pydantic import BaseModel
15
+ import ast
15
16
 
16
17
  os.environ["COVERAGE_FILE"] = str(Path(".coverage").resolve())
17
18
 
@@ -122,6 +123,7 @@ class ModelEngine:
122
123
  plot: bool = False,
123
124
  log_dir: str = None,
124
125
  ):
126
+ self.threshold = None
125
127
  self.path = path
126
128
  if path:
127
129
  self.load()
@@ -152,8 +154,6 @@ class ModelEngine:
152
154
  else:
153
155
  self.scaler_y = None
154
156
 
155
- self.threshold = None
156
-
157
157
  def fit(self, *args):
158
158
  if self.recurrent:
159
159
  fit = self.fit_recurrent
@@ -1070,7 +1070,7 @@ class ModelSelectionEngine:
1070
1070
  best_score_overall = scores_tracking.iloc[0, :]
1071
1071
  best_model_name = best_score_overall["MODEL_NAME"]
1072
1072
  if self.target_type == "classification":
1073
- best_thresholds = best_score_overall["THRESHOLDS"]
1073
+ best_thresholds = ast.literal_eval(best_score_overall["THRESHOLDS"])
1074
1074
  joblib.dump(best_thresholds, f"{self.target_dir}/thresholds.pkl")
1075
1075
  else:
1076
1076
  best_thresholds = None
@@ -1852,7 +1852,9 @@ def apply_thresholds(
1852
1852
  """
1853
1853
 
1854
1854
  # Case 1: Per-class thresholds
1855
- if isinstance(threshold, dict):
1855
+ if not isinstance(threshold, int):
1856
+ if isinstance(threshold, str):
1857
+ threshold = ast.literal_eval(threshold)
1856
1858
  class_predictions = []
1857
1859
  class_probabilities = []
1858
1860
 
@@ -1862,6 +1864,7 @@ def apply_thresholds(
1862
1864
  metrics.get("threshold") if isinstance(metrics, dict) else metrics[0]
1863
1865
  )
1864
1866
  if _threshold is not None:
1867
+ class_label = int(class_label)
1865
1868
  if class_label not in pred_proba.columns:
1866
1869
  continue # skip missing class
1867
1870
  col = pred_proba[class_label]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lecrapaud"
3
- version = "0.18.2"
3
+ version = "0.18.3"
4
4
  description = "Framework for machine and deep learning, with regression, classification and time series analysis"
5
5
  authors = [
6
6
  {name = "Pierre H. Gallet"}
File without changes
File without changes
File without changes