![]() |
mutable
A Database System for Research and Fast Prototyping
|
A model for predicting the costs of a physical operator. More...
#include <LinearModel.hpp>
Public Member Functions | |
LinearModel (Eigen::VectorXd coefficientVector) | |
Create a LinearModel instance given a coefficient vector. | |
LinearModel (Eigen::VectorXd coefficientVector, unsigned numFeatures, std::function< Eigen::MatrixXd(Eigen::MatrixXd)> transform_function) | |
Create a LinearModel instance given a coefficient vector, a transformation function and the number of expected features. | |
LinearModel (const Eigen::MatrixXd &X, const Eigen::VectorXd &y) | |
Create a LinearModel instance by linear regression given a feature maxtrix X containing training data of the features and target vector y containing expected values for the features in X . | |
LinearModel (const Eigen::MatrixXd &X, const Eigen::VectorXd &y, const std::function< Eigen::MatrixXd(Eigen::MatrixXd)> &transform_function) | |
Create a LinearModel instance by linear regression given a feature maxtrix X containing training data of the features, target vector y containing expected values for the features in X and a transformation function for the features. | |
double | predict_target (const Eigen::RowVectorXd &feature_vector) const |
Eigen::VectorXd | get_coefficients () const |
void | dump (std::ostream &out) const |
void | dump () const |
Private Attributes | |
Eigen::VectorXd | coefficients_ |
vector of coefficients for every feature | |
std::function< Eigen::MatrixXd(Eigen::MatrixXd)> | transformation_ |
transformation that is applied on the feature matrix | |
unsigned | num_features_ |
number of features this model expects pre-transformation | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const LinearModel &linear_model) |
A model for predicting the costs of a physical operator.
Definition at line 11 of file LinearModel.hpp.
|
inlineexplicit |
Create a LinearModel
instance given a coefficient vector.
Definition at line 20 of file LinearModel.hpp.
|
inlineexplicit |
Create a LinearModel
instance given a coefficient vector, a transformation function and the number of expected features.
Definition at line 25 of file LinearModel.hpp.
LinearModel::LinearModel | ( | const Eigen::MatrixXd & | X, |
const Eigen::VectorXd & | y | ||
) |
Create a LinearModel
instance by linear regression given a feature maxtrix X
containing training data of the features and target vector y
containing expected values for the features in X
.
Definition at line 15 of file LinearModel.cpp.
LinearModel::LinearModel | ( | const Eigen::MatrixXd & | X, |
const Eigen::VectorXd & | y, | ||
const std::function< Eigen::MatrixXd(Eigen::MatrixXd)> & | transform_function | ||
) |
Create a LinearModel
instance by linear regression given a feature maxtrix X
containing training data of the features, target vector y
containing expected values for the features in X
and a transformation function for the features.
Definition at line 18 of file LinearModel.cpp.
References coefficients_, num_features_, m::regression_linear_closed_form(), transformation_, and m::X.
void LinearModel::dump | ( | ) | const |
void LinearModel::dump | ( | std::ostream & | out | ) | const |
Definition at line 57 of file LinearModel.cpp.
|
inline |
Definition at line 42 of file LinearModel.hpp.
Referenced by m::CostModelFactory::generate_filter_cost_model(), m::CostModelFactory::generate_group_by_cost_model(), and m::CostModelFactory::generate_join_cost_model().
double LinearModel::predict_target | ( | const Eigen::RowVectorXd & | feature_vector | ) | const |
Definition at line 29 of file LinearModel.cpp.
References m::and, coefficients_, M_insist, num_features_, and transformation_.
|
friend |
|
private |
vector of coefficients for every feature
Definition at line 13 of file LinearModel.hpp.
Referenced by LinearModel(), and predict_target().
|
private |
number of features this model expects pre-transformation
Definition at line 16 of file LinearModel.hpp.
Referenced by LinearModel(), and predict_target().
|
private |
transformation that is applied on the feature matrix
Definition at line 15 of file LinearModel.hpp.
Referenced by LinearModel(), and predict_target().