Lab build

Network security phishing classifier

Classifies phishing websites from URL features with MongoDB ETL, drift checks, MLflow tracking and AWS deployment.

Role
Builder, end to end
Group
MLOps
Services
AI & LLM systems · MLOps & cloud

What it does

Phishing website data is converted from CSV to JSON and loaded into MongoDB Atlas, then ingested, schema-validated and checked for drift with a two-sample KS test. A KNN imputer prepares the features, six classifiers are compared with GridSearchCV and the best is logged to MLflow on DagsHub, with artifacts and models synced to S3. A FastAPI app offers /train and batch /predict on uploaded CSVs; GitHub Actions pushes the image to Amazon ECR and a self-hosted runner on EC2 runs it.

What was built

  1. 01

    ETL script converts the phishing CSV to JSON records and inserts them into a MongoDB Atlas collection.

  2. 02

    Validation checks column count against schema.yaml and writes a per-column KS-test drift report.

  3. 03

    KNNImputer pipeline feeds Random Forest, Decision Tree, Gradient Boosting, Logistic Regression and AdaBoost grid searches.

  4. 04

    Best model's F1, precision and recall are logged to MLflow on DagsHub; artifacts and models sync to S3.

  5. 05

    GitHub Actions builds and pushes to Amazon ECR, then a self-hosted EC2 runner pulls and runs the container.

The pipeline, layer by layer

Five layers, one pipeline.

  1. L1ETL

    • Phishing CSV
    • MongoDB Atlas
  2. L2Validation

    • Schema check
    • KS drift report
  3. L3Training

    • KNN imputer
    • Model selection and tuning
    • MLflow on DagsHub
  4. L4Artifacts

    • S3 sync
  5. L5Delivery

    • FastAPI app
    • GitHub Actions to ECR
    • EC2 self-hosted runner

Stack

  • pandas
  • scikit-learn
  • MongoDB Atlas
  • pymongo
  • MLflow
  • DagsHub
  • FastAPI
  • Docker
  • GitHub Actions
  • Amazon ECR
  • Amazon EC2
  • Amazon S3

Next lab build · 16 / 46

Survival prediction with feature store and drift monitoring

Predicts Titanic passenger survival from Redis-stored features, fed by Airflow ETL and monitored for drift.

Previous: Hybrid anime recommender

Need a system like this in production? Tell us about it.