The Problem
Clients often need a ready‑made showcase of data‑science techniques (exploratory analysis, feature engineering, classic ML models, and small production‑style scripts) but lack a curated, reproducible collection. This repo attempts to fill that gap, yet its size and lack of structure make onboarding, testing, and reuse difficult.
What This Does
The repository is a portfolio of 29 self‑contained projects. The biggest is Data Science ALX (≈ 800 files, 213 Jupyter notebooks) covering data cleaning, SQL ingestion, and model validation. Other notable clusters are:
Patience ML Project/Naive Bayes/– a Naïve‑Bayes classifier with a CLI (main.py) that trains, predicts, and writes model files.Customer_Behaviour/– churn and segmentation analysis notebooks with visualizations.BI Analyst Case study/– end‑to‑end credit‑risk case study, including data files, arequirements.txt, and a final report notebook.
Common tools across the collection are pandas, scikit‑learn, Streamlit, and a few Flask/Express snippets. All Python dependencies are listed in plain requirements.txt files; no lockfile or Docker image is provided.
How It Is Wired
Execution starts in the only true script entry point:
Patience ML Project/Naive Bayes/main.py
main()(line 63) orchestrates the workflow, callingtrain()(line 23) once andpredict()(line 36) many times.predict()reaches 12 internal functions and is invoked from 21 distinct callers, making it the highest‑fan‑in function.train()similarly reaches 12 functions but is called only once.
Key internal call chain (representative edges):
| Caller → Callee | Times |
|---|---|
__init__ → initialize_logging | 21 |
ingest_sql_data → create_db_engine | 14 |
ingest_sql_data → query_data | 14 |
plot_fastest_laps → format_timedelta | 14 |
weather_station_mapping → read_from_web_CSV | 13 |
process → weather_station_mapping | 13 |
process → ingest_sql_data | 9 |
process → merge | 8 |
External effects are limited to:
- Filesystem –
main → download_audioremoves a temporary file (os.remove). - Network –
weather_station_mappingfetches CSV data from a URL (13 calls). - Database –
ingest_sql_datacreates an engine and runs queries (14 calls). - Model inference – Random‑Forest and Naïve‑Bayes classifiers expose
predict/predict_probamethods used by downstream notebooks.
The internal call graph contains 458 resolved edges, but there are no circular imports and only a single internal module (Streamlit Projects/StreamlitApp1) with zero dependencies, indicating low coupling within each sub‑project.
How To Use It
# Clone the full repo
git clone https://github.com/moses-y/Data-Science-Machine-Learning.git
cd Data-Science-Machine-Learning
# Install the Naïve Bayes project's deps (example)
pip install -r "Patience ML Project/Naive Bayes/requirements.txt"
# Run the classifier (training then prediction)
python "Patience ML Project/Naive Bayes/main.py"
Other projects follow the same pattern: locate a requirements.txt, pip install -r <path>, then execute the provided .py script or open the notebook in Jupyter. No Dockerfile, Makefile, or entry‑point script exists for the larger ALX notebooks; they are intended for interactive exploration.
Real‑World Use
A consulting team could copy the Patience ML Project folder into a client’s code base, add their own data, and call train() and predict() from a Flask endpoint or a scheduled Airflow DAG. The clear separation of data ingestion (ingest_sql_data) and model inference (predict) lets the team replace the Naïve‑Bayes implementation with a more advanced model without touching the surrounding pipeline.
from Patience_ML_Project.Naive_Bayes.main import train, predict
train() # builds model.pkl
score = predict(new_row) # returns class label
Code Health & Issues
| Severity | Issue | Location |
|---|---|---|
| High | No LICENSE file – reuse rights undefined | repository root |
| High | No CI/CD pipeline – no automated build/test | repository root (no .github/ workflows) |
| Medium | No Dependabot/Renovate configuration | repository root |
| Medium | Notebook outputs stored, inflating repo size | e.g., BI Analyst Case study/notebooks/Product EDA.ipynb |
| Medium | Oversized notebook cell hampers debugging | Customer_Behaviour/citations/e-commerce-customer-analysis.ipynb |
| Medium | Large binary assets (>5 MB) tracked in Git | e.g., Data Science ALX/.../Maji_Ndogo_Part_1 [Slides].pdf |
| Medium | README only 236 bytes – no usage instructions | README.md |
| Medium | Test coverage minimal (2 test files for 85 source files) | Patience ML Project/Naive Bayes/test_naivebayes.py |
No secrets were detected, but the lack of lockfiles (requirements.txt only) means reproducible builds are not guaranteed.
The Bottom Line
The repository offers a broad showcase of beginner‑to‑intermediate data‑science work, with many ready‑to‑run notebooks and a few executable scripts. However, the portfolio‑style layout, missing licensing, absent CI, and large untracked binaries limit its suitability for production deployment. It is best used as a learning or prototyping sandbox; teams intending to adopt any component should isolate the desired folder, add proper licensing, CI, and dependency pinning before integration.