mlpack
Functions
bayesian_linear_regression_main.cpp File Reference
#include <mlpack/prereqs.hpp>
#include <mlpack/core/util/io.hpp>
#include <mlpack/core/util/mlpack_main.hpp>
#include "bayesian_linear_regression.hpp"
Include dependency graph for bayesian_linear_regression_main.cpp:
This graph shows which files directly or indirectly include this file:

Functions

 BINDING_NAME ("BayesianLinearRegression")
 
 BINDING_SHORT_DESC ("An implementation of the bayesian linear regression.")
 
 BINDING_LONG_DESC ("An implementation of the bayesian linear regression." "\ "This model is a probabilistic view and implementation of the linear " "regression. The final solution is obtained by computing a posterior " "distribution from gaussian likelihood and a zero mean gaussian isotropic " " prior distribution on the solution. " "\" "Optimization is AUTOMATIC and does not require cross validation. " "The optimization is performed by maximization of the evidence function. " "Parameters are tuned during the maximization of the marginal likelihood. " "This procedure includes the Ockham 's razor that penalizes over complex " "solutions. " "\\" "This program is able to train a Bayesian linear regression model or load " "a model from file, output regression predictions for a test set, and save " "the trained model to a file." "\\" "To train a BayesianLinearRegression model, the "+PRINT_PARAM_STRING("input")+" and "+PRINT_PARAM_STRING("responses")+"parameters must be given. The "+PRINT_PARAM_STRING("center")+"and "+PRINT_PARAM_STRING("scale")+" parameters control the " "centering and the normalizing options. A trained model can be saved with " "the "+PRINT_PARAM_STRING("output_model")+". If no training is desired " "at all, a model can be passed via the "+PRINT_PARAM_STRING("input_model")+" parameter." "\\" "The program can also provide predictions for test data using either the " "trained model or the given input model. Test points can be specified " "with the "+PRINT_PARAM_STRING("test")+" parameter. Predicted " "responses to the test points can be saved with the "+PRINT_PARAM_STRING("predictions")+" output parameter. The " "corresponding standard deviation can be save by precising the "+PRINT_PARAM_STRING("stds")+" parameter.")
 
 BINDING_EXAMPLE ("For example, the following command trains a model on the data "+PRINT_DATASET("data")+" and responses "+PRINT_DATASET("responses")+"with center set to true and scale set to false (so, Bayesian " "linear regression is being solved, and then the model is saved to "+PRINT_MODEL("blr_model")+":" "\"+PRINT_CALL("bayesian_linear_regression", "input", "data", "responses", "responses", "center", 1, "scale", 0, "output_model", "blr_model")+"\" "The following command uses the "+PRINT_MODEL("blr_model")+" to provide predicted "+" responses for the data "+PRINT_DATASET("test")+" and save those "+" responses to "+PRINT_DATASET("test_predictions")+": " "\"+PRINT_CALL("bayesian_linear_regression", "input_model", "blr_model", "test", "test", "predictions", "test_predictions")+"\" "Because the estimator computes a predictive distribution instead of " "a simple point estimate, the "+PRINT_PARAM_STRING("stds")+" parameter " "allows one to save the prediction uncertainties: " "\"+PRINT_CALL("bayesian_linear_regression", "input_model", "blr_model", "test", "test", "predictions", "test_predictions", "stds", "stds"))
 
 BINDING_SEE_ALSO ("Bayesian Interpolation", "https://authors.library.caltech.edu/13792/1/MACnc92a.pdf")
 
 BINDING_SEE_ALSO ("Bayesian Linear Regression, Section 3.3", "MLA Bishop, Christopher M. Pattern Recognition and Machine " "Learning. New York :Springer, 2006, section 3.3.")
 
 BINDING_SEE_ALSO ("mlpack::regression::BayesianLinearRegression C++ class " "documentation", "@doxygen/classmlpack_1_1regression_1_1BayesianLinearRegression.html")
 
 PARAM_MATRIX_IN ("input", "Matrix of covariates (X).", "i")
 
 PARAM_ROW_IN ("responses", "Matrix of responses/observations (y).", "r")
 
 PARAM_MODEL_IN (BayesianLinearRegression, "input_model", "Trained " "BayesianLinearRegression model to use.", "m")
 
 PARAM_MODEL_OUT (BayesianLinearRegression, "output_model", "Output " "BayesianLinearRegression model.", "M")
 
 PARAM_MATRIX_IN ("test", "Matrix containing points to regress on (test " "points).", "t")
 
 PARAM_MATRIX_OUT ("predictions", "If --test_file is specified, this " "file is where the predicted responses will be saved.", "o")
 
 PARAM_MATRIX_OUT ("stds", "If specified, this is where the standard deviations " "of the predictive distribution will be saved.", "u")
 
 PARAM_FLAG ("center", "Center the data and fit the intercept if enabled.", "c")
 
 PARAM_FLAG ("scale", "Scale each feature by their standard deviations if " "enabled.", "s")
 

Detailed Description

Author
Clement Mercier

Executable for BayesianLinearRegression.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.