How to correctly use scikit-learn's Gaussian Process for a 2D-inputs, 1D-output regression?

后端 未结 2 1961
情深已故
情深已故 2020-12-28 14:54

Prior to posting I did a lot of searches and found this question which might be exactly my problem. However, I tried what is proposed in the answer but unfortunately this di

2条回答
  •  囚心锁ツ
    2020-12-28 15:17

    I'm also fairly new using scikit-learn gaussian process. But after some effort, I managed to implement a 3-d gaussian process regression successfully. There are a lot of examples of 1-d regression but nothing on higher input dimensions.

    Perhaps you could show the values that you are using.

    I found that sometimes the format in which you send the inputs can produce some issues. Try formatting input X as:

    X = np.array([param1, param2]).T
    

    and format the output as:

    gp.fit(X, y.reshape(-1,1))
    

    Also, as I understood, the implementation assumes a mean function m=0. If the output you are trying to regress presents an average value which differs significantly from 0 you should normalize it (that will probably solve your problem). Standardizing the parameter space will help as well.

提交回复
热议问题