singlepp
A C++ library for cell type classification
Loading...
Searching...
No Matches
singlepp::TrainedSingle< Index_, Float_ > Class Template Reference

Classifier trained from a single reference. More...

#include <train_single.hpp>

Public Member Functions

Index_ test_nrow () const
 
const Markers< Index_ > & markers () const
 
const std::vector< Index_ > & subset () const
 
std::size_t num_labels () const
 
std::size_t num_profiles () const
 

Detailed Description

template<typename Index_, typename Float_>
class singlepp::TrainedSingle< Index_, Float_ >

Classifier trained from a single reference.

Instances of this class should not be directly constructed, but instead returned by calling train_single() on a reference dataset. Each instance can be used in classify_single() with a test dataset that has the same number and order of genes as the reference dataset.

Template Parameters
Index_Integer type for the row/column indices of the matrix.
Float_Floating-point type for the correlations and scores.

Member Function Documentation

◆ markers()

template<typename Index_ , typename Float_ >
const Markers< Index_ > & singlepp::TrainedSingle< Index_, Float_ >::markers ( ) const
inline
Returns
A vector of vectors of vectors of ranked marker genes to be used in the classification. In the innermost vectors, each value is an index into the subset vector (see subset()), e.g., subset()[markers()[2][1].front()] is the row index of the first marker of the third label over the first label. The set of marker genes is a subset of the input markers used in train_single().

◆ num_labels()

template<typename Index_ , typename Float_ >
std::size_t singlepp::TrainedSingle< Index_, Float_ >::num_labels ( ) const
inline
Returns
Number of labels in this reference.

◆ num_profiles()

template<typename Index_ , typename Float_ >
std::size_t singlepp::TrainedSingle< Index_, Float_ >::num_profiles ( ) const
inline
Returns
Number of profiles in this reference.

◆ subset()

template<typename Index_ , typename Float_ >
const std::vector< Index_ > & singlepp::TrainedSingle< Index_, Float_ >::subset ( ) const
inline
Returns
The subset of genes in the test dataset that were used in the classification. Each value is a row index into the test matrix. Values are sorted and unique.

◆ test_nrow()

template<typename Index_ , typename Float_ >
Index_ singlepp::TrainedSingle< Index_, Float_ >::test_nrow ( ) const
inline
Returns
Number of rows that should be present in the test dataset.

The documentation for this class was generated from the following file: