24 [[nodiscard]] std::shared_ptr<const GenericFeatureMatrix>
get_features()
const;
27 [[nodiscard]] std::shared_ptr<GenericFeatureMatrix>
edit_features();
37 [[nodiscard]] virtual
long num_labels() const noexcept = 0;
77 [[nodiscard]]
long num_labels() const noexcept override;
89 DatasetBase(x.markAsRValue()), m_Labels(std::move(y)) {
97 [[nodiscard]]
long num_labels() const noexcept override;
104 [[nodiscard]] const std::vector<
long>& get_label_instances(
label_id_t label) const;
108 [[nodiscard]] const std::vector<std::vector<
long>>& all_labels()
const {
return m_Labels; }
Collects the data related to a single optimization problem.
BinaryData(SparseFeatures x, std::shared_ptr< BinaryLabelVector > y)
virtual long num_negatives(label_id_t id) const
long num_examples() const noexcept
Get the total number of instances, i.e. the number of rows in the feature matrix.
DatasetBase & operator=(const DatasetBase &)=default
DatasetBase(DatasetBase &&)=default
DatasetBase(const DatasetBase &)=default
std::shared_ptr< const BinaryLabelVector > get_labels(label_id_t id) const
virtual long num_positives(label_id_t id) const
std::shared_ptr< const GenericFeatureMatrix > get_features() const
get a shared pointer to the (immutable) feature data
std::shared_ptr< GenericFeatureMatrix > m_Features
DatasetBase & operator=(DatasetBase &&)=default
virtual long num_labels() const noexcept=0
long num_features() const noexcept
Get the total number of features, i.e. the number of columns in the feature matrix.
virtual ~DatasetBase()=default
std::shared_ptr< GenericFeatureMatrix > edit_features()
get a shared pointer to mutable feature data. Use with care.
std::vector< std::vector< long > > m_Labels
MultiLabelData(SparseFeatures x, std::vector< std::vector< long >> y)
MultiLabelData(DenseFeatures x, std::vector< std::vector< long >> y)
Strong typedef for an int to signify a label id.
Main namespace in which all types, classes, and functions are defined.
types::DenseRowMajor< real_t > DenseFeatures
Dense Feature Matrix in Row Major format.
types::DenseVector< std::int8_t > BinaryLabelVector
Dense vector for storing binary labels.
types::SparseRowMajor< real_t > SparseFeatures
Sparse Feature Matrix in Row Major format.