Skip to content

Commit b07e1a9

Browse files
authored
Update compas.R
Fix #77
1 parent c66f304 commit b07e1a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/compas.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
#' * Factorize the features that are categorical.
3333
#' * Add length of stay (c_jail_out - c_jail_in) in the dataset.
3434
#' * `Pre-processing Resource:` @url https://github.com/propublica/compas-analysis/blob/master/Compas%20Analysis.ipynb
35+
#'
36+
#' Note: The 'is_recid' column was removed as it's a target column.
3537
#'
3638
#' @section Metadata:
37-
#' * (integer) age : The age of defendants.
39+
#' * (integer) age: The age of defendants.
3840
#' * (factor) c_charge_degree : The charge degree of defendants. F: Felony M: Misdemeanor
3941
#' * (factor) race: The race of defendants.
4042
#' * (factor) age_cat: The age category of defendants.
@@ -45,7 +47,6 @@
4547
#' If they are too far apart, that may indicate an error. If the value is negative,
4648
#' that indicate the screening date happened before the arrest date.
4749
#' * (integer) decile_score: Indicate the risk of recidivism (Min=1, Max=10)
48-
#' * (integer) is_recid: Binary variable indicate whether defendant is rearrested at any time.
4950
#' * (factor) two_year_recid: Binary variable indicate whether defendant is rearrested at within two years.
5051
#' * (numeric) length_of_stay: The count of days stay in jail.
5152
#'
@@ -80,6 +81,7 @@ get_compas_task = function() { # nocov start
8081
b = as_data_backend(mlr3fairness::compas)
8182
task = mlr3::TaskClassif$new("compas", b, target = "two_year_recid")
8283
task$col_roles$pta = "sex"
84+
task$col_roles$feature = setdiff(task$feature_names, "is_recid")
8385
b$hash = task$man = "mlr3fairness::mlr_tasks_compas"
8486
task
8587
} # nocov end

0 commit comments

Comments
 (0)