Python - Kriging (Gaussian Process) in scikit_learn

前端 未结 2 467
旧时难觅i
旧时难觅i 2021-01-05 04:25

I am considering using this method to interpolate some 3D points I have. As an input I have atmospheric concentrations of a gas at various elevations over an area. The data

2条回答
  •  暖寄归人
    2021-01-05 05:30

    In the 2d case, something like this should work:

    import numpy as np
    from sklearn.gaussian_process import GaussianProcess
    
    x = np.arange(1,51)
    y = np.arange(1,51)
    X, Y = np.meshgrid(lons, lats)
    
    points = zip(obs_x,  obs_y)
    values = obs_data    # Replace with your observed data
    
    gp = GaussianProcess(theta0=0.1, thetaL=.001, thetaU=1., nugget=0.001)
    gp.fit(points, values)
    XY_pairs = np.column_stack([X.flatten(), Y.flatten()])
    predicted = gp.predict(XY_pairs).reshape(X.shape)
    

提交回复
热议问题