$ mlpack_logistic_regression --training_file data.csv --labels_file labels.csv --lambda 0.1 --output_model_file lr_model.bin
$ mlpack_logistic_regression --input_model_file lr_model.bin --test_file test.csv --output_file predictions.csv
LogisticRegression ( const MatType & predictors, const arma::Row< size_t > & responses, const double lambda = 0
)
The parameter description for the constructor is as follows :
predictors Input training variables. responses Outputs resulting from input training variables. lambda L2-regularization parameter.
void Classify ( const MatType & dataset, arma::Row< size_t > & labels, const double decisionBoundary = 0.5
) const
Parameters
dataset Set of points to classify. labels Predicted labels for each point. decisionBoundary Decision boundary (default 0.5).
double ComputeAccuracy ( const MatType & predictors, const arma::Row< size_t > & responses, const double decisionBoundary = 0.5
)
Parameters
predictors Input predictors. responses Vector of responses. decisionBoundary Decision boundary (default 0.5).
#include <mlpack/core.hpp>
#include <mlpack/methods/logistic_regression/logistic_regression.hpp>
#include <ensmallen.hpp>
#include <boost/test/unit_test.hpp>
#include "test_tools.hpp"
using namespace mlpack;
using namespace mlpack::regression;
using namespace mlpack::distribution;
Comments