Strong typedef for an int to signify a label id.
A model combines a set of weight with some meta-information about these weights.
label_id_t labels_end() const noexcept
GenericInMatrix FeatureMatrixIn
virtual long num_features() const =0
How many weights are in each weight vector, i.e. how many features should the input have.
Model(PartialModelSpec spec)
long num_labels() const noexcept
How many labels are in the underlying dataset.
virtual void get_weights_for_label_unchecked(label_id_t label, Eigen::Ref< DenseRealVector > target) const =0
Unchecked version of get_weights_for_label().
long contained_labels() const noexcept
How many labels are in this submodel.
Eigen::Ref< PredictionMatrix > PredictionMatrixOut
virtual void predict_scores_unchecked(const FeatureMatrixIn &instances, PredictionMatrixOut target) const =0
Unchecked version of predict_scores().
virtual bool has_sparse_weights() const =0
whether this model stores the weights in a sparse format, or a dense format.
void set_weights_for_label(label_id_t label, const WeightVectorIn &weights)
Sets the weights for a label.
bool is_partial_model() const
returns true if this instance only stores part of the weights of an entire model
long num_weights() const noexcept
How many weights vectors are in this model.
GenericInVector WeightVectorIn
virtual void set_weights_for_label_unchecked(label_id_t label, const WeightVectorIn &weights)=0
Unchecked version of set_weights_for_label().
long m_NumLabels
Total number of labels of the complete model.
void get_weights_for_label(label_id_t label, Eigen::Ref< DenseRealVector > target) const
Gets the weights for the given label as a dense vector.
label_id_t labels_begin() const noexcept
void predict_scores(const FeatureMatrixIn &instances, PredictionMatrixOut target) const
Calculates the scores for all examples and all labels in this model.
label_id_t adjust_label(label_id_t label) const
types::GenericVectorRef< const real_t > GenericInVector
types::GenericMatrixRef< const real_t > GenericInMatrix
Specifies how to interpret a weight matrix for a partial model.
label_id_t first_label
First label in the partial model.
long label_count
Number of labels in the partial model.
long total_labels
Total number of labels.