Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
70463d5
[skip doc] remove dict and add tests
jpaillard Sep 2, 2025
14352f1
[skip doc] remove useless lines
jpaillard Sep 2, 2025
f68b292
adapt examples
jpaillard Sep 2, 2025
8677b5f
[build doc] improve doc explamation
jpaillard Sep 2, 2025
feb5a4b
add test for error
jpaillard Sep 2, 2025
255f14a
try to cover missing line
jpaillard Sep 2, 2025
c4c3af6
move screening out of the class so that it can be re-used
jpaillard Sep 2, 2025
946217c
set to 0 non selected coef
jpaillard Sep 2, 2025
de0c4cf
set coef to 0 in classification
jpaillard Sep 3, 2025
58afd82
fix docstring
jpaillard Sep 3, 2025
bb961a8
a decision_function to the list of prediction methods
jpaillard Sep 4, 2025
d9aee7c
add transform to the list
jpaillard Sep 4, 2025
1df0c82
remove transform
jpaillard Sep 5, 2025
8f7c50d
remove sentence on d1CRT
jpaillard Sep 5, 2025
abb1cfb
fix regression typo
jpaillard Sep 5, 2025
582fd3f
add line
jpaillard Sep 5, 2025
51a0522
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 7, 2025
b700347
Update test/test_distilled_conditional_randomization_test.py
jpaillard Sep 7, 2025
5aad988
Update test/test_distilled_conditional_randomization_test.py
jpaillard Sep 7, 2025
07239b0
Update test/test_distilled_conditional_randomization_test.py
jpaillard Sep 7, 2025
d7206c7
fix all typos
jpaillard Sep 7, 2025
8cb08cb
set default random_state to None
jpaillard Sep 7, 2025
fe27364
Merge branch 'main' of github.com:mind-inria/hidimstat into 369-d0crt…
jpaillard Sep 7, 2025
02c1eb6
formatting
jpaillard Sep 7, 2025
6c5d3ab
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 8, 2025
462153d
underscore after selection_set
jpaillard Sep 8, 2025
4e215e4
fix test
jpaillard Sep 8, 2025
9f663b3
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 8, 2025
4373310
remove is_lasso att
jpaillard Sep 8, 2025
8acbfa1
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 8, 2025
b34546e
Merge branch '369-d0crt-accept-scikit-learn-models-directly-instead-o…
jpaillard Sep 8, 2025
d706870
set underscore attributes to None in init, update check_fit
jpaillard Sep 8, 2025
43cb619
remove coefficient from check_fit
jpaillard Sep 8, 2025
92829ad
Merge branch 'main' into 369-d0crt-accept-scikit-learn-models-directl…
lionelkusch Sep 9, 2025
947fe83
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 10, 2025
e6cb9d1
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 10, 2025
19dd850
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 10, 2025
06d79b3
format
jpaillard Sep 10, 2025
d386573
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 11, 2025
2a1d53c
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 11, 2025
c2ccac3
Update src/hidimstat/distilled_conditional_randomization_test.py
jpaillard Sep 11, 2025
c3f9f01
remove lasso_model_ from attributes
jpaillard Sep 11, 2025
056a0d3
Merge branch '369-d0crt-accept-scikit-learn-models-directly-instead-o…
jpaillard Sep 11, 2025
469470b
add docstring
jpaillard Sep 11, 2025
32b7b8d
Merge branch 'main' into 369-d0crt-accept-scikit-learn-models-directl…
lionelkusch Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/plot_dcrt_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
y = np.maximum(0.0, y)

## dcrt Lasso ##
d0crt_lasso = D0CRT(estimator=LassoCV(random_state=42, n_jobs=1), screening=False)
d0crt_lasso = D0CRT(
estimator=LassoCV(random_state=42, n_jobs=1), screening_threshold=None
)
d0crt_lasso.fit_importance(X, y)
pvals_lasso = d0crt_lasso.pvalues_
results_list.append(
Expand All @@ -73,7 +75,7 @@
## dcrt Random Forest ##
d0crt_random_forest = D0CRT(
estimator=RandomForestRegressor(n_estimators=100, random_state=42, n_jobs=1),
screening=False,
screening_threshold=None,
)
d0crt_random_forest.fit_importance(X, y)
pvals_forest = d0crt_random_forest.pvalues_
Expand Down
11 changes: 6 additions & 5 deletions examples/plot_model_agnostic_importance.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from sklearn.model_selection import KFold
from sklearn.svm import SVC

from hidimstat import LOCO, D0CRT
from hidimstat import D0CRT, LOCO

#############################################################################
# Generate data where classes are not linearly separable
Expand Down Expand Up @@ -70,11 +70,11 @@
# test (:math:`H_0: X_j \perp\!\!\!\perp y | X_{-j}`) for each variable. However,
# this test is based on a linear model (LogisticRegression) and fails to reject the null
# in the presence of non-linear relationships.
d0crt_linear = D0CRT(estimator=clone(linear_model), screening=False)
d0crt_linear = D0CRT(estimator=clone(linear_model), screening_threshold=None)
d0crt_linear.fit_importance(X, y)
pval_dcrt_linear = d0crt_linear.pvalues_

d0crt_non_linear = D0CRT(estimator=clone(non_linear_model), screening=False)
d0crt_non_linear = D0CRT(estimator=clone(non_linear_model), screening_threshold=None)
d0crt_non_linear.fit_importance(X, y)
pval_dcrt_non_linear = d0crt_non_linear.pvalues_

Expand Down Expand Up @@ -162,8 +162,9 @@
# As expected, when using linear models (d0CRT and LOCO-linear) that are misspecified,
# the varibles are not selected. This highlights the benefit of using model-agnostic
# methods such as LOCO, which allows for the use of models that are expressive enough
# to explain the data.

# to explain the data. While d0CRT can use any estimator, its distillation step
# restricts it from capturing variable interactions. A more advanced distillation
# approach, such as d1CRT, may help overcome this limitation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we provide no implementation of d1CRT, we should not make any claim on it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the last sentence


#################################################################################
# References
Expand Down
Loading
Loading