6 #ifndef TURI_GROUPED_SFRAME_HPP 7 #define TURI_GROUPED_SFRAME_HPP 9 #include <model_server/lib/toolkit_class_macros.hpp> 10 #include <core/data/sframe/gl_sframe.hpp> 11 #include <model_server/lib/extensions/model_base.hpp> 12 #include <core/export.hpp> 13 #include <core/parallel/lambda_omp.hpp> 16 std::vector<turi::toolkit_class_specification> get_toolkit_class_registration();
22 inline size_t operator()(std::vector<flexible_type> f)
const {
24 for(
const auto &i : f) {
32 class EXPORT grouped_sframe:
public model_base {
47 void group(
const gl_sframe &sf,
const std::vector<std::string> column_names,
60 gl_sframe get_group(std::vector<flexible_type> key);
65 inline size_t num_groups()
const {
66 return m_range_directory.size();
91 inline void begin_iterator() {
93 m_cur_iterator_idx = 0;
110 std::vector<std::pair<flexible_type,gl_sframe>> iterator_get_next(
size_t len);
134 gl_sframe get_group_by_index(
size_t range_dir_idx);
144 std::vector<size_t> m_range_directory;
145 std::vector<std::string> m_key_col_names;
146 std::vector<flexible_type> m_group_names;
151 std::unordered_map<std::vector<flexible_type>, size_t,
GroupKeyHash> m_key2range;
153 bool m_inited =
false;
155 bool m_iterating =
false;
156 size_t m_cur_iterator_idx = 0;
173 #endif // TURI_GROUPED_SFRAME_HPP #define BEGIN_CLASS_MEMBER_REGISTRATION(python_facing_classname)
#define REGISTER_CLASS_MEMBER_FUNCTION(function,...)
sframe group(sframe sframe_in, std::string key_column)
static uint64_t hash64_combine(uint64_t h1, uint64_t h2)
#define END_CLASS_MEMBER_REGISTRATION
#define REGISTER_GETTER(propname, function)