Chandan Singh commited on
Commit
aa2d71d
1 Parent(s): d5a3792

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -0
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators: []
3
+ language: []
4
+ language_creators: []
5
+ license: []
6
+ multilinguality: []
7
+ pretty_name: credit-card
8
+ size_categories:
9
+ - 10K<n<100K
10
+ source_datasets: []
11
+ tags:
12
+ - interpretability
13
+ - fairness
14
+ - medicine
15
+ task_categories:
16
+ - tabular-classification
17
+ task_ids: []
18
+ ---
19
+
20
+ Port of the credit-card dataset from UCI (link [here](https://www.kaggle.com/datasets/uciml/default-of-credit-card-clients-dataset)). See details there and use carefully.
21
+
22
+ Basic preprocessing done by the [imodels team](https://github.com/csinva/imodels) in [this notebook](https://github.com/csinva/imodels-data/blob/master/notebooks_fetch_data/00_get_datasets_custom.ipynb).
23
+
24
+ The target is the binary outcome `default.payment.next.month`.
25
+
26
+ ### Sample usage
27
+
28
+ Load the data:
29
+
30
+ ```
31
+ from datasets import load_dataset
32
+
33
+ dataset = load_dataset("imodels/credit-card")
34
+ df = pd.DataFrame(dataset['train'])
35
+ X = df.drop(columns=['default.payment.next.month'])
36
+ y = df['default.payment.next.month'].values
37
+ ```
38
+
39
+ Fit a model:
40
+
41
+ ```
42
+ import imodels
43
+ import numpy as np
44
+
45
+ m = imodels.FIGSClassifier(max_rules=5)
46
+ m.fit(X, y)
47
+ print(m)
48
+ ```
49
+
50
+
51
+ Evaluate:
52
+
53
+
54
+ ```
55
+ df_test = pd.DataFrame(dataset['test'])
56
+ X_test = df.drop(columns=['default.payment.next.month'])
57
+ y_test = df['default.payment.next.month'].values
58
+ print('accuracy', np.mean(m.predict(X_test) == y_test))
59
+ ```