lecrapaud 0.1.0__tar.gz → 0.2.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.
- lecrapaud-0.2.1/PKG-INFO +171 -0
- lecrapaud-0.2.1/README.md +122 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/config.py +1 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/session.py +16 -6
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/feature_engineering.py +0 -1
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/feature_selection.py +2 -4
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/model_selection.py +0 -3
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/pyproject.toml +1 -1
- lecrapaud-0.1.0/PKG-INFO +0 -105
- lecrapaud-0.1.0/README.md +0 -56
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/LICENSE +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/__init__.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/api.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/__init__.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/README +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/env.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/script.py.mako +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_04_06_1738-7390745388e4_initial_setup.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_04_06_1755-40cd8d3e798e_unique_constraint_for_data.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_23_1724-2360941fa0bd_longer_string.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_27_1159-b96396dcfaff_add_env_to_trading_tables.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_27_1337-40cbfc215f7c_fix_nb_character_on_portfolio.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_27_1526-3de994115317_to_datetime.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_27_2003-25c227c684f8_add_fees_to_transactions.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_27_2047-6b6f2d38e9bc_double_instead_of_float.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_31_1111-c175e4a36d68_generalise_stock_to_group.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_31_1256-5681095bfc27_create_investment_run_and_portfolio_.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_31_1806-339927587383_add_investment_run_id.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_31_1834-52b809a34371_make_nullablee.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_31_1849-3b8550297e8e_change_date_to_datetime.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_05_31_1852-e6b8c95d8243_add_date_to_portfolio_history.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_06_10_1136-db8cdd83563a_addnewsandoptiontodata.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/alembic/versions/2025_06_17_1652-c45f5e49fa2c_make_fields_nullable.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/__init__.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/base.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/dataset.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/feature.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/feature_selection.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/feature_selection_rank.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/model.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/model_selection.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/model_training.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/score.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/db/models/target.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/directory_management.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/experiment.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/integrations/openai_integration.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/jobs/__init__.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/jobs/config.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/jobs/scheduler.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/jobs/tasks.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/predictions.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/preprocessing.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/search_space.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/services/__init__.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/services/embedding_categorical.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/services/indicators.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/speed_tests/experiments.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/speed_tests/test-gpu-bilstm.ipynb +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/speed_tests/test-gpu-resnet.ipynb +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/speed_tests/test-gpu-transformers.ipynb +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/speed_tests/tests.ipynb +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/speed_tests/trash.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/training.py +0 -0
- {lecrapaud-0.1.0 → lecrapaud-0.2.1}/lecrapaud/utils.py +0 -0
lecrapaud-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: lecrapaud
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Framework for machine and deep learning, with regression, classification and time series analysis
|
|
5
|
+
License: Apache License
|
|
6
|
+
Author: Pierre H. Gallet
|
|
7
|
+
Requires-Python: ==3.12.*
|
|
8
|
+
Classifier: License :: Other/Proprietary License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Requires-Dist: backoff (>=2.2.1)
|
|
12
|
+
Requires-Dist: category-encoders (>=2.8.1)
|
|
13
|
+
Requires-Dist: celery (>=5.5.1)
|
|
14
|
+
Requires-Dist: curl-cffi (>=0.11.1)
|
|
15
|
+
Requires-Dist: deep-translator (>=1.11.4)
|
|
16
|
+
Requires-Dist: degiro-connector (>=3.0.26)
|
|
17
|
+
Requires-Dist: fake-useragent (>=2.1.0)
|
|
18
|
+
Requires-Dist: ftfy (>=6.3.1)
|
|
19
|
+
Requires-Dist: honeybadger (>=0.21)
|
|
20
|
+
Requires-Dist: joblib (>=1.4.2)
|
|
21
|
+
Requires-Dist: keras (>=3.9.0)
|
|
22
|
+
Requires-Dist: keras-tcn (>=3.1.2)
|
|
23
|
+
Requires-Dist: lightgbm (>=4.6.0)
|
|
24
|
+
Requires-Dist: matplotlib (>=3.10.1)
|
|
25
|
+
Requires-Dist: mlxtend (>=0.23.4)
|
|
26
|
+
Requires-Dist: numpy (>=2.1.3)
|
|
27
|
+
Requires-Dist: openai (>=1.86.0)
|
|
28
|
+
Requires-Dist: pandas (>=2.2.3)
|
|
29
|
+
Requires-Dist: pandas-market-calendars (>=4.6.1)
|
|
30
|
+
Requires-Dist: playwright (>=1.52.0)
|
|
31
|
+
Requires-Dist: pydantic (>=2.10.6)
|
|
32
|
+
Requires-Dist: python-dotenv (>=1.0.1)
|
|
33
|
+
Requires-Dist: pytz (>=2025.1)
|
|
34
|
+
Requires-Dist: ratelimit (>=2.2.1)
|
|
35
|
+
Requires-Dist: scikit-learn (>=1.6.1)
|
|
36
|
+
Requires-Dist: scipy (>=1.15.2)
|
|
37
|
+
Requires-Dist: seaborn (>=0.13.2)
|
|
38
|
+
Requires-Dist: sentence-transformers (>=3.4.1)
|
|
39
|
+
Requires-Dist: sqlalchemy (>=2.0.39)
|
|
40
|
+
Requires-Dist: tensorboardx (>=2.6.2.2)
|
|
41
|
+
Requires-Dist: tensorflow (>=2.19.0)
|
|
42
|
+
Requires-Dist: tf-keras (>=2.19.0)
|
|
43
|
+
Requires-Dist: tiktoken (>=0.9.0)
|
|
44
|
+
Requires-Dist: tqdm (>=4.67.1)
|
|
45
|
+
Requires-Dist: xgboost (>=3.0.0)
|
|
46
|
+
Requires-Dist: yahoo-fin (>=0.8.9.1)
|
|
47
|
+
Requires-Dist: yfinance (>=0.2.55)
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
<div align="center">
|
|
51
|
+
|
|
52
|
+
<div style="font-size:50rem;">🐸</div>
|
|
53
|
+
|
|
54
|
+
## Welcome to LeCrapaud
|
|
55
|
+
|
|
56
|
+
**An all-in-one machine learning framework**
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
## 🚀 Introduction
|
|
61
|
+
|
|
62
|
+
LeCrapaud is a high-level Python library for end-to-end machine learning workflows on tabular data, with a focus on financial and stock datasets. It provides a simple API to handle feature engineering, model selection, training, and prediction, all in a reproducible and modular way.
|
|
63
|
+
|
|
64
|
+
## ✨ Key Features
|
|
65
|
+
|
|
66
|
+
- 🧩 Modular pipeline: Feature engineering, preprocessing, selection, and modeling as independent steps
|
|
67
|
+
- 🤖 Automated model selection and hyperparameter optimization
|
|
68
|
+
- 📊 Easy integration with pandas DataFrames
|
|
69
|
+
- 🔬 Supports both regression and classification tasks
|
|
70
|
+
- 🛠️ Simple API for both full pipeline and step-by-step usage
|
|
71
|
+
- 📦 Ready for production and research workflows
|
|
72
|
+
|
|
73
|
+
## ⚡ Quick Start
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### ⚙️ Install the package
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
pip install lecrapaud
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 🛠️ How it works
|
|
83
|
+
|
|
84
|
+
This package provides a high-level API to manage experiments for feature engineering, model selection, and prediction on tabular data (e.g. stock data).
|
|
85
|
+
|
|
86
|
+
### Typical workflow
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from lecrapaud import LeCrapaud
|
|
90
|
+
|
|
91
|
+
# 1. Create the main app
|
|
92
|
+
app = LeCrapaud()
|
|
93
|
+
|
|
94
|
+
# 2. Define your experiment context (see your notebook or api.py for all options)
|
|
95
|
+
context = {
|
|
96
|
+
"data": your_dataframe,
|
|
97
|
+
"columns_drop": [...],
|
|
98
|
+
"columns_date": [...],
|
|
99
|
+
# ... other config options
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# 3. Create an experiment
|
|
103
|
+
experiment = app.create_experiment(**context)
|
|
104
|
+
|
|
105
|
+
# 4. Run the full training pipeline
|
|
106
|
+
experiment.train(your_dataframe)
|
|
107
|
+
|
|
108
|
+
# 5. Make predictions on new data
|
|
109
|
+
predictions = experiment.predict(new_data)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Modular usage
|
|
113
|
+
|
|
114
|
+
You can also use each step independently:
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
data_eng = experiment.feature_engineering(data)
|
|
118
|
+
train, val, test = experiment.preprocess_feature(data_eng)
|
|
119
|
+
features = experiment.feature_selection(train)
|
|
120
|
+
std_data, reshaped_data = experiment.preprocess_model(train, val, test)
|
|
121
|
+
experiment.model_selection(std_data, reshaped_data)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 🤝 Contributing
|
|
125
|
+
|
|
126
|
+
### Reminders for Github usage
|
|
127
|
+
|
|
128
|
+
1. Creating Github repository
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
$ brew install gh
|
|
132
|
+
$ gh auth login
|
|
133
|
+
$ gh repo create
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
2. Initializing git and first commit to distant repository
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
$ git init
|
|
140
|
+
$ git add .
|
|
141
|
+
$ git commit -m 'first commit'
|
|
142
|
+
$ git remote add origin <YOUR_REPO_URL>
|
|
143
|
+
$ git push -u origin master
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
3. Use conventional commits
|
|
147
|
+
https://www.conventionalcommits.org/en/v1.0.0/#summary
|
|
148
|
+
|
|
149
|
+
4. Create environment
|
|
150
|
+
|
|
151
|
+
```sh
|
|
152
|
+
$ pip install virtualenv
|
|
153
|
+
$ python -m venv .venv
|
|
154
|
+
$ source .venv/bin/activate
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
5. Install dependencies
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
$ make install
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
6. Deactivate virtualenv (if needed)
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
$ deactivate
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
Pierre Gallet © 2025
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<div style="font-size:50rem;">🐸</div>
|
|
4
|
+
|
|
5
|
+
## Welcome to LeCrapaud
|
|
6
|
+
|
|
7
|
+
**An all-in-one machine learning framework**
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
## 🚀 Introduction
|
|
12
|
+
|
|
13
|
+
LeCrapaud is a high-level Python library for end-to-end machine learning workflows on tabular data, with a focus on financial and stock datasets. It provides a simple API to handle feature engineering, model selection, training, and prediction, all in a reproducible and modular way.
|
|
14
|
+
|
|
15
|
+
## ✨ Key Features
|
|
16
|
+
|
|
17
|
+
- 🧩 Modular pipeline: Feature engineering, preprocessing, selection, and modeling as independent steps
|
|
18
|
+
- 🤖 Automated model selection and hyperparameter optimization
|
|
19
|
+
- 📊 Easy integration with pandas DataFrames
|
|
20
|
+
- 🔬 Supports both regression and classification tasks
|
|
21
|
+
- 🛠️ Simple API for both full pipeline and step-by-step usage
|
|
22
|
+
- 📦 Ready for production and research workflows
|
|
23
|
+
|
|
24
|
+
## ⚡ Quick Start
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### ⚙️ Install the package
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
pip install lecrapaud
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 🛠️ How it works
|
|
34
|
+
|
|
35
|
+
This package provides a high-level API to manage experiments for feature engineering, model selection, and prediction on tabular data (e.g. stock data).
|
|
36
|
+
|
|
37
|
+
### Typical workflow
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from lecrapaud import LeCrapaud
|
|
41
|
+
|
|
42
|
+
# 1. Create the main app
|
|
43
|
+
app = LeCrapaud()
|
|
44
|
+
|
|
45
|
+
# 2. Define your experiment context (see your notebook or api.py for all options)
|
|
46
|
+
context = {
|
|
47
|
+
"data": your_dataframe,
|
|
48
|
+
"columns_drop": [...],
|
|
49
|
+
"columns_date": [...],
|
|
50
|
+
# ... other config options
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# 3. Create an experiment
|
|
54
|
+
experiment = app.create_experiment(**context)
|
|
55
|
+
|
|
56
|
+
# 4. Run the full training pipeline
|
|
57
|
+
experiment.train(your_dataframe)
|
|
58
|
+
|
|
59
|
+
# 5. Make predictions on new data
|
|
60
|
+
predictions = experiment.predict(new_data)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Modular usage
|
|
64
|
+
|
|
65
|
+
You can also use each step independently:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
data_eng = experiment.feature_engineering(data)
|
|
69
|
+
train, val, test = experiment.preprocess_feature(data_eng)
|
|
70
|
+
features = experiment.feature_selection(train)
|
|
71
|
+
std_data, reshaped_data = experiment.preprocess_model(train, val, test)
|
|
72
|
+
experiment.model_selection(std_data, reshaped_data)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 🤝 Contributing
|
|
76
|
+
|
|
77
|
+
### Reminders for Github usage
|
|
78
|
+
|
|
79
|
+
1. Creating Github repository
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
$ brew install gh
|
|
83
|
+
$ gh auth login
|
|
84
|
+
$ gh repo create
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
2. Initializing git and first commit to distant repository
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
$ git init
|
|
91
|
+
$ git add .
|
|
92
|
+
$ git commit -m 'first commit'
|
|
93
|
+
$ git remote add origin <YOUR_REPO_URL>
|
|
94
|
+
$ git push -u origin master
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
3. Use conventional commits
|
|
98
|
+
https://www.conventionalcommits.org/en/v1.0.0/#summary
|
|
99
|
+
|
|
100
|
+
4. Create environment
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
$ pip install virtualenv
|
|
104
|
+
$ python -m venv .venv
|
|
105
|
+
$ source .venv/bin/activate
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
5. Install dependencies
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
$ make install
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
6. Deactivate virtualenv (if needed)
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
$ deactivate
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
Pierre Gallet © 2025
|
|
@@ -22,4 +22,5 @@ DB_PASSWORD = (
|
|
|
22
22
|
DB_HOST = os.getenv("TEST_DB_HOST") if PYTHON_ENV == "Test" else os.getenv("DB_HOST")
|
|
23
23
|
DB_PORT = os.getenv("TEST_DB_PORT") if PYTHON_ENV == "Test" else os.getenv("DB_PORT")
|
|
24
24
|
DB_NAME = os.getenv("TEST_DB_NAME") if PYTHON_ENV == "Test" else os.getenv("DB_NAME")
|
|
25
|
+
DB_URI = os.getenv("DB_URI", None)
|
|
25
26
|
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
|
@@ -3,20 +3,30 @@
|
|
|
3
3
|
from contextlib import contextmanager
|
|
4
4
|
from sqlalchemy import create_engine, text
|
|
5
5
|
from sqlalchemy.orm import sessionmaker
|
|
6
|
-
from
|
|
6
|
+
from urllib.parse import urlparse
|
|
7
|
+
|
|
8
|
+
from lecrapaud.config import DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME, DB_URI
|
|
7
9
|
|
|
8
10
|
_engine = None
|
|
9
11
|
_SessionLocal = None
|
|
10
|
-
DATABASE_URL =
|
|
12
|
+
DATABASE_URL = (
|
|
13
|
+
f"mysql+pymysql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}" or DB_URI
|
|
14
|
+
)
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
def init_db(uri: str = None):
|
|
14
18
|
global _engine, _SessionLocal
|
|
15
19
|
|
|
20
|
+
uri = uri if uri else DATABASE_URL
|
|
21
|
+
# Extract DB name from URI to connect without it
|
|
22
|
+
parsed = urlparse(uri)
|
|
23
|
+
db_name = parsed.path.lstrip("/") # remove leading slash
|
|
24
|
+
|
|
25
|
+
# Build root engine (no database in URI)
|
|
26
|
+
root_uri = uri.replace(f"/{db_name}", "/")
|
|
27
|
+
|
|
16
28
|
# Step 1: Connect to MySQL without a database
|
|
17
|
-
root_engine = create_engine(
|
|
18
|
-
uri if uri else f"mysql+pymysql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/"
|
|
19
|
-
)
|
|
29
|
+
root_engine = create_engine(root_uri)
|
|
20
30
|
|
|
21
31
|
# Step 2: Create database if it doesn't exist
|
|
22
32
|
with root_engine.connect() as conn:
|
|
@@ -24,7 +34,7 @@ def init_db(uri: str = None):
|
|
|
24
34
|
conn.commit()
|
|
25
35
|
|
|
26
36
|
# Step 3: Connect to the newly created database
|
|
27
|
-
_engine = create_engine(
|
|
37
|
+
_engine = create_engine(uri, echo=False)
|
|
28
38
|
|
|
29
39
|
# Step 4: Create session factory
|
|
30
40
|
_SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=_engine)
|
|
@@ -811,12 +811,10 @@ class PreprocessModel:
|
|
|
811
811
|
if duplicates:
|
|
812
812
|
raise ValueError(f"Doublons détectés dans columns_to_keep: {duplicates}")
|
|
813
813
|
|
|
814
|
-
logger.info(self.all_features)
|
|
815
|
-
|
|
816
814
|
self.train = train[columns_to_keep]
|
|
817
|
-
if val:
|
|
815
|
+
if isinstance(val, pd.DataFrame):
|
|
818
816
|
self.val = val[columns_to_keep]
|
|
819
|
-
if test:
|
|
817
|
+
if isinstance(test, pd.DataFrame):
|
|
820
818
|
self.test = test[columns_to_keep]
|
|
821
819
|
|
|
822
820
|
def run(self):
|
|
@@ -894,12 +894,9 @@ class ModelSelectionEngine:
|
|
|
894
894
|
# instantiate model
|
|
895
895
|
model = ModelEngine(
|
|
896
896
|
model_name=model_name,
|
|
897
|
-
recurrent=recurrent,
|
|
898
|
-
need_scaling=need_scaling,
|
|
899
897
|
search_params=config["search_params"],
|
|
900
898
|
target_type=self.target_type,
|
|
901
899
|
create_model=config["create_model"],
|
|
902
|
-
scaler_y=self.scaler_y,
|
|
903
900
|
plot=self.plot,
|
|
904
901
|
log_dir=log_dir,
|
|
905
902
|
)
|
lecrapaud-0.1.0/PKG-INFO
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: lecrapaud
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Framework for machine and deep learning, with regression, classification and time series analysis
|
|
5
|
-
License: Apache License
|
|
6
|
-
Author: Pierre H. Gallet
|
|
7
|
-
Requires-Python: ==3.12.*
|
|
8
|
-
Classifier: License :: Other/Proprietary License
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
-
Requires-Dist: backoff (>=2.2.1)
|
|
12
|
-
Requires-Dist: category-encoders (>=2.8.1)
|
|
13
|
-
Requires-Dist: celery (>=5.5.1)
|
|
14
|
-
Requires-Dist: curl-cffi (>=0.11.1)
|
|
15
|
-
Requires-Dist: deep-translator (>=1.11.4)
|
|
16
|
-
Requires-Dist: degiro-connector (>=3.0.26)
|
|
17
|
-
Requires-Dist: fake-useragent (>=2.1.0)
|
|
18
|
-
Requires-Dist: ftfy (>=6.3.1)
|
|
19
|
-
Requires-Dist: honeybadger (>=0.21)
|
|
20
|
-
Requires-Dist: joblib (>=1.4.2)
|
|
21
|
-
Requires-Dist: keras (>=3.9.0)
|
|
22
|
-
Requires-Dist: keras-tcn (>=3.1.2)
|
|
23
|
-
Requires-Dist: lightgbm (>=4.6.0)
|
|
24
|
-
Requires-Dist: matplotlib (>=3.10.1)
|
|
25
|
-
Requires-Dist: mlxtend (>=0.23.4)
|
|
26
|
-
Requires-Dist: numpy (>=2.1.3)
|
|
27
|
-
Requires-Dist: openai (>=1.86.0)
|
|
28
|
-
Requires-Dist: pandas (>=2.2.3)
|
|
29
|
-
Requires-Dist: pandas-market-calendars (>=4.6.1)
|
|
30
|
-
Requires-Dist: playwright (>=1.52.0)
|
|
31
|
-
Requires-Dist: pydantic (>=2.10.6)
|
|
32
|
-
Requires-Dist: python-dotenv (>=1.0.1)
|
|
33
|
-
Requires-Dist: pytz (>=2025.1)
|
|
34
|
-
Requires-Dist: ratelimit (>=2.2.1)
|
|
35
|
-
Requires-Dist: scikit-learn (>=1.6.1)
|
|
36
|
-
Requires-Dist: scipy (>=1.15.2)
|
|
37
|
-
Requires-Dist: seaborn (>=0.13.2)
|
|
38
|
-
Requires-Dist: sentence-transformers (>=3.4.1)
|
|
39
|
-
Requires-Dist: sqlalchemy (>=2.0.39)
|
|
40
|
-
Requires-Dist: tensorboardx (>=2.6.2.2)
|
|
41
|
-
Requires-Dist: tensorflow (>=2.19.0)
|
|
42
|
-
Requires-Dist: tf-keras (>=2.19.0)
|
|
43
|
-
Requires-Dist: tiktoken (>=0.9.0)
|
|
44
|
-
Requires-Dist: tqdm (>=4.67.1)
|
|
45
|
-
Requires-Dist: xgboost (>=3.0.0)
|
|
46
|
-
Requires-Dist: yahoo-fin (>=0.8.9.1)
|
|
47
|
-
Requires-Dist: yfinance (>=0.2.55)
|
|
48
|
-
Description-Content-Type: text/markdown
|
|
49
|
-
|
|
50
|
-
# Stock
|
|
51
|
-
|
|
52
|
-
## Overview
|
|
53
|
-
|
|
54
|
-
## Project description
|
|
55
|
-
|
|
56
|
-
## Quick Start
|
|
57
|
-
|
|
58
|
-
1. Create environment
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
$ pip install virtualenv
|
|
62
|
-
$ python -m venv .venv
|
|
63
|
-
$ source .venv/bin/activate
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
2. Install dependencies
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
$ pip install -r requirements.txt
|
|
70
|
-
$ pip freeze > requirements.txt
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
3. Deactivate virtualenv (if needed)
|
|
74
|
-
|
|
75
|
-
```sh
|
|
76
|
-
$ deactivate
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Reminders for Github usage
|
|
80
|
-
|
|
81
|
-
1. Creating Github repository
|
|
82
|
-
|
|
83
|
-
```sh
|
|
84
|
-
$ brew install gh
|
|
85
|
-
$ gh auth login
|
|
86
|
-
$ gh repo create
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
2. Initializing git and first commit to distant repository
|
|
90
|
-
|
|
91
|
-
```sh
|
|
92
|
-
$ git init
|
|
93
|
-
$ git add .
|
|
94
|
-
$ git commit -m 'first commit'
|
|
95
|
-
$ git remote add origin <YOUR_REPO_URL>
|
|
96
|
-
$ git push -u origin master
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
3. use conventional commits
|
|
100
|
-
https://www.conventionalcommits.org/en/v1.0.0/#summary
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
***
|
|
104
|
-
|
|
105
|
-
Pierre Gallet © 2024
|
lecrapaud-0.1.0/README.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Stock
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
## Project description
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
1. Create environment
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
$ pip install virtualenv
|
|
13
|
-
$ python -m venv .venv
|
|
14
|
-
$ source .venv/bin/activate
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. Install dependencies
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
$ pip install -r requirements.txt
|
|
21
|
-
$ pip freeze > requirements.txt
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
3. Deactivate virtualenv (if needed)
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
$ deactivate
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Reminders for Github usage
|
|
31
|
-
|
|
32
|
-
1. Creating Github repository
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
$ brew install gh
|
|
36
|
-
$ gh auth login
|
|
37
|
-
$ gh repo create
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
2. Initializing git and first commit to distant repository
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
$ git init
|
|
44
|
-
$ git add .
|
|
45
|
-
$ git commit -m 'first commit'
|
|
46
|
-
$ git remote add origin <YOUR_REPO_URL>
|
|
47
|
-
$ git push -u origin master
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
3. use conventional commits
|
|
51
|
-
https://www.conventionalcommits.org/en/v1.0.0/#summary
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
***
|
|
55
|
-
|
|
56
|
-
Pierre Gallet © 2024
|
|
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
|
|
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
|
|
File without changes
|