lecrapaud 0.14.0__tar.gz → 0.14.1__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 (44) hide show
  1. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/PKG-INFO +3 -3
  2. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/README.md +2 -2
  3. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/env.py +3 -2
  4. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/experiment.py +4 -3
  5. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/feature_selection.py +8 -5
  6. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/feature_selection_rank.py +7 -2
  7. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/model_selection.py +5 -3
  8. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/model_training.py +5 -2
  9. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/score.py +2 -1
  10. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/feature_engineering.py +9 -10
  11. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/pyproject.toml +1 -1
  12. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/LICENSE +0 -0
  13. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/__init__.py +0 -0
  14. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/api.py +0 -0
  15. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/config.py +0 -0
  16. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/__init__.py +0 -0
  17. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/README +0 -0
  18. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/script.py.mako +0 -0
  19. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/versions/2025_06_23_1748-f089dfb7e3ba_.py +0 -0
  20. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/versions/2025_06_24_1216-c62251b129ed_.py +0 -0
  21. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/versions/2025_06_24_1711-86457e2f333f_.py +0 -0
  22. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic/versions/2025_06_25_1759-72aa496ca65b_.py +0 -0
  23. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/alembic.ini +0 -0
  24. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/__init__.py +0 -0
  25. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/base.py +0 -0
  26. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/feature.py +0 -0
  27. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/model.py +0 -0
  28. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/models/target.py +0 -0
  29. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/db/session.py +0 -0
  30. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/directories.py +0 -0
  31. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/experiment.py +0 -0
  32. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/feature_selection.py +0 -0
  33. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/integrations/openai_integration.py +0 -0
  34. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/jobs/__init__.py +0 -0
  35. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/jobs/config.py +0 -0
  36. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/jobs/scheduler.py +0 -0
  37. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/jobs/tasks.py +0 -0
  38. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/misc/tabpfn_tests.ipynb +0 -0
  39. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/misc/test-gpu-bilstm.ipynb +0 -0
  40. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/misc/test-gpu-resnet.ipynb +0 -0
  41. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/misc/test-gpu-transformers.ipynb +0 -0
  42. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/model_selection.py +0 -0
  43. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/search_space.py +0 -0
  44. {lecrapaud-0.14.0 → lecrapaud-0.14.1}/lecrapaud/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lecrapaud
3
- Version: 0.14.0
3
+ Version: 0.14.1
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
@@ -177,13 +177,13 @@ experiment.model_selection(std_data, reshaped_data)
177
177
 
178
178
  ## ⚠️ Using Alembic in Your Project (Important for Integrators)
179
179
 
180
- If you use Alembic for migrations in your own project and you share the same database with LeCrapaud, you must ensure that Alembic does **not** attempt to drop or modify LeCrapaud tables (those prefixed with `lecrapaud_`).
180
+ If you use Alembic for migrations in your own project and you share the same database with LeCrapaud, you must ensure that Alembic does **not** attempt to drop or modify LeCrapaud tables (those prefixed with `{LECRAPAUD_TABLE_PREFIX}_`).
181
181
 
182
182
  By default, Alembic's autogenerate feature will propose to drop any table that exists in the database but is not present in your project's models. To prevent this, add the following filter to your `env.py`:
183
183
 
184
184
  ```python
185
185
  def include_object(object, name, type_, reflected, compare_to):
186
- if type_ == "table" and name.startswith("lecrapaud_"):
186
+ if type_ == "table" and name.startswith(f"{LECRAPAUD_TABLE_PREFIX}_"):
187
187
  return False # Ignore LeCrapaud tables
188
188
  return True
189
189
 
@@ -144,13 +144,13 @@ experiment.model_selection(std_data, reshaped_data)
144
144
 
145
145
  ## ⚠️ Using Alembic in Your Project (Important for Integrators)
146
146
 
147
- If you use Alembic for migrations in your own project and you share the same database with LeCrapaud, you must ensure that Alembic does **not** attempt to drop or modify LeCrapaud tables (those prefixed with `lecrapaud_`).
147
+ If you use Alembic for migrations in your own project and you share the same database with LeCrapaud, you must ensure that Alembic does **not** attempt to drop or modify LeCrapaud tables (those prefixed with `{LECRAPAUD_TABLE_PREFIX}_`).
148
148
 
149
149
  By default, Alembic's autogenerate feature will propose to drop any table that exists in the database but is not present in your project's models. To prevent this, add the following filter to your `env.py`:
150
150
 
151
151
  ```python
