GithubHelp home page GithubHelp logo

fraenkel-lab / mogp Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 1.0 19.49 MB

Mixture of Gaussian Processes Model for Sparse Longitudinal Data

License: BSD 3-Clause "New" or "Revised" License

Python 1.22% Jupyter Notebook 98.73% Shell 0.05%

mogp's People

Contributors

divyaramamoorthy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

hideki105

mogp's Issues

Trouble training the model

Sorry to bother you, thanks for the amazing model! I'm just having trouble training the model with some of my own ALSFRS data. despite not having any missing or infinite values, I keep getting this message at the training stage.

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

Any ideas what I'm doing wrong?

Thanks!

The full error message is as follows:


ValueError Traceback (most recent call last)
/var/folders/s0/t1rd1wdx11s0sngn007g49n40000gn/T/ipykernel_76381/238700026.py in
1 mix = mogp.MoGP_constrained(X= dfTime, Y= dfALS, alpha=1., num_iter=10, savepath=save_dir, rand_seed=0, normalize=True)
----> 2 mix.sample()

~/opt/anaconda3/lib/python3.9/site-packages/mogp/mogp_constrained.py in sample(self)
217 """Sampler for Mixture of Gaussian Process model"""
218
--> 219 self.initialize_sampler(init_K=self.num_init_clusters, onset_anchor=self.onset_anchor)
220 self.allocmodel.calc_suffstats(self.z)
221 idx = np.arange(self.allocmodel.N)

~/opt/anaconda3/lib/python3.9/site-packages/mogp/mogp_constrained.py in initialize_sampler(self, init_K, onset_anchor)
203 # if fewer than specified init K clusters are found, then use largest number of clusters returned by kmeans
204 # kmeans = KMeans(n_clusters=init_K, random_state=self.rand_seed).fit(x_data)
--> 205 kmeans = self.k_means_init(init_K, x_data)
206
207 self.z = kmeans.labels

~/opt/anaconda3/lib/python3.9/site-packages/mogp/mogp_constrained.py in _k_means_init(self, init_K, x_data)
182 def _k_means_init(self, init_K, x_data):
183 # if fewer than specified init K clusters are found, then use largest number of clusters returned by kmeans
--> 184 kmeans = KMeans(n_clusters=init_K, random_state=self.rand_seed, n_init=10).fit(x_data)
185 return kmeans
186

~/opt/anaconda3/lib/python3.9/site-packages/sklearn/cluster/_kmeans.py in fit(self, X, y, sample_weight)
1135 Fitted estimator.
1136 """
-> 1137 X = self._validate_data(
1138 X,
1139 accept_sparse="csr",

~/opt/anaconda3/lib/python3.9/site-packages/sklearn/base.py in _validate_data(self, X, y, reset, validate_separately, **check_params)
564 raise ValueError("Validation should be done on X, y or both.")
565 elif not no_val_X and no_val_y:
--> 566 X = check_array(X, **check_params)
567 out = X
568 elif no_val_X and not no_val_y:

~/opt/anaconda3/lib/python3.9/site-packages/sklearn/utils/validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator)
798
799 if force_all_finite:
--> 800 _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan")
801
802 if ensure_min_samples > 0:

~/opt/anaconda3/lib/python3.9/site-packages/sklearn/utils/validation.py in _assert_all_finite(X, allow_nan, msg_dtype)
112 ):
113 type_err = "infinity" if allow_nan else "NaN, infinity"
--> 114 raise ValueError(
115 msg_err.format(
116 type_err, msg_dtype if msg_dtype is not None else X.dtype

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.