Skip to content

Commit 7171f54

Browse files
committed
bug fix in MDI+ get_scores using X_test
* LOO ppms should not use loo predictions in MDI+ computation when sample_split != "loo"
1 parent a93459a commit 7171f54

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

imodels/importance/mdi_plus.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from scipy.spatial.distance import pdist
44
from functools import partial
55

6-
from .ppms import PartialPredictionModelBase, GenericRegressorPPM, GenericClassifierPPM
6+
from .ppms import PartialPredictionModelBase, GenericRegressorPPM, GenericClassifierPPM, _GlmPPM
77
from .block_transformers import _blocked_train_test_split
88
from .ranking_stability import tauAP_b, rbo
99

@@ -309,6 +309,9 @@ def __init__(self, estimator, transformer, scoring_fns, local_scoring_fns=False,
309309
_validate_sample_split(self.sample_split, self.estimator, isinstance(self.estimator, PartialPredictionModelBase))
310310
if self.sample_split in ["oob", "inbag"] and not self.tree_random_state:
311311
raise ValueError("Must specify tree_random_state to use 'oob' or 'inbag' sample_split.")
312+
if isinstance(self.estimator, _GlmPPM):
313+
if self.estimator.loo and self.sample_split != "loo":
314+
self.estimator.loo = False
312315
self.mode = mode
313316
self.task = task
314317
self.center = center

0 commit comments

Comments
 (0)