152
152
  def include_object(object, name, type_, reflected, compare_to):
153
- if type_ == "table" and name.startswith("lecrapaud_"):
153
+ if type_ == "table" and name.startswith(f"{LECRAPAUD_TABLE_PREFIX}_"):
154
154
  return False # Ignore LeCrapaud tables
155
155
  return True
156
156
 
@@ -6,6 +6,7 @@ from sqlalchemy import pool
6
6
  from alembic import context
7
7
  from lecrapaud.db.session import DATABASE_URL
8
8
  from lecrapaud.db.models.base import Base
9
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
9
10
 
10
11
  # this is the Alembic Config object, which provides
11
12
  # access to the values within the .ini file in use.
@@ -46,7 +47,7 @@ def run_migrations_offline() -> None:
46
47
  target_metadata=target_metadata,
47
48
  literal_binds=True,
48
49
  dialect_opts={"paramstyle": "named"},
49
- version_table="lecrapaud_alembic_version",
50
+ version_table=f"{LECRAPAUD_TABLE_PREFIX}_alembic_version",
50
51
  )
51
52
 
52
53
  with context.begin_transaction():
@@ -70,7 +71,7 @@ def run_migrations_online() -> None:
70
71
  context.configure(
71
72
  connection=connection,
72
73
  target_metadata=target_metadata,
73
- version_table="lecrapaud_alembic_version",
74
+ version_table=f"{LECRAPAUD_TABLE_PREFIX}_alembic_version",
74
75
  )
75
76
 
76
77
  with context.begin_transaction():
