6 #ifndef TURI_DML_METADATA_IMPL_H_ 7 #define TURI_DML_METADATA_IMPL_H_ 17 inline ml_data_internal::column_metadata_ptr
28 auto it = _column_name_to_index_map.find(_column_name);
30 bool is_present = (it != _column_name_to_index_map.end());
33 return LIKELY(is_present) ? it->second : size_t(-1);
35 if(UNLIKELY(!is_present)) {
36 log_and_throw((std::string(
"Column ") + _column_name +
" not found in model metadata.").c_str());
49 return (_column_name_to_index_map.find(column_name) != _column_name_to_index_map.end());
54 return (target !=
nullptr);
60 inline const std::shared_ptr<ml_data_internal::column_indexer>&
65 inline const std::shared_ptr<ml_data_internal::column_indexer>&
74 inline const std::shared_ptr<ml_data_internal::column_statistics>&
79 inline const std::shared_ptr<ml_data_internal::column_statistics>&
86 size_t nc = columns.size();
88 if(!include_untranslated_columns)
95 DASSERT_NE(_num_untranslated_columns,
size_t(-1));
96 return _num_untranslated_columns;
117 DASSERT_NE(_num_dimensions,
size_t(-1));
118 return _num_dimensions;
138 inline const std::shared_ptr<ml_data_internal::column_indexer>&
139 ml_metadata::target_indexer()
const {
141 return target->indexer;
144 inline const std::shared_ptr<ml_data_internal::column_statistics>&
145 ml_metadata::target_statistics()
const {
147 return target->statistics;
173 return target->column_size();
201 return target->index_size();
280 return target->original_column_type;
static GL_HOT_INLINE_FLATTEN bool mode_is_categorical(ml_column_mode mode)
static GL_HOT_INLINE_FLATTEN bool mode_is_indexed(ml_column_mode mode)
#define DASSERT_TRUE(cond)