mrsindhunugroho's picture
Create README.md
8367546 verified
|
Raw
History Blame Contribute Delete
2.3 kB
metadata
license: apache-2.0
language:
  - en
metrics:
  - accuracy
pipeline_tag: tabular-classification
library_name: sklearn
tags:
  - stacking-ensemble
  - xgboost
  - catboost
  - lightgbm
  - adaboost
  - randomforest
model-index:
  - name: stacking-ensemble-learning
    results:
      - task:
          type: tabular-classification
          name: Network Intrusion Detection
        dataset:
          name: CSE-CIC-IDS2018 Cleaned
          type: cicids2018
          url: >-
            https://www.kaggle.com/datasets/ekkykharismadhany/csecicids2018-cleaned
        metrics:
          - type: accuracy
            value: 1
            name: Accuracy (Meta Model)
          - type: f1
            value: 1
            name: F1 Score (Meta Model)
          - type: precision
            value: 1
            name: Precision (Meta Model)
          - type: recall
            value: 1
            name: Recall (Meta Model)

IDS Stacking Ensemble Learning

Stacking ensemble (XGBoost + CatBoost + LightGBM + AdaBoost) for base mdoel with Random Forest as meta-model for Network Intrusion Detection System (IDS).

Metrics (test set)

Model Accuracy F1
XGBoost 1.0000 1.0000
CatBoost 0.9998 0.9998
LightGBM 0.4441 0.5403
AdaBoost 0.9911 0.9907

Requirements

pip install scikit-learn xgboost catboost lightgbm pandas numpy joblib huggingface_hub

Usage

import joblib
import numpy as np
from huggingface_hub import hf_hub_download

models = {k: joblib.load(hf_hub_download("mrsindhunugroho/stacking-ensemble-learning", f"models/{k}_model.pkl"))
          for k in ["xgboost", "catboost", "lightgbm", "adaboost"]}
meta = joblib.load(hf_hub_download("mrsindhunugroho/stacking-ensemble-learning", "models/meta_model.pkl"))
le   = joblib.load(hf_hub_download("mrsindhunugroho/stacking-ensemble-learning", "models/label_encoder.pkl"))

base_preds = np.column_stack([m.predict(X) for m in models.values()])
y_pred = le.inverse_transform(meta.predict(base_preds))

Dataset

  • Source: Kaggle — CSE-CIC-IDS2018 Cleaned
  • Original: Canadian Institute for Cybersecurity (CSE-CIC-IDS2018)
  • Preprocessing: sampling, label encoding, imputation, feature sanitization

Author

Sindhu Nugroho — ORCID