JohanBeytell commited on
Commit
3557421
·
verified ·
1 Parent(s): 84adf5e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -3
README.md CHANGED
@@ -1,3 +1,129 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ metrics:
6
+ - precision
7
+ - recall
8
+ - f1
9
+ - accuracy
10
+ - roc_auc
11
+ pipeline_tag: tabular-classification
12
+ tags:
13
+ - classification
14
+ - psychology
15
+ ---
16
+
17
+ # Model Card for Infinitode/BPPM-OPEN-ARC
18
+
19
+ Repository: https://github.com/Infinitode/OPEN-ARC/
20
+
21
+ ## Model Description
22
+
23
+ OPEN-ARC-BPP is a simple XGBClassifier model developed as part of Infinitode's OPEN-ARC initiative. It was designed to determine a person's basic personality type (introvert/extrovert) based on several personal questions.
24
+
25
+ **Architecture**:
26
+
27
+ - **XGBClassifer**: `n_estimators=200`, `learning_rate=0.1`, `max_depth=4`, `eval_metric="logloss"`, `use_label_encoder=False`, `random_state=42``.
28
+ - **Framework**: XGBoost
29
+ - **Training Setup**: Trained using selected params.
30
+
31
+ ## Uses
32
+
33
+ - Identifying a person's basic personality type through a series of personal questions.
34
+ - Enhancing knowledge and research in psychology and human behavior.
35
+
36
+ ## Limitations
37
+
38
+ - Might lead to inaccurate evaluations of personality types because of exceptions and inconsistencies.
39
+
40
+ ## Training Data
41
+
42
+ - Dataset: Personality Dataset (introvert or Extrovert) dataset from Kaggle.
43
+ - Source URL: https://www.kaggle.com/datasets/hardikchhipa28/personality-dataset-introvert-or-extrovert
44
+ - Content: Personality-determining features such as hours spent alone per day, etc.
45
+ - Size: The size is unknown as the dataset is no longer publicly available.
46
+ - Preprocessing: Preprocessing involved techniques such as number and category imputation, one-hot encoding, and label encoding.
47
+
48
+ ## Training Procedure
49
+
50
+ - Metrics: accuracy, precision, recall, F1, ROC AUC
51
+ - Train/Testing Split: 75% train, 25% testing.
52
+
53
+ ## Evaluation Results
54
+
55
+ | Metric | Value |
56
+ | ------ | ----- |
57
+ | Testing Accuracy | 92.0% |
58
+ | Testing Weighted Average Precision | 92% |
59
+ | Testing Weighted Average Recall | 92% |
60
+ | Testing Weighted Average F1 | 92% |
61
+ | Testing ROC AUC | 95.5% |
62
+
63
+ ## How to Use
64
+
65
+ ```python
66
+ import joblib
67
+ import pandas as pd
68
+ import numpy as np
69
+
70
+ # Load artifacts
71
+ art = joblib.load("personality_artifacts.pkl")
72
+ model = art["model"]
73
+ num_imputer = art["num_imputer"]
74
+ cat_imputer = art["cat_imputer"]
75
+ ohe = art["ohe"]
76
+ le = art["label_encoder"]
77
+ num_cols = art["num_cols"]
78
+ cat_cols = art["cat_cols"]
79
+
80
+ def ask(prompt, cast=str, options=None):
81
+ """Tiny helper to get clean input."""
82
+ while True:
83
+ try:
84
+ val = cast(input(prompt))
85
+ if options and val not in options:
86
+ raise ValueError(f"Must be one of {options}")
87
+ return val
88
+ except Exception as e:
89
+ print(f"Error: {e}. Try again.\n")
90
+
91
+ def predict_personality():
92
+ print("\n🎭 Introvert vs Extrovert Predictor")
93
+ print("Answer a few quick questions:\n")
94
+
95
+ # Gather answers
96
+ answers = {
97
+ "Time_spent_Alone": ask("Hours spent alone per day (0‑24): ", float),
98
+ "Stage_fear": ask("Stage fear? (Yes/No): ", str.title, ["Yes", "No"]),
99
+ "Social_event_attendance":ask("Social events per week (0‑10): ", int),
100
+ "Going_outside": ask("Trips outside per day (0‑10): ", int),
101
+ "Drained_after_socializing": ask("Feel drained after socializing? (Yes/No): ",
102
+ str.title, ["Yes", "No"]),
103
+ "Friends_circle_size": ask("Number of close friends (0‑30): ", int),
104
+ "Post_frequency": ask("Social‑media posts per week (0‑30): ", int),
105
+ }
106
+
107
+ # Build one‑row DataFrame in correct column order
108
+ row = pd.DataFrame([answers])[num_cols + cat_cols]
109
+
110
+ # --- Re‑run exact preprocessing -------------------------------------------------
111
+ X_num = num_imputer.transform(row[num_cols])
112
+ X_cat = cat_imputer.transform(row[cat_cols])
113
+ X_cat_enc = ohe.transform(X_cat)
114
+ X_ready = np.hstack([X_num, X_cat_enc])
115
+
116
+ # --- Predict --------------------------------------------------------------------
117
+ proba = model.predict_proba(X_ready)[0]
118
+ idx = proba.argmax()
119
+ pred_label = le.inverse_transform([idx])[0]
120
+ confidence = proba[idx]
121
+
122
+ print(f"\n🔮 You are likely an **{pred_label}** (confidence {confidence:.0%}).")
123
+
124
+ predict_personality()
125
+ ```
126
+
127
+ ## Contact
128
+
129
+ For questions or issues, open a GitHub issue or reach out at https://infinitode.netlify.app/forms/contact.