pyKriging icon indicating copy to clipboard operation
pyKriging copied to clipboard

Prediction with multiple inputs

Open mill1016 opened this issue 6 years ago • 4 comments

Hello, let's say I have set-up and trained my model,

k = kriging(np.array(X),np.array(y)) k.train(optimizer=optimizer)

where X has 50rows and 13 columns.

I now want to use it to predict new outputs, where the input vector, X_new, is 100 x 12 (list, array, dataframe, ??). Is there a way to predice all 100 rows at the same time or do we need to loop.

I can't get this to work, but would like it too prediction = k.predict(X_new)

Any suggestions?

Thanks.

mill1016 avatar Feb 19 '19 19:02 mill1016

i have met the same problem,i used loop,the algorithm runs slowly because of it.

haomjc avatar Mar 13 '19 08:03 haomjc

I had the same issue, I used loop too. I think the speed of the algorithm depends on the training data. It takes little time to predict but quite a while to train using over 100 input data

lumedee007 avatar Mar 13 '19 16:03 lumedee007

@mill1016 @haomjc can you share more details about the error? That should work, if your array is correct. See the plotting function in krige.py for an example of predicting many points in one prediction call.

@lumedee007 You're correct, training takes a long time relative to predictions. Two hyperparameters are created for every dimension you add. These parameters are tuned during fitting. pyKriging uses a blend of global optimization and local optimization to best tune these parameters. Given the complexity of this problem, traning can take some time. Once the most optimal hyperparameters are found, predictions become some simple matrix calculations. This makes prediction very fast.

capaulson avatar Mar 16 '19 04:03 capaulson

can anyone share how to use CoKriging using this package?

trivediashutosh avatar May 04 '23 07:05 trivediashutosh