Nzinga-xgb-model
🧾 Model Description
The Nzinga XGBoost Regression Model is part of the Soulprint Archetype Series.
It predicts a courage score (0.0 – 1.0) from input text, reflecting levels of hesitation, partial action, steady resolve, and fearless conviction.
This model is named after Queen Nzinga of Ndongo and Matamba, representing courage, resistance, and unshakable determination.
- Architecture: XGBoost Regressor
- Input: Text (embedded using all-mpnet-base-v2)
- Output: Continuous courage score (float, 0–1)
📚 Training Data
-
Source: Custom Nzinga regression dataset (balanced across 4 ranges).
-
Size: 1368 examples
-
Balance: 342 rows per range:
-
Low (0.0–0.3): hesitant, almost-action, retreating moments
-
Mid (0.3–0.6): measured firmness, small everyday acts of courage
-
High (0.6–0.9): strong steady action, visible resolve
-
Peak (0.9–1.0): fearless symbolic acts, full conviction
Sentence lengths were cycled (1, 2–3, 4–5 sentences) to encourage generalization.
Contexts include family, healthcare, online spaces, sports, workplaces, and public gatherings.
🧪 Evaluation
This indicates the model explains ~82% of the variance in courage scores and has low error, making it robust for prediction tasks.
🚀 Example Usage
1import xgboost as xgb
2from sentence_transformers import SentenceTransformer
3from huggingface_hub import hf_hub_download
4
5# -----------------------------
6# 1. Download model
7# -----------------------------
8REPO_ID = "mjpsm/Nzinga-xgb-model"
9FILENAME = "Nzinga_xgb_model.json"
10
11model_path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
12
13# -----------------------------
14# 2. Load model + embedder
15# -----------------------------
16model = xgb.XGBRegressor()
17model.load_model(model_path)
18
19embedder = SentenceTransformer("all-mpnet-base-v2")
20
21# -----------------------------
22# 3. Example prediction
23# -----------------------------
24text = "I stood before the crowd and spoke with steady confidence."
25embedding = embedder.encode([text])
26score = model.predict(embedding)[0]
27
28print("Predicted Nzinga Score:", round(float(score), 3))