Skip to content

Commit bd40051

Browse files
committed
feat: upgrade to Python 3.13
- Update Python version from 3.8 to 3.13.0 - Update dependencies to latest compatible versions - Update scikit-learn OneHotEncoder parameter for compatibility - Add version upgrade documentation Dependencies updated: - numpy >= 1.26.0 - pandas >= 2.1.0 - scikit-learn >= 1.3.0 - fastapi >= 0.103.0 - uvicorn >= 0.23.0 - gunicorn >= 21.2.0
1 parent e1662e8 commit bd40051

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

PYTHON_3_13_UPDATES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Python 3.13 Compatibility Updates
2+
3+
This document summarizes the changes made to make the codebase compatible with Python 3.13.
4+
5+
## Dependencies Updated
6+
- Python: 3.8 → 3.13.0
7+
- NumPy: Latest compatible (1.26.0+)
8+
- Pandas: Latest compatible (2.1.0+)
9+
- scikit-learn: Latest compatible (1.3.0+)
10+
- FastAPI: 0.63.0 → 0.103.0+
11+
- Other dependencies updated to latest stable versions
12+
13+
## Code Changes
14+
1. **ML Data Processing (`ml/data.py`)**
15+
- Updated OneHotEncoder parameters from `sparse=False` to `sparse_output=False` to match newer scikit-learn API
16+
17+
## Notes
18+
- The core ML functionality and boilerplate structure remains unchanged
19+
- Dependencies updated to ensure compatibility with Python 3.13
20+
- Starter code structure maintained for student implementation

starter/requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
python==3.8
2-
numpy
3-
pandas
4-
scikit-learn
5-
pytest
6-
requests
7-
fastapi==0.63.0
8-
uvicorn
9-
gunicorn
1+
python>=3.13.0
2+
numpy>=1.26.0
3+
pandas>=2.1.0
4+
scikit-learn>=1.3.0
5+
pytest>=7.4.0
6+
requests>=2.31.0
7+
fastapi>=0.103.0
8+
uvicorn>=0.23.0
9+
gunicorn>=21.2.0

starter/starter/ml/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def process_data(
5454
X_continuous = X.drop(*[categorical_features], axis=1)
5555

5656
if training is True:
57-
encoder = OneHotEncoder(sparse=False, handle_unknown="ignore")
57+
encoder = OneHotEncoder(sparse_output=False, handle_unknown="ignore")
5858
lb = LabelBinarizer()
5959
X_categorical = encoder.fit_transform(X_categorical)
6060
y = lb.fit_transform(y.values).ravel()

0 commit comments

Comments
 (0)