Accidentally created an ML so complex nothing can solve it

Hi, I accidentally created an ML so complex that has grown to 18,000+ lines of Python(i know it’s wrong and should’ve divided the code into different files form the get go but stick with me now, i never imagine it will get so complex), focusing on an NFL prediction system (using nfl_data_py, XGBoost, Keras/TensorFlow, statsmodels, and scikit-learn).

Right now I’m struggling with a severe and persistent data handling issue, which is likely a bug causing feature misalignment, near-zero variance, or NaN/Inf propagation in the massive feature engineering pipeline (which includes rolling stats, EWMA, hierarchical adjustments, and Elo ratings).

I use mainly Antigravity and use between Claude Opus 4.5 (thinking) with Planning and sometimes Gemini 3 Pro (High) with Planning, and neither of those ai has been able to solve the problem. when i first started i used GPT-5.1-Codex-Max with Extra high reasoning, and it help at the beginning of my project, but at this point, one question consumes all my tokens.

These models are excellent at planning and agentic task execution, but the complexity of the non-linear, multi-model data transformations is causing them to fail.

I have chat GPT Plus and Google AI Pro, but which other AI would you recommend because im this close to hiring a python expert or something to help me fix it

I’m worried about the limitations of the Opus context window, so try with GPT-5.2 XHigh in Agent mode:

Review the project and create a RefactoringTODO.md at the root of the repository.

Targets:
- SRP compliance
- test coverage check
- verification of documentation of key decisions

Don't make any changes to the project.
1 Like

Sorry Chief, a refactor is in your future, or your just going to break it everytime you touch it…. A file like that can never be properly processed by the available models while simultaneously maintaining adequate focus for your prompt at hand. The system is then forced to grep to try to make edits, and since python is based on indents the code gets broken and the ai spends a whole session trying to fix it by iterating through the whole file, potentially breaking more things. Embrace the suck my friend and get that file refactored, or plan to rebuild from the ground up.

1 Like

OP, I feel you on this. You need to try to analyze/refactor and start building out some separation of concerns (which I find these AI models seem to really shine on).