Views
No views yet
1import joblib
2from huggingface_hub import hf_hub_download
3
4# Download model
5model_path = hf_hub_download(
6 repo_id="IVB-2005/disaster-model",
7 filename="disaster_risk_model.pkl"
8)
9model = joblib.load(model_path)
10
11# Download encoders
12disaster_enc_path = hf_hub_download(
13 repo_id="IVB-2005/disaster-model",
14 filename="disaster_encoder.pkl"
15)
16disaster_encoder = joblib.load(disaster_enc_path)
17
18location_enc_path = hf_hub_download(
19 repo_id="IVB-2005/disaster-model",
20 filename="location_encoder.pkl"
21)
22location_encoder = joblib.load(location_enc_path)
23
24# Make prediction
25location_encoded = location_encoder.transform(['India'])[0]
26disaster_encoded = disaster_encoder.transform(['Earthquake'])[0]
27
28features = [[location_encoded, disaster_encoded]]
29risk_score = model.predict(features)[0]
30
31print(f"Risk Score: {risk_score:.3f}")1@misc{disaster-risk-model,
2 author = {Your Name},
3 title = {Disaster Risk Prediction Model},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/IVB-2005/disaster-model}
7}