Skip to content

Implementation of GP-BART algorithm.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

MateusMaiaDS/gpbart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GP-BART

Installation

You can install the development version:

devtools::install_github("MateusMaiaDS/gpbart")

Setting a example

This a vignette to explain how to run a simple example of the model, setting its own prior and its hyperparameters. To start we going to use the friedman example as the dataset to be used.

library(gpbart)
library(mlbench)

# Setting simulation parameters
n <- 100
seed <- 42
sd <- 0.1

# Loading the data
fried_data <- as.data.frame(mlbench::mlbench.friedman1(n = n,sd = 0.1))

# Setting a cross-validation object
cv_obj <- k_fold(data = fried_data,dependent_variable = "y",
                 k_partitions = 5,seed = seed,as_data_frame = TRUE)

# Selecting one fold
fold <- 2
x_train <- cv_obj[[fold]]$x_train
y_train <- c(unlist(cv_obj[[fold]]$y_train))
x_test <- cv_obj[[fold]]$x_test
y_test <- cv_obj[[fold]]$y_test


Running the model

To run the model we would have:

gp_bart_mod <- gpbart(x_train = x_train,
                       y = c(unlist(y_train)),
                       x_test = x_test,
                       n_tree = 20)

About

Implementation of GP-BART algorithm.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published