Skip to content

Fix Python 3.12 compatibility across all model table_generators#10

Open
pig8pig wants to merge 2 commits into
In-Network-Machine-Learning:mainfrom
pig8pig:fix/python312-compatibility
Open

Fix Python 3.12 compatibility across all model table_generators#10
pig8pig wants to merge 2 commits into
In-Network-Machine-Learning:mainfrom
pig8pig:fix/python312-compatibility

Conversation

@pig8pig

@pig8pig pig8pig commented Mar 29, 2026

Copy link
Copy Markdown

Combines and extends #7 and #9 into a single comprehensive fix.

Fixes two Python 3.12 breaking changes across ALL 235 model files:

  1. plt.style.use('seaborn') → 'seaborn-v0_8' (matplotlib 3.6+)
  2. .max()[0] → .max().iloc[0] (pandas 2.0+)

Covers all ML modules: DT, RF, XGB, SVM, KNN, KM, NN, Bayes, IF, PCA, Autoencoder

Tested: Full end-to-end BMv2 deployment on Iris dataset
Matrix 1 (sklearn): 95.56% ✓
Matrix 2 (simulated): 95.56% ✓
Matrix 3 (BMv2 switch): 95.56% ✓
Python 3.12.3, pandas 2.4.3, matplotlib 3.x, Ubuntu 24.04 WSL2

Yuzhong Luo added 2 commits March 29, 2026 15:21
- Replace deprecated plt.style.use('seaborn') with 'seaborn-v0_8'
  (matplotlib 3.6+ breaking change)
- Replace .max()[0] with .max().iloc[0] for pandas 2.0+ compatibility
- Replace plt.style.use('seaborn') with 'seaborn-v0_8' in all models
  (matplotlib 3.6+ removed the seaborn style alias)
- Replace .max()[0] with .max().iloc[0] in all models
  (pandas 2.0+ no longer supports integer indexing on named Series)

Fixes affect 15+ model types including DT, RF, XGB, SVM, Bayes,
KM, KNN, NN, IF, PCA, Autoencoder across all type variations.

Tested on: Python 3.12.3, matplotlib 3.x, pandas 2.4.3, Ubuntu 24.04
@pig8pig pig8pig changed the title Fix Python 3.12 compatibility in DT Type_EB table_generator Fix Python 3.12 compatibility across all model table_generators Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant