lecrapaud 0.16.3__tar.gz → 0.16.5__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.16.3 → lecrapaud-0.16.5}/PKG-INFO +1 -1
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/config.py +1 -1
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic.ini +7 -1
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/experiment.py +26 -12
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/session.py +7 -7
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/model_selection.py +1 -1
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/pyproject.toml +1 -1
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/LICENSE +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/README.md +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/__init__.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/api.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/__init__.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/README +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/env.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/script.py.mako +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_23_1748-f089dfb7e3ba_.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_24_1216-c62251b129ed_.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_24_1711-86457e2f333f_.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_25_1759-72aa496ca65b_.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/__init__.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/base.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/feature.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/feature_selection.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/feature_selection_rank.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/model.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/model_selection.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/model_training.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/score.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/target.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/models/utils.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/directories.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/experiment.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/feature_engineering.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/feature_selection.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/integrations/openai_integration.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/jobs/__init__.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/jobs/config.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/jobs/scheduler.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/jobs/tasks.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/misc/tabpfn_tests.ipynb +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/misc/test-gpu-bilstm.ipynb +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/misc/test-gpu-resnet.ipynb +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/misc/test-gpu-transformers.ipynb +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/search_space.py +0 -0
- {lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/utils.py +0 -0
|
@@ -82,7 +82,7 @@ sqlalchemy.url = %(DATABASE_URL)s
|
|
|
82
82
|
|
|
83
83
|
# Logging configuration
|
|
84
84
|
[loggers]
|
|
85
|
-
keys = root,sqlalchemy,alembic
|
|
85
|
+
keys = root,sqlalchemy,alembic,lecrapaud
|
|
86
86
|
|
|
87
87
|
[loggers_root]
|
|
88
88
|
disable_existing_loggers = False
|
|
@@ -108,6 +108,12 @@ level = INFO
|
|
|
108
108
|
handlers =
|
|
109
109
|
qualname = alembic
|
|
110
110
|
|
|
111
|
+
[logger_lecrapaud]
|
|
112
|
+
level = INFO
|
|
113
|
+
handlers = console
|
|
114
|
+
qualname = lecrapaud
|
|
115
|
+
propagate = 0
|
|
116
|
+
|
|
111
117
|
[handler_console]
|
|
112
118
|
class = StreamHandler
|
|
113
119
|
args = (sys.stderr,)
|
|
@@ -241,7 +241,7 @@ class Experiment(Base):
|
|
|
241
241
|
# This ensures we're comparing apples to apples by normalizing the scores
|
|
242
242
|
experiments = db.query(cls).filter(cls.name.ilike(f"%{name}%")).all()
|
|
243
243
|
if not experiments:
|
|
244
|
-
|
|
244
|
+
raise ValueError(f"No experiments found with the given name: {name}")
|
|
245
245
|
|
|
246
246
|
# Get all scores
|
|
247
247
|
rmse_scores = [e.avg_rmse for e in experiments if e.avg_rmse is not None]
|
|
@@ -250,7 +250,9 @@ class Experiment(Base):
|
|
|
250
250
|
]
|
|
251
251
|
|
|
252
252
|
if not rmse_scores or not logloss_scores:
|
|
253
|
-
|
|
253
|
+
raise ValueError(
|
|
254
|
+
"No experiments found with both RMSE and LogLoss scores. Maybe try with only one metric."
|
|
255
|
+
)
|
|
254
256
|
|
|
255
257
|
# Normalize scores (subtract min and divide by range)
|
|
256
258
|
min_rmse = min(rmse_scores)
|
|
@@ -277,17 +279,29 @@ class Experiment(Base):
|
|
|
277
279
|
|
|
278
280
|
return experiment_scores[0][0] if experiment_scores else None
|
|
279
281
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
+
elif metric == "rmse" or metric == "logloss":
|
|
283
|
+
# For single metric case (rmse or logloss)
|
|
284
|
+
# Need to get all experiments first to evaluate instance properties
|
|
285
|
+
experiments = db.query(cls).filter(cls.name.ilike(f"%{name}%")).all()
|
|
282
286
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
if not experiments:
|
|
288
|
+
return None
|
|
289
|
+
|
|
290
|
+
# Filter out experiments without scores and sort by the selected metric
|
|
291
|
+
filtered_experiments = []
|
|
292
|
+
for exp in experiments:
|
|
293
|
+
score = exp.avg_rmse if metric == "rmse" else exp.avg_logloss
|
|
294
|
+
if score is not None:
|
|
295
|
+
filtered_experiments.append((exp, score))
|
|
296
|
+
|
|
297
|
+
if not filtered_experiments:
|
|
298
|
+
return None
|
|
299
|
+
|
|
300
|
+
# Sort by score (ascending since lower is better)
|
|
301
|
+
filtered_experiments.sort(key=lambda x: x[1])
|
|
302
|
+
return filtered_experiments[0][0]
|
|
303
|
+
else:
|
|
304
|
+
raise ValueError("Invalid metric. Must be 'rmse', 'logloss', or 'both'.")
|
|
291
305
|
|
|
292
306
|
def get_features(self, target_number: int):
|
|
293
307
|
targets = [t for t in self.targets if t.name == f"TARGET_{target_number}"]
|
|
@@ -13,6 +13,8 @@ from lecrapaud.config import DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME, DB
|
|
|
13
13
|
_engine = None
|
|
14
14
|
_SessionLocal = None
|
|
15
15
|
if DB_URI:
|
|
16
|
+
if "mysql://" in DB_URI:
|
|
17
|
+
DB_URI = DB_URI.replace("mysql://", "mysql+pymysql://")
|
|
16
18
|
DATABASE_URL = DB_URI
|
|
17
19
|
elif DB_USER:
|
|
18
20
|
DATABASE_URL = (
|
|
@@ -23,15 +25,13 @@ else:
|
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
def init_db(uri: str = None):
|
|
26
|
-
global _engine, _SessionLocal, DATABASE_URL
|
|
28
|
+
global _engine, _SessionLocal, DATABASE_URL, DB_URI
|
|
27
29
|
if uri:
|
|
30
|
+
if "mysql://" in uri:
|
|
31
|
+
uri = uri.replace("mysql://", "mysql+pymysql://")
|
|
28
32
|
DATABASE_URL = uri
|
|
29
|
-
elif
|
|
30
|
-
|
|
31
|
-
f"mysql+pymysql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
|
|
32
|
-
)
|
|
33
|
-
elif DB_URI:
|
|
34
|
-
DATABASE_URL = DB_URI
|
|
33
|
+
elif DATABASE_URL:
|
|
34
|
+
pass
|
|
35
35
|
else:
|
|
36
36
|
raise ValueError(
|
|
37
37
|
"No database configuration found, please set env variables "
|
|
@@ -1253,7 +1253,7 @@ class ModelSelectionEngine:
|
|
|
1253
1253
|
try:
|
|
1254
1254
|
with open(best_params_file, "r") as f:
|
|
1255
1255
|
target_params = json.load(f)
|
|
1256
|
-
all_best_params[target_number] = target_params
|
|
1256
|
+
all_best_params[int(target_number)] = target_params
|
|
1257
1257
|
except Exception as e:
|
|
1258
1258
|
logger.warning(
|
|
1259
1259
|
f"Error loading best params for {target_dir}: {str(e)}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_23_1748-f089dfb7e3ba_.py
RENAMED
|
File without changes
|
{lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_24_1216-c62251b129ed_.py
RENAMED
|
File without changes
|
{lecrapaud-0.16.3 → lecrapaud-0.16.5}/lecrapaud/db/alembic/versions/2025_06_24_1711-86457e2f333f_.py
RENAMED
|
File without changes
|
{lecrapaud-0.16.3 → lecrapaud-0.16.5}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|