Skip to content

Commit

Permalink
update to more recent sklearn.mixture.GaussianMixture keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Apr 18, 2018
1 parent dbc9ced commit 57099a7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions py/desiutil/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ def save(model, filename):
from astropy.io import fits
hdus = fits.HDUList()
hdr = fits.Header()
hdr['covtype'] = model.covtype
hdus.append(fits.ImageHDU(model.weights, name='weights', header=hdr))
hdus.append(fits.ImageHDU(model.means, name='means'))
hdus.append(fits.ImageHDU(model.covars, name='covars'))
try:
hdr['covtype'] = model.covariance_type
hdus.append(fits.ImageHDU(model.weights_, name='weights', header=hdr))
hdus.append(fits.ImageHDU(model.means_, name='means'))
hdus.append(fits.ImageHDU(model.covariances_, name='covars'))
except:
hdr['covtype'] = model.covtype
hdus.append(fits.ImageHDU(model.weights, name='weights', header=hdr))
hdus.append(fits.ImageHDU(model.means, name='means'))
hdus.append(fits.ImageHDU(model.covars, name='covars'))
hdus.writeto(filename, overwrite=True)

@staticmethod
Expand Down

0 comments on commit 57099a7

Please sign in to comment.