DiSMEC++
|
Collects the data related to a single optimization problem. More...
#include <data.h>
Public Member Functions | |
BinaryData (SparseFeatures x, std::shared_ptr< BinaryLabelVector > y) | |
long | num_labels () const noexcept override |
void | get_labels (label_id_t i, Eigen::Ref< BinaryLabelVector > target) const override |
![]() | |
virtual | ~DatasetBase ()=default |
DatasetBase (const DatasetBase &)=default | |
DatasetBase (DatasetBase &&)=default | |
DatasetBase & | operator= (DatasetBase &&)=default |
DatasetBase & | operator= (const DatasetBase &)=default |
std::shared_ptr< const GenericFeatureMatrix > | get_features () const |
get a shared pointer to the (immutable) feature data More... | |
std::shared_ptr< GenericFeatureMatrix > | edit_features () |
get a shared pointer to mutable feature data. Use with care. More... | |
long | num_features () const noexcept |
Get the total number of features, i.e. the number of columns in the feature matrix. More... | |
long | num_examples () const noexcept |
Get the total number of instances, i.e. the number of rows in the feature matrix. More... | |
virtual long | num_positives (label_id_t id) const |
virtual long | num_negatives (label_id_t id) const |
std::shared_ptr< const BinaryLabelVector > | get_labels (label_id_t id) const |
Private Attributes | |
std::shared_ptr< BinaryLabelVector > | m_Labels |
Additional Inherited Members | |
![]() | |
DatasetBase (SparseFeatures x) | |
DatasetBase (DenseFeatures x) | |
![]() | |
std::shared_ptr< GenericFeatureMatrix > | m_Features |
Collects the data related to a single optimization problem.
This contains the entire training set as sparse features, so we require that this fit into memory. The lables are strored as a dense vector.
|
inline |
|
overridevirtual |
Gets the label vector (encoded as dense vector with elements from {-1, 1}) for the id
'th class. The weights will be put into the given target
buffer. Throws std::out_of_bounds, if id is not in [0, num_labels())
.
Implements dismec::DatasetBase.
Definition at line 28 of file data.cpp.
References m_Labels.
|
overridevirtualnoexcept |
Gets the total number of different labels in the dataset. TODO call this num_classes instead?
Implements dismec::DatasetBase.
|
private |
Definition at line 82 of file data.h.
Referenced by get_labels().