6 #ifndef TURI_CLASS_LINEAR_SVM_OPT_INTERFACE_H_ 7 #define TURI_CLASS_LINEAR_SVM_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/linear_svm.hpp> 18 #include <ml/optimization/optimization_interface.hpp> 22 namespace supervised {
61 std::map<int, float> class_weights = {{0,1.0}, {1, 1.0}};
64 std::shared_ptr<l2_rescaling> scaler;
67 bool is_dense =
false;
139 std::vector<std::pair<std::string, size_t>>
148 std::vector<std::string>
get_status(
const DenseVector& coefs,
149 const std::vector<std::string>& stats);
167 double get_validation_accuracy();
168 double get_training_accuracy();
181 gradient,
double & function_value,
const size_t mbStart = 0,
const size_t std::vector< std::string > get_status(const DenseVector &coefs, const std::vector< std::string > &stats)
size_t num_examples() const
~linear_svm_scaled_logistic_opt_interface()
void set_gamma(const double _gamma)
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)
linear_svm_scaled_logistic_opt_interface(const ml_data &_data, const ml_data &_valid_data, linear_svm &model)
void set_class_weights(const flexible_type &class_weights)
size_t num_validation_examples() const
void rescale_solution(DenseVector &coefs)
void compute_first_order_statistics(const DenseVector &point, DenseVector &gradient, double &function_value, const size_t mbStart=0, const size_t mbSize=-1)
size_t num_classes() const
size_t num_variables() const
void init_feature_rescaling()