Public Member Functions | Protected Attributes | List of all members
ldaplusplus::corpus::EigenCorpus Class Reference

#include <Document.hpp>

Inheritance diagram for ldaplusplus::corpus::EigenCorpus:

Public Member Functions

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

Protected Attributes

CorpusIndexes indices_
const Eigen::MatrixXi & X_

Detailed Description

Wrap a matrix X and implement the corpus interface.

Member Function Documentation

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

The ith document

Implements ldaplusplus::corpus::Corpus.

void ldaplusplus::corpus::EigenCorpus::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::EigenCorpus::size ( ) const

The number of documents in the corpus

Implements ldaplusplus::corpus::Corpus.

Member Data Documentation

CorpusIndexes ldaplusplus::corpus::EigenCorpus::indices_

To implement shuffle

const Eigen::MatrixXi& ldaplusplus::corpus::EigenCorpus::X_

We keep X_ protected instead of private to reduce boilerplate in creating a supervised version of this Corpus.

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