Skip to content
Merged
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions ezyrb/reducedordermodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ def kfold_cv_error(self, n_splits, *args, norm=np.linalg.norm, **kwargs):
for train_index, test_index in kf.split(self.database):
new_db = self.database[train_index]
rom = type(self)(new_db, copy.deepcopy(self.reduction),
copy.deepcopy(self.approximation)).fit(
copy.deepcopy(self.approximation),
plugins=[copy.deepcopy(p) for p in self.plugins]).fit(
*args, **kwargs)

error.append(rom.test_error(self.database[test_index], norm))
Expand Down Expand Up @@ -487,7 +488,8 @@ def loo_error(self, *args, norm=np.linalg.norm, **kwargs):
new_db = self.database[indeces]
test_db = self.database[~indeces]
rom = type(self)(new_db, copy.deepcopy(self.reduction),
copy.deepcopy(self.approximation)).fit()
copy.deepcopy(self.approximation),
plugins=[copy.deepcopy(p) for p in self.plugins]).fit()

error[j] = rom.test_error(test_db)

Expand Down Expand Up @@ -860,6 +862,7 @@ def kfold_cv_error(self, n_splits, *args, norm=np.linalg.norm, relative=True,
kf = KFold(n_splits=n_splits)
for train_index, test_index in kf.split(self.database):
new_db = self.database[train_index]
# TODO: Fix plugins handling - should pass: plugins=[copy.deepcopy(p) for p in self.plugins]
rom = type(self)(new_db, copy.deepcopy(self.reduction),
copy.deepcopy(self.approximation)).fit(
*args, **kwargs)
Expand Down Expand Up @@ -896,6 +899,7 @@ def loo_error(self, *args, norm=np.linalg.norm, **kwargs):

new_db = self.database[indeces]
test_db = self.database[~indeces]
# TODO: Fix plugins handling - should pass: plugins=[copy.deepcopy(p) for p in self.plugins]
rom = type(self)(new_db, copy.deepcopy(self.reduction),
copy.deepcopy(self.approximation)).fit()

Expand Down