[Tutor] Gaussian process regression
Steven D'Aprano
steve at pearwood.info
Fri Feb 27 02:57:00 CET 2015
On Fri, Feb 27, 2015 at 03:04:25AM +0900, Huijae wrote:
> Hi, I am trying to use Gaussian process regression for Near Infrared
> spectra. I have reference data(spectra), concentrations of reference
> data and sample data, and I am trying to predict concentrations of
> sample data. Here is my code. from sklearn.gaussian_process import
> GaussianProcess gp = GaussianProcess() gp.fit(reference,
> concentration) concentration_pred = gp.predict(sample) The results
> always gave me the same concentration even though I used different
> sample data. When I used some parts of reference data as sample data,
> it predicted concentration well. But whenever I use different data
> than reference data, it always gave me the same concentration. Can I
> get some help with this problem? What am I doing wrong? I would
> appreciate any help. Thanks, Jay
Your mail program has mangled your code and mixed up the layout. I
suggest turning off all formatting, "Rich Text" or HTML mail, since that
usually destroys the layout of code.
I'm going to try to guess your code's layout:
from sklearn.gaussian_process import GaussianProcess
gp = GaussianProcess()
gp.fit(reference, concentration)
concentration_pred = gp.predict(sample)
This is not enough for us to give any meaningful advice. What is
"sklearn"? What are "reference", "concentration", "sample"? We'd need
to see actual data, and know what GaussianProcess does, to help.
> The results always gave me the same concentration
> even though I used different sample data.
*Exactly* the same? To 17 decimal places? Or just close to the same?
Perhaps the different samples give the same result because they are
samples from the same population.
> When I used some parts of
> reference data as sample data, it predicted concentration well. But
> whenever I use different data than reference data, it always gave me
> the same concentration.
You may need to ask people who know more about GaussianProcess and how
it works.
--
Steve
More information about the Tutor
mailing list