fraenkel-lab / mogp Goto Github PK
View Code? Open in Web Editor NEWMixture of Gaussian Processes Model for Sparse Longitudinal Data
License: BSD 3-Clause "New" or "Revised" License
Mixture of Gaussian Processes Model for Sparse Longitudinal Data
License: BSD 3-Clause "New" or "Revised" License
Thanks for providing this amazing work. My use case is mapping from a 2d sequence to another 2d sequence. How can I modify the code to achieve this goal?
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').
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.