1 #ifndef _LDAPLUSPLUS_DOCUMENT_HPP_ 2 #define _LDAPLUSPLUS_DOCUMENT_HPP_ 32 virtual const std::shared_ptr<const Corpus>
get_corpus()
const = 0;
36 virtual const Eigen::VectorXi &
get_words()
const = 0;
44 return std::static_pointer_cast<
const T>(
get_corpus());
61 virtual int get_class()
const = 0;
72 virtual size_t size()
const = 0;
74 virtual const std::shared_ptr<Document> at(
size_t index)
const = 0;
79 virtual void shuffle() = 0;
97 virtual float get_prior(
int y)
const = 0;
108 EigenDocument(Eigen::VectorXi X, std::shared_ptr<const Corpus> corpus);
110 const std::shared_ptr<const Corpus>
get_corpus()
const override;
111 const Eigen::VectorXi &
get_words()
const override;
115 std::shared_ptr<const Corpus> corpus_;
132 const std::shared_ptr<const Corpus>
get_corpus()
const override;
133 const Eigen::VectorXi &
get_words()
const override;
134 int get_class()
const override;
137 std::shared_ptr<Document> document_;
155 int get_index(
int index)
const {
return indices_[index]; }
167 std::vector<int> indices_;
180 EigenCorpus(
const Eigen::MatrixXi & X,
int random_state=0);
182 size_t size()
const override;
183 virtual const std::shared_ptr<Document> at(
size_t index)
const override;
184 void shuffle()
override;
194 const Eigen::MatrixXi &
X_;
207 const Eigen::MatrixXi &X,
208 const Eigen::VectorXi &y,
212 size_t size()
const override;
213 virtual const std::shared_ptr<Document> at(
size_t index)
const override;
214 void shuffle()
override;
215 float get_prior(
int y)
const override;
222 const Eigen::MatrixXi & X_;
223 const Eigen::VectorXi & y_;
226 Eigen::VectorXf priors_;
232 #endif // _LDAPLUSPLUS_DOCUMENT_HPP_ Definition: Document.hpp:68
const std::shared_ptr< const T > get_corpus() const
Definition: Document.hpp:43
Definition: Document.hpp:89
Definition: Document.hpp:104
Definition: Document.hpp:203
const Eigen::MatrixXi & X_
Definition: Document.hpp:194
Definition: Document.hpp:123
Definition: Document.hpp:146
Definition: Document.hpp:177
virtual const std::shared_ptr< const Corpus > get_corpus() const =0
CorpusIndexes indices_
Definition: Document.hpp:188
virtual const Eigen::VectorXi & get_words() const =0
Definition: Document.hpp:55
int get_index(int index) const
Definition: Document.hpp:155
Definition: Document.hpp:26
Definition: Document.hpp:11