Datasets:
Upload compas.py
Browse files
compas.py
ADDED
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Compas Dataset"""
|
2 |
+
|
3 |
+
from typing import List
|
4 |
+
|
5 |
+
import datasets
|
6 |
+
|
7 |
+
import pandas
|
8 |
+
|
9 |
+
|
10 |
+
VERSION = datasets.Version("1.0.0")
|
11 |
+
_ORIGINAL_FEATURE_NAMES = [
|
12 |
+
"id",
|
13 |
+
"name",
|
14 |
+
"first",
|
15 |
+
"last",
|
16 |
+
"compas_screening_date",
|
17 |
+
"sex",
|
18 |
+
"dob",
|
19 |
+
"age",
|
20 |
+
"age_cat",
|
21 |
+
"race",
|
22 |
+
"juv_fel_count",
|
23 |
+
"decile_score",
|
24 |
+
"juv_misd_count",
|
25 |
+
"juv_other_count",
|
26 |
+
"priors_count",
|
27 |
+
"days_b_screening_arrest",
|
28 |
+
"c_jail_in",
|
29 |
+
"c_jail_out",
|
30 |
+
"c_case_number",
|
31 |
+
"c_offense_date",
|
32 |
+
"c_arrest_date",
|
33 |
+
"c_days_from_compas",
|
34 |
+
"c_charge_degree",
|
35 |
+
"c_charge_desc",
|
36 |
+
"is_recid",
|
37 |
+
"r_case_number",
|
38 |
+
"r_charge_degree",
|
39 |
+
"r_days_from_arrest",
|
40 |
+
"r_offense_date",
|
41 |
+
"r_charge_desc",
|
42 |
+
"r_jail_in",
|
43 |
+
"r_jail_out",
|
44 |
+
"violent_recid",
|
45 |
+
"is_violent_recid",
|
46 |
+
"vr_case_number",
|
47 |
+
"vr_charge_degree",
|
48 |
+
"vr_offense_date",
|
49 |
+
"vr_charge_desc",
|
50 |
+
"type_of_assessment",
|
51 |
+
"decile_score",
|
52 |
+
"score_text",
|
53 |
+
"screening_date",
|
54 |
+
"v_type_of_assessment",
|
55 |
+
"v_decile_score",
|
56 |
+
"v_score_text",
|
57 |
+
"v_screening_date",
|
58 |
+
"in_custody",
|
59 |
+
"out_custody",
|
60 |
+
"priors_count",
|
61 |
+
"start",
|
62 |
+
"end",
|
63 |
+
"event",
|
64 |
+
"two_year_recid",
|
65 |
+
"two_year_recid"
|
66 |
+
]
|
67 |
+
_BASE_FEATURE_NAMES = [
|
68 |
+
"sex",
|
69 |
+
"age",
|
70 |
+
"race",
|
71 |
+
"number_of_juvenile_fellonies",
|
72 |
+
"decile_score",
|
73 |
+
"number_of_juvenile_misdemeanors",
|
74 |
+
"number_of_other_juvenile_offenses",
|
75 |
+
"number_of_priors_offenses",
|
76 |
+
"days_before_screening_arrest",
|
77 |
+
"is_recidivous",
|
78 |
+
"days_of_recidividity_after_arrest",
|
79 |
+
"days_in_jail_before_recidividity",
|
80 |
+
"days_in_custody",
|
81 |
+
"is_violent_recidivous",
|
82 |
+
"violence_decile_score",
|
83 |
+
"time_in_custody",
|
84 |
+
"priors_count",
|
85 |
+
"two_year_recidivous"
|
86 |
+
]
|
87 |
+
DESCRIPTION = "COMPAS dataset for recidivism prediction."
|
88 |
+
_HOMEPAGE = "https://github.com/propublica/compas-analysis"
|
89 |
+
_URLS = ("https://huggingface.co/datasets/mstz/compas/raw/compas-scores-two-years-violent.csv")
|
90 |
+
_CITATION = """"""
|
91 |
+
|
92 |
+
# Dataset info
|
93 |
+
urls_per_split = {
|
94 |
+
"train": "https://huggingface.co/datasets/mstz/compas/raw/compas-scores-two-years-violent.csv",
|
95 |
+
}
|
96 |
+
features_types_per_config = {
|
97 |
+
"two-year-recidividity": {
|
98 |
+
"sex": datasets.Value("int64"),
|
99 |
+
"age": datasets.Value("int64"),
|
100 |
+
"race": datasets.Value("int64"),
|
101 |
+
"number_of_juvenile_fellonies": datasets.Value("int64"),
|
102 |
+
"decile_score": datasets.Value("int64"),
|
103 |
+
"number_of_juvenile_misdemeanors": datasets.Value("int64"),
|
104 |
+
"number_of_other_juvenile_offenses": datasets.Value("int64"),
|
105 |
+
"number_of_priors_offenses": datasets.Value("int64"),
|
106 |
+
"days_before_screening_arrest": datasets.Value("int64"),
|
107 |
+
"is_recidivous": datasets.Value("int64"),
|
108 |
+
"days_of_recidividity_after_arrest": datasets.Value("int64"),
|
109 |
+
"days_in_jail_before_recidividity": datasets.Value("int64"),
|
110 |
+
"days_in_custody": datasets.Value("int64"),
|
111 |
+
"is_violent_recidivous": datasets.Value("int64"),
|
112 |
+
"violence_decile_score": datasets.Value("int64"),
|
113 |
+
"time_in_custody": datasets.Value("int64"),
|
114 |
+
"priors_count": datasets.Value("int64"),
|
115 |
+
"two_year_recidivous": datasets.ClassLabel(num_classes=2, names=("no", "yes")),
|
116 |
+
},
|
117 |
+
|
118 |
+
"two-year-recidividity-no-race": {
|
119 |
+
"sex": datasets.Value("int64"),
|
120 |
+
"age": datasets.Value("int64"),
|
121 |
+
"number_of_juvenile_fellonies": datasets.Value("int64"),
|
122 |
+
"decile_score": datasets.Value("int64"),
|
123 |
+
"number_of_juvenile_misdemeanors": datasets.Value("int64"),
|
124 |
+
"number_of_other_juvenile_offenses": datasets.Value("int64"),
|
125 |
+
"number_of_priors_offenses": datasets.Value("int64"),
|
126 |
+
"days_before_screening_arrest": datasets.Value("int64"),
|
127 |
+
"is_recidivous": datasets.Value("int64"),
|
128 |
+
"days_of_recidividity_after_arrest": datasets.Value("int64"),
|
129 |
+
"days_in_jail_before_recidividity": datasets.Value("int64"),
|
130 |
+
"days_in_custody": datasets.Value("int64"),
|
131 |
+
"is_violent_recidivous": datasets.Value("int64"),
|
132 |
+
"violence_decile_score": datasets.Value("int64"),
|
133 |
+
"time_in_custody": datasets.Value("int64"),
|
134 |
+
"priors_count": datasets.Value("int64"),
|
135 |
+
"two_year_recidivous": datasets.ClassLabel(num_classes=2, names=("no", "yes")),
|
136 |
+
},
|
137 |
+
|
138 |
+
"priors-prediction": {
|
139 |
+
"sex": datasets.Value("int64"),
|
140 |
+
"age": datasets.Value("int64"),
|
141 |
+
"race": datasets.Value("int64"),
|
142 |
+
"number_of_juvenile_fellonies": datasets.Value("int64"),
|
143 |
+
"decile_score": datasets.Value("int64"),
|
144 |
+
"number_of_juvenile_misdemeanors": datasets.Value("int64"),
|
145 |
+
"number_of_other_juvenile_offenses": datasets.Value("int64"),
|
146 |
+
"number_of_priors_offenses": datasets.Value("int64"),
|
147 |
+
"days_before_screening_arrest": datasets.Value("int64"),
|
148 |
+
"is_recidivous": datasets.Value("int64"),
|
149 |
+
"days_of_recidividity_after_arrest": datasets.Value("int64"),
|
150 |
+
"days_in_jail_before_recidividity": datasets.Value("int64"),
|
151 |
+
"days_in_custody": datasets.Value("int64"),
|
152 |
+
"is_violent_recidivous": datasets.Value("int64"),
|
153 |
+
"violence_decile_score": datasets.Value("int64"),
|
154 |
+
"time_in_custody": datasets.Value("int64"),
|
155 |
+
"two_year_recidivous": datasets.Value("int64"),
|
156 |
+
"priors_count": datasets.Value("int64")
|
157 |
+
},
|
158 |
+
|
159 |
+
"priors-prediction-no-race": {
|
160 |
+
"sex": datasets.Value("int64"),
|
161 |
+
"age": datasets.Value("int64"),
|
162 |
+
"number_of_juvenile_fellonies": datasets.Value("int64"),
|
163 |
+
"decile_score": datasets.Value("int64"),
|
164 |
+
"number_of_juvenile_misdemeanors": datasets.Value("int64"),
|
165 |
+
"number_of_other_juvenile_offenses": datasets.Value("int64"),
|
166 |
+
"number_of_priors_offenses": datasets.Value("int64"),
|
167 |
+
"days_before_screening_arrest": datasets.Value("int64"),
|
168 |
+
"is_recidivous": datasets.Value("int64"),
|
169 |
+
"days_of_recidividity_after_arrest": datasets.Value("int64"),
|
170 |
+
"days_in_jail_before_recidividity": datasets.Value("int64"),
|
171 |
+
"days_in_custody": datasets.Value("int64"),
|
172 |
+
"is_violent_recidivous": datasets.Value("int64"),
|
173 |
+
"violence_decile_score": datasets.Value("int64"),
|
174 |
+
"time_in_custody": datasets.Value("int64"),
|
175 |
+
"two_year_recidivous": datasets.Value("int64"),
|
176 |
+
"priors_count": datasets.Value("int64")
|
177 |
+
},
|
178 |
+
}
|
179 |
+
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
180 |
+
|
181 |
+
|
182 |
+
class CompasConfig(datasets.BuilderConfig):
|
183 |
+
def __init__(self, **kwargs):
|
184 |
+
super(CompasConfig, self).__init__(version=VERSION, **kwargs)
|
185 |
+
self.features = features_per_config[kwargs["name"]]
|
186 |
+
|
187 |
+
|
188 |
+
class Compas(datasets.GeneratorBasedBuilder):
|
189 |
+
# dataset versions
|
190 |
+
DEFAULT_CONFIG = "two-years-recidividity"
|
191 |
+
BUILDER_CONFIGS = [
|
192 |
+
CompasConfig(name="two-year-recidividity",
|
193 |
+
description="Compas binary classification for two-year recidividity."),
|
194 |
+
CompasConfig(name="two-years-recidividity-no-race",
|
195 |
+
description="Compas binary classification for two-year recidividity. Race excluded from features."),
|
196 |
+
CompasConfig(name="priors-prediction",
|
197 |
+
description="Compas regression task for estimating number of prior offenses of defendant."),
|
198 |
+
CompasConfig(name="priors-prediction-no-race",
|
199 |
+
description="Compas regression task for estimating number of prior offenses of defendant. Race excluded from features."),
|
200 |
+
]
|
201 |
+
|
202 |
+
|
203 |
+
def _info(self):
|
204 |
+
if self.config.name not in features_per_config:
|
205 |
+
raise ValueError(f"Unknown configuration: {self.config.name}")
|
206 |
+
|
207 |
+
info = datasets.DatasetInfo(description=DESCRIPTION, citation=_CITATION, homepage=_HOMEPAGE,
|
208 |
+
features=features_per_config[self.config.name])
|
209 |
+
|
210 |
+
return info
|
211 |
+
|
212 |
+
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
213 |
+
downloads = dl_manager.download_and_extract(urls_per_split)
|
214 |
+
|
215 |
+
return [
|
216 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloads["train"]}),
|
217 |
+
]
|
218 |
+
|
219 |
+
def _generate_examples(self, filepath: str):
|
220 |
+
data = pandas.read_csv(filepath)
|
221 |
+
print("preprocessing...")
|
222 |
+
data = self.preprocess(data, config=self.config.name)
|
223 |
+
print("done!")
|
224 |
+
|
225 |
+
for row_id, row in data.iterrows():
|
226 |
+
data_row = dict(row)
|
227 |
+
|
228 |
+
yield row_id, data_row
|
229 |
+
|
230 |
+
def preprocess(self, data: pandas.DataFrame, config: str = "income") -> pandas.DataFrame:
|
231 |
+
print("dropping columns...")
|
232 |
+
data.drop("id", axis="columns", inplace=True)
|
233 |
+
data.drop("name", axis="columns", inplace=True)
|
234 |
+
data.drop("first", axis="columns", inplace=True)
|
235 |
+
data.drop("last", axis="columns", inplace=True)
|
236 |
+
data.drop("dob", axis="columns", inplace=True)
|
237 |
+
data.drop("age_cat", axis="columns", inplace=True)
|
238 |
+
data.drop("c_offense_date", axis="columns", inplace=True)
|
239 |
+
data.drop("c_arrest_date", axis="columns", inplace=True)
|
240 |
+
data.drop("c_charge_degree", axis="columns", inplace=True)
|
241 |
+
data.drop("c_charge_desc", axis="columns", inplace=True)
|
242 |
+
data.drop("r_case_number", axis="columns", inplace=True)
|
243 |
+
data.drop("r_charge_degree", axis="columns", inplace=True)
|
244 |
+
data.drop("r_charge_degree", axis="columns", inplace=True)
|
245 |
+
data.drop("r_offense_date", axis="columns", inplace=True)
|
246 |
+
data.drop("r_charge_desc", axis="columns", inplace=True)
|
247 |
+
data.drop("violent_recid", axis="columns", inplace=True)
|
248 |
+
data.drop("vr_case_number", axis="columns", inplace=True)
|
249 |
+
data.drop("vr_charge_degree", axis="columns", inplace=True)
|
250 |
+
data.drop("vr_offense_date", axis="columns", inplace=True)
|
251 |
+
data.drop("vr_charge_desc", axis="columns", inplace=True)
|
252 |
+
data.drop("type_of_assessment", axis="columns", inplace=True)
|
253 |
+
data.drop("score_text", axis="columns", inplace=True)
|
254 |
+
data.drop("v_score_text", axis="columns", inplace=True)
|
255 |
+
data.drop("v_screening_date", axis="columns", inplace=True)
|
256 |
+
data.drop("screening_date", axis="columns", inplace=True)
|
257 |
+
data.drop("start", axis="columns", inplace=True)
|
258 |
+
data.drop("end", axis="columns", inplace=True)
|
259 |
+
data.drop("event", axis="columns", inplace=True)
|
260 |
+
data.drop("two_year_recid.1", axis="columns", inplace=True)
|
261 |
+
data.drop("r_jail_in", axis="columns", inplace=True)
|
262 |
+
data.drop("r_jail_out", axis="columns", inplace=True)
|
263 |
+
data.drop("vr_case_number", axis="columns", inplace=True)
|
264 |
+
data.drop("type_of_assessment", axis="columns", inplace=True)
|
265 |
+
data.drop("v_type_of_assessment", axis="columns", inplace=True)
|
266 |
+
data.drop("v_score_text", axis="columns", inplace=True)
|
267 |
+
data.drop("start", axis="columns", inplace=True)
|
268 |
+
data.drop("end", axis="columns", inplace=True)
|
269 |
+
data.drop("event", axis="columns", inplace=True)
|
270 |
+
data.drop("compas_screening_date", axis="columns", inplace=True)
|
271 |
+
data.drop("dob", axis="columns", inplace=True)
|
272 |
+
data.drop("decile_score.1", axis="columns", inplace=True)
|
273 |
+
data.drop("priors_count.1", axis="columns", inplace=True)
|
274 |
+
|
275 |
+
# drop nan values
|
276 |
+
data = data[~data.days_b_screening_arrest.isna()]
|
277 |
+
data = data[~data.c_days_from_compas.isna()]
|
278 |
+
data = data[~data.r_days_from_arrest.isna()]
|
279 |
+
|
280 |
+
# transform columns into intervals
|
281 |
+
data = data[(~data.in_custody.isna()) & (~data.out_custody.isna())]
|
282 |
+
in_dates = data.in_custody.apply(datetime.date.fromisoformat)
|
283 |
+
out_dates = data.out_custody.apply(datetime.date.fromisoformat)
|
284 |
+
days_in_custody = [delta.days for delta in out_dates - in_dates]
|
285 |
+
data["days_in_custody"] = days_in_custody
|
286 |
+
data.drop("in_custody", axis="columns", inplace=True)
|
287 |
+
data.drop("out_custody", axis="columns", inplace=True)
|
288 |
+
|
289 |
+
data = data[["sex",
|
290 |
+
"age",
|
291 |
+
"race",
|
292 |
+
"juv_fel_count",
|
293 |
+
"decile_score",
|
294 |
+
"juv_misd_count",
|
295 |
+
"juv_other_count",
|
296 |
+
"priors_count",
|
297 |
+
"days_b_screening_arrest",
|
298 |
+
"is_recid",
|
299 |
+
"r_days_from_arrest",
|
300 |
+
"days_in_jail_before_recidividity",
|
301 |
+
"days_in_custody",
|
302 |
+
"is_violent_recid",
|
303 |
+
"v_decile_score",
|
304 |
+
"time_in_custody",
|
305 |
+
"two_year_recid"]]
|
306 |
+
|
307 |
+
data.columns = _BASE_FEATURE_NAMES
|
308 |
+
|
309 |
+
# binarize features
|
310 |
+
data.loc[:, "sex"] = data.sex.apply(self.encode_sex)
|
311 |
+
|
312 |
+
if config == "two-years-recidividity":
|
313 |
+
return self.two_years_recidividity_preprocessing(data)
|
314 |
+
elif config == "two-years-recidividity-no-race":
|
315 |
+
return self.two_years_recidividity_no_race_preprocessing(data)
|
316 |
+
elif config == "priors-prediction":
|
317 |
+
return self.priors_prediction_preprocessing(data)
|
318 |
+
elif config == "priors-prediction-no-race":
|
319 |
+
return self.priors_prediction_no_race_preprocessing(data)
|
320 |
+
else:
|
321 |
+
raise ValueError(f"Unknown config: {config}")
|
322 |
+
|
323 |
+
|
324 |
+
def two_years_recidividity_preprocessing(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
325 |
+
# categorize features
|
326 |
+
data.loc[:, "race"] = data.race.apply(self.encode_race(race))
|
327 |
+
|
328 |
+
return data
|
329 |
+
|
330 |
+
def two_years_recidividity_no_race_preprocessing(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
331 |
+
# categorize features
|
332 |
+
data.drop("race", axis="columns", inplace=True)
|
333 |
+
|
334 |
+
return data
|
335 |
+
|
336 |
+
def priors_prediction_preprocessing(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
337 |
+
# categorize features
|
338 |
+
data.loc[:, "race"] = data.race.apply(self.encode_race(race))
|
339 |
+
|
340 |
+
return data
|
341 |
+
|
342 |
+
def priors_prediction_no_race_preprocessing(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
343 |
+
# categorize features
|
344 |
+
data.drop("race", axis="columns", inplace=True)
|
345 |
+
|
346 |
+
return data
|
347 |
+
|
348 |
+
def encode_race(self, race):
|
349 |
+
return self.race_encoding_dic()[race]
|
350 |
+
|
351 |
+
def decode_race(self, code):
|
352 |
+
return self.race_decoding_dic()[code]
|
353 |
+
|
354 |
+
def race_decoding_dic(self):
|
355 |
+
return {
|
356 |
+
0: "Caucasian",
|
357 |
+
1: "African-American",
|
358 |
+
2: "Hispanic",
|
359 |
+
3: "Asian",
|
360 |
+
4: "Other",
|
361 |
+
5: "Native American",
|
362 |
+
}
|
363 |
+
|
364 |
+
def race_encoding_dic(self):
|
365 |
+
return {
|
366 |
+
"Caucasian": 0,
|
367 |
+
"African-American": 1,
|
368 |
+
"Hispanic": 2,
|
369 |
+
"Asian": 3,
|
370 |
+
"Other": 4,
|
371 |
+
"Native American": 5,
|
372 |
+
}
|
373 |
+
|
374 |
+
def encode_sex(self, sex):
|
375 |
+
return self.sex_encoding_dic()[sex]
|
376 |
+
|
377 |
+
def decode_sex(self, code):
|
378 |
+
return self.sex_decoding_dic()[code]
|
379 |
+
|
380 |
+
def sex_encoding_dic(self):
|
381 |
+
return {
|
382 |
+
"Male": 0,
|
383 |
+
"Female": 1
|
384 |
+
}
|
385 |
+
|
386 |
+
def sex_decoding_dic(self):
|
387 |
+
return {
|
388 |
+
0: "Male",
|
389 |
+
1: "Female"
|
390 |
+
}
|