How ayushd64/pandas_dpa works
1. Repository purpose
- This is a Python/Pandas-based offline data pipeline for soccer/FIFA player analysis.
- It appears to ingest yearly FIFA CSV datasets, clean and transform them, train a model, run optimization/analysis, and generate plots and derived output folders.
2. Primary inputs
- The repository includes yearly source files: 2009.csv through 2019.csv, plus raw_data.csv.
- The README says raw_dats.csv is the 2020 FIFA dataset, so the project likely spans multiple seasons/years of player data.
- These CSVs are the main data boundary into the system; there is no sign of a database or external API dependency at runtime.
3. Data acquisition layer
- Web_Scrapping.py suggests a scraper that likely gathers FIFA/player data from an external website and produces raw tabular data.
- This is the first stage in the pipeline and likely feeds the CSV inputs used by the rest of the system.
- If the scraper is used, it is a separate acquisition boundary from the main analysis pipeline.
4. Cleaning and normalization
- Data_Clean.py is the cleanup stage, likely handling missing values, inconsistent formats, and column normalization across yearly files.
- This stage probably converts the scraped/raw data into a consistent schema suitable for analysis and modeling.
- The presence of many year-specific CSVs implies schema harmonization is important here.
5. Feature processing / transformation
- Data_Process.py likely performs feature engineering and prepares the cleaned dataset for modeling.
- This is where the pipeline probably derives analysis-ready fields from raw player attributes and performance indicators.
- It acts as the bridge between cleaning and ML training.
6. Train/test partitioning
- Train_Test_Split.py isolates the modeling dataset into training and evaluation subsets.
- This is a distinct boundary before model fitting, which suggests the project treats evaluation as a separate step rather than doing it inline.
7. Modeling subsystem
- ML.py is the main machine-learning component.
- It likely trains one or more predictive models using the processed training data and produces prediction outputs.
- The folders before_prediction and after_prediction suggest the pipeline stores intermediate datasets or comparison artifacts around the model inference step.
8. Optimization subsystem
- Optimization.py likely tunes model parameters or computes an optimized assignment/ranking based on predictions or player metrics.
- This suggests the project is not just descriptive analytics; it includes a decision/optimization layer on top of the model outputs.
9. Analysis and visualization
- Data_Analyze.py and Plots.py are the reporting/interpretation layer.
- Plots.py likely generates charts, while Data_Analyze.py computes summary statistics or comparative insights.
- The player_performance directory probably contains analysis outputs specific to player-level results.
10. Pipeline orchestration
- Master.py is the top-level orchestrator.
- The README instructs running it from Jupyter with %run Master.py, which implies the whole workflow is executed as a scripted batch pipeline rather than through a service or UI.
- This script likely sequences the steps: load data → clean → process → split → train → optimize → analyze/plot.
11. Output/artifact boundaries
- before_prediction, after_prediction, and player_performance look like generated artifact directories rather than source code.
- These directories likely hold intermediate and final outputs for model comparison, prediction results, and performance summaries.
- This is useful for diagramming because it separates transient processing stages from persisted results.
12. Tooling/runtime
- The repo is Python 3–based and depends on packages listed in requirements.txt.
- Execution is intended from a Jupyter notebook environment, but the actual work is in reusable .py modules.
- The included PDF report indicates the code supports an offline analysis/reporting workflow, not a production API or web app.
13. Overall architecture
- The system is a linear data pipeline with clear phases: acquisition → cleaning → transformation → split → model/optimization → analysis/plots.
- Master.py coordinates the flow across these modules, and the CSV files plus output directories form the main data stores.
- For an architecture diagram, the most important distinction is between the raw yearly data inputs, the processing/modeling stages, and the generated analysis artifacts.
Main entry points: Master.py Master · ML.py ML · Data_Analyze.py Analyze · Data_Clean.py Clean Data
Components 14
Inputs
Raw and yearly FIFA CSV data
- Yearly CSVs · FIFA season datasets from 2009 through 2019
- Raw Data · Combined raw tabular dataset
raw_data.csv
Pipeline
Cleaning, modeling, optimization, and reporting stages
- Master · Top-level batch workflow runner
Master.py - Web Scrape · Collects raw player data from the source site
Web_Scrapping.py - Clean Data · Normalizes and prepares raw CSV data
Data_Clean.py - Process Data · Transforms cleaned data into model-ready features
Data_Process.py - Split Data · Separates training and evaluation sets
Train_Test_Split.py - ML · Trains predictive models and generates predictions
ML.py - Optimize · Tunes or ranks results using model outputs
Optimization.py - Analyze · Computes summaries and comparative insights
Data_Analyze.py - Plots · Builds charts and visual reports
Plots.py
Artifacts
Generated prediction and analysis outputs
- Before Predict · Intermediate inputs before prediction
before_prediction - After Predict · Outputs after prediction
after_prediction - Player Perf · Player-level analysis and performance artifacts
player_performance
Connections 21
- Web Scrape → Raw Data: produces · Scraped raw data is written to the raw dataset
- Yearly CSVs → Clean Data: inputs · Season CSVs are cleaned and harmonized
- Raw Data → Clean Data: inputs · Raw combined data enters cleaning
- Clean Data → Process Data: prepared data · Cleaned records are transformed into features
- Process Data → Split Data: features · Model-ready dataset is partitioned
- Split Data → ML: train/eval · Split datasets feed model training
- ML → Before Predict: stores · Pre-prediction artifacts are captured
- ML → After Predict: stores · Prediction outputs are captured
- ML → Optimize: predictions · Model outputs feed the optimization layer
- Optimize → Analyze: results · Optimized results are analyzed
- Analyze → Plots: summaries · Analysis results are visualized
- Plots → Player Perf: publishes · Charts and reports are stored for player performance
- Analyze → Player Perf: publishes · Analysis artifacts are stored alongside visuals
- Master → Web Scrape: runs · Master orchestrates the acquisition step
- Master → Clean Data: runs · Master orchestrates cleaning
- Master → Process Data: runs · Master orchestrates feature processing
- Master → Split Data: runs · Master orchestrates splitting
- Master → ML: runs · Master orchestrates model training
- Master → Optimize: runs · Master orchestrates optimization
- Master → Analyze: runs · Master orchestrates analysis
- Master → Plots: runs · Master orchestrates plotting