Skip to content

Commit ec89712

Browse files
committed
Shouldn't re-run if self.fitted already set. So avoid that when you call fit()
1 parent 2aeac30 commit ec89712

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dsbox/overfitdetector/detector.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ def produce(self, *, inputs: Sequence[Input], timeout: float = None, iterations:
7373
def fit(self, *, timeout: float = None, iterations: int = None):
7474
if iterations is not None:
7575
self.n_sample_iterations = iterations
76-
self.confidence = self.produce(inputs=self.training_inputs, iterations=iterations)
76+
77+
if not self.fitted:
78+
self.confidence = self.produce(inputs=self.training_inputs, iterations=iterations)
79+
else:
80+
self.__logger.debug("Already self.fitted so using prev confidence")
81+
7782
self.fitted = True
7883

7984
def get_confidence(self):

0 commit comments

Comments
 (0)