π Phishing URL Detection Model
Model Description
A Random Forest classifier that detects phishing URLs using 20 URL-based features extracted in real-time.
- Accuracy: 99.65%
- F1-Score: 0.9969
- Features: 20 URL-based features
- Training Data: 235,370 URLs
Features Used
| # | Feature | Description |
|---|---|---|
| 1 | URLLength | Total characters in URL |
| 2 | DomainLength | Length of domain name |
| 3 | IsDomainIP | 1 if URL contains IP address |
| 4 | CharContinuationRate | Character repetition pattern |
| 5 | TLDLegitimateProb | Probability TLD is legitimate |
| 6 | URLCharProb | Character probability distribution |
| 7 | TLDLength | Length of top-level domain |
| 8 | NoOfSubDomain | Number of subdomains |
| 9 | HasObfuscation | 1 if obfuscated characters present |
| 10 | NoOfObfuscatedChar | Count of obfuscated characters |
| 11 | ObfuscationRatio | Ratio of obfuscated chars |
| 12 | NoOfLettersInURL | Count of letters |
| 13 | LetterRatioInURL | Ratio of letters |
| 14 | NoOfDegitsInURL | Count of digits |
| 15 | DegitRatioInURL | Ratio of digits |
| 16 | IsHTTPS | 1 if HTTPS used |
| 17 | IsSuspiciousTLD | 1 if TLD is suspicious |
| 18 | ContainsBrand | 1 if URL contains a brand name |
| 19 | IsSuspiciousDomain | 1 if domain = brand + extra text |
| 20 | SuspiciousKeywordCount | Count of suspicious keywords |
Model Performance
| Metric | Score |
|---|---|
| Accuracy | 99.65% |
| Precision | 99.57% |
| Recall | 99.82% |
| F1-Score | 99.69% |
How to Use
import joblib
import pandas as pd
# Load the model
model = joblib.load('phishing_model_final.pkl')
scaler = joblib.load('scaler_final.pkl')
feature_names = joblib.load('feature_names_final.pkl')
# Extract features from URL
def predict_url(url):
# ... (include your feature extraction code)
pass
# Make prediction
result = predict_url("www.google.com")
print(result) # {'url': 'www.google.com', 'is_phishing': False, 'confidence': 99.0%}
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support