Datasets:
Upload 2 files
Browse files
README.md
CHANGED
@@ -6,13 +6,46 @@ tags:
|
|
6 |
- fico
|
7 |
- tabular_classification
|
8 |
- binary_classification
|
9 |
-
pretty_name:
|
10 |
size_categories:
|
11 |
-
-
|
12 |
task_categories: # Full list at https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts
|
13 |
- tabular-classification
|
14 |
configs:
|
15 |
- risk
|
16 |
---
|
17 |
# HELOC
|
18 |
-
The [HELOC dataset](https://community.fico.com/s/explainable-machine-learning-challenge?tabset-158d9=d157e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
- fico
|
7 |
- tabular_classification
|
8 |
- binary_classification
|
9 |
+
pretty_name: Heloc
|
10 |
size_categories:
|
11 |
+
- 1K<n<10K
|
12 |
task_categories: # Full list at https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts
|
13 |
- tabular-classification
|
14 |
configs:
|
15 |
- risk
|
16 |
---
|
17 |
# HELOC
|
18 |
+
The [HELOC dataset](https://community.fico.com/s/explainable-machine-learning-challenge?tabset-158d9=d157e) from FICO.
|
19 |
+
Each entry in the dataset is a line of credit typically offered by a bank as a percentage of home equity (the difference between the current market value of a home and its purchase price).
|
20 |
+
The customers in this dataset have requested a credit line in the range of $5,000 - $150,000.
|
21 |
+
The fundamental task is to use the information about the applicant in their credit report to predict whether they will repay their HELOC account within 2 years.
|
22 |
+
|
23 |
+
# Configurations and tasks
|
24 |
+
- `risk` Predict the risk of insolvency.
|
25 |
+
|
26 |
+
# Features
|
27 |
+
|**Feature** |**Type**|
|
28 |
+
|-------------------------------------------|--------|
|
29 |
+
|`estimate_of_risk` |`int8` |
|
30 |
+
|`months_since_first_trade` |`int32` |
|
31 |
+
|`months_since_last_trade` |`int32` |
|
32 |
+
|`average_duration_of_resolution` |`int32` |
|
33 |
+
|`number_of_satisfactory_trades` |`int16` |
|
34 |
+
|`nr_trades_insolvent_for_over_60_days` |`int16` |
|
35 |
+
|`nr_trades_insolvent_for_over_90_days` |`int16` |
|
36 |
+
|`percentage_of_legal_trades` |`int16` |
|
37 |
+
|`months_since_last_illegal_trade` |`int32` |
|
38 |
+
|`maximum_illegal_trades_over_last_year` |`int8` |
|
39 |
+
|`maximum_illegal_trades` |`int16` |
|
40 |
+
|`nr_total_trades` |`int16` |
|
41 |
+
|`nr_trades_initiated_in_last_year` |`int16` |
|
42 |
+
|`percentage_of_installment_trades` |`int16` |
|
43 |
+
|`months_since_last_inquiry_not_recent` |`int16` |
|
44 |
+
|`nr_inquiries_in_last_6_months` |`int16` |
|
45 |
+
|`nr_inquiries_in_last_6_months_not_recent` |`int16` |
|
46 |
+
|`net_fraction_of_revolving_burden` |`int32` |
|
47 |
+
|`net_fraction_of_installment_burden` |`int32` |
|
48 |
+
|`nr_revolving_trades_with_balance` |`int16` |
|
49 |
+
|`nr_installment_trades_with_balance` |`int16` |
|
50 |
+
|`nr_banks_with_high_ratio` |`int16` |
|
51 |
+
|`percentage_trades_with_balance` |`int16` |
|
heloc.py
CHANGED
@@ -136,21 +136,21 @@ class Heloc(datasets.GeneratorBasedBuilder):
|
|
136 |
]
|
137 |
|
138 |
def _generate_examples(self, filepath: str):
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
142 |
|
143 |
-
|
144 |
-
|
145 |
|
146 |
-
|
|
|
|
|
147 |
|
148 |
def preprocess(self, data: pandas.DataFrame, config: str = "risk") -> pandas.DataFrame:
|
149 |
data = data[list(features_types_per_config["risk"].keys())]
|
150 |
|
151 |
data.loc[:, "is_at_risk"] = data.is_at_risk.apply(lambda x: 1 if x == "Bad" else 0)
|
152 |
|
153 |
-
|
154 |
-
return data
|
155 |
-
else:
|
156 |
-
raise ValueError(f"Unknown config: {config}")
|
|
|
136 |
]
|
137 |
|
138 |
def _generate_examples(self, filepath: str):
|
139 |
+
if self.config.name == "risk":
|
140 |
+
data = pandas.read_csv(filepath)
|
141 |
+
data.columns = _BASE_FEATURE_NAMES
|
142 |
+
data = self.preprocess(data, config=self.config.name)
|
143 |
|
144 |
+
for row_id, row in data.iterrows():
|
145 |
+
data_row = dict(row)
|
146 |
|
147 |
+
yield row_id, data_row
|
148 |
+
else:
|
149 |
+
raise ValueError(f"Unknown config: {self.config.name}")
|
150 |
|
151 |
def preprocess(self, data: pandas.DataFrame, config: str = "risk") -> pandas.DataFrame:
|
152 |
data = data[list(features_types_per_config["risk"].keys())]
|
153 |
|
154 |
data.loc[:, "is_at_risk"] = data.is_at_risk.apply(lambda x: 1 if x == "Bad" else 0)
|
155 |
|
156 |
+
return data
|
|
|
|
|
|