cestwc commited on
Commit
d3bf3a8
·
verified ·
1 Parent(s): 2411a2d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -0
README.md CHANGED
@@ -210,3 +210,62 @@ If you use this dataset, please consider cite the following works (these might b
210
  year={2007},
211
  institution={Duke University}
212
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  year={2007},
211
  institution={Duke University}
212
  }
213
+ ```
214
+
215
+ ## The source
216
+ Unfortunately, the source of this data is still a myth. This could by no means be the original data by [Wightman](https://files.eric.ed.gov/fulltext/ED469370.pdf) or [Richard Sander](https://www.brown.edu/Departments/Economics/Faculty/Glenn_Loury/louryhomepage/teaching/Ec%20137/Richard%20Sander%20on%20Affirmative%20Action%20in%20Law%20Schools.pdf), as these two papers were published before 2004.
217
+
218
+ We roughly remember we came across a web page with the two papers in bibtex above, which could be the right page. Sadly, we cannot remember where it is, nor can we find it again. We really hope you can let us know the real source if you happen to know it.
219
+
220
+ We used the following code to produce this Hugging Face dataset.
221
+
222
+ ```
223
+ wget https://web.archive.org/web/20210427055113/http://www.seaphe.org/databases/FOIA/lawschs1_0.dta
224
+ wget https://web.archive.org/web/20210427055113/http://www.seaphe.org/databases/FOIA/lawschs1_1.dta
225
+ ```
226
+
227
+ (Note that we need to use this link. The original link is gone. Also, ```lawschs1_0.dta``` and ```lawschs1_1.dta``` only have < 5000 different rows out of > 120 k rows (if you happen to see number 1507 or 4556, then you are even closer). So we would just use ```lawschs1_1.dta```.)
228
+
229
+ ```python
230
+ from datasets import Dataset, DatasetDict, Features, Value, ClassLabel
231
+
232
+ # Define categorical and continuous columns
233
+ continuous_columns = ["lsat", "gpa"]
234
+ categorical_columns = ["race", "resident", "college", "year", "gender", "admit", "black",
235
+ "hispanic", "asian", "white", "missingrace", "urm", "enroll"]
236
+
237
+ # Convert categorical columns to category type and get mappings
238
+ category_mappings = {}
239
+ for col in categorical_columns:
240
+ # df_law[col] = df_law[col].astype("category")
241
+ category_mappings[col] = df_law[col].astype("category").cat.categories.to_list()
242
+ # df_law[col] = df_law[col].cat.codes # Convert to integer codes
243
+
244
+ # Define Hugging Face Dataset Features
245
+ hf_features = Features({
246
+ "lsat": Value("int64"),
247
+ "gpa": Value("float32"),
248
+ "race": ClassLabel(names=category_mappings["race"]),
249
+ "resident": ClassLabel(names=['out-of-state', 'in-state']),
250
+ "college": ClassLabel(names=category_mappings["college"]),
251
+ "year": ClassLabel(names=[str(y) for y in category_mappings["year"]]),
252
+ "gender": ClassLabel(names=["female", "male"]),
253
+ "admit": ClassLabel(names=["denied", "admitted"]),
254
+ "black": ClassLabel(names=category_mappings["black"]),
255
+ "hispanic": ClassLabel(names=category_mappings["hispanic"]),
256
+ "asian": ClassLabel(names=category_mappings["asian"]),
257
+ "white": ClassLabel(names=category_mappings["white"]),
258
+ "missingrace": ClassLabel(names=category_mappings["missingrace"]),
259
+ "urm": ClassLabel(names=[0, 'Black OR Hispanic']),
260
+ "enroll": ClassLabel(names=["not enrolled", "enrolled"]),
261
+ })
262
+
263
+ # Convert to Hugging Face dataset
264
+ hf_dataset = Dataset.from_pandas(df_law, features=hf_features)
265
+
266
+ # Create DatasetDict for organization
267
+ hf_dataset_dict = DatasetDict({"train": hf_dataset})
268
+
269
+ # Display dataset structure
270
+ hf_dataset_dict
271
+ ```