GithubHelp home page GithubHelp logo

gaussianprocess's Introduction

gaussianProcess

R package for Gaussian Process regression with various kernels

Usage

If X is a matrix of training covariates and y a vector of training targets then you create a gaussianProcess and automatically tune the hyper parameters with various options (see doc) with

gp <- gaussianProcess(X,y,options)

To predict the output for a new data matrix X.new run

pred <- predict(gp, X.new)

Here pred is a list with the posterior mean in pred$mean and the posterior covariance in pred$covariance. If in 1 dimension, you can plot the posterior process between x.min and x.max with

plot(gp, x.min, x.max)

Using a mean function

If you define a mean function mean.f that takes in a matrix and returns a vector you can use this as the mean function for the GP with

gp <- gaussianProcess(X,y, meanFunc=mean.f)

For instance you can use glmnet to train a mean function to pass into the GP as follows. Fit with glmnet (e.g. with lambda=1), get the beta and create the mean function:

fit <- glmnet(x, y, lambda=1)
beta <- fit$beta
mean.f <- function(x) x %*% beta

Or you can use the pryr package to do a partial application

fit <- glmnet(x, y, lambda=1)
mean.f <- pryr::partial(predict, object=fit)

Cross Validation

You can Leave One Out CV errors (true - predicted) for all data points with loocv(gp)

gaussianprocess's People

Contributors

ebenmichael avatar

Stargazers

 avatar M. Amalan avatar Kevin Josey avatar  avatar 刘洋洋 avatar  avatar Maarten Slagter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.