lecrapaud 0.14.0__tar.gz → 0.14.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.
Potentially problematic release.
This version of lecrapaud might be problematic. Click here for more details.
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/PKG-INFO +3 -3
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/README.md +2 -2
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/api.py +3 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/env.py +3 -2
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/experiment.py +4 -3
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/feature_selection.py +8 -5
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/feature_selection_rank.py +7 -2
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/model_selection.py +5 -3
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/model_training.py +5 -2
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/score.py +2 -1
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/experiment.py +1 -1
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/feature_engineering.py +9 -10
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/pyproject.toml +1 -1
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/LICENSE +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/__init__.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/config.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/__init__.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/README +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/script.py.mako +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_23_1748-f089dfb7e3ba_.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_24_1216-c62251b129ed_.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_24_1711-86457e2f333f_.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_25_1759-72aa496ca65b_.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic.ini +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/__init__.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/base.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/feature.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/model.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/models/target.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/session.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/directories.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/feature_selection.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/integrations/openai_integration.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/jobs/__init__.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/jobs/config.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/jobs/scheduler.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/jobs/tasks.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/misc/tabpfn_tests.ipynb +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/misc/test-gpu-bilstm.ipynb +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/misc/test-gpu-resnet.ipynb +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/misc/test-gpu-transformers.ipynb +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/model_selection.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/search_space.py +0 -0
- {lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: lecrapaud
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
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 `
|
|
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("
|
|
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 `
|
|
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("
|
|
153
|
+
if type_ == "table" and name.startswith(f"{LECRAPAUD_TABLE_PREFIX}_"):
|
|
154
154
|
return False # Ignore LeCrapaud tables
|
|
155
155
|
return True
|
|
156
156
|
|
|
@@ -298,6 +298,9 @@ class ExperimentEngine:
|
|
|
298
298
|
all_features = self.experiment.get_all_features(
|
|
299
299
|
date_column=self.date_column, group_column=self.group_column
|
|
300
300
|
)
|
|
301
|
+
joblib.dump(
|
|
302
|
+
all_features, f"{self.experiment.path}/preprocessing/all_features.pkl"
|
|
303
|
+
)
|
|
301
304
|
return all_features
|
|
302
305
|
|
|
303
306
|
def preprocess_model(self, train, val=None, test=None, for_training=True):
|
|
@@ -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="
|
|
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="
|
|
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
|
-
"
|
|
25
|
+
f"{LECRAPAUD_TABLE_PREFIX}_experiment_target_association",
|
|
25
26
|
Base.metadata,
|
|
26
27
|
Column(
|
|
27
28
|
"experiment_id",
|
|
28
29
|
BigInteger,
|
|
29
|
-
ForeignKey("
|
|
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("
|
|
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
|
-
"
|
|
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(
|
|
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("
|
|
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("
|
|
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("
|
|
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,
|
|
45
|
+
BigInteger,
|
|
46
|
+
ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_features.id", ondelete="CASCADE"),
|
|
45
47
|
)
|
|
46
48
|
feature_selection_id = Column(
|
|
47
|
-
BigInteger,
|
|
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,
|
|
41
|
+
BigInteger,
|
|
42
|
+
ForeignKey(f"{LECRAPAUD_TABLE_PREFIX}_models.id", ondelete="CASCADE"),
|
|
41
43
|
)
|
|
42
44
|
target_id = Column(
|
|
43
45
|
BigInteger,
|
|
44
|
-
ForeignKey("
|
|
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("
|
|
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(
|
|
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("
|
|
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("
|
|
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] =
|
|
586
|
-
columns_binary: list[str] =
|
|
587
|
-
columns_ordinal: list[str] =
|
|
588
|
-
columns_frequency: list[str] =
|
|
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_")]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_23_1748-f089dfb7e3ba_.py
RENAMED
|
File without changes
|
{lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_24_1216-c62251b129ed_.py
RENAMED
|
File without changes
|
{lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_24_1711-86457e2f333f_.py
RENAMED
|
File without changes
|
{lecrapaud-0.14.0 → lecrapaud-0.14.2}/lecrapaud/db/alembic/versions/2025_06_25_1759-72aa496ca65b_.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|