6 #ifndef TURI_REGR_LOGISTIC_REGRESSION_OPT_INTERFACE_H_ 7 #define TURI_REGR_LOGISTIC_REGRESSION_OPT_INTERFACE_H_ 10 #include <ml/ml_data/ml_data.hpp> 13 #include <toolkits/supervised_learning/standardization-inl.hpp> 14 #include <toolkits/supervised_learning/supervised_learning.hpp> 15 #include <toolkits/supervised_learning/logistic_regression.hpp> 18 #include <ml/optimization/optimization_interface.hpp> 22 namespace supervised {
59 std::map<size_t, float> class_weights = {{0,1.0}, {1, 1.0}};
61 std::shared_ptr<l2_rescaling> scaler;
147 std::vector<std::pair<std::string, size_t>>
156 std::vector<std::string>
get_status(
const DenseVector& coefs,
157 const std::vector<std::string>& stats);
159 double get_validation_accuracy();
160 double get_training_accuracy();
173 gradient,
double & function_value,
const size_t mbStart = 0,
const size_t 186 hessian, DenseVector& gradient,
double & function_value);
198 const DenseVector& point, DenseVector& gradient,
double &function_value);
203 &point, DenseVector& gradient,
double & function_value,
const size_t 204 mbStart = 0,
const size_t mbSize = -1);
size_t num_validation_examples() const
logistic_regression_opt_interface(const ml_data &_data, const ml_data &_valid_data, logistic_regression &_model)
std::vector< std::string > get_status(const DenseVector &coefs, const std::vector< std::string > &stats)
void rescale_solution(DenseVector &coefs)
~logistic_regression_opt_interface()
void set_class_weights(const flexible_type &class_weights)
void compute_validation_first_order_statistics(const DenseVector &point, DenseVector &gradient, double &function_value)
void init_feature_rescaling()
void compute_first_order_statistics(const DenseVector &point, DenseVector &gradient, double &function_value, const size_t mbStart=0, const size_t mbSize=-1)
void set_threads(size_t _n_threads)
std::vector< std::pair< std::string, size_t > > get_status_header(const std::vector< std::string > &stat_names)
void compute_second_order_statistics(const DenseVector &point, DenseMatrix &hessian, DenseVector &gradient, double &function_value)
size_t num_variables() const
size_t num_examples() const
size_t num_classes() const