YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

URL Phishing Detection Model

This repository contains a XGBoost model trained to detect phishing URLs with high accuracy.

Model Performance

  • Accuracy: 0.9631
  • Precision: 0.9600
  • Recall: 0.9666
  • F1 Score: 0.9633

Dataset

The model was trained on the pirocheto/phishing-url dataset from Hugging Face.

Usage

import joblib
import numpy as np
from sklearn.preprocessing import StandardScaler
import json

# Load the model and preprocessing components
model = joblib.load('xgboost_model.joblib')
scaler = joblib.load('scaler.joblib')

# Load feature names
with open('feature_names.json', 'r') as f:
    feature_names = json.load(f)

# Function to preprocess a URL and make a prediction
def predict_url(url_features):
    # Ensure features are in the correct order
    features = [url_features[feature] for feature in feature_names]

    # Scale features
    scaled_features = scaler.transform([features])

    # Make prediction
    prediction = model.predict(scaled_features)[0]
    probability = model.predict_proba(scaled_features)[0][1]

    return {
        'is_phishing': bool(prediction),
        'probability': float(probability)
    }

License

This model is available under the MIT License.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using Devishetty100/neoguardianai 1