dev9269/darkweb-slang-dictionary
Viewer • Updated • 1 • 16
How to use dev9269/malware-detector-rf with Scikit-learn:
from huggingface_hub import hf_hub_download
import joblib
model = joblib.load(
hf_hub_download("dev9269/malware-detector-rf", "sklearn_model.joblib")
)
# only load pickle files from sources you trust
# read more about it here https://skops.readthedocs.io/en/stable/persistence.htmlA Random Forest classifier for PE (Portable Executable) malware detection, trained on the EMBER dataset.
import joblib
import numpy as np
model = joblib.load("model.pkl")
features = np.load("sample_features.npy") # 2381-dim feature vector
prediction = model.predict([features])[0]
confidence = model.predict_proba([features])[0]
print(f"Malicious: {bool(prediction)}")
print(f"Confidence: {max(confidence):.2%}")
| Metric | Score |
|---|---|
| Accuracy | ~96% |
| Precision | ~0.95 |
| Recall | ~0.94 |
| F1 Score | ~0.94 |