Public Member Functions | List of all members
ldaplusplus::corpus::EigenClassificationCorpus Class Reference

#include <Document.hpp>

Inheritance diagram for ldaplusplus::corpus::EigenClassificationCorpus:
ldaplusplus::corpus::ClassificationCorpus ldaplusplus::corpus::Corpus

Public Member Functions

 EigenClassificationCorpus (const Eigen::MatrixXi &X, const Eigen::VectorXi &y, int random_state=0)
size_t size () const override
virtual const std::shared_ptr< Documentat (size_t index) const override
void shuffle () override
float get_prior (int y) const override

Detailed Description

EigenClassificationCorpus wraps a pair of matrices X, y and implements the Corpus interface with them using X as the words and y as the classes.

Member Function Documentation

const std::shared_ptr< Document > ldaplusplus::corpus::EigenClassificationCorpus::at ( size_t  index) const

The ith document

Implements ldaplusplus::corpus::Corpus.

float ldaplusplus::corpus::EigenClassificationCorpus::get_prior ( int  y) const
yA class
The count of the documents in class y divided by the count of all the documents

Implements ldaplusplus::corpus::ClassificationCorpus.

void ldaplusplus::corpus::EigenClassificationCorpus::shuffle ( )

Shuffle the documents so that the ith document is any of the documents with probability 1.0/size() .

Implements ldaplusplus::corpus::Corpus.

size_t ldaplusplus::corpus::EigenClassificationCorpus::size ( ) const

The number of documents in the corpus

Implements ldaplusplus::corpus::Corpus.

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