6 #ifndef TURI_DML_METADATA_H_ 7 #define TURI_DML_METADATA_H_ 9 #include <ml/ml_data/ml_data_column_modes.hpp> 10 #include <ml/ml_data/data_storage/internal_metadata.hpp> 61 inline const std::shared_ptr<ml_data_internal::column_indexer>&
62 indexer(
size_t column_index)
const;
70 inline const std::shared_ptr<ml_data_internal::column_indexer>&
71 indexer(
const std::string& column_name)
const;
80 inline const std::shared_ptr<ml_data_internal::column_indexer>& target_indexer()
const;
89 inline const std::shared_ptr<ml_data_internal::column_statistics>&
98 inline const std::shared_ptr<ml_data_internal::column_statistics>&
99 statistics(
const std::string& column_name)
const;
101 inline const std::shared_ptr<ml_data_internal::column_statistics>& target_statistics()
const;
109 inline size_t num_columns(
bool include_untranslated_columns =
true)
const;
129 inline const std::string&
column_name(
size_t column_index)
const;
143 inline size_t column_index(
const std::string& column_name,
bool max_on_error =
false)
const;
160 inline size_t column_size(
size_t column_index)
const;
167 inline const flex_nd_vec::index_range_type&
nd_column_shape(
size_t column_index)
const;
174 inline const flex_nd_vec::index_range_type&
nd_column_shape(
const std::string& column_name)
const;
189 inline size_t index_size(
size_t column_index)
const;
199 inline size_t index_size(
const std::string& column_name)
const;
339 std::string
feature_name(
size_t column_idx,
size_t index,
bool quote_string_values =
false)
const;
355 std::vector<std::string>
feature_names(
bool unpack_categorical_columns =
true)
const;
376 inline ml_data_internal::column_metadata_ptr
get_column_metadata(
size_t column_index)
const;
381 void _debug_is_equal(
const std::shared_ptr<ml_metadata>& m)
const;
383 void _debug_is_equal(
const std::shared_ptr<ml_metadata>& m)
const {}
396 friend struct turi::metadata_load;
399 std::vector<ml_data_internal::column_metadata_ptr> columns;
400 ml_data_internal::column_metadata_ptr target;
406 std::vector<std::string> original_column_names;
412 void setup_cached_values();
414 size_t _num_dimensions = size_t(-1);
415 size_t _num_untranslated_columns = size_t(-1);
416 std::map<std::string, size_t> _column_name_to_index_map;
429 #include <ml/ml_data/metadata_impl.hpp> 442 } END_OUT_OF_PLACE_SAVE()
446 arc >> is_not_nullptr;
451 m = std::shared_ptr<turi::ml_metadata>(
nullptr);
453 } END_OUT_OF_PLACE_LOAD()
#define BEGIN_OUT_OF_PLACE_LOAD(arc, tname, tval)
Macro to make it easy to define out-of-place loads.
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
#define BEGIN_OUT_OF_PLACE_SAVE(arc, tname, tval)
Macro to make it easy to define out-of-place saves.