| 
35 | 35 | from sklearn.model_selection import KFold  | 
36 | 36 | from sklearn.svm import SVC  | 
37 | 37 | 
 
  | 
38 |  | -from hidimstat import LOCO, D0CRT  | 
 | 38 | +from hidimstat import D0CRT, LOCO  | 
39 | 39 | 
 
  | 
40 | 40 | #############################################################################  | 
41 | 41 | # Generate data where classes are not linearly separable  | 
 | 
70 | 70 | # test (:math:`H_0: X_j \perp\!\!\!\perp y | X_{-j}`) for each variable. However,  | 
71 | 71 | # this test is based on a linear model (LogisticRegression) and fails to reject the null  | 
72 | 72 | # in the presence of non-linear relationships.  | 
73 |  | -d0crt_linear = D0CRT(estimator=clone(linear_model), screening=False)  | 
 | 73 | +d0crt_linear = D0CRT(estimator=clone(linear_model), screening_threshold=None)  | 
74 | 74 | d0crt_linear.fit_importance(X, y)  | 
75 | 75 | pval_dcrt_linear = d0crt_linear.pvalues_  | 
76 | 76 | 
 
  | 
77 |  | -d0crt_non_linear = D0CRT(estimator=clone(non_linear_model), screening=False)  | 
 | 77 | +d0crt_non_linear = D0CRT(estimator=clone(non_linear_model), screening_threshold=None)  | 
78 | 78 | d0crt_non_linear.fit_importance(X, y)  | 
79 | 79 | pval_dcrt_non_linear = d0crt_non_linear.pvalues_  | 
80 | 80 | 
 
  | 
 | 
162 | 162 | # As expected, when using linear models (d0CRT and LOCO-linear) that are misspecified,  | 
163 | 163 | # the varibles are not selected. This highlights the benefit of using model-agnostic  | 
164 | 164 | # methods such as LOCO, which allows for the use of models that are expressive enough  | 
165 |  | -# to explain the data.  | 
 | 165 | +# to explain the data. While d0CRT can use any estimator, its distillation step  | 
 | 166 | +# restricts it from capturing variable interactions.  | 
166 | 167 | 
 
  | 
167 | 168 | 
 
  | 
168 | 169 | #################################################################################  | 
 | 
0 commit comments