Skip to content

Commit

Permalink
Suppress sklearn warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
arokem committed May 10, 2017
1 parent cc4374d commit 9df1fe3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dipy/reconst/sfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,10 @@ def fit(self, data, mask=None):
# parameters at all-zeros, and avoid nasty sklearn errors:
if not (np.any(~np.isfinite(vox_data)) or np.all(vox_data == 0)):
fit_it = vox_data - isopredict[vox]
flat_params[vox] = self.solver.fit(self.design_matrix,
fit_it).coef_
with warnings.catch_warnings():
warnings.simplefilter("ignore")
flat_params[vox] = self.solver.fit(self.design_matrix,
fit_it).coef_

if mask is None:
out_shape = data.shape[:-1] + (-1, )
Expand Down

0 comments on commit 9df1fe3

Please sign in to comment.