6 #ifndef TURI_ML_DATA_ROW_TYPES_H_ 7 #define TURI_ML_DATA_ROW_TYPES_H_ 10 #include <toolkits/ml_data_2/ml_data_entry.hpp> 11 #include <toolkits/ml_data_2/metadata.hpp> 13 #include <Eigen/SparseCore> 14 #include <core/data/flexible_type/flexible_type.hpp> 16 namespace turi {
namespace v2 {
18 typedef Eigen::Matrix<double, Eigen::Dynamic,1> dense_vector;
19 typedef Eigen::SparseVector<double> sparse_vector;
21 class composite_row_specification;
93 : subrow_spec(_subrow_specs)
96 std::vector<dense_vector> dense_subrows;
97 std::vector<sparse_vector> sparse_subrows;
98 std::vector<std::vector<flexible_type> > flex_subrows;
106 std::shared_ptr<composite_row_specification> subrow_spec;
109 std::vector<size_t> buffer;
110 std::vector<flexible_type> flextype_buffer;
128 size_t add_sparse_subrow(
const std::vector<size_t>& column_indices);
134 size_t add_dense_subrow(
const std::vector<size_t>& column_indices);
140 size_t add_flex_type_subrow(
const std::vector<size_t>& column_indices);
146 std::shared_ptr<ml_metadata> metadata;
148 size_t n_dense_subrows = 0;
149 size_t n_sparse_subrows = 0;
150 size_t n_flex_subrows = 0;
154 std::vector<std::vector<size_t> > dense_spec;
155 std::vector<std::vector<size_t> > sparse_spec;
159 std::vector<std::vector<size_t> > flex_subrow_spec_by_subrow;
162 std::vector<size_t> dense_spec_sizes;
163 std::vector<size_t> sparse_spec_sizes;