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, a requirements.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, calling train() (line 23) once and predict() (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 → CalleeTimes
__init__initialize_logging21
ingest_sql_datacreate_db_engine14
ingest_sql_dataquery_data14
plot_fastest_lapsformat_timedelta14
weather_station_mappingread_from_web_CSV13
processweather_station_mapping13
processingest_sql_data9
processmerge8

External effects are limited to:

  • Filesystemmain → download_audio removes a temporary file (os.remove).
  • Networkweather_station_mapping fetches CSV data from a URL (13 calls).
  • Databaseingest_sql_data creates an engine and runs queries (14 calls).
  • Model inference – Random‑Forest and Naïve‑Bayes classifiers expose predict/predict_proba methods 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

SeverityIssueLocation
HighNo LICENSE file – reuse rights undefinedrepository root
HighNo CI/CD pipeline – no automated build/testrepository root (no .github/ workflows)
MediumNo Dependabot/Renovate configurationrepository root
MediumNotebook outputs stored, inflating repo sizee.g., BI Analyst Case study/notebooks/Product EDA.ipynb
MediumOversized notebook cell hampers debuggingCustomer_Behaviour/citations/e-commerce-customer-analysis.ipynb
MediumLarge binary assets (>5 MB) tracked in Gite.g., Data Science ALX/.../Maji_Ndogo_Part_1 [Slides].pdf
MediumREADME only 236 bytes – no usage instructionsREADME.md
MediumTest 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.