@@ -18,21 +18,22 @@ from sqlalchemy import (
18
18
  from sqlalchemy.orm import relationship
19
19
 
20
20
  from lecrapaud.db.models.base import Base
21
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
21
22
 
22
23
  # jointures
23
24
  lecrapaud_experiment_target_association = Table(
24
- "lecrapaud_experiment_target_association",
25
+ f"{LECRAPAUD_TABLE_PREFIX}_experiment_target_association",
25
26
  Base.metadata,
26
27
  Column(
27
28
  "experiment_id",
28
29
  BigInteger,
29
- ForeignKey("lecrapaud_experiments.id", ondelete="CASCADE"),
30
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_experiments.id", ondelete="CASCADE"),
30
31
  primary_key=True,
31
32
  ),
32
33
  Column(
33
34
  "target_id",
34
35
  BigInteger,
35
- ForeignKey("lecrapaud_targets.id", ondelete="CASCADE"),
36
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_targets.id", ondelete="CASCADE"),
36
37
  primary_key=True,
37
38
  ),
38
39
  )
@@ -26,21 +26,24 @@ from collections.abc import Iterable
26
26
 
27
27
  from lecrapaud.db.session import get_db
28
28
  from lecrapaud.db.models.base import Base, with_db
29
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
29
30
 
30
31
  # jointures
31
32
  lecrapaud_feature_selection_association = Table(
32
- "lecrapaud_feature_selection_association",
33
+ f"{LECRAPAUD_TABLE_PREFIX}_feature_selection_association",
33
34
  Base.metadata,
34
35
  Column(
35
36
  "feature_selection_id",
36
37
  BigInteger,
37
- ForeignKey("lecrapaud_feature_selections.id", ondelete="CASCADE"),
38
+ ForeignKey(
39
+ f"{LECRAPAUD_TABLE_PREFIX}_feature_selections.id", ondelete="CASCADE"
40
+ ),
38
41
  primary_key=True,
39
42
  ),
40
43
  Column(
41
44
  "feature_id",
42
45
  BigInteger,
43
- ForeignKey("lecrapaud_features.id", ondelete="CASCADE"),
46
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_features.id", ondelete="CASCADE"),
44
47
  primary_key=True,
45
48
  ),
46
49
  )
@@ -62,12 +65,12 @@ class FeatureSelection(Base):
62
65
  best_features_path = Column(String(255))
63
66
  experiment_id = Column(
64
67
  BigInteger,
65
- ForeignKey("lecrapaud_experiments.id", ondelete="CASCADE"),
68
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_experiments.id", ondelete="CASCADE"),
66
69
  nullable=False,
67
70
  )
68
71
  target_id = Column(
69
72
  BigInteger,
70
- ForeignKey("lecrapaud_targets.id", ondelete="CASCADE"),
73
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_targets.id", ondelete="CASCADE"),
71
74
  nullable=False,
72
75
  )
73
76
 
@@ -20,6 +20,7 @@ from sqlalchemy.dialects.mysql import insert
20
20
 
21
21
  from lecrapaud.db.session import get_db
22
22
  from lecrapaud.db.models.base import Base, with_db
23
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
23
24
 
24
25
 
25
26
  class FeatureSelectionRank(Base):
@@ -41,10 +42,14 @@ class FeatureSelectionRank(Base):
41
42
  method = Column(String(50))
42
43
  training_time = Column(Integer)
43
44
  feature_id = Column(
44
- BigInteger, ForeignKey("lecrapaud_features.id", ondelete="CASCADE")
45
+ BigInteger,
46
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_features.id", ondelete="CASCADE"),
45
47
  )
46
48
  feature_selection_id = Column(
47
- BigInteger, ForeignKey("lecrapaud_feature_selections.id", ondelete="CASCADE")
49
+ BigInteger,
50
+ ForeignKey(
51
+ f"{LECRAPAUD_TABLE_PREFIX}_feature_selections.id", ondelete="CASCADE"
52
+ ),
48
53
  )
49
54
 
50
55
  feature = relationship("Feature", lazy="selectin")
@@ -19,6 +19,7 @@ from sqlalchemy.orm import relationship, Mapped, mapped_column, DeclarativeBase
19
19
 
20
20
  from lecrapaud.db.session import get_db
21
21
  from lecrapaud.db.models.base import Base
22
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
22
23
 
23
24
 
24
25
  class ModelSelection(Base):
@@ -37,16 +38,17 @@ class ModelSelection(Base):
37
38
  best_thresholds = Column(JSON)
38
39
  best_model_path = Column(String(255))
39
40
  best_model_id = Column(
40
- BigInteger, ForeignKey("lecrapaud_models.id", ondelete="CASCADE")
41
+ BigInteger,
42
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_models.id", ondelete="CASCADE"),
41
43
  )
42
44
  target_id = Column(
43
45
  BigInteger,
44
- ForeignKey("lecrapaud_targets.id", ondelete="CASCADE"),
46
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_targets.id", ondelete="CASCADE"),
45
47
  nullable=False,
46
48
  )
47
49
  experiment_id = Column(
48
50
  BigInteger,
49
- ForeignKey("lecrapaud_experiments.id", ondelete="CASCADE"),
51
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_experiments.id", ondelete="CASCADE"),
50
52
  nullable=False,
51
53
  )
52
54
 
@@ -19,6 +19,7 @@ from sqlalchemy.orm import relationship, Mapped, mapped_column, DeclarativeBase
19
19
 
20
20
  from lecrapaud.db.session import get_db
21
21
  from lecrapaud.db.models.base import Base
22
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
22
23
 
23
24
 
24
25
  class ModelTraining(Base):
@@ -36,10 +37,12 @@ class ModelTraining(Base):
36
37
  best_params = Column(JSON)
37
38
  model_path = Column(String(255))
38
39
  training_time = Column(Integer)
39
- model_id = Column(BigInteger, ForeignKey("lecrapaud_models.id"), nullable=False)
40
+ model_id = Column(
41
+ BigInteger, ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_models.id"), nullable=False
42
+ )
40
43
  model_selection_id = Column(
41
44
  BigInteger,
42
- ForeignKey("lecrapaud_model_selections.id", ondelete="CASCADE"),
45
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_model_selections.id", ondelete="CASCADE"),
43
46
  nullable=False,
44
47
  )
45
48
 
@@ -11,6 +11,7 @@ from sqlalchemy import (
11
11
  from sqlalchemy import func
12
12
  from sqlalchemy.orm import relationship
13
13
  from lecrapaud.db.models.base import Base
14
+ from lecrapaud.config import LECRAPAUD_TABLE_PREFIX
14
15
 
15
16
 
16
17
  class Score(Base):
@@ -50,7 +51,7 @@ class Score(Base):
50
51
  f1_at_threshold = Column(Float)
51
52
  model_training_id = Column(
52
53
  BigInteger,
53
- ForeignKey("lecrapaud_model_trainings.id", ondelete="CASCADE"),
54
+ ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_model_trainings.id", ondelete="CASCADE"),
54
55
  nullable=False,
55
56
  )
56
57
 
@@ -327,11 +327,11 @@ class PreprocessFeature:
327
327
  self.data.columns = self.data.columns.str.upper()
328
328
 
329
329
  self.experiment = experiment
330
- self.columns_pca = columns_pca
331
- self.columns_onehot = columns_onehot
332
- self.columns_binary = columns_binary
333
- self.columns_ordinal = columns_ordinal
334
- self.columns_frequency = columns_frequency
330
+ self.columns_pca = [col.upper() for col in columns_pca]
331
+ self.columns_onehot = [col.upper() for col in columns_onehot]
332
+ self.columns_binary = [col.upper() for col in columns_binary]
333
+ self.columns_ordinal = [col.upper() for col in columns_ordinal]
334
+ self.columns_frequency = [col.upper() for col in columns_frequency]
335
335
  self.target_numbers = target_numbers
336
336
  self.target_clf = target_clf
337
337
 
@@ -526,7 +526,6 @@ class PreprocessFeature:
526
526
 
527
527
  pcas_dict = {}
528
528
  for column in columns:
529
- column = column.upper()
530
529
  # Convert text to embeddings if necessary
531
530
  if not isinstance(df[column].iloc[0], (np.ndarray, list)):
532
531
  sentences = df[column].astype(str).tolist()
@@ -582,10 +581,10 @@ class PreprocessFeature:
582
581
  Returns:
583
582
  tuple: (transformed DataFrame, ColumnTransformer)
584
583
  """
585
- columns_onehot: list[str] = [col.upper() for col in self.columns_onehot]
586
- columns_binary: list[str] = [col.upper() for col in self.columns_binary]
587
- columns_ordinal: list[str] = [col.upper() for col in self.columns_ordinal]
588
- columns_frequency: list[str] = [col.upper() for col in self.columns_frequency]
584
+ columns_onehot: list[str] = self.columns_onehot
585
+ columns_binary: list[str] = self.columns_binary
586
+ columns_ordinal: list[str] = self.columns_ordinal
587
+ columns_frequency: list[str] = self.columns_frequency
589
588
 
590
589
  X = df.loc[:, ~df.columns.str.contains("^TARGET_")]
591
590
  y = df.loc[:, df.columns.str.contains("^TARGET_")]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lecrapaud"
3
- version = "0.14.0"
3
+ version = "0.14.1"
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