Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ JUDGE_BACKEND=stub
# LLM Judge (only used when JUDGE_BACKEND=llm)
OLLAMA_HOST=http://localhost:11434
JUDGE_MODEL=llama3.2:1b
JUDGE_TIMEOUT_SECS=12
JUDGE_TIMEOUT_SECS=60

# ============================================================
# MODEL SERVICE CONFIGURATION
Expand All @@ -15,17 +15,17 @@ JUDGE_TIMEOUT_SECS=12
# Configuration file path
CONFIG_PATH=configs/dev/config.yaml

# Primary model (8-feature production model)
PRIMARY_MODEL_PATH=models/dev/model_8feat.pkl
PRIMARY_META_PATH=models/dev/model_8feat_meta.json
# Primary model (7-feature production model)
PRIMARY_MODEL_PATH=models/dev/model_7feat.pkl
PRIMARY_META_PATH=models/dev/model_7feat_meta.json

# Shadow testing (DISABLED for production)
SHADOW_ENABLED=false
SHADOW_MODEL_PATH=models/dev/model_7feat.pkl
SHADOW_META_PATH=models/dev/model_7feat_meta.json
SHADOW_MODEL_PATH=models/dev/model_8feat.pkl
SHADOW_META_PATH=models/dev/model_8feat_meta.json

# Service URLs
MODEL_SVC_URL=http://localhost:9000
MODEL_SVC_URL=http://localhost:8002
GATEWAY_PORT=8000
MODEL_SVC_PORT=9000

Expand Down
371 changes: 215 additions & 156 deletions Readme.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions configs/dev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
model_service:
# Primary model (production)
primary:
path: "models/dev/model_8feat.pkl"
meta_path: "models/dev/model_8feat_meta.json"
name: "8-feature-production-v1"
description: "8-feature URL model with IsHTTPS (PR-AUC: 99.92%)"
path: "models/dev/model_7feat.pkl"
meta_path: "models/dev/model_7feat_meta.json"
name: "7-feature-production-v1"
description: "7-feature URL model without IsHTTPS (PR-AUC: 99.88%)"

# Shadow model (DISABLED for production)
shadow:
enabled: false
path: "models/dev/model_7feat.pkl"
meta_path: "models/dev/model_7feat_meta.json"
name: "7-feature-baseline"
description: "7-feature URL model without IsHTTPS (research only)"
path: "models/dev/model_8feat.pkl"
meta_path: "models/dev/model_8feat_meta.json"
name: "8-feature-baseline"
description: "8-feature URL model with IsHTTPS (research only)"
log_path: "outputs/shadow_predictions.jsonl"

# Gateway Configuration
Expand Down
35 changes: 25 additions & 10 deletions configs/dev/thresholds.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
{
"optimal_threshold": 0.35,
"gray_zone_low": 0.004,
"gray_zone_high": 0.9990000000000006,
"gray_zone_rate": 0.10936468383276894,
"f1_score_at_optimal": 0.002766509680600472,
"decision_distribution": {
"allow_rate": 0.48099162992780015,
"review_rate": 0.10936468383276894,
"block_rate": 0.4096436862394309
}
"model": "xgb",
"class_mapping": {
"phish": 0,
"legit": 1
},
"calibration": {
"method": "isotonic",
"cv": 5
},
"thresholds": {
"optimal_threshold": 0.49999999999999994,
"gray_zone_low": 0.011,
"gray_zone_high": 0.9979999999999727,
"gray_zone_rate": 0.11994973697101356,
"f1_score_at_optimal": 0.9939829924548755,
"decision_distribution": {
"allow_rate": 0.5199241794986476,
"review_rate": 0.11994973697101356,
"block_rate": 0.36012608353033887
}
},
"data": {
"file": "data\\processed\\phiusiil_features_v2.csv"
},
"seed": 42
}
33 changes: 33 additions & 0 deletions configs/dev/thresholds_7feat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"model": "xgb_7feat",
"features": [
"TLDLegitimateProb",
"CharContinuationRate",
"SpacialCharRatioInURL",
"URLCharProb",
"LetterRatioInURL",
"NoOfOtherSpecialCharsInURL",
"DomainLength"
],
"class_mapping": {
"phish": 0,
"legit": 1
},
"calibration": {
"method": "isotonic",
"cv": 5
},
"thresholds": {
"optimal_threshold": 0.49999999999999994,
"gray_zone_low": 0.011,
"gray_zone_high": 0.9979999999999727,
"gray_zone_rate": 0.11994973697101356,
"f1_score_at_optimal": 0.9939829924548755,
"decision_distribution": {
"allow_rate": 0.5199241794986476,
"review_rate": 0.11994973697101356,
"block_rate": 0.36012608353033887
}
},
"seed": 42
}
19 changes: 7 additions & 12 deletions configs/dev/thresholds_8feat.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"model": "xgb_8feat",
"features": [
"IsHTTPS",
"TLDLegitimateProb",
"CharContinuationRate",
"SpacialCharRatioInURL",
"URLCharProb",
"LetterRatioInURL",
"NoOfOtherSpecialCharsInURL",
"DomainLength"
"DomainLength",
"IsHTTPS"
],
"class_mapping": {
"phish": 0,
Expand All @@ -19,16 +19,11 @@
"cv": 5
},
"thresholds": {
"optimal_threshold": 0.35,
"gray_zone_low": 0.004,
"gray_zone_high": 0.9990000000000006,
"gray_zone_rate": 0.10936468383276894,
"f1_score_at_optimal": 0.002766509680600472,
"decision_distribution": {
"allow_rate": 0.48099162992780015,
"review_rate": 0.10936468383276894,
"block_rate": 0.4096436862394309
}
"optimal_threshold": 0.3599999999999999,
"gray_zone_low": 0.003,
"gray_zone_high": 0.3599999999999999,
"gray_zone_rate": 0.13355909100589952,
"f1_score_at_optimal": 0.9971890180308938
},
"seed": 42
}
Loading
Loading