Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- regression
|
| 6 |
+
- xgboost
|
| 7 |
+
- soulprint
|
| 8 |
+
- imani
|
| 9 |
+
datasets:
|
| 10 |
+
- custom
|
| 11 |
+
metrics:
|
| 12 |
+
- mse
|
| 13 |
+
- r2
|
| 14 |
+
model-index:
|
| 15 |
+
- name: Imani XGBoost Regression Model
|
| 16 |
+
results:
|
| 17 |
+
- task:
|
| 18 |
+
type: regression
|
| 19 |
+
name: Soulprint Archetype Scoring
|
| 20 |
+
dataset:
|
| 21 |
+
name: Imani-regression-data
|
| 22 |
+
type: custom
|
| 23 |
+
metrics:
|
| 24 |
+
- name: MSE
|
| 25 |
+
type: mse
|
| 26 |
+
value: 0.00866
|
| 27 |
+
- name: R²
|
| 28 |
+
type: r2
|
| 29 |
+
value: 0.892
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
# 🕊️ Imani XGBoost Regression Model
|
| 33 |
+
|
| 34 |
+
This model is part of the **Soulprint archetype system**, designed to measure the presence of the **Imani (Faithful)** archetype in text.
|
| 35 |
+
It outputs a **score between 0.0 and 1.0** that reflects the degree of *faith, resilience, and affirmation* expressed.
|
| 36 |
+
|
| 37 |
+
- **Framework:** XGBoost
|
| 38 |
+
- **Embeddings:** SentenceTransformer (`all-mpnet-base-v2`)
|
| 39 |
+
- **Training Data Size:** 819 samples
|
| 40 |
+
- **Balanced dataset:** Low, mid, and high Imani scores evenly distributed (~33% each)
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## 🧾 Model Details
|
| 45 |
+
|
| 46 |
+
- **Archetype:** Imani (Faithful)
|
| 47 |
+
- **Description:** Sacred conviction and hope, even in adversity.
|
| 48 |
+
- **Traits captured:** Encouraging, spiritual, consistent, compassionate.
|
| 49 |
+
- **Perspective:** *Faith is the seed, action is the rain.*
|
| 50 |
+
- **Output range:** `0.0 – 1.0`
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## 📊 Training Results
|
| 55 |
+
|
| 56 |
+
- **MSE:** `0.00866`
|
| 57 |
+
- **R²:** `0.892`
|
| 58 |
+
|
| 59 |
+
These metrics indicate that the model is highly accurate, with predictions averaging less than `0.1` away from true labels on the 0–1 scale.
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## 🚀 Usage
|
| 64 |
+
|
| 65 |
+
You can load the model directly from Hugging Face Hub and run predictions:
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
import xgboost as xgb
|
| 69 |
+
from sentence_transformers import SentenceTransformer
|
| 70 |
+
from huggingface_hub import hf_hub_download
|
| 71 |
+
|
| 72 |
+
# -----------------------------
|
| 73 |
+
# 1. Download model from Hugging Face
|
| 74 |
+
# -----------------------------
|
| 75 |
+
REPO_ID = "mjpsm/Imani-xgb-model"
|
| 76 |
+
FILENAME = "Imani_xgb_model.json"
|
| 77 |
+
|
| 78 |
+
model_path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
|
| 79 |
+
|
| 80 |
+
# -----------------------------
|
| 81 |
+
# 2. Load Model + Embedder
|
| 82 |
+
# -----------------------------
|
| 83 |
+
model = xgb.XGBRegressor()
|
| 84 |
+
model.load_model(model_path)
|
| 85 |
+
|
| 86 |
+
embedder = SentenceTransformer("all-mpnet-base-v2")
|
| 87 |
+
|
| 88 |
+
# -----------------------------
|
| 89 |
+
# 3. Example Prediction
|
| 90 |
+
# -----------------------------
|
| 91 |
+
text = "I reminded my cousin that storms always pass."
|
| 92 |
+
embedding = embedder.encode([text])
|
| 93 |
+
score = model.predict(embedding)[0]
|
| 94 |
+
|
| 95 |
+
print("Predicted Imani Score:", round(float(score), 3))
|
| 96 |
+
```
|