6 #ifndef TURI_CLASS_LINEAR_SVM_H_ 7 #define TURI_CLASS_LINEAR_SVM_H_ 10 #include <ml/ml_data/ml_data.hpp> 11 #include <core/data/sframe/gl_sframe.hpp> 14 #include <toolkits/supervised_learning/supervised_learning.hpp> 15 #include <toolkits/coreml_export/mlmodel_wrapper.hpp> 18 #include <ml/optimization/optimization_interface.hpp> 20 #include <core/export.hpp> 23 namespace supervised {
25 class linear_svm_scaled_logistic_opt_interface;
40 Eigen::Matrix<double, Eigen::Dynamic,1>
coefs;
41 std::shared_ptr<linear_svm_scaled_logistic_opt_interface>
42 scaled_logistic_svm_interface;
46 static constexpr
size_t SVM_MODEL_VERSION = 5;
56 set_evaluation_metric({
81 void model_specific_init(
const ml_data& data,
82 const ml_data& valid_data)
override;
89 void train()
override;
96 void init_options(
const std::map<std::string,flexible_type>& _opts)
override;
102 size_t get_version()
const override;
107 void set_coefs(
const DenseVector& _coefs)
override;
130 const DenseVector& x,
131 const prediction_type_enum& output_type=prediction_type_enum::NA)
override;
143 const SparseVector& x,
144 const prediction_type_enum& output_type=prediction_type_enum::NA)
override;
156 const std::string& output_type=
"")
override;
165 const std::vector<flexible_type>& rows,
166 const std::string& missing_value_action =
"error")
override;
172 _coefs.resize(coefs.size());
176 std::shared_ptr<coreml::MLModelWrapper> export_to_coreml()
override;
#define BEGIN_CLASS_MEMBER_REGISTRATION(python_facing_classname)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
#define IMPORT_BASE_CLASS_REGISTRATION(base_class)
void set_default_evaluation_metric() override
#define END_CLASS_MEMBER_REGISTRATION
Eigen::Matrix< double, Eigen::Dynamic, 1 > coefs
void get_coefficients(DenseVector &_coefs) const
void set_default_tracking_metric() override
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
bool is_classifier() const override