Running 'testthat.R' [29s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(fairmodels)
  > 
  > 
  > test_check("fairmodels")
  Welcome to DALEX (version: 2.5.3).
  Find examples and detailed introduction at: http://ema.drwhy.ai/
  Additional features will be available after installation of: ggpubr.
  Use 'install_dependencies()' to get all suggested dependencies
  Loaded gbm 2.2.2
  This version of gbm is no longer under development. Consider transitioning to gbm3, https://github.com/gbm-developers/gbm3
  Preparation of a new explainer is initiated
    -> model label       :  ranger  ( [33m default [39m )
    -> data              :  6172  rows  7  cols 
    -> target variable   :  6172  values 
    -> predict function  :  yhat.ranger  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package ranger , ver. 0.17.0 , task classification ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  0.1517377 , mean =  0.5445326 , max =  0.865768  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -0.8454911 , mean =  0.000347517 , max =  0.7784076  
   [32m A new explainer has been created! [39m 
  Preparation of a new explainer is initiated
    -> model label       :  lm  ( [33m default [39m )
    -> data              :  6172  rows  7  cols 
    -> target variable   :  6172  values 
    -> predict function  :  yhat.glm  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package stats , ver. 4.6.0 , task classification ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  0.004522979 , mean =  0.5448801 , max =  0.8855426  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -0.8822826 , mean =  -5.053611e-13 , max =  0.9767658  
   [32m A new explainer has been created! [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 13/13 metrics calculated for all models
  [32m Fairness object created succesfully [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 13/13 metrics calculated for all models
   Fairness object created succesfully  
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from numeric [39m )
  -> Cutoff values for explainers	: 0.5 ( for all subgroups )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 13/13 metrics calculated for all models
   Fairness object created succesfully  
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 2 objects ( [32m compatible [39m )
  -> Checking explainers		: 4 in total ( [32m compatible [39m )
  Creating fairness classification object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 1 object ( [32m compatible [39m )
  -> Checking explainers		: 3 in total ( [31m model type not supported [39m )
  Creating fairness classification object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 2 objects ( [31m not compatible [39m ) 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 2 objects ( [31m not compatible [39m ) 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 2 objects ( [31m not compatible [39m ) 
  Preparation of a new explainer is initiated
    -> model label       :  lm  ( [33m default [39m )
    -> data              :  1000  rows  3  cols 
    -> target variable   :  1000  values 
    -> predict function  :  yhat.lm  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package stats , ver. 4.6.0 , task regression ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  -163.4531 , mean =  755.4191 , max =  1624.618  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -291.1838 , mean =  2.481582e-12 , max =  348.2506  
   [32m A new explainer has been created! [39m 
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
  [32m Fairness regression object created succesfully [39m 
  
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
   Fairness regression object created succesfully  
  
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
  [32m Fairness regression object created succesfully [39m 
  
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 1 object ( [32m compatible [39m )
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from numeric [39m )
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  Creating fairness regression object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  Creating fairness regression object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  Creating fairness regression object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 1 object ( [32m compatible [39m )
  -> Checking explainers		: 2 in total ( [31m model type not supported [39m )
  Preparation of a new explainer is initiated
    -> model label       :  lm  ( [33m default [39m )
    -> data              :  1000  rows  3  cols 
    -> target variable   :  1000  values 
    -> predict function  :  yhat.lm  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package stats , ver. 4.6.0 , task regression ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  -163.4531 , mean =  755.4191 , max =  1624.618  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -291.1838 , mean =  2.481582e-12 , max =  348.2506  
   [32m A new explainer has been created! [39m 
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
  [32m Fairness regression object created succesfully [39m 
  
  Creating fairness regression object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Fairness objects		: 1 object ( [32m compatible [39m )
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
  [32m Fairness regression object created succesfully [39m 
  
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 11/13 metrics calculated for all models ( [33m2 NA created[39m )
  [32m Fairness object created succesfully [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [31m not compatible [39m )
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 11/13 metrics calculated for all models ( [33m2 NA created[39m )
  [32m Fairness object created succesfully [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 1 object ( [32m compatible [39m )
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 11/13 metrics calculated for all models ( [33m2 NA created[39m )
  [32m Fairness object created succesfully [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 2 objects ( [31m not compatible [39m ) 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 2 in total ( [31m y not equal [39m )
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 11/13 metrics calculated for all models ( [33m2 NA created[39m )
  [32m Fairness object created succesfully [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 2 objects ( [32m compatible [39m )
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 13/13 metrics calculated for all models
  [32m Fairness object created succesfully [39m 
  Performace metric not given, setting deafult ( accuracy )  
  Performace metric not given, setting deafult ( accuracy )  
  Performace metric not given, setting deafult ( accuracy )  
  Fairness Metric not given, setting deafult ( TPR )  
  Fairness Metric not given, setting deafult ( TPR )  
  Fairness Metric not given, setting deafult ( TPR )  
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 6/13 metrics calculated for all models ( [33m7 NA created[39m )
  [32m Fairness object created succesfully [39m 
  Fairness Metric not given, setting deafult ( TPR )  
  Performace metric not given, setting deafult ( accuracy )  
  
  Creating object with: 
  Fairness metric:  TPR 
  Performance metric:  accuracy 
  
  
  Creating object with: 
  Fairness metric:  FPR 
  Performance metric:  f1 
  
  Fairness data top rows for FPR 
               group      score model
  1 African_American 0.35204756    lm
  2            Asian 0.04347826    lm
  3        Caucasian 0.16393443    lm
  4         Hispanic 0.11562500    lm
  5  Native_American 0.16666667    lm
  6            Other 0.07762557    lm
  
  Performance data for f1 :                  
  1     lm 0.6039853
  2 ranger 0.6447198
  
  Fairness Metric is NULL, setting deafult parity loss metric ( TPR )  
  Performace metric is NULL, setting deafult ( accuracy )  
  
  Creating object with: 
  Fairness metric: TPR 
  Performance metric: accuracy 
  Performace metric is NULL, setting deafult ( accuracy )  
  
  Creating object with: 
  Fairness metric: non_existing 
  Performance metric: accuracy 
  Fairness Metric is NULL, setting deafult parity loss metric ( TPR )  
  
  Creating object with: 
  Fairness metric: TPR 
  Performance metric: non_existing 
  Fairness Metric is NULL, setting deafult parity loss metric ( TPR )  
  
  Creating object with: 
  Fairness metric: TPR 
  Performance metric: auc 
  Fairness Metric is NULL, setting deafult parity loss metric ( TPR )  
  
  Creating object with: 
  Fairness metric: TPR 
  Performance metric: accuracy 
  Fairness Metric is NULL, setting deafult parity loss metric ( TPR )  
  
  Creating object with: 
  Fairness metric: TPR 
  Performance metric: precision 
  Fairness Metric is NULL, setting deafult parity loss metric ( TPR )  
  
  Creating object with: 
  Fairness metric: TPR 
  Performance metric: recall 
  Preparation of a new explainer is initiated
    -> model label       :  lm  ( [33m default [39m )
    -> data              :  6172  rows  7  cols 
    -> target variable   :  6172  values 
    -> predict function  :  yhat.glm  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package stats , ver. 4.6.0 , task classification ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  0.1144574 , mean =  0.4551199 , max =  0.995477  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -0.9767658 , mean =  5.053909e-13 , max =  0.8822826  
   [32m A new explainer has been created! [39m 
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 8/13 metrics calculated for all models ( [33m5 NA created[39m )
  [32m Fairness object created succesfully [39m 
  Preparation of a new explainer is initiated
    -> model label       :  lm  ( [33m default [39m )
    -> data              :  1000  rows  3  cols 
    -> target variable   :  1000  values 
    -> predict function  :  yhat.lm  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package stats , ver. 4.6.0 , task regression ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  -119.546 , mean =  756.4906 , max =  1594.562  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -302.6659 , mean =  3.478115e-13 , max =  332.7938  
   [32m A new explainer has been created! [39m 
  Creating fairness regression object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([33m changed from character [39m )
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
  [32m Fairness regression object created succesfully [39m 
  
  Preparation of a new explainer is initiated
    -> model label       :  ranger  ( [33m default [39m )
    -> data              :  1000  rows  3  cols 
    -> target variable   :  1000  values 
    -> predict function  :  yhat.ranger  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package ranger , ver. 0.17.0 , task regression ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  361.6527 , mean =  756.1869 , max =  1136.792  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -669.0748 , mean =  0.3037205 , max =  630.6428  
   [32m A new explainer has been created! [39m 
  Creating fairness regression object
  -> Privileged subgroup		: character ([33m from first fairness object [39m ) 
  -> Protected variable		: factor ([33m from first fairness object [39m ) 
  -> Fairness objects		: 1 object ( [32m compatible [39m )
  -> Checking explainers		: 2 in total ( [32m compatible [39m )
  -> Metric calculation		: 3/3 metrics calculated for all models
  [32m Fairness regression object created succesfully [39m 
  
  Creating fairness classification object
  -> Privileged subgroup		: character ([32m Ok [39m )
  -> Protected variable		: factor ([32m Ok [39m ) 
  -> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
  -> Fairness objects		: 0 objects 
  -> Checking explainers		: 1 in total ( [32m compatible [39m )
  -> Metric calculation		: 13/13 metrics calculated for all models
  [32m Fairness object created succesfully [39m 
  
  changing protected to factor 
  Preparation of a new explainer is initiated
    -> model label       :  lm  ( [33m default [39m )
    -> data              :  15  rows  2  cols 
    -> target variable   :  15  values 
    -> predict function  :  yhat.glm  will be used ( [33m default [39m )
    -> predicted values  :  No value for predict function target column. ( [33m default [39m )
    -> model_info        :  package stats , ver. 4.6.0 , task classification ( [33m default [39m ) 
    -> predicted values  :  numerical, min =  7.884924e-12 , mean =  0.4666667 , max =  1  
    -> residual function :  difference between y and yhat ( [33m default [39m )
    -> residuals         :  numerical, min =  -7.884924e-12 , mean =  -5.256659e-13 , max =  7.884915e-12  
   [32m A new explainer has been created! [39m 
  [ FAIL 3 | WARN 1 | SKIP 0 | PASS 299 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_heatmap.R:2:3'): Test heatmap ──────────────────────────────────
  Error in `rep(yes, length.out = len)`: attempt to replicate an object of type 'object'
  Backtrace:
      ▆
   1. ├─base::plot(fairness_heatmap(fobject)) at test_heatmap.R:2:3
   2. └─fairmodels:::plot.fairness_heatmap(fairness_heatmap(fobject))
   3.   └─base::ifelse(...)
  ── Failure ('test_plot_density.R:14:3'): Test plot_density ─────────────────────
  plt$labels$x not equal to "probability".
  target is NULL, current is character
  ── Error ('test_plot_fairmodels.R:8:3'): Test plot_fairmodels ──────────────────
  Error in `rep(yes, length.out = len)`: attempt to replicate an object of type 'object'
  Backtrace:
       ▆
    1. ├─base::suppressWarnings(...) at test_plot_fairmodels.R:8:3
    2. │ └─base::withCallingHandlers(...)
    3. ├─fairmodels:::expect_s3_class(...)
    4. │ ├─testthat::expect(...) at D:\RCompile\CRANpkg\local\4.6\fairmodels.Rcheck\tests\testthat\helper_objects.R:70:20
    5. │ └─base::class(object) %in% class
    6. ├─fairmodels::plot_fairmodels(fc, type = "fairness_heatmap")
    7. └─fairmodels:::plot_fairmodels.fairness_object(fc, type = "fairness_heatmap")
    8.   └─fairmodels:::plot_fairmodels.default(x, type, ...)
    9.     └─fairmodels:::plot.fairness_heatmap(fairness_heatmap(x, ...))
   10.       └─base::ifelse(...)
  
  [ FAIL 3 | WARN 1 | SKIP 0 | PASS 299 ]
  Error: Test failures
  Execution halted