6 #ifndef TURI_FEATURE_ENGINEERING_COUNT_FEATURIZER_HPP 7 #define TURI_FEATURE_ENGINEERING_COUNT_FEATURIZER_HPP 8 #include <model_server/lib/toolkit_class_macros.hpp> 9 #include <toolkits/feature_engineering/transformer_base.hpp> 10 #include <ml/sketches/countmin.hpp> 11 #include <core/export.hpp> 17 namespace feature_engineering {
62 static constexpr
size_t count_featurizer_VERSION = 0;
63 static constexpr
char COUNTS_PREFIX[] =
"count_";
64 static constexpr
char PROBABILITY_PREFIX[] =
"prob_";
69 size_t get_version()
const override;
70 void save_impl(
oarchive& oarc)
const override;
71 void load_version(
iarchive& iarc,
size_t version)
override;
74 void init_options(
const std::map<std::string,
76 void init_transformer(
const std::map<std::string,
84 struct transform_state {
87 double laplace_smearing = 0.0;
88 std::string count_column_prefix;
89 std::string prob_column_prefix;
90 std::vector<flexible_type> y_values;
94 std::vector<sketches::countmin<flexible_type>>
113 std::vector<std::string> feature_columns;
115 bool exclude =
false;
120 std::shared_ptr<transform_state> m_state;
#define BEGIN_CLASS_MEMBER_REGISTRATION(python_facing_classname)
#define REGISTER_CLASS_MEMBER_FUNCTION(function,...)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
const std::map< std::string, flexible_type > & get_current_options() const
#define END_CLASS_MEMBER_REGISTRATION
gl_sframe transform(gl_sframe data) override
const variant_type & get_value_from_state(std::string key)
std::vector< std::string > list_fields()
void fit(gl_sframe data) override
#define REGISTER_NAMED_CLASS_MEMBER_FUNCTION(name, function,...)
std::map< std::string, flexible_type > get_default_options() const
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
void transform(S &&input, T &&output, TransformFn transformfn, std::set< size_t > constraint_segments=std::set< size_t >())
void init_transformer(const std::map< std::string, flexible_type > &_options) override