Skip to content

Commit

Permalink
Fixed GaussianProcessRegression
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed May 22, 2012
1 parent b6a6727 commit 9eb2a83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Expand Up @@ -25,6 +25,6 @@
labels=BinaryLabels(trainlab);
gp=GaussianProcessRegression(1.0, kernel, feats_train, labels);
gp.train(feats_train);
out=gp.apply(feats_test).get_labels();
out=gp.apply_regression(feats_test).get_labels();
testerr=mean(sign(out)!=testlab)
print(testerr)
4 changes: 2 additions & 2 deletions src/shogun/regression/GaussianProcessRegression.cpp
Expand Up @@ -52,7 +52,7 @@ void CGaussianProcessRegression::init()
SG_ADD(&m_sigma, "sigma", "Sigma.", MS_AVAILABLE);
}

CLabels* CGaussianProcessRegression::mean_prediction(CFeatures* data)
CRegressionLabels* CGaussianProcessRegression::mean_prediction(CFeatures* data)
{
if (!kernel)
SG_ERROR( "No kernel assigned!\n");
Expand All @@ -79,7 +79,7 @@ CLabels* CGaussianProcessRegression::mean_prediction(CFeatures* data)
return result;
}

CLabels* CGaussianProcessRegression::apply(CFeatures* data)
CRegressionLabels* CGaussianProcessRegression::apply_regression(CFeatures* data)
{
if (data)
{
Expand Down
12 changes: 6 additions & 6 deletions src/shogun/regression/GaussianProcessRegression.h
Expand Up @@ -115,7 +115,7 @@ class CGaussianProcessRegression : public CMachine
* @param data (test)data to be classified
* @return classified labels
*/
virtual CLabels* apply(CFeatures* data=NULL);
virtual CRegressionLabels* apply_regression(CFeatures* data=NULL);

/** get classifier type
*
Expand Down Expand Up @@ -144,19 +144,19 @@ class CGaussianProcessRegression : public CMachine
*/
virtual bool train_machine(CFeatures* data=NULL);
private:

/** function for initialization*/
void init();

/** apply mean prediction from data
*
* @param data (test)data to be classified
* @return classified labels
*/
virtual CLabels* mean_prediction(CFeatures* data);
virtual CRegressionLabels* mean_prediction(CFeatures* data);

private:

/** Observation noise alpha */
float64_t m_sigma;

Expand Down

0 comments on commit 9eb2a83

Please sign in to comment.