BoostA2DE #29

Merged
rmontanana merged 21 commits from BoostA2DE into main 2024-06-09 10:02:48 +00:00
303 changed files with 15 additions and 32446 deletions
Showing only changes of commit d43be27821 - Show all commits

View File

@ -88,4 +88,18 @@ install(TARGETS BayesNet
LIBRARY DESTINATION lib
CONFIGURATIONS Release)
install(DIRECTORY bayesnet/ DESTINATION include/bayesnet FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h")
install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DESTINATION include/bayesnet CONFIGURATIONS Release)
install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DESTINATION include/bayesnet CONFIGURATIONS Release)
# Documentation
# -------------
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
# doc build only target, target is not in default build, so it must be
# triggered explicitly
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)

View File

@ -1,257 +0,0 @@
.TH "bayesnet::A2DE" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::A2DE
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Ensemble\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBA2DE\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title='A2DE') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB12\fP of file \fBA2DE\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::A2DE::A2DE (bool predict_voting = \fRfalse\fP)"
.PP
Definition at line \fB10\fP of file \fBA2DE\&.cc\fP\&.
.SS "virtual bayesnet::A2DE::~A2DE ()\fR [inline]\fP, \fR [virtual]\fP"
.PP
Definition at line \fB15\fP of file \fBA2DE\&.h\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::A2DE::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB23\fP of file \fBA2DE\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::A2DE::graph (const std::string & title = \fR'A2DE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB36\fP of file \fBA2DE\&.cc\fP\&.
.SS "void bayesnet::A2DE::setHyperparameters (const nlohmann::json & hyperparameters)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB14\fP of file \fBA2DE\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,257 +0,0 @@
.TH "bayesnet::AODE" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::AODE
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Ensemble\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBAODE\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title='AODE') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB12\fP of file \fBAODE\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::AODE::AODE (bool predict_voting = \fRfalse\fP)"
.PP
Definition at line \fB10\fP of file \fBAODE\&.cc\fP\&.
.SS "virtual bayesnet::AODE::~AODE ()\fR [inline]\fP, \fR [virtual]\fP"
.PP
Definition at line \fB15\fP of file \fBAODE\&.h\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::AODE::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB24\fP of file \fBAODE\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::AODE::graph (const std::string & title = \fR'AODE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB34\fP of file \fBAODE\&.cc\fP\&.
.SS "void bayesnet::AODE::setHyperparameters (const nlohmann::json & hyperparameters)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB15\fP of file \fBAODE\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,296 +0,0 @@
.TH "bayesnet::AODELd" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::AODELd
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Ensemble\fP, and \fBbayesnet::Proposal\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBAODELd\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "\fBAODELd\fP & \fBfit\fP (torch::Tensor &X_, torch::Tensor &y_, const std::vector< std::string > &features_, const std::string &className_, map< std::string, std::vector< int > > &states_) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='AODELd') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "\fBProposal\fP (torch::Tensor &pDataset, std::vector< std::string > &features_, std::string &className_)"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "void \fBcheckInput\fP (const torch::Tensor &X, const torch::Tensor &y)"
.br
.ti -1c
.RI "torch::Tensor \fBprepareX\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBlocalDiscretizationProposal\fP (const map< std::string, std::vector< int > > &states, \fBNetwork\fP &model)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBfit_local_discretization\fP (const torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBXf\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy\fP"
.br
.ti -1c
.RI "map< std::string, mdlp::CPPFImdlp * > \fBdiscretizers\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB14\fP of file \fBAODELd\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::AODELd::AODELd (bool predict_voting = \fRtrue\fP)"
.PP
Definition at line \fB10\fP of file \fBAODELd\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::AODELd::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB28\fP of file \fBAODELd\&.cc\fP\&.
.SS "\fBAODELd\fP & bayesnet::AODELd::fit (torch::Tensor & X_, torch::Tensor & y_, const std::vector< std::string > & features_, const std::string & className_, map< std::string, std::vector< int > > & states_)\fR [override]\fP"
.PP
Definition at line \fB13\fP of file \fBAODELd\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::AODELd::graph (const std::string & name = \fR'AODELd'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB43\fP of file \fBAODELd\&.cc\fP\&.
.SS "void bayesnet::AODELd::trainModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB37\fP of file \fBAODELd\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,116 +0,0 @@
.TH "bayesnet::BaseClassifier" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::BaseClassifier
.SH SYNOPSIS
.br
.PP
.PP
Inherited by \fBbayesnet::Classifier\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "virtual \fBBaseClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states)=0"
.br
.ti -1c
.RI "virtual \fBBaseClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states)=0"
.br
.ti -1c
.RI "virtual \fBBaseClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states)=0"
.br
.ti -1c
.RI "virtual \fBBaseClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights)=0"
.br
.ti -1c
.RI "virtual torch::Tensor \fBpredict\fP (torch::Tensor &X)=0"
.br
.ti -1c
.RI "virtual std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X)=0"
.br
.ti -1c
.RI "virtual torch::Tensor \fBpredict_proba\fP (torch::Tensor &X)=0"
.br
.ti -1c
.RI "virtual std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X)=0"
.br
.ti -1c
.RI "virtual status_t \fBgetStatus\fP () const =0"
.br
.ti -1c
.RI "virtual float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y)=0"
.br
.ti -1c
.RI "virtual float \fBscore\fP (torch::Tensor &X, torch::Tensor &y)=0"
.br
.ti -1c
.RI "virtual int \fBgetNumberOfNodes\fP () const =0"
.br
.ti -1c
.RI "virtual int \fBgetNumberOfEdges\fP () const =0"
.br
.ti -1c
.RI "virtual int \fBgetNumberOfStates\fP () const =0"
.br
.ti -1c
.RI "virtual int \fBgetClassNumStates\fP () const =0"
.br
.ti -1c
.RI "virtual std::vector< std::string > \fBshow\fP () const =0"
.br
.ti -1c
.RI "virtual std::vector< std::string > \fBgraph\fP (const std::string &title='') const =0"
.br
.ti -1c
.RI "virtual std::string \fBgetVersion\fP ()=0"
.br
.ti -1c
.RI "virtual std::vector< std::string > \fBtopological_order\fP ()=0"
.br
.ti -1c
.RI "virtual std::vector< std::string > \fBgetNotes\fP () const =0"
.br
.ti -1c
.RI "virtual std::string \fBdump_cpt\fP () const =0"
.br
.ti -1c
.RI "virtual void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters)=0"
.br
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual void \fBtrainModel\fP (const torch::Tensor &weights)=0"
.br
.in -1c
.SS "Protected Attributes"
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB13\fP of file \fBBaseClassifier\&.h\fP\&.
.SH "Member Function Documentation"
.PP
.SS "std::vector< std::string > & bayesnet::BaseClassifier::getValidHyperparameters ()\fR [inline]\fP"
.PP
Definition at line \fB40\fP of file \fBBaseClassifier\&.h\fP\&.
.SH "Member Data Documentation"
.PP
.SS "std::vector<std::string> bayesnet::BaseClassifier::validHyperparameters\fR [protected]\fP"
.PP
Definition at line \fB43\fP of file \fBBaseClassifier\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,369 +0,0 @@
.TH "bayesnet::Boost" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::Boost
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Ensemble\fP\&.
.PP
Inherited by \fBbayesnet::BoostA2DE\fP, and \fBbayesnet::BoostAODE\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBBoost\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters_) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "std::vector< int > \fBfeatureSelection\fP (torch::Tensor &weights_)"
.br
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "std::tuple< torch::Tensor &, double, bool > \fBupdate_weights\fP (torch::Tensor &ytrain, torch::Tensor &ypred, torch::Tensor &weights)"
.br
.ti -1c
.RI "std::tuple< torch::Tensor &, double, bool > \fBupdate_weights_block\fP (int k, torch::Tensor &ytrain, torch::Tensor &weights)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Protected Attributes"
.in +1c
.ti -1c
.RI "torch::Tensor \fBX_train\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy_train\fP"
.br
.ti -1c
.RI "torch::Tensor \fBX_test\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy_test\fP"
.br
.ti -1c
.RI "bool \fBbisection\fP = true"
.br
.ti -1c
.RI "int \fBmaxTolerance\fP = 3"
.br
.ti -1c
.RI "std::string \fBorder_algorithm\fP"
.br
.ti -1c
.RI "bool \fBconvergence\fP = true"
.br
.ti -1c
.RI "bool \fBconvergence_best\fP = false"
.br
.ti -1c
.RI "bool \fBselectFeatures\fP = false"
.br
.ti -1c
.RI "std::string \fBselect_features_algorithm\fP = Orders\&.DESC"
.br
.ti -1c
.RI "FeatureSelect * \fBfeatureSelector\fP = nullptr"
.br
.ti -1c
.RI "double \fBthreshold\fP = \-1"
.br
.ti -1c
.RI "bool \fBblock_update\fP = false"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB27\fP of file \fBBoost\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::Boost::Boost (bool predict_voting = \fRfalse\fP)\fR [explicit]\fP"
.PP
Definition at line \fB13\fP of file \fBBoost\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::Boost::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB71\fP of file \fBBoost\&.cc\fP\&.
.SS "std::vector< int > bayesnet::Boost::featureSelection (torch::Tensor & weights_)\fR [protected]\fP"
.PP
Definition at line \fB102\fP of file \fBBoost\&.cc\fP\&.
.SS "void bayesnet::Boost::setHyperparameters (const nlohmann::json & hyperparameters_)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB18\fP of file \fBBoost\&.cc\fP\&.
.SS "std::tuple< torch::Tensor &, double, bool > bayesnet::Boost::update_weights (torch::Tensor & ytrain, torch::Tensor & ypred, torch::Tensor & weights)\fR [protected]\fP"
.PP
Definition at line \fB123\fP of file \fBBoost\&.cc\fP\&.
.SS "std::tuple< torch::Tensor &, double, bool > bayesnet::Boost::update_weights_block (int k, torch::Tensor & ytrain, torch::Tensor & weights)\fR [protected]\fP"
.PP
Definition at line \fB150\fP of file \fBBoost\&.cc\fP\&.
.SH "Member Data Documentation"
.PP
.SS "bool bayesnet::Boost::bisection = true\fR [protected]\fP"
.PP
Definition at line \fB39\fP of file \fBBoost\&.h\fP\&.
.SS "bool bayesnet::Boost::block_update = false\fR [protected]\fP"
.PP
Definition at line \fB48\fP of file \fBBoost\&.h\fP\&.
.SS "bool bayesnet::Boost::convergence = true\fR [protected]\fP"
.PP
Definition at line \fB42\fP of file \fBBoost\&.h\fP\&.
.SS "bool bayesnet::Boost::convergence_best = false\fR [protected]\fP"
.PP
Definition at line \fB43\fP of file \fBBoost\&.h\fP\&.
.SS "FeatureSelect* bayesnet::Boost::featureSelector = nullptr\fR [protected]\fP"
.PP
Definition at line \fB46\fP of file \fBBoost\&.h\fP\&.
.SS "int bayesnet::Boost::maxTolerance = 3\fR [protected]\fP"
.PP
Definition at line \fB40\fP of file \fBBoost\&.h\fP\&.
.SS "std::string bayesnet::Boost::order_algorithm\fR [protected]\fP"
.PP
Definition at line \fB41\fP of file \fBBoost\&.h\fP\&.
.SS "std::string bayesnet::Boost::select_features_algorithm = Orders\&.DESC\fR [protected]\fP"
.PP
Definition at line \fB45\fP of file \fBBoost\&.h\fP\&.
.SS "bool bayesnet::Boost::selectFeatures = false\fR [protected]\fP"
.PP
Definition at line \fB44\fP of file \fBBoost\&.h\fP\&.
.SS "double bayesnet::Boost::threshold = \-1\fR [protected]\fP"
.PP
Definition at line \fB47\fP of file \fBBoost\&.h\fP\&.
.SS "torch::Tensor bayesnet::Boost::X_test\fR [protected]\fP"
.PP
Definition at line \fB37\fP of file \fBBoost\&.h\fP\&.
.SS "torch::Tensor bayesnet::Boost::X_train\fR [protected]\fP"
.PP
Definition at line \fB37\fP of file \fBBoost\&.h\fP\&.
.SS "torch::Tensor bayesnet::Boost::y_test\fR [protected]\fP"
.PP
Definition at line \fB37\fP of file \fBBoost\&.h\fP\&.
.SS "torch::Tensor bayesnet::Boost::y_train\fR [protected]\fP"
.PP
Definition at line \fB37\fP of file \fBBoost\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,316 +0,0 @@
.TH "bayesnet::BoostA2DE" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::BoostA2DE
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Boost\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBBoostA2DE\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title='BoostA2DE') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Boost\fP
.in +1c
.ti -1c
.RI "\fBBoost\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters_) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Boost\fP
.in +1c
.ti -1c
.RI "std::vector< int > \fBfeatureSelection\fP (torch::Tensor &weights_)"
.br
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "std::tuple< torch::Tensor &, double, bool > \fBupdate_weights\fP (torch::Tensor &ytrain, torch::Tensor &ypred, torch::Tensor &weights)"
.br
.ti -1c
.RI "std::tuple< torch::Tensor &, double, bool > \fBupdate_weights_block\fP (int k, torch::Tensor &ytrain, torch::Tensor &weights)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Boost\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBX_train\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy_train\fP"
.br
.ti -1c
.RI "torch::Tensor \fBX_test\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy_test\fP"
.br
.ti -1c
.RI "bool \fBbisection\fP = true"
.br
.ti -1c
.RI "int \fBmaxTolerance\fP = 3"
.br
.ti -1c
.RI "std::string \fBorder_algorithm\fP"
.br
.ti -1c
.RI "bool \fBconvergence\fP = true"
.br
.ti -1c
.RI "bool \fBconvergence_best\fP = false"
.br
.ti -1c
.RI "bool \fBselectFeatures\fP = false"
.br
.ti -1c
.RI "std::string \fBselect_features_algorithm\fP = Orders\&.DESC"
.br
.ti -1c
.RI "FeatureSelect * \fBfeatureSelector\fP = nullptr"
.br
.ti -1c
.RI "double \fBthreshold\fP = \-1"
.br
.ti -1c
.RI "bool \fBblock_update\fP = false"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB14\fP of file \fBBoostA2DE\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::BoostA2DE::BoostA2DE (bool predict_voting = \fRfalse\fP)\fR [explicit]\fP"
.PP
Definition at line \fB19\fP of file \fBBoostA2DE\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "std::vector< std::string > bayesnet::BoostA2DE::graph (const std::string & title = \fR'BoostA2DE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB163\fP of file \fBBoostA2DE\&.cc\fP\&.
.SS "void bayesnet::BoostA2DE::trainModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB44\fP of file \fBBoostA2DE\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,316 +0,0 @@
.TH "bayesnet::BoostAODE" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::BoostAODE
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Boost\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBBoostAODE\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title='BoostAODE') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Boost\fP
.in +1c
.ti -1c
.RI "\fBBoost\fP (bool predict_voting=false)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters_) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Boost\fP
.in +1c
.ti -1c
.RI "std::vector< int > \fBfeatureSelection\fP (torch::Tensor &weights_)"
.br
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "std::tuple< torch::Tensor &, double, bool > \fBupdate_weights\fP (torch::Tensor &ytrain, torch::Tensor &ypred, torch::Tensor &weights)"
.br
.ti -1c
.RI "std::tuple< torch::Tensor &, double, bool > \fBupdate_weights_block\fP (int k, torch::Tensor &ytrain, torch::Tensor &weights)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Boost\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBX_train\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy_train\fP"
.br
.ti -1c
.RI "torch::Tensor \fBX_test\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy_test\fP"
.br
.ti -1c
.RI "bool \fBbisection\fP = true"
.br
.ti -1c
.RI "int \fBmaxTolerance\fP = 3"
.br
.ti -1c
.RI "std::string \fBorder_algorithm\fP"
.br
.ti -1c
.RI "bool \fBconvergence\fP = true"
.br
.ti -1c
.RI "bool \fBconvergence_best\fP = false"
.br
.ti -1c
.RI "bool \fBselectFeatures\fP = false"
.br
.ti -1c
.RI "std::string \fBselect_features_algorithm\fP = Orders\&.DESC"
.br
.ti -1c
.RI "FeatureSelect * \fBfeatureSelector\fP = nullptr"
.br
.ti -1c
.RI "double \fBthreshold\fP = \-1"
.br
.ti -1c
.RI "bool \fBblock_update\fP = false"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Ensemble\fP
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB15\fP of file \fBBoostAODE\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::BoostAODE::BoostAODE (bool predict_voting = \fRfalse\fP)\fR [explicit]\fP"
.PP
Definition at line \fB16\fP of file \fBBoostAODE\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "std::vector< std::string > bayesnet::BoostAODE::graph (const std::string & title = \fR'BoostAODE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB157\fP of file \fBBoostAODE\&.cc\fP\&.
.SS "void bayesnet::BoostAODE::trainModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB33\fP of file \fBBoostAODE\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,360 +0,0 @@
.TH "bayesnet::Classifier" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::Classifier
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::BaseClassifier\fP\&.
.PP
Inherited by \fBbayesnet::Ensemble\fP, \fBbayesnet::KDB\fP, \fBbayesnet::SPODE\fP, \fBbayesnet::SPnDE\fP, and \fBbayesnet::TAN\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "virtual std::vector< std::string > \fBgraph\fP (const std::string &title='') const =0"
.br
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "virtual void \fBbuildModel\fP (const torch::Tensor &weights)=0"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Protected Attributes"
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB15\fP of file \fBClassifier\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::Classifier::Classifier (\fBNetwork\fP model)"
.PP
Definition at line \fB12\fP of file \fBClassifier\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::Classifier::addNodes ()"
.PP
Definition at line \fB155\fP of file \fBClassifier\&.cc\fP\&.
.SS "void bayesnet::Classifier::buildDataset (torch::Tensor & y)\fR [protected]\fP"
.PP
Definition at line \fB30\fP of file \fBClassifier\&.cc\fP\&.
.SS "void bayesnet::Classifier::checkFitParameters ()\fR [protected]\fP"
.PP
Definition at line \fB79\fP of file \fBClassifier\&.cc\fP\&.
.SS "std::string bayesnet::Classifier::dump_cpt () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB184\fP of file \fBClassifier\&.cc\fP\&.
.SS "\fBClassifier\fP & bayesnet::Classifier::fit (std::vector< std::vector< int > > & X, std::vector< int > & y, const std::vector< std::string > & features, const std::string & className, std::map< std::string, std::vector< int > > & states)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB57\fP of file \fBClassifier\&.cc\fP\&.
.SS "\fBClassifier\fP & bayesnet::Classifier::fit (torch::Tensor & dataset, const std::vector< std::string > & features, const std::string & className, std::map< std::string, std::vector< int > > & states)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB68\fP of file \fBClassifier\&.cc\fP\&.
.SS "\fBClassifier\fP & bayesnet::Classifier::fit (torch::Tensor & dataset, const std::vector< std::string > & features, const std::string & className, std::map< std::string, std::vector< int > > & states, const torch::Tensor & weights)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB74\fP of file \fBClassifier\&.cc\fP\&.
.SS "\fBClassifier\fP & bayesnet::Classifier::fit (torch::Tensor & X, torch::Tensor & y, const std::vector< std::string > & features, const std::string & className, std::map< std::string, std::vector< int > > & states)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB49\fP of file \fBClassifier\&.cc\fP\&.
.SS "int bayesnet::Classifier::getClassNumStates () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB176\fP of file \fBClassifier\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Classifier::getNotes () const\fR [inline]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB38\fP of file \fBClassifier\&.h\fP\&.
.SS "int bayesnet::Classifier::getNumberOfEdges () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB168\fP of file \fBClassifier\&.cc\fP\&.
.SS "int bayesnet::Classifier::getNumberOfNodes () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB163\fP of file \fBClassifier\&.cc\fP\&.
.SS "int bayesnet::Classifier::getNumberOfStates () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB172\fP of file \fBClassifier\&.cc\fP\&.
.SS "status_t bayesnet::Classifier::getStatus () const\fR [inline]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB32\fP of file \fBClassifier\&.h\fP\&.
.SS "std::string bayesnet::Classifier::getVersion ()\fR [inline]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB33\fP of file \fBClassifier\&.h\fP\&.
.SS "std::vector< int > bayesnet::Classifier::predict (std::vector< std::vector< int > > & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB103\fP of file \fBClassifier\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Classifier::predict (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB96\fP of file \fBClassifier\&.cc\fP\&.
.SS "std::vector< std::vector< double > > bayesnet::Classifier::predict_proba (std::vector< std::vector< int > > & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB124\fP of file \fBClassifier\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Classifier::predict_proba (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB117\fP of file \fBClassifier\&.cc\fP\&.
.SS "float bayesnet::Classifier::score (std::vector< std::vector< int > > & X, std::vector< int > & y)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB144\fP of file \fBClassifier\&.cc\fP\&.
.SS "float bayesnet::Classifier::score (torch::Tensor & X, torch::Tensor & y)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB139\fP of file \fBClassifier\&.cc\fP\&.
.SS "void bayesnet::Classifier::setHyperparameters (const nlohmann::json & hyperparameters)\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB188\fP of file \fBClassifier\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Classifier::show () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB151\fP of file \fBClassifier\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Classifier::topological_order ()\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB180\fP of file \fBClassifier\&.cc\fP\&.
.SS "void bayesnet::Classifier::trainModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB44\fP of file \fBClassifier\&.cc\fP\&.
.SH "Member Data Documentation"
.PP
.SS "std::string bayesnet::Classifier::className\fR [protected]\fP"
.PP
Definition at line \fB47\fP of file \fBClassifier\&.h\fP\&.
.SS "torch::Tensor bayesnet::Classifier::dataset\fR [protected]\fP"
.PP
Definition at line \fB49\fP of file \fBClassifier\&.h\fP\&.
.SS "std::vector<std::string> bayesnet::Classifier::features\fR [protected]\fP"
.PP
Definition at line \fB46\fP of file \fBClassifier\&.h\fP\&.
.SS "bool bayesnet::Classifier::fitted\fR [protected]\fP"
.PP
Definition at line \fB42\fP of file \fBClassifier\&.h\fP\&.
.SS "unsigned int bayesnet::Classifier::m\fR [protected]\fP"
.PP
Definition at line \fB43\fP of file \fBClassifier\&.h\fP\&.
.SS "Metrics bayesnet::Classifier::metrics\fR [protected]\fP"
.PP
Definition at line \fB45\fP of file \fBClassifier\&.h\fP\&.
.SS "\fBNetwork\fP bayesnet::Classifier::model\fR [protected]\fP"
.PP
Definition at line \fB44\fP of file \fBClassifier\&.h\fP\&.
.SS "unsigned int bayesnet::Classifier::n\fR [protected]\fP"
.PP
Definition at line \fB43\fP of file \fBClassifier\&.h\fP\&.
.SS "std::vector<std::string> bayesnet::Classifier::notes\fR [protected]\fP"
.PP
Definition at line \fB51\fP of file \fBClassifier\&.h\fP\&.
.SS "std::map<std::string, std::vector<int> > bayesnet::Classifier::states\fR [protected]\fP"
.PP
Definition at line \fB48\fP of file \fBClassifier\&.h\fP\&.
.SS "status_t bayesnet::Classifier::status = NORMAL\fR [protected]\fP"
.PP
Definition at line \fB50\fP of file \fBClassifier\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,348 +0,0 @@
.TH "bayesnet::Ensemble" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::Ensemble
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Classifier\fP\&.
.PP
Inherited by \fBbayesnet::A2DE\fP, \fBbayesnet::AODE\fP, \fBbayesnet::AODELd\fP, and \fBbayesnet::Boost\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBEnsemble\fP (bool predict_voting=true)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "torch::Tensor \fBpredict_average_voting\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_voting\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_average_proba\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_average_proba\fP (std::vector< std::vector< int > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBcompute_arg_max\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "std::vector< int > \fBcompute_arg_max\fP (std::vector< std::vector< double > > &X)"
.br
.ti -1c
.RI "torch::Tensor \fBvoting\fP (torch::Tensor &votes)"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "virtual void \fBbuildModel\fP (const torch::Tensor &weights)=0"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Protected Attributes"
.in +1c
.ti -1c
.RI "unsigned \fBn_models\fP"
.br
.ti -1c
.RI "std::vector< std::unique_ptr< \fBClassifier\fP > > \fBmodels\fP"
.br
.ti -1c
.RI "std::vector< double > \fBsignificanceModels\fP"
.br
.ti -1c
.RI "bool \fBpredict_voting\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB15\fP of file \fBEnsemble\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::Ensemble::Ensemble (bool predict_voting = \fRtrue\fP)"
.PP
Definition at line \fB11\fP of file \fBEnsemble\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "std::vector< int > bayesnet::Ensemble::compute_arg_max (std::vector< std::vector< double > > & X)\fR [protected]\fP"
.PP
Definition at line \fB24\fP of file \fBEnsemble\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Ensemble::compute_arg_max (torch::Tensor & X)\fR [protected]\fP"
.PP
Definition at line \fB33\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::string bayesnet::Ensemble::dump_cpt () const\fR [inline]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB34\fP of file \fBEnsemble\&.h\fP\&.
.SS "int bayesnet::Ensemble::getNumberOfEdges () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB206\fP of file \fBEnsemble\&.cc\fP\&.
.SS "int bayesnet::Ensemble::getNumberOfNodes () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB198\fP of file \fBEnsemble\&.cc\fP\&.
.SS "int bayesnet::Ensemble::getNumberOfStates () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB214\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Ensemble::graph (const std::string & title) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB189\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< int > bayesnet::Ensemble::predict (std::vector< std::vector< int > > & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB74\fP of file \fBEnsemble\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Ensemble::predict (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB79\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< std::vector< double > > bayesnet::Ensemble::predict_average_proba (std::vector< std::vector< int > > & X)\fR [protected]\fP"
.PP
Definition at line \fB104\fP of file \fBEnsemble\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Ensemble::predict_average_proba (torch::Tensor & X)\fR [protected]\fP"
.PP
Definition at line \fB84\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< std::vector< double > > bayesnet::Ensemble::predict_average_voting (std::vector< std::vector< int > > & X)\fR [protected]\fP"
.PP
Definition at line \fB133\fP of file \fBEnsemble\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Ensemble::predict_average_voting (torch::Tensor & X)\fR [protected]\fP"
.PP
Definition at line \fB140\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< std::vector< double > > bayesnet::Ensemble::predict_proba (std::vector< std::vector< int > > & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB60\fP of file \fBEnsemble\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Ensemble::predict_proba (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB67\fP of file \fBEnsemble\&.cc\fP\&.
.SS "float bayesnet::Ensemble::score (std::vector< std::vector< int > > & X, std::vector< int > & y)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB169\fP of file \fBEnsemble\&.cc\fP\&.
.SS "float bayesnet::Ensemble::score (torch::Tensor & X, torch::Tensor & y)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB158\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Ensemble::show () const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB180\fP of file \fBEnsemble\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Ensemble::topological_order ()\fR [inline]\fP, \fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB30\fP of file \fBEnsemble\&.h\fP\&.
.SS "void bayesnet::Ensemble::trainModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB16\fP of file \fBEnsemble\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Ensemble::voting (torch::Tensor & votes)\fR [protected]\fP"
.PP
Definition at line \fB38\fP of file \fBEnsemble\&.cc\fP\&.
.SH "Member Data Documentation"
.PP
.SS "std::vector<std::unique_ptr<\fBClassifier\fP> > bayesnet::Ensemble::models\fR [protected]\fP"
.PP
Definition at line \fB47\fP of file \fBEnsemble\&.h\fP\&.
.SS "unsigned bayesnet::Ensemble::n_models\fR [protected]\fP"
.PP
Definition at line \fB46\fP of file \fBEnsemble\&.h\fP\&.
.SS "bool bayesnet::Ensemble::predict_voting\fR [protected]\fP"
.PP
Definition at line \fB50\fP of file \fBEnsemble\&.h\fP\&.
.SS "std::vector<double> bayesnet::Ensemble::significanceModels\fR [protected]\fP"
.PP
Definition at line \fB48\fP of file \fBEnsemble\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,201 +0,0 @@
.TH "bayesnet::KDB" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::KDB
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Classifier\fP\&.
.PP
Inherited by \fBbayesnet::KDBLd\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBKDB\fP (int k, float theta=0\&.03)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters_) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='KDB') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB13\fP of file \fBKDB\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::KDB::KDB (int k, float theta = \fR0\&.03\fP)\fR [explicit]\fP"
.PP
Definition at line \fB10\fP of file \fBKDB\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::KDB::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB28\fP of file \fBKDB\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::KDB::graph (const std::string & name = \fR'KDB'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB103\fP of file \fBKDB\&.cc\fP\&.
.SS "void bayesnet::KDB::setHyperparameters (const nlohmann::json & hyperparameters_)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB15\fP of file \fBKDB\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,254 +0,0 @@
.TH "bayesnet::KDBLd" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::KDBLd
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::KDB\fP, and \fBbayesnet::Proposal\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBKDBLd\fP (int k)"
.br
.ti -1c
.RI "\fBKDBLd\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='KDB') const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::KDB\fP
.in +1c
.ti -1c
.RI "\fBKDB\fP (int k, float theta=0\&.03)"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters_) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "\fBProposal\fP (torch::Tensor &pDataset, std::vector< std::string > &features_, std::string &className_)"
.br
.in -1c
.SS "Static Public Member Functions"
.in +1c
.ti -1c
.RI "static std::string \fBversion\fP ()"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Member Functions inherited from \fBbayesnet::KDB\fP
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "void \fBcheckInput\fP (const torch::Tensor &X, const torch::Tensor &y)"
.br
.ti -1c
.RI "torch::Tensor \fBprepareX\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBlocalDiscretizationProposal\fP (const map< std::string, std::vector< int > > &states, \fBNetwork\fP &model)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBfit_local_discretization\fP (const torch::Tensor &y)"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBXf\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy\fP"
.br
.ti -1c
.RI "map< std::string, mdlp::CPPFImdlp * > \fBdiscretizers\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB13\fP of file \fBKDBLd\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::KDBLd::KDBLd (int k)\fR [explicit]\fP"
.PP
Definition at line \fB10\fP of file \fBKDBLd\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "\fBKDBLd\fP & bayesnet::KDBLd::fit (torch::Tensor & X, torch::Tensor & y, const std::vector< std::string > & features, const std::string & className, map< std::string, std::vector< int > > & states)\fR [override]\fP"
.PP
Definition at line \fB11\fP of file \fBKDBLd\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::KDBLd::graph (const std::string & name = \fR'KDB'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::KDB\fP\&.
.PP
Definition at line \fB31\fP of file \fBKDBLd\&.cc\fP\&.
.SS "torch::Tensor bayesnet::KDBLd::predict (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB26\fP of file \fBKDBLd\&.cc\fP\&.
.SS "static std::string bayesnet::KDBLd::version ()\fR [inline]\fP, \fR [static]\fP"
.PP
Definition at line \fB21\fP of file \fBKDBLd\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,223 +0,0 @@
.TH "bayesnet::Network" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::Network
.SH SYNOPSIS
.br
.PP
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBNetwork\fP (float)"
.br
.ti -1c
.RI "\fBNetwork\fP (const \fBNetwork\fP &)"
.br
.ti -1c
.RI "torch::Tensor & \fBgetSamples\fP ()"
.br
.ti -1c
.RI "float \fBgetMaxThreads\fP () const"
.br
.ti -1c
.RI "void \fBaddNode\fP (const std::string &)"
.br
.ti -1c
.RI "void \fBaddEdge\fP (const std::string &, const std::string &)"
.br
.ti -1c
.RI "std::map< std::string, std::unique_ptr< \fBNode\fP > > & \fBgetNodes\fP ()"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetFeatures\fP () const"
.br
.ti -1c
.RI "int \fBgetStates\fP () const"
.br
.ti -1c
.RI "std::vector< std::pair< std::string, std::string > > \fBgetEdges\fP () const"
.br
.ti -1c
.RI "int \fBgetNumEdges\fP () const"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const"
.br
.ti -1c
.RI "std::string \fBgetClassName\fP () const"
.br
.ti -1c
.RI "void \fBfit\fP (const std::vector< std::vector< int > > &input_data, const std::vector< int > &labels, const std::vector< double > &weights, const std::vector< std::string > &featureNames, const std::string &className, const std::map< std::string, std::vector< int > > &states)"
.br
.ti -1c
.RI "void \fBfit\fP (const torch::Tensor &X, const torch::Tensor &y, const torch::Tensor &weights, const std::vector< std::string > &featureNames, const std::string &className, const std::map< std::string, std::vector< int > > &states)"
.br
.ti -1c
.RI "void \fBfit\fP (const torch::Tensor &samples, const torch::Tensor &weights, const std::vector< std::string > &featureNames, const std::string &className, const std::map< std::string, std::vector< int > > &states)"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (const std::vector< std::vector< int > > &)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (const torch::Tensor &)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_tensor\fP (const torch::Tensor &samples, const bool proba)"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (const std::vector< std::vector< int > > &)"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (const torch::Tensor &)"
.br
.ti -1c
.RI "double \fBscore\fP (const std::vector< std::vector< int > > &, const std::vector< int > &)"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_sort\fP ()"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &title) const"
.br
.ti -1c
.RI "void \fBinitialize\fP ()"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const"
.br
.ti -1c
.RI "std::string \fBversion\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB15\fP of file \fBNetwork\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::Network::Network ()"
.PP
Definition at line \fB13\fP of file \fBNetwork\&.cc\fP\&.
.SS "bayesnet::Network::Network (float maxT)\fR [explicit]\fP"
.PP
Definition at line \fB16\fP of file \fBNetwork\&.cc\fP\&.
.SS "bayesnet::Network::Network (const \fBNetwork\fP & other)\fR [explicit]\fP"
.PP
Definition at line \fB20\fP of file \fBNetwork\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::Network::addEdge (const std::string & parent, const std::string & child)"
.PP
Definition at line \fB95\fP of file \fBNetwork\&.cc\fP\&.
.SS "void bayesnet::Network::addNode (const std::string & name)"
.PP
Definition at line \fB46\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::string bayesnet::Network::dump_cpt () const"
.PP
Definition at line \fB420\fP of file \fBNetwork\&.cc\fP\&.
.SS "void bayesnet::Network::fit (const std::vector< std::vector< int > > & input_data, const std::vector< int > & labels, const std::vector< double > & weights, const std::vector< std::string > & featureNames, const std::string & className, const std::map< std::string, std::vector< int > > & states)"
.PP
Definition at line \fB177\fP of file \fBNetwork\&.cc\fP\&.
.SS "void bayesnet::Network::fit (const torch::Tensor & samples, const torch::Tensor & weights, const std::vector< std::string > & featureNames, const std::string & className, const std::map< std::string, std::vector< int > > & states)"
.PP
Definition at line \fB169\fP of file \fBNetwork\&.cc\fP\&.
.SS "void bayesnet::Network::fit (const torch::Tensor & X, const torch::Tensor & y, const torch::Tensor & weights, const std::vector< std::string > & featureNames, const std::string & className, const std::map< std::string, std::vector< int > > & states)"
.PP
Definition at line \fB158\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::string bayesnet::Network::getClassName () const"
.PP
Definition at line \fB75\fP of file \fBNetwork\&.cc\fP\&.
.SS "int bayesnet::Network::getClassNumStates () const"
.PP
Definition at line \fB63\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< std::pair< std::string, std::string > > bayesnet::Network::getEdges () const"
.PP
Definition at line \fB371\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Network::getFeatures () const"
.PP
Definition at line \fB59\fP of file \fBNetwork\&.cc\fP\&.
.SS "float bayesnet::Network::getMaxThreads () const"
.PP
Definition at line \fB38\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::map< std::string, std::unique_ptr< \fBNode\fP > > & bayesnet::Network::getNodes ()"
.PP
Definition at line \fB116\fP of file \fBNetwork\&.cc\fP\&.
.SS "int bayesnet::Network::getNumEdges () const"
.PP
Definition at line \fB383\fP of file \fBNetwork\&.cc\fP\&.
.SS "torch::Tensor & bayesnet::Network::getSamples ()"
.PP
Definition at line \fB42\fP of file \fBNetwork\&.cc\fP\&.
.SS "int bayesnet::Network::getStates () const"
.PP
Definition at line \fB67\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Network::graph (const std::string & title) const"
.PP
Definition at line \fB357\fP of file \fBNetwork\&.cc\fP\&.
.SS "void bayesnet::Network::initialize ()"
.PP
Definition at line \fB29\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< int > bayesnet::Network::predict (const std::vector< std::vector< int > > & tsamples)"
.PP
Definition at line \fB237\fP of file \fBNetwork\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Network::predict (const torch::Tensor & samples)"
.PP
Definition at line \fB230\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< std::vector< double > > bayesnet::Network::predict_proba (const std::vector< std::vector< int > > & tsamples)"
.PP
Definition at line \fB259\fP of file \fBNetwork\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Network::predict_proba (const torch::Tensor & samples)"
.PP
Definition at line \fB224\fP of file \fBNetwork\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Network::predict_tensor (const torch::Tensor & samples, const bool proba)"
.PP
Definition at line \fB205\fP of file \fBNetwork\&.cc\fP\&.
.SS "double bayesnet::Network::score (const std::vector< std::vector< int > > & tsamples, const std::vector< int > & labels)"
.PP
Definition at line \fB275\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Network::show () const"
.PP
Definition at line \fB344\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Network::topological_sort ()"
.PP
Definition at line \fB387\fP of file \fBNetwork\&.cc\fP\&.
.SS "std::string bayesnet::Network::version ()\fR [inline]\fP"
.PP
Definition at line \fB49\fP of file \fBNetwork\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,135 +0,0 @@
.TH "bayesnet::Node" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::Node
.SH SYNOPSIS
.br
.PP
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBNode\fP (const std::string &)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.ti -1c
.RI "void \fBaddParent\fP (\fBNode\fP *)"
.br
.ti -1c
.RI "void \fBaddChild\fP (\fBNode\fP *)"
.br
.ti -1c
.RI "void \fBremoveParent\fP (\fBNode\fP *)"
.br
.ti -1c
.RI "void \fBremoveChild\fP (\fBNode\fP *)"
.br
.ti -1c
.RI "std::string \fBgetName\fP () const"
.br
.ti -1c
.RI "std::vector< \fBNode\fP * > & \fBgetParents\fP ()"
.br
.ti -1c
.RI "std::vector< \fBNode\fP * > & \fBgetChildren\fP ()"
.br
.ti -1c
.RI "torch::Tensor & \fBgetCPT\fP ()"
.br
.ti -1c
.RI "void \fBcomputeCPT\fP (const torch::Tensor &dataset, const std::vector< std::string > &features, const double laplaceSmoothing, const torch::Tensor &weights)"
.br
.ti -1c
.RI "int \fBgetNumStates\fP () const"
.br
.ti -1c
.RI "void \fBsetNumStates\fP (int)"
.br
.ti -1c
.RI "unsigned \fBminFill\fP ()"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &clasName)"
.br
.ti -1c
.RI "float \fBgetFactorValue\fP (std::map< std::string, int > &)"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB14\fP of file \fBNode\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::Node::Node (const std::string & name)\fR [explicit]\fP"
.PP
Definition at line \fB11\fP of file \fBNode\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::Node::addChild (\fBNode\fP * child)"
.PP
Definition at line \fB39\fP of file \fBNode\&.cc\fP\&.
.SS "void bayesnet::Node::addParent (\fBNode\fP * parent)"
.PP
Definition at line \fB27\fP of file \fBNode\&.cc\fP\&.
.SS "void bayesnet::Node::clear ()"
.PP
Definition at line \fB15\fP of file \fBNode\&.cc\fP\&.
.SS "void bayesnet::Node::computeCPT (const torch::Tensor & dataset, const std::vector< std::string > & features, const double laplaceSmoothing, const torch::Tensor & weights)"
.PP
Definition at line \fB93\fP of file \fBNode\&.cc\fP\&.
.SS "std::vector< \fBNode\fP * > & bayesnet::Node::getChildren ()"
.PP
Definition at line \fB47\fP of file \fBNode\&.cc\fP\&.
.SS "torch::Tensor & bayesnet::Node::getCPT ()"
.PP
Definition at line \fB59\fP of file \fBNode\&.cc\fP\&.
.SS "float bayesnet::Node::getFactorValue (std::map< std::string, int > & evidence)"
.PP
Definition at line \fB124\fP of file \fBNode\&.cc\fP\&.
.SS "std::string bayesnet::Node::getName () const"
.PP
Definition at line \fB23\fP of file \fBNode\&.cc\fP\&.
.SS "int bayesnet::Node::getNumStates () const"
.PP
Definition at line \fB51\fP of file \fBNode\&.cc\fP\&.
.SS "std::vector< \fBNode\fP * > & bayesnet::Node::getParents ()"
.PP
Definition at line \fB43\fP of file \fBNode\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::Node::graph (const std::string & clasName)"
.PP
Definition at line \fB132\fP of file \fBNode\&.cc\fP\&.
.SS "unsigned bayesnet::Node::minFill ()"
.PP
Definition at line \fB70\fP of file \fBNode\&.cc\fP\&.
.SS "void bayesnet::Node::removeChild (\fBNode\fP * child)"
.PP
Definition at line \fB35\fP of file \fBNode\&.cc\fP\&.
.SS "void bayesnet::Node::removeParent (\fBNode\fP * parent)"
.PP
Definition at line \fB31\fP of file \fBNode\&.cc\fP\&.
.SS "void bayesnet::Node::setNumStates (int numStates)"
.PP
Definition at line \fB55\fP of file \fBNode\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,95 +0,0 @@
.TH "bayesnet::Proposal" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::Proposal
.SH SYNOPSIS
.br
.PP
.PP
Inherited by \fBbayesnet::AODELd\fP, \fBbayesnet::KDBLd\fP, \fBbayesnet::SPODELd\fP, and \fBbayesnet::TANLd\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBProposal\fP (torch::Tensor &pDataset, std::vector< std::string > &features_, std::string &className_)"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBcheckInput\fP (const torch::Tensor &X, const torch::Tensor &y)"
.br
.ti -1c
.RI "torch::Tensor \fBprepareX\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBlocalDiscretizationProposal\fP (const map< std::string, std::vector< int > > &states, \fBNetwork\fP &model)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBfit_local_discretization\fP (const torch::Tensor &y)"
.br
.in -1c
.SS "Protected Attributes"
.in +1c
.ti -1c
.RI "torch::Tensor \fBXf\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy\fP"
.br
.ti -1c
.RI "map< std::string, mdlp::CPPFImdlp * > \fBdiscretizers\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB17\fP of file \fBProposal\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::Proposal::Proposal (torch::Tensor & pDataset, std::vector< std::string > & features_, std::string & className_)"
.PP
Definition at line \fB10\fP of file \fBProposal\&.cc\fP\&.
.SS "bayesnet::Proposal::~Proposal ()\fR [virtual]\fP"
.PP
Definition at line \fB11\fP of file \fBProposal\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::Proposal::checkInput (const torch::Tensor & X, const torch::Tensor & y)\fR [protected]\fP"
.PP
Definition at line \fB17\fP of file \fBProposal\&.cc\fP\&.
.SS "map< std::string, std::vector< int > > bayesnet::Proposal::fit_local_discretization (const torch::Tensor & y)\fR [protected]\fP"
.PP
Definition at line \fB77\fP of file \fBProposal\&.cc\fP\&.
.SS "map< std::string, std::vector< int > > bayesnet::Proposal::localDiscretizationProposal (const map< std::string, std::vector< int > > & states, \fBNetwork\fP & model)\fR [protected]\fP"
.PP
Definition at line \fB26\fP of file \fBProposal\&.cc\fP\&.
.SS "torch::Tensor bayesnet::Proposal::prepareX (torch::Tensor & X)\fR [protected]\fP"
.PP
Definition at line \fB104\fP of file \fBProposal\&.cc\fP\&.
.SH "Member Data Documentation"
.PP
.SS "map<std::string, mdlp::CPPFImdlp*> bayesnet::Proposal::discretizers\fR [protected]\fP"
.PP
Definition at line \fB28\fP of file \fBProposal\&.h\fP\&.
.SS "torch::Tensor bayesnet::Proposal::Xf\fR [protected]\fP"
.PP
Definition at line \fB26\fP of file \fBProposal\&.h\fP\&.
.SS "torch::Tensor bayesnet::Proposal::y\fR [protected]\fP"
.PP
Definition at line \fB27\fP of file \fBProposal\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,195 +0,0 @@
.TH "bayesnet::SPODE" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::SPODE
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Classifier\fP\&.
.PP
Inherited by \fBbayesnet::SPODELd\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBSPODE\fP (int root)"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='SPODE') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB12\fP of file \fBSPODE\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::SPODE::SPODE (int root)\fR [explicit]\fP"
.PP
Definition at line \fB11\fP of file \fBSPODE\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::SPODE::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB13\fP of file \fBSPODE\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::SPODE::graph (const std::string & name = \fR'SPODE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB26\fP of file \fBSPODE\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,268 +0,0 @@
.TH "bayesnet::SPODELd" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::SPODELd
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::SPODE\fP, and \fBbayesnet::Proposal\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBSPODELd\fP (int root)"
.br
.ti -1c
.RI "\fBSPODELd\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBSPODELd\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBSPODELd\fP & \fBcommonFit\fP (const std::vector< std::string > &features, const std::string &className, map< std::string, std::vector< int > > &states)"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='SPODE') const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::SPODE\fP
.in +1c
.ti -1c
.RI "\fBSPODE\fP (int root)"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "\fBProposal\fP (torch::Tensor &pDataset, std::vector< std::string > &features_, std::string &className_)"
.br
.in -1c
.SS "Static Public Member Functions"
.in +1c
.ti -1c
.RI "static std::string \fBversion\fP ()"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Member Functions inherited from \fBbayesnet::SPODE\fP
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "void \fBcheckInput\fP (const torch::Tensor &X, const torch::Tensor &y)"
.br
.ti -1c
.RI "torch::Tensor \fBprepareX\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBlocalDiscretizationProposal\fP (const map< std::string, std::vector< int > > &states, \fBNetwork\fP &model)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBfit_local_discretization\fP (const torch::Tensor &y)"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBXf\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy\fP"
.br
.ti -1c
.RI "map< std::string, mdlp::CPPFImdlp * > \fBdiscretizers\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB13\fP of file \fBSPODELd\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::SPODELd::SPODELd (int root)\fR [explicit]\fP"
.PP
Definition at line \fB10\fP of file \fBSPODELd\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "\fBSPODELd\fP & bayesnet::SPODELd::commonFit (const std::vector< std::string > & features, const std::string & className, map< std::string, std::vector< int > > & states)"
.PP
Definition at line \fB29\fP of file \fBSPODELd\&.cc\fP\&.
.SS "\fBSPODELd\fP & bayesnet::SPODELd::fit (torch::Tensor & dataset, const std::vector< std::string > & features, const std::string & className, map< std::string, std::vector< int > > & states)\fR [override]\fP"
.PP
Definition at line \fB19\fP of file \fBSPODELd\&.cc\fP\&.
.SS "\fBSPODELd\fP & bayesnet::SPODELd::fit (torch::Tensor & X, torch::Tensor & y, const std::vector< std::string > & features, const std::string & className, map< std::string, std::vector< int > > & states)\fR [override]\fP"
.PP
Definition at line \fB11\fP of file \fBSPODELd\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::SPODELd::graph (const std::string & name = \fR'SPODE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::SPODE\fP\&.
.PP
Definition at line \fB46\fP of file \fBSPODELd\&.cc\fP\&.
.SS "torch::Tensor bayesnet::SPODELd::predict (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB41\fP of file \fBSPODELd\&.cc\fP\&.
.SS "static std::string bayesnet::SPODELd::version ()\fR [inline]\fP, \fR [static]\fP"
.PP
Definition at line \fB22\fP of file \fBSPODELd\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,193 +0,0 @@
.TH "bayesnet::SPnDE" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::SPnDE
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Classifier\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBSPnDE\fP (std::vector< int > parents)"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='SPnDE') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB13\fP of file \fBSPnDE\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::SPnDE::SPnDE (std::vector< int > parents)\fR [explicit]\fP"
.PP
Definition at line \fB11\fP of file \fBSPnDE\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::SPnDE::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB13\fP of file \fBSPnDE\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::SPnDE::graph (const std::string & name = \fR'SPnDE'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB33\fP of file \fBSPnDE\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,192 +0,0 @@
.TH "bayesnet::TAN" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::TAN
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::Classifier\fP\&.
.PP
Inherited by \fBbayesnet::TANLd\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='TAN') const override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB11\fP of file \fBTAN\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::TAN::TAN ()"
.PP
Definition at line \fB10\fP of file \fBTAN\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void bayesnet::TAN::buildModel (const torch::Tensor & weights)\fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB12\fP of file \fBTAN\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::TAN::graph (const std::string & name = \fR'TAN'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Implements \fBbayesnet::BaseClassifier\fP\&.
.PP
Definition at line \fB41\fP of file \fBTAN\&.cc\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,244 +0,0 @@
.TH "bayesnet::TANLd" 3 "Version 1.0.5" "BayesNet" \" -*- nroff -*-
.ad l
.nh
.SH NAME
bayesnet::TANLd
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBbayesnet::TAN\fP, and \fBbayesnet::Proposal\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBTANLd\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgraph\fP (const std::string &name='TAN') const override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict\fP (torch::Tensor &X) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "\fBClassifier\fP (\fBNetwork\fP model)"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (std::vector< std::vector< int > > &X, std::vector< int > &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &X, torch::Tensor &y, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states) override"
.br
.ti -1c
.RI "\fBClassifier\fP & \fBfit\fP (torch::Tensor &dataset, const std::vector< std::string > &features, const std::string &className, std::map< std::string, std::vector< int > > &states, const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBaddNodes\fP ()"
.br
.ti -1c
.RI "int \fBgetNumberOfNodes\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfEdges\fP () const override"
.br
.ti -1c
.RI "int \fBgetNumberOfStates\fP () const override"
.br
.ti -1c
.RI "int \fBgetClassNumStates\fP () const override"
.br
.ti -1c
.RI "std::vector< int > \fBpredict\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "torch::Tensor \fBpredict_proba\fP (torch::Tensor &X) override"
.br
.ti -1c
.RI "std::vector< std::vector< double > > \fBpredict_proba\fP (std::vector< std::vector< int > > &X) override"
.br
.ti -1c
.RI "status_t \fBgetStatus\fP () const override"
.br
.ti -1c
.RI "std::string \fBgetVersion\fP () override"
.br
.ti -1c
.RI "float \fBscore\fP (torch::Tensor &X, torch::Tensor &y) override"
.br
.ti -1c
.RI "float \fBscore\fP (std::vector< std::vector< int > > &X, std::vector< int > &y) override"
.br
.ti -1c
.RI "std::vector< std::string > \fBshow\fP () const override"
.br
.ti -1c
.RI "std::vector< std::string > \fBtopological_order\fP () override"
.br
.ti -1c
.RI "std::vector< std::string > \fBgetNotes\fP () const override"
.br
.ti -1c
.RI "std::string \fBdump_cpt\fP () const override"
.br
.ti -1c
.RI "void \fBsetHyperparameters\fP (const nlohmann::json &hyperparameters) override"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > & \fBgetValidHyperparameters\fP ()"
.br
.in -1c
Public Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "\fBProposal\fP (torch::Tensor &pDataset, std::vector< std::string > &features_, std::string &className_)"
.br
.in -1c
.SS "Static Public Member Functions"
.in +1c
.ti -1c
.RI "static std::string \fBversion\fP ()"
.br
.in -1c
.SS "Additional Inherited Members"
Protected Member Functions inherited from \fBbayesnet::TAN\fP
.in +1c
.ti -1c
.RI "void \fBbuildModel\fP (const torch::Tensor &weights) override"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "void \fBcheckFitParameters\fP ()"
.br
.ti -1c
.RI "void \fBtrainModel\fP (const torch::Tensor &weights) override"
.br
.ti -1c
.RI "void \fBbuildDataset\fP (torch::Tensor &y)"
.br
.in -1c
Protected Member Functions inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "void \fBcheckInput\fP (const torch::Tensor &X, const torch::Tensor &y)"
.br
.ti -1c
.RI "torch::Tensor \fBprepareX\fP (torch::Tensor &X)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBlocalDiscretizationProposal\fP (const map< std::string, std::vector< int > > &states, \fBNetwork\fP &model)"
.br
.ti -1c
.RI "map< std::string, std::vector< int > > \fBfit_local_discretization\fP (const torch::Tensor &y)"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Classifier\fP
.in +1c
.ti -1c
.RI "bool \fBfitted\fP"
.br
.ti -1c
.RI "unsigned int \fBm\fP"
.br
.ti -1c
.RI "unsigned int \fBn\fP"
.br
.ti -1c
.RI "\fBNetwork\fP \fBmodel\fP"
.br
.ti -1c
.RI "Metrics \fBmetrics\fP"
.br
.ti -1c
.RI "std::vector< std::string > \fBfeatures\fP"
.br
.ti -1c
.RI "std::string \fBclassName\fP"
.br
.ti -1c
.RI "std::map< std::string, std::vector< int > > \fBstates\fP"
.br
.ti -1c
.RI "torch::Tensor \fBdataset\fP"
.br
.ti -1c
.RI "status_t \fBstatus\fP = NORMAL"
.br
.ti -1c
.RI "std::vector< std::string > \fBnotes\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::BaseClassifier\fP
.in +1c
.ti -1c
.RI "std::vector< std::string > \fBvalidHyperparameters\fP"
.br
.in -1c
Protected Attributes inherited from \fBbayesnet::Proposal\fP
.in +1c
.ti -1c
.RI "torch::Tensor \fBXf\fP"
.br
.ti -1c
.RI "torch::Tensor \fBy\fP"
.br
.ti -1c
.RI "map< std::string, mdlp::CPPFImdlp * > \fBdiscretizers\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
Definition at line \fB13\fP of file \fBTANLd\&.h\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "bayesnet::TANLd::TANLd ()"
.PP
Definition at line \fB10\fP of file \fBTANLd\&.cc\fP\&.
.SH "Member Function Documentation"
.PP
.SS "\fBTANLd\fP & bayesnet::TANLd::fit (torch::Tensor & X, torch::Tensor & y, const std::vector< std::string > & features, const std::string & className, map< std::string, std::vector< int > > & states)\fR [override]\fP"
.PP
Definition at line \fB11\fP of file \fBTANLd\&.cc\fP\&.
.SS "std::vector< std::string > bayesnet::TANLd::graph (const std::string & name = \fR'TAN'\fP) const\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::TAN\fP\&.
.PP
Definition at line \fB32\fP of file \fBTANLd\&.cc\fP\&.
.SS "torch::Tensor bayesnet::TANLd::predict (torch::Tensor & X)\fR [override]\fP, \fR [virtual]\fP"
.PP
Reimplemented from \fBbayesnet::Classifier\fP\&.
.PP
Definition at line \fB27\fP of file \fBTANLd\&.cc\fP\&.
.SS "static std::string bayesnet::TANLd::version ()\fR [inline]\fP, \fR [static]\fP"
.PP
Definition at line \fB21\fP of file \fBTANLd\&.h\fP\&.
.SH "Author"
.PP
Generated automatically by Doxygen for BayesNet from the source code\&.

View File

@ -1,154 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/A2DE.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_a2_d_e_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">A2DE.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;A2DE.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> A2DE::A2DE(<span class="keywordtype">bool</span> predict_voting) : Ensemble(predict_voting)</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> validHyperparameters = { <span class="stringliteral">&quot;predict_voting&quot;</span> };</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> }</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">void</span> A2DE::setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters_)</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">auto</span> hyperparameters = hyperparameters_;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;predict_voting&quot;</span>)) {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> predict_voting = hyperparameters[<span class="stringliteral">&quot;predict_voting&quot;</span>];</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> hyperparameters.erase(<span class="stringliteral">&quot;predict_voting&quot;</span>);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> }</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> Classifier::setHyperparameters(hyperparameters);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> }</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> A2DE::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> models.clear();</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> significanceModels.clear();</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; features.size() - 1; ++i) {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; features.size(); ++j) {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">auto</span> model = std::make_unique&lt;SPnDE&gt;(std::vector&lt;int&gt;({ i, j }));</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> models.push_back(std::move(model));</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> n_models = <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span><span class="keyword">&gt;</span>(models.size());</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> significanceModels = std::vector&lt;double&gt;(n_models, 1.0);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> std::vector&lt;std::string&gt; A2DE::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">return</span> Ensemble::graph(title);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> }</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>A2DE.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,140 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/A2DE.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_a2_d_e_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">A2DE.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef A2DE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define A2DE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;bayesnet/classifiers/SPnDE.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Ensemble.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="};">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_a2_d_e.html"> 12</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_a2_d_e.html">A2DE</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_ensemble.html">Ensemble</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <a class="code hl_class" href="classbayesnet_1_1_a2_d_e.html">A2DE</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_a2_d_e.html">~A2DE</a>() {};</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">void</span> setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; title = <span class="stringliteral">&quot;A2DE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> };</div>
</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span>}</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_a2_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a></div><div class="ttdef"><b>Definition</b> <a href="#l00012">A2DE.h:12</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_ensemble_html"><div class="ttname"><a href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></div><div class="ttdef"><b>Definition</b> <a href="_ensemble_8h_source.html#l00015">Ensemble.h:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>A2DE.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,152 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/AODE.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_a_o_d_e_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">AODE.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;AODE.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> AODE::AODE(<span class="keywordtype">bool</span> predict_voting) : Ensemble(predict_voting)</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> validHyperparameters = { <span class="stringliteral">&quot;predict_voting&quot;</span> };</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> }</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordtype">void</span> AODE::setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters_)</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">auto</span> hyperparameters = hyperparameters_;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;predict_voting&quot;</span>)) {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> predict_voting = hyperparameters[<span class="stringliteral">&quot;predict_voting&quot;</span>];</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> hyperparameters.erase(<span class="stringliteral">&quot;predict_voting&quot;</span>);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> Classifier::setHyperparameters(hyperparameters);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> AODE::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> models.clear();</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> significanceModels.clear();</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; features.size(); ++i) {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> models.push_back(std::make_unique&lt;SPODE&gt;(i));</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> n_models = models.size();</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> significanceModels = std::vector&lt;double&gt;(n_models, 1.0);</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> }</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> std::vector&lt;std::string&gt; AODE::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> Ensemble::graph(title);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>AODE.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,140 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/AODE.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_a_o_d_e_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">AODE.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef AODE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define AODE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;bayesnet/classifiers/SPODE.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Ensemble.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="};">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_a_o_d_e.html"> 12</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_a_o_d_e.html">AODE</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_ensemble.html">Ensemble</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <a class="code hl_class" href="classbayesnet_1_1_a_o_d_e.html">AODE</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_a_o_d_e.html">~AODE</a>() {};</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">void</span> setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; title = <span class="stringliteral">&quot;AODE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> };</div>
</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span>}</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_a_o_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a></div><div class="ttdef"><b>Definition</b> <a href="#l00012">AODE.h:12</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_ensemble_html"><div class="ttname"><a href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></div><div class="ttdef"><b>Definition</b> <a href="_ensemble_8h_source.html#l00015">Ensemble.h:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>AODE.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/AODELd.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_a_o_d_e_ld_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">AODELd.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;AODELd.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> AODELd::AODELd(<span class="keywordtype">bool</span> predict_voting) : Ensemble(predict_voting), Proposal(dataset, features, className)</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> }</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> AODELd&amp; AODELd::fit(torch::Tensor&amp; X_, torch::Tensor&amp; y_, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_)</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> checkInput(X_, y_);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> features = features_;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> className = className_;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> Xf = X_;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> y = y_;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="comment">// Fills std::vectors Xv &amp; yv with the data from tensors X_ (discretized) &amp; y</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> states = fit_local_discretization(y);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="comment">// We have discretized the input data</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// 1st we need to fit the model to build the normal TAN structure, TAN::fit initializes the base Bayesian network</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> Ensemble::fit(dataset, features, className, states);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">void</span> AODELd::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> models.clear();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; features.size(); ++i) {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> models.push_back(std::make_unique&lt;SPODELd&gt;(i));</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> }</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> n_models = models.size();</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> significanceModels = std::vector&lt;double&gt;(n_models, 1.0);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> }</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">void</span> AODELd::trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> {</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; model : models) {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> model-&gt;fit(Xf, y, features, className, states);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> }</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::vector&lt;std::string&gt; AODELd::graph(<span class="keyword">const</span> std::string&amp; name)<span class="keyword"> const</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">return</span> Ensemble::graph(name);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> }</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>AODELd.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/AODELd.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_a_o_d_e_ld_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">AODELd.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef AODELD_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define AODELD_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;bayesnet/classifiers/Proposal.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;bayesnet/classifiers/SPODELd.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;Ensemble.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00014" data-start="{" data-end="};">
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_a_o_d_e_ld.html"> 14</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_a_o_d_e_ld.html">AODELd</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_ensemble.html">Ensemble</a>, <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_proposal.html">Proposal</a> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <a class="code hl_class" href="classbayesnet_1_1_a_o_d_e_ld.html">AODELd</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_a_o_d_e_ld.html">~AODELd</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <a class="code hl_class" href="classbayesnet_1_1_a_o_d_e_ld.html">AODELd</a>&amp; fit(torch::Tensor&amp; X_, torch::Tensor&amp; y_, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;AODELd&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> };</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span>}</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#endif </span><span class="comment">// !AODELD_H</span></div>
<div class="ttc" id="aclassbayesnet_1_1_a_o_d_e_ld_html"><div class="ttname"><a href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></div><div class="ttdef"><b>Definition</b> <a href="#l00014">AODELd.h:14</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_ensemble_html"><div class="ttname"><a href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></div><div class="ttdef"><b>Definition</b> <a href="_ensemble_8h_source.html#l00015">Ensemble.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_proposal_html"><div class="ttname"><a href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></div><div class="ttdef"><b>Definition</b> <a href="_proposal_8h_source.html#l00017">Proposal.h:17</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>AODELd.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,162 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/BaseClassifier.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_base_classifier_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">BaseClassifier.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;nlohmann/json.hpp&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keyword">enum</span> status_t { NORMAL, WARNING, ERROR };</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_base_classifier.html"> 13</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// X is nxm std::vector, y is nx1 std::vector</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a>&amp; fit(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) = 0;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="comment">// X is nxm tensor, y is nx1 tensor</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a>&amp; fit(torch::Tensor&amp; X, torch::Tensor&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) = 0;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a>&amp; fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) = 0;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a>&amp; fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights) = 0;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">~BaseClassifier</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> torch::Tensor <span class="keyword">virtual</span> predict(torch::Tensor&amp; X) = 0;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::vector&lt;int&gt; <span class="keyword">virtual</span> predict(std::vector&lt;std::vector&lt;int &gt;&gt;&amp; X) = 0;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> torch::Tensor <span class="keyword">virtual</span> predict_proba(torch::Tensor&amp; X) = 0;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::vector&lt;std::vector&lt;double&gt;&gt; <span class="keyword">virtual</span> predict_proba(std::vector&lt;std::vector&lt;int &gt;&gt;&amp; X) = 0;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> status_t <span class="keyword">virtual</span> getStatus() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">float</span> <span class="keyword">virtual</span> score(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y) = 0;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">float</span> <span class="keyword">virtual</span> score(torch::Tensor&amp; X, torch::Tensor&amp; y) = 0;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">int</span> <span class="keyword">virtual</span> getNumberOfNodes()<span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">int</span> <span class="keyword">virtual</span> getNumberOfEdges()<span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">int</span> <span class="keyword">virtual</span> getNumberOfStates() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">int</span> <span class="keyword">virtual</span> getClassNumStates() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::vector&lt;std::string&gt; <span class="keyword">virtual</span> show() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> std::vector&lt;std::string&gt; <span class="keyword">virtual</span> graph(<span class="keyword">const</span> std::string&amp; title = <span class="stringliteral">&quot;&quot;</span>) <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">virtual</span> std::string getVersion() = 0;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> std::vector&lt;std::string&gt; <span class="keyword">virtual</span> topological_order() = 0;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::vector&lt;std::string&gt; <span class="keyword">virtual</span> getNotes() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::string <span class="keyword">virtual</span> dump_cpt()<span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters) = 0;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> std::vector&lt;std::string&gt;&amp; getValidHyperparameters() { <span class="keywordflow">return</span> validHyperparameters; }</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights) = 0;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::vector&lt;std::string&gt; validHyperparameters;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> };</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>}</div>
<div class="ttc" id="aclassbayesnet_1_1_base_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></div><div class="ttdef"><b>Definition</b> <a href="#l00013">BaseClassifier.h:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><b>BaseClassifier.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,360 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/Boost.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_boost_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Boost.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;folding.hpp&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/CFS.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/FCBF.h&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/IWSS.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Boost.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> Boost::Boost(<span class="keywordtype">bool</span> predict_voting) : Ensemble(predict_voting)</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> validHyperparameters = { <span class="stringliteral">&quot;order&quot;</span>, <span class="stringliteral">&quot;convergence&quot;</span>, <span class="stringliteral">&quot;convergence_best&quot;</span>, <span class="stringliteral">&quot;bisection&quot;</span>, <span class="stringliteral">&quot;threshold&quot;</span>, <span class="stringliteral">&quot;maxTolerance&quot;</span>,</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="stringliteral">&quot;predict_voting&quot;</span>, <span class="stringliteral">&quot;select_features&quot;</span>, <span class="stringliteral">&quot;block_update&quot;</span> };</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> }</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordtype">void</span> Boost::setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters_)</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">auto</span> hyperparameters = hyperparameters_;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;order&quot;</span>)) {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> std::vector&lt;std::string&gt; algos = { Orders.ASC, Orders.DESC, Orders.RAND };</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> order_algorithm = hyperparameters[<span class="stringliteral">&quot;order&quot;</span>];</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">if</span> (std::find(algos.begin(), algos.end(), order_algorithm) == algos.end()) {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Invalid order algorithm, valid values [&quot;</span> + Orders.ASC + <span class="stringliteral">&quot;, &quot;</span> + Orders.DESC + <span class="stringliteral">&quot;, &quot;</span> + Orders.RAND + <span class="stringliteral">&quot;]&quot;</span>);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> }</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> hyperparameters.erase(<span class="stringliteral">&quot;order&quot;</span>);</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> }</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;convergence&quot;</span>)) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> convergence = hyperparameters[<span class="stringliteral">&quot;convergence&quot;</span>];</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> hyperparameters.erase(<span class="stringliteral">&quot;convergence&quot;</span>);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;convergence_best&quot;</span>)) {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> convergence_best = hyperparameters[<span class="stringliteral">&quot;convergence_best&quot;</span>];</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> hyperparameters.erase(<span class="stringliteral">&quot;convergence_best&quot;</span>);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> }</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;bisection&quot;</span>)) {</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> bisection = hyperparameters[<span class="stringliteral">&quot;bisection&quot;</span>];</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> hyperparameters.erase(<span class="stringliteral">&quot;bisection&quot;</span>);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;threshold&quot;</span>)) {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> threshold = hyperparameters[<span class="stringliteral">&quot;threshold&quot;</span>];</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> hyperparameters.erase(<span class="stringliteral">&quot;threshold&quot;</span>);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> }</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;maxTolerance&quot;</span>)) {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> maxTolerance = hyperparameters[<span class="stringliteral">&quot;maxTolerance&quot;</span>];</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">if</span> (maxTolerance &lt; 1 || maxTolerance &gt; 4)</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Invalid maxTolerance value, must be greater in [1, 4]&quot;</span>);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> hyperparameters.erase(<span class="stringliteral">&quot;maxTolerance&quot;</span>);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;predict_voting&quot;</span>)) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> predict_voting = hyperparameters[<span class="stringliteral">&quot;predict_voting&quot;</span>];</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> hyperparameters.erase(<span class="stringliteral">&quot;predict_voting&quot;</span>);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;select_features&quot;</span>)) {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">auto</span> selectedAlgorithm = hyperparameters[<span class="stringliteral">&quot;select_features&quot;</span>];</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> std::vector&lt;std::string&gt; algos = { SelectFeatures.IWSS, SelectFeatures.CFS, SelectFeatures.FCBF };</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> selectFeatures = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> select_features_algorithm = selectedAlgorithm;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">if</span> (std::find(algos.begin(), algos.end(), selectedAlgorithm) == algos.end()) {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Invalid selectFeatures value, valid values [&quot;</span> + SelectFeatures.IWSS + <span class="stringliteral">&quot;, &quot;</span> + SelectFeatures.CFS + <span class="stringliteral">&quot;, &quot;</span> + SelectFeatures.FCBF + <span class="stringliteral">&quot;]&quot;</span>);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> hyperparameters.erase(<span class="stringliteral">&quot;select_features&quot;</span>);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;block_update&quot;</span>)) {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> block_update = hyperparameters[<span class="stringliteral">&quot;block_update&quot;</span>];</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> hyperparameters.erase(<span class="stringliteral">&quot;block_update&quot;</span>);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> }</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> Classifier::setHyperparameters(hyperparameters);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">void</span> Boost::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Models shall be built in trainModel</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> models.clear();</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> significanceModels.clear();</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> n_models = 0;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// Prepare the validation dataset</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">auto</span> y_ = dataset.index({ -1, <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">if</span> (convergence) {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// Prepare train &amp; validation sets from train data</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">auto</span> fold = folding::StratifiedKFold(5, y_, 271);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">auto</span> [train, test] = fold.getFold(0);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">auto</span> train_t = torch::tensor(train);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keyword">auto</span> test_t = torch::tensor(test);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// Get train and validation sets</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> X_train = dataset.index({ torch::indexing::Slice(0, dataset.size(0) - 1), train_t });</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> y_train = dataset.index({ -1, train_t });</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> X_test = dataset.index({ torch::indexing::Slice(0, dataset.size(0) - 1), test_t });</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> y_test = dataset.index({ -1, test_t });</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> dataset = X_train;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> m = X_train.size(1);</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keyword">auto</span> n_classes = states.at(className).size();</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// Build dataset with train data</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> buildDataset(y_train);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> metrics = Metrics(dataset, features, className, n_classes);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// Use all data to train</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> X_train = dataset.index({ torch::indexing::Slice(0, dataset.size(0) - 1), <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> y_train = y_;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> }</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> }</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> std::vector&lt;int&gt; Boost::featureSelection(torch::Tensor&amp; weights_)</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordtype">int</span> maxFeatures = 0;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">if</span> (select_features_algorithm == SelectFeatures.CFS) {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> featureSelector = <span class="keyword">new</span> CFS(dataset, features, className, maxFeatures, states.at(className).size(), weights_);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (select_features_algorithm == SelectFeatures.IWSS) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">if</span> (threshold &lt; 0 || threshold &gt;0.5) {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Invalid threshold value for &quot;</span> + SelectFeatures.IWSS + <span class="stringliteral">&quot; [0, 0.5]&quot;</span>);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> featureSelector = <span class="keyword">new</span> IWSS(dataset, features, className, maxFeatures, states.at(className).size(), weights_, threshold);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (select_features_algorithm == SelectFeatures.FCBF) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (threshold &lt; 1e-7 || threshold &gt; 1) {</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Invalid threshold value for &quot;</span> + SelectFeatures.FCBF + <span class="stringliteral">&quot; [1e-7, 1]&quot;</span>);</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> featureSelector = <span class="keyword">new</span> FCBF(dataset, features, className, maxFeatures, states.at(className).size(), weights_, threshold);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> featureSelector-&gt;fit();</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keyword">auto</span> featuresUsed = featureSelector-&gt;getFeatures();</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keyword">delete</span> featureSelector;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">return</span> featuresUsed;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> }</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> std::tuple&lt;torch::Tensor&amp;, double, bool&gt; Boost::update_weights(torch::Tensor&amp; ytrain, torch::Tensor&amp; ypred, torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">bool</span> terminate = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordtype">double</span> alpha_t = 0;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keyword">auto</span> mask_wrong = ypred != ytrain;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keyword">auto</span> mask_right = ypred == ytrain;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keyword">auto</span> masked_weights = weights * mask_wrong.to(weights.dtype());</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keywordtype">double</span> epsilon_t = masked_weights.sum().item&lt;<span class="keywordtype">double</span>&gt;();</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">if</span> (epsilon_t &gt; 0.5) {</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// Inverse the weights policy (plot ln(wt))</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// &quot;In each round of AdaBoost, there is a sanity check to ensure that the current base </span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// learner is better than random guess&quot; (Zhi-Hua Zhou, 2012)</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> terminate = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordtype">double</span> wt = (1 - epsilon_t) / epsilon_t;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> alpha_t = epsilon_t == 0 ? 1 : 0.5 * log(wt);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="comment">// Step 3.2: Update weights for next classifier</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// Step 3.2.1: Update weights of wrong samples</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> weights += mask_wrong.to(weights.dtype()) * exp(alpha_t) * weights;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="comment">// Step 3.2.2: Update weights of right samples</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> weights += mask_right.to(weights.dtype()) * exp(-alpha_t) * weights;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="comment">// Step 3.3: Normalise the weights</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordtype">double</span> totalWeights = torch::sum(weights).item&lt;<span class="keywordtype">double</span>&gt;();</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> weights = weights / totalWeights;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordflow">return</span> { weights, alpha_t, terminate };</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> }</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> std::tuple&lt;torch::Tensor&amp;, double, bool&gt; Boost::update_weights_block(<span class="keywordtype">int</span> k, torch::Tensor&amp; ytrain, torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="comment">/* Update Block algorithm</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span><span class="comment"> k = # of models in block</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span><span class="comment"> n_models = # of models in ensemble to make predictions</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="comment"> n_models_bak = # models saved</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="comment"> models = vector of models to make predictions</span></div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="comment"> models_bak = models not used to make predictions</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="comment"> significances_bak = backup of significances vector</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="comment"></span> </div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span><span class="comment"> Case list</span></div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="comment"> A) k = 1, n_models = 1 =&gt; n = 0 , n_models = n + k</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="comment"> B) k = 1, n_models = n + 1 =&gt; n_models = n + k</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="comment"> C) k &gt; 1, n_models = k + 1 =&gt; n= 1, n_models = n + k</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="comment"> D) k &gt; 1, n_models = k =&gt; n = 0, n_models = n + k</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span><span class="comment"> E) k &gt; 1, n_models = k + n =&gt; n_models = n + k</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span><span class="comment"></span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span><span class="comment"> A, D) n=0, k &gt; 0, n_models == k</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="comment"> 1. n_models_bak &lt;- n_models</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="comment"> 2. significances_bak &lt;- significances</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span><span class="comment"> 3. significances = vector(k, 1)</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="comment"> 4. Dont move any classifiers out of models</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="comment"> 5. n_models &lt;- k</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="comment"> 6. Make prediction, compute alpha, update weights</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="comment"> 7. Dont restore any classifiers to models</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="comment"> 8. significances &lt;- significances_bak</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="comment"> 9. Update last k significances</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="comment"> 10. n_models &lt;- n_models_bak</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="comment"></span> </div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="comment"> B, C, E) n &gt; 0, k &gt; 0, n_models == n + k</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="comment"> 1. n_models_bak &lt;- n_models</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="comment"> 2. significances_bak &lt;- significances</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="comment"> 3. significances = vector(k, 1)</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span><span class="comment"> 4. Move first n classifiers to models_bak</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="comment"> 5. n_models &lt;- k</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="comment"> 6. Make prediction, compute alpha, update weights</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span><span class="comment"> 7. Insert classifiers in models_bak to be the first n models</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span><span class="comment"> 8. significances &lt;- significances_bak</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span><span class="comment"> 9. Update last k significances</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="comment"> 10. n_models &lt;- n_models_bak</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="comment"> */</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="comment">//</span></div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="comment">// Make predict with only the last k models</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="comment">//</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> std::unique_ptr&lt;Classifier&gt; model;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> std::vector&lt;std::unique_ptr&lt;Classifier&gt;&gt; models_bak;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="comment">// 1. n_models_bak &lt;- n_models 2. significances_bak &lt;- significances</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="keyword">auto</span> significance_bak = significanceModels;</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="keyword">auto</span> n_models_bak = n_models;</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="comment">// 3. significances = vector(k, 1)</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> significanceModels = std::vector&lt;double&gt;(k, 1.0);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="comment">// 4. Move first n classifiers to models_bak</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="comment">// backup the first n_models - k models (if n_models == k, don&#39;t backup any)</span></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_models - k; ++i) {</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> model = std::move(models[0]);</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> models.erase(models.begin());</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> models_bak.push_back(std::move(model));</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> }</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> assert(models.size() == k);</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="comment">// 5. n_models &lt;- k</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> n_models = k;</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <span class="comment">// 6. Make prediction, compute alpha, update weights</span></div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keyword">auto</span> ypred = predict(X_train);</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="comment">//</span></div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="comment">// Update weights</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <span class="comment">//</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> <span class="keywordtype">double</span> alpha_t;</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="keywordtype">bool</span> terminate;</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> std::tie(weights, alpha_t, terminate) = update_weights(y_train, ypred, weights);</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="comment">//</span></div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="comment">// Restore the models if needed</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="comment">//</span></div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="comment">// 7. Insert classifiers in models_bak to be the first n models</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="comment">// if n_models_bak == k, don&#39;t restore any, because none of them were moved</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordflow">if</span> (k != n_models_bak) {</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="comment">// Insert in the same order as they were extracted</span></div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keywordtype">int</span> bak_size = models_bak.size();</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; bak_size; ++i) {</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> model = std::move(models_bak[bak_size - 1 - i]);</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> models_bak.erase(models_bak.end() - 1);</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> models.insert(models.begin(), std::move(model));</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> }</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> }</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="comment">// 8. significances &lt;- significances_bak</span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> significanceModels = significance_bak;</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="comment">//</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="comment">// Update the significance of the last k models</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="comment">//</span></div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="comment">// 9. Update last k significances</span></div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; k; ++i) {</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> significanceModels[n_models_bak - k + i] = alpha_t;</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> }</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="comment">// 10. n_models &lt;- n_models_bak</span></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> n_models = n_models_bak;</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="keywordflow">return</span> { weights, alpha_t, terminate };</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> }</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>Boost.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,170 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/Boost.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_boost_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Boost.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef BOOST_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define BOOST_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;tuple&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;nlohmann/json.hpp&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &quot;Ensemble.h&quot;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/FeatureSelect.h&quot;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">const</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> std::string CFS = <span class="stringliteral">&quot;CFS&quot;</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> std::string FCBF = <span class="stringliteral">&quot;FCBF&quot;</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> std::string IWSS = <span class="stringliteral">&quot;IWSS&quot;</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }SelectFeatures;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">const</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::string ASC = <span class="stringliteral">&quot;asc&quot;</span>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::string DESC = <span class="stringliteral">&quot;desc&quot;</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::string RAND = <span class="stringliteral">&quot;rand&quot;</span>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> }Orders;</div>
<div class="foldopen" id="foldopen00027" data-start="{" data-end="};">
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_boost.html"> 27</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_boost.html">Boost</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_ensemble.html">Ensemble</a> {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_boost.html">Boost</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_boost.html">~Boost</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">void</span> setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters_) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::vector&lt;int&gt; featureSelection(torch::Tensor&amp; weights_);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> std::tuple&lt;torch::Tensor&amp;, double, bool&gt; update_weights(torch::Tensor&amp; ytrain, torch::Tensor&amp; ypred, torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> std::tuple&lt;torch::Tensor&amp;, double, bool&gt; update_weights_block(<span class="keywordtype">int</span> k, torch::Tensor&amp; ytrain, torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> torch::Tensor X_train, y_train, X_test, y_test;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// Hyperparameters</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">bool</span> bisection = <span class="keyword">true</span>; <span class="comment">// if true, use bisection stratety to add k models at once to the ensemble</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">int</span> maxTolerance = 3;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> std::string order_algorithm; <span class="comment">// order to process the KBest features asc, desc, rand</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">bool</span> convergence = <span class="keyword">true</span>; <span class="comment">//if true, stop when the model does not improve</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">bool</span> convergence_best = <span class="keyword">false</span>; <span class="comment">// wether to keep the best accuracy to the moment or the last accuracy as prior accuracy</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">bool</span> selectFeatures = <span class="keyword">false</span>; <span class="comment">// if true, use feature selection</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> std::string select_features_algorithm = Orders.DESC; <span class="comment">// Selected feature selection algorithm</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> FeatureSelect* featureSelector = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">double</span> threshold = -1;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">bool</span> block_update = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> };</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>}</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_boost_html"><div class="ttname"><a href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></div><div class="ttdef"><b>Definition</b> <a href="#l00027">Boost.h:27</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_ensemble_html"><div class="ttname"><a href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></div><div class="ttdef"><b>Definition</b> <a href="_ensemble_8h_source.html#l00015">Ensemble.h:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>Boost.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,281 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/BoostA2DE.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_boost_a2_d_e_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">BoostA2DE.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;set&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;limits.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;tuple&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;folding.hpp&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/CFS.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/FCBF.h&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &quot;bayesnet/feature_selection/IWSS.h&quot;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &quot;BoostA2DE.h&quot;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> BoostA2DE::BoostA2DE(<span class="keywordtype">bool</span> predict_voting) : Boost(predict_voting)</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> std::vector&lt;int&gt; BoostA2DE::initializeModels()</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> torch::Tensor weights_ = torch::full({ m }, 1.0 / m, torch::kFloat64);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::vector&lt;int&gt; featuresSelected = featureSelection(weights_);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">if</span> (featuresSelected.size() &lt; 2) {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> notes.push_back(<span class="stringliteral">&quot;No features selected in initialization&quot;</span>);</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> status = ERROR;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">return</span> std::vector&lt;int&gt;();</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; featuresSelected.size() - 1; i++) {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; featuresSelected.size(); j++) {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">auto</span> parents = { featuresSelected[i], featuresSelected[j] };</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> std::unique_ptr&lt;Classifier&gt; model = std::make_unique&lt;SPnDE&gt;(parents);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> model-&gt;fit(dataset, features, className, states, weights_);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> models.push_back(std::move(model));</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> significanceModels.push_back(1.0); <span class="comment">// They will be updated later in trainModel</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> n_models++;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> }</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> notes.push_back(<span class="stringliteral">&quot;Used features in initialization: &quot;</span> + std::to_string(featuresSelected.size()) + <span class="stringliteral">&quot; of &quot;</span> + std::to_string(features.size()) + <span class="stringliteral">&quot; with &quot;</span> + select_features_algorithm);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">return</span> featuresSelected;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> }</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">void</span> BoostA2DE::trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="comment">//</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// Logging setup</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="comment">//</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// loguru::set_thread_name(&quot;BoostA2DE&quot;);</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="comment">// loguru::g_stderr_verbosity = loguru::Verbosity_OFF;</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// loguru::add_file(&quot;boostA2DE.log&quot;, loguru::Truncate, loguru::Verbosity_MAX);</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// Algorithm based on the adaboost algorithm for classification</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="comment">// as explained in Ensemble methods (Zhi-Hua Zhou, 2012)</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> fitted = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">double</span> alpha_t = 0;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> torch::Tensor weights_ = torch::full({ m }, 1.0 / m, torch::kFloat64);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">bool</span> finished = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> std::vector&lt;int&gt; featuresUsed;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">if</span> (selectFeatures) {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> featuresUsed = initializeModels();</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">auto</span> ypred = predict(X_train);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> std::tie(weights_, alpha_t, finished) = update_weights(y_train, ypred, weights_);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">// Update significance of the models</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> significanceModels[i] = alpha_t;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">if</span> (finished) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> }</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">int</span> numItemsPack = 0; <span class="comment">// The counter of the models inserted in the current pack</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Variables to control the accuracy finish condition</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">double</span> priorAccuracy = 0.0;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordtype">double</span> improvement = 1.0;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">double</span> convergence_threshold = 1e-4;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordtype">int</span> tolerance = 0; <span class="comment">// number of times the accuracy is lower than the convergence_threshold</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// Step 0: Set the finish condition</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// epsilon sub t &gt; 0.5 =&gt; inverse the weights policy</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// validation error is not decreasing</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// run out of features</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordtype">bool</span> ascending = order_algorithm == Orders.ASC;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> std::mt19937 g{ 173 };</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::vector&lt;std::pair&lt;int, int&gt;&gt; pairSelection;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">while</span> (!finished) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// Step 1: Build ranking with mutual information</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> pairSelection = metrics.SelectKPairs(weights_, featuresUsed, ascending, 0); <span class="comment">// Get all the pairs sorted</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">if</span> (order_algorithm == Orders.RAND) {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::shuffle(pairSelection.begin(), pairSelection.end(), g);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordtype">int</span> k = bisection ? pow(2, tolerance) : 1;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordtype">int</span> counter = 0; <span class="comment">// The model counter of the current pack</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// VLOG_SCOPE_F(1, &quot;counter=%d k=%d featureSelection.size: %zu&quot;, counter, k, featureSelection.size());</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">while</span> (counter++ &lt; k &amp;&amp; pairSelection.size() &gt; 0) {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keyword">auto</span> feature_pair = pairSelection[0];</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> pairSelection.erase(pairSelection.begin());</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> std::unique_ptr&lt;Classifier&gt; model;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> model = std::make_unique&lt;SPnDE&gt;(std::vector&lt;int&gt;({ feature_pair.first, feature_pair.second }));</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> model-&gt;fit(dataset, features, className, states, weights_);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> alpha_t = 0.0;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">if</span> (!block_update) {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">auto</span> ypred = model-&gt;predict(X_train);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// Step 3.1: Compute the classifier amout of say</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::tie(weights_, alpha_t, finished) = update_weights(y_train, ypred, weights_);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> }</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// Step 3.4: Store classifier and its accuracy to weigh its future vote</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> numItemsPack++;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> models.push_back(std::move(model));</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> significanceModels.push_back(alpha_t);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> n_models++;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// VLOG_SCOPE_F(2, &quot;numItemsPack: %d n_models: %d featuresUsed: %zu&quot;, numItemsPack, n_models, featuresUsed.size());</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> }</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (block_update) {</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::tie(weights_, alpha_t, finished) = update_weights_block(k, y_train, weights_);</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">if</span> (convergence &amp;&amp; !finished) {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keyword">auto</span> y_val_predict = predict(X_test);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordtype">double</span> accuracy = (y_val_predict == y_test).sum().item&lt;<span class="keywordtype">double</span>&gt;() / (<span class="keywordtype">double</span>)y_test.size(0);</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">if</span> (priorAccuracy == 0) {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> priorAccuracy = accuracy;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> improvement = accuracy - priorAccuracy;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">if</span> (improvement &lt; convergence_threshold) {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// VLOG_SCOPE_F(3, &quot; (improvement&lt;threshold) tolerance: %d numItemsPack: %d improvement: %f prior: %f current: %f&quot;, tolerance, numItemsPack, improvement, priorAccuracy, accuracy);</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> tolerance++;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="comment">// VLOG_SCOPE_F(3, &quot;* (improvement&gt;=threshold) Reset. tolerance: %d numItemsPack: %d improvement: %f prior: %f current: %f&quot;, tolerance, numItemsPack, improvement, priorAccuracy, accuracy);</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> tolerance = 0; <span class="comment">// Reset the counter if the model performs better</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> numItemsPack = 0;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> }</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (convergence_best) {</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// Keep the best accuracy until now as the prior accuracy</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> priorAccuracy = std::max(accuracy, priorAccuracy);</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="comment">// Keep the last accuray obtained as the prior accuracy</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> priorAccuracy = accuracy;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// VLOG_SCOPE_F(1, &quot;tolerance: %d featuresUsed.size: %zu features.size: %zu&quot;, tolerance, featuresUsed.size(), features.size());</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> finished = finished || tolerance &gt; maxTolerance || pairSelection.size() == 0;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> }</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">if</span> (tolerance &gt; maxTolerance) {</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">if</span> (numItemsPack &lt; n_models) {</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> notes.push_back(<span class="stringliteral">&quot;Convergence threshold reached &amp; &quot;</span> + std::to_string(numItemsPack) + <span class="stringliteral">&quot; models eliminated&quot;</span>);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="comment">// VLOG_SCOPE_F(4, &quot;Convergence threshold reached &amp; %d models eliminated of %d&quot;, numItemsPack, n_models);</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; numItemsPack; ++i) {</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> significanceModels.pop_back();</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> models.pop_back();</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> n_models--;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> notes.push_back(<span class="stringliteral">&quot;Convergence threshold reached &amp; 0 models eliminated&quot;</span>);</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="comment">// VLOG_SCOPE_F(4, &quot;Convergence threshold reached &amp; 0 models eliminated n_models=%d numItemsPack=%d&quot;, n_models, numItemsPack);</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keywordflow">if</span> (pairSelection.size() &gt; 0) {</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> notes.push_back(<span class="stringliteral">&quot;Pairs not used in train: &quot;</span> + std::to_string(pairSelection.size()));</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> status = WARNING;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> notes.push_back(<span class="stringliteral">&quot;Number of models: &quot;</span> + std::to_string(n_models));</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> std::vector&lt;std::string&gt; BoostA2DE::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">return</span> Ensemble::graph(title);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>BoostA2DE.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,143 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/BoostA2DE.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_boost_a2_d_e_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">BoostA2DE.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef BOOSTA2DE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define BOOSTA2DE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;bayesnet/classifiers/SPnDE.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;Boost.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00014" data-start="{" data-end="};">
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_boost_a2_d_e.html"> 14</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_boost_a2_d_e.html">BoostA2DE</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_boost.html">Boost</a> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_boost_a2_d_e.html">BoostA2DE</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_boost_a2_d_e.html">~BoostA2DE</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; title = <span class="stringliteral">&quot;BoostA2DE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">void</span> trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> std::vector&lt;int&gt; initializeModels();</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> };</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span>}</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_boost_a2_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a></div><div class="ttdef"><b>Definition</b> <a href="#l00014">BoostA2DE.h:14</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_boost_html"><div class="ttname"><a href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></div><div class="ttdef"><b>Definition</b> <a href="_boost_8h_source.html#l00027">Boost.h:27</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>BoostA2DE.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,275 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/BoostAODE.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_boost_a_o_d_e_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">BoostAODE.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;random&gt;</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;set&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;limits.h&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;tuple&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;BoostAODE.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> BoostAODE::BoostAODE(<span class="keywordtype">bool</span> predict_voting) : Boost(predict_voting)</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> }</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> std::vector&lt;int&gt; BoostAODE::initializeModels()</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> torch::Tensor weights_ = torch::full({ m }, 1.0 / m, torch::kFloat64);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> std::vector&lt;int&gt; featuresSelected = featureSelection(weights_);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">int</span>&amp; feature : featuresSelected) {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::unique_ptr&lt;Classifier&gt; model = std::make_unique&lt;SPODE&gt;(feature);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> model-&gt;fit(dataset, features, className, states, weights_);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> models.push_back(std::move(model));</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> significanceModels.push_back(1.0); <span class="comment">// They will be updated later in trainModel</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> n_models++;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> }</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> notes.push_back(<span class="stringliteral">&quot;Used features in initialization: &quot;</span> + std::to_string(featuresSelected.size()) + <span class="stringliteral">&quot; of &quot;</span> + std::to_string(features.size()) + <span class="stringliteral">&quot; with &quot;</span> + select_features_algorithm);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">return</span> featuresSelected;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">void</span> BoostAODE::trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="comment">//</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// Logging setup</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="comment">//</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// loguru::set_thread_name(&quot;BoostAODE&quot;);</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// loguru::g_stderr_verbosity = loguru::Verbosity_OFF;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// loguru::add_file(&quot;boostAODE.log&quot;, loguru::Truncate, loguru::Verbosity_MAX);</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// Algorithm based on the adaboost algorithm for classification</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// as explained in Ensemble methods (Zhi-Hua Zhou, 2012)</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> fitted = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">double</span> alpha_t = 0;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> torch::Tensor weights_ = torch::full({ m }, 1.0 / m, torch::kFloat64);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">bool</span> finished = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::vector&lt;int&gt; featuresUsed;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">if</span> (selectFeatures) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> featuresUsed = initializeModels();</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">auto</span> ypred = predict(X_train);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> std::tie(weights_, alpha_t, finished) = update_weights(y_train, ypred, weights_);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// Update significance of the models</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> significanceModels[i] = alpha_t;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> }</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">if</span> (finished) {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> }</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">int</span> numItemsPack = 0; <span class="comment">// The counter of the models inserted in the current pack</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// Variables to control the accuracy finish condition</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">double</span> priorAccuracy = 0.0;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">double</span> improvement = 1.0;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">double</span> convergence_threshold = 1e-4;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">int</span> tolerance = 0; <span class="comment">// number of times the accuracy is lower than the convergence_threshold</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="comment">// Step 0: Set the finish condition</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// epsilon sub t &gt; 0.5 =&gt; inverse the weights policy</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// validation error is not decreasing</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// run out of features</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">bool</span> ascending = order_algorithm == Orders.ASC;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> std::mt19937 g{ 173 };</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">while</span> (!finished) {</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="comment">// Step 1: Build ranking with mutual information</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">auto</span> featureSelection = metrics.SelectKBestWeighted(weights_, ascending, n); <span class="comment">// Get all the features sorted</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">if</span> (order_algorithm == Orders.RAND) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> std::shuffle(featureSelection.begin(), featureSelection.end(), g);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Remove used features</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> featureSelection.erase(remove_if(begin(featureSelection), end(featureSelection), [&amp;](<span class="keyword">auto</span> x)</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> { <span class="keywordflow">return</span> std::find(begin(featuresUsed), end(featuresUsed), x) != end(featuresUsed);}),</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> end(featureSelection)</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> );</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">int</span> k = bisection ? pow(2, tolerance) : 1;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordtype">int</span> counter = 0; <span class="comment">// The model counter of the current pack</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// VLOG_SCOPE_F(1, &quot;counter=%d k=%d featureSelection.size: %zu&quot;, counter, k, featureSelection.size());</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">while</span> (counter++ &lt; k &amp;&amp; featureSelection.size() &gt; 0) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">auto</span> feature = featureSelection[0];</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> featureSelection.erase(featureSelection.begin());</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> std::unique_ptr&lt;Classifier&gt; model;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> model = std::make_unique&lt;SPODE&gt;(feature);</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> model-&gt;fit(dataset, features, className, states, weights_);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> alpha_t = 0.0;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">if</span> (!block_update) {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keyword">auto</span> ypred = model-&gt;predict(X_train);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// Step 3.1: Compute the classifier amout of say</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> std::tie(weights_, alpha_t, finished) = update_weights(y_train, ypred, weights_);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// Step 3.4: Store classifier and its accuracy to weigh its future vote</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> numItemsPack++;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> featuresUsed.push_back(feature);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> models.push_back(std::move(model));</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> significanceModels.push_back(alpha_t);</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> n_models++;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="comment">// VLOG_SCOPE_F(2, &quot;numItemsPack: %d n_models: %d featuresUsed: %zu&quot;, numItemsPack, n_models, featuresUsed.size());</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (block_update) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::tie(weights_, alpha_t, finished) = update_weights_block(k, y_train, weights_);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">if</span> (convergence &amp;&amp; !finished) {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">auto</span> y_val_predict = predict(X_test);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordtype">double</span> accuracy = (y_val_predict == y_test).sum().item&lt;<span class="keywordtype">double</span>&gt;() / (<span class="keywordtype">double</span>)y_test.size(0);</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (priorAccuracy == 0) {</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> priorAccuracy = accuracy;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> improvement = accuracy - priorAccuracy;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">if</span> (improvement &lt; convergence_threshold) {</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// VLOG_SCOPE_F(3, &quot; (improvement&lt;threshold) tolerance: %d numItemsPack: %d improvement: %f prior: %f current: %f&quot;, tolerance, numItemsPack, improvement, priorAccuracy, accuracy);</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> tolerance++;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="comment">// VLOG_SCOPE_F(3, &quot;* (improvement&gt;=threshold) Reset. tolerance: %d numItemsPack: %d improvement: %f prior: %f current: %f&quot;, tolerance, numItemsPack, improvement, priorAccuracy, accuracy);</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> tolerance = 0; <span class="comment">// Reset the counter if the model performs better</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> numItemsPack = 0;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">if</span> (convergence_best) {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="comment">// Keep the best accuracy until now as the prior accuracy</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> priorAccuracy = std::max(accuracy, priorAccuracy);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// Keep the last accuray obtained as the prior accuracy</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> priorAccuracy = accuracy;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> }</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> }</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// VLOG_SCOPE_F(1, &quot;tolerance: %d featuresUsed.size: %zu features.size: %zu&quot;, tolerance, featuresUsed.size(), features.size());</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> finished = finished || tolerance &gt; maxTolerance || featuresUsed.size() == features.size();</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> }</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">if</span> (tolerance &gt; maxTolerance) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">if</span> (numItemsPack &lt; n_models) {</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> notes.push_back(<span class="stringliteral">&quot;Convergence threshold reached &amp; &quot;</span> + std::to_string(numItemsPack) + <span class="stringliteral">&quot; models eliminated&quot;</span>);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// VLOG_SCOPE_F(4, &quot;Convergence threshold reached &amp; %d models eliminated of %d&quot;, numItemsPack, n_models);</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; numItemsPack; ++i) {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> significanceModels.pop_back();</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> models.pop_back();</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> n_models--;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> }</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> notes.push_back(<span class="stringliteral">&quot;Convergence threshold reached &amp; 0 models eliminated&quot;</span>);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="comment">// VLOG_SCOPE_F(4, &quot;Convergence threshold reached &amp; 0 models eliminated n_models=%d numItemsPack=%d&quot;, n_models, numItemsPack);</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> }</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">if</span> (featuresUsed.size() != features.size()) {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> notes.push_back(<span class="stringliteral">&quot;Used features in train: &quot;</span> + std::to_string(featuresUsed.size()) + <span class="stringliteral">&quot; of &quot;</span> + std::to_string(features.size()));</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> status = WARNING;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> }</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> notes.push_back(<span class="stringliteral">&quot;Number of models: &quot;</span> + std::to_string(n_models));</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> std::vector&lt;std::string&gt; BoostAODE::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">return</span> Ensemble::graph(title);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>BoostAODE.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/BoostAODE.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_boost_a_o_d_e_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">BoostAODE.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef BOOSTAODE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define BOOSTAODE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;bayesnet/classifiers/SPODE.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;Boost.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_boost_a_o_d_e.html"> 15</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_boost_a_o_d_e.html">BoostAODE</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_boost.html">Boost</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_boost_a_o_d_e.html">BoostAODE</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_boost_a_o_d_e.html">~BoostAODE</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; title = <span class="stringliteral">&quot;BoostAODE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::vector&lt;int&gt; initializeModels();</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> };</div>
</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span>}</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_boost_a_o_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_boost_a_o_d_e.html">bayesnet::BoostAODE</a></div><div class="ttdef"><b>Definition</b> <a href="#l00015">BoostAODE.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_boost_html"><div class="ttname"><a href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></div><div class="ttdef"><b>Definition</b> <a href="_boost_8h_source.html#l00027">Boost.h:27</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>BoostAODE.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,308 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/Classifier.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_classifier_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Classifier.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &quot;bayesnet/utils/bayesnetUtils.h&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;Classifier.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> Classifier::Classifier(Network model) : model(model), m(0), n(0), metrics(Metrics()), fitted(false) {}</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">const</span> std::string CLASSIFIER_NOT_FITTED = <span class="stringliteral">&quot;Classifier has not been fitted&quot;</span>;</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> Classifier&amp; Classifier::build(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> this-&gt;features = features;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> this-&gt;className = className;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> this-&gt;states = states;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> m = dataset.size(1);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> n = features.size();</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> checkFitParameters();</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">auto</span> n_classes = states.at(className).size();</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> metrics = Metrics(dataset, features, className, n_classes);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> model.initialize();</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> buildModel(weights);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> trainModel(weights);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> fitted = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> }</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">void</span> Classifier::buildDataset(torch::Tensor&amp; ytmp)</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">try</span> {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">auto</span> yresized = torch::transpose(ytmp.view({ ytmp.size(0), 1 }), 0, 1);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> dataset = torch::cat({ dataset, yresized }, 0);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception&amp; e) {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::stringstream oss;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> oss &lt;&lt; <span class="stringliteral">&quot;* Error in X and y dimensions *\n&quot;</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> oss &lt;&lt; <span class="stringliteral">&quot;X dimensions: &quot;</span> &lt;&lt; dataset.sizes() &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> oss &lt;&lt; <span class="stringliteral">&quot;y dimensions: &quot;</span> &lt;&lt; ytmp.sizes();</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">throw</span> std::runtime_error(oss.str());</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> }</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">void</span> Classifier::trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> model.fit(dataset, weights, features, className, states);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> }</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// X is nxm where n is the number of features and m the number of samples</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> Classifier&amp; Classifier::fit(torch::Tensor&amp; X, torch::Tensor&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> dataset = X;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> buildDataset(y);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">const</span> torch::Tensor weights = torch::full({ dataset.size(1) }, 1.0 / dataset.size(1), torch::kDouble);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> build(features, className, states, weights);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="comment">// X is nxm where n is the number of features and m the number of samples</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> Classifier&amp; Classifier::fit(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> dataset = torch::zeros({ <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(X.size()), <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(X[0].size()) }, torch::kInt32);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; X.size(); ++i) {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> dataset.index_put_({ i, <span class="stringliteral">&quot;...&quot;</span> }, torch::tensor(X[i], torch::kInt32));</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keyword">auto</span> ytmp = torch::tensor(y, torch::kInt32);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> buildDataset(ytmp);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">const</span> torch::Tensor weights = torch::full({ dataset.size(1) }, 1.0 / dataset.size(1), torch::kDouble);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> build(features, className, states, weights);</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> Classifier&amp; Classifier::fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> this-&gt;dataset = dataset;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">const</span> torch::Tensor weights = torch::full({ dataset.size(1) }, 1.0 / dataset.size(1), torch::kDouble);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">return</span> build(features, className, states, weights);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> Classifier&amp; Classifier::fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> this-&gt;dataset = dataset;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> build(features, className, states, weights);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">void</span> Classifier::checkFitParameters()</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">if</span> (torch::is_floating_point(dataset)) {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;dataset (X, y) must be of type Integer&quot;</span>);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> }</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">if</span> (dataset.size(0) - 1 != features.size()) {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Classifier: X &quot;</span> + std::to_string(dataset.size(0) - 1) + <span class="stringliteral">&quot; and features &quot;</span> + std::to_string(features.size()) + <span class="stringliteral">&quot; must have the same number of features&quot;</span>);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (states.find(className) == states.end()) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;class name not found in states&quot;</span>);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> feature : features) {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> (states.find(feature) == states.end()) {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;feature [&quot;</span> + feature + <span class="stringliteral">&quot;] not found in states&quot;</span>);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> }</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> torch::Tensor Classifier::predict(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">throw</span> std::logic_error(CLASSIFIER_NOT_FITTED);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> }</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">return</span> model.predict(X);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::vector&lt;int&gt; Classifier::predict(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> {</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">throw</span> std::logic_error(CLASSIFIER_NOT_FITTED);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> }</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">auto</span> m_ = X[0].size();</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keyword">auto</span> n_ = X.size();</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::vector&lt;std::vector&lt;int&gt;&gt; Xd(n_, std::vector&lt;int&gt;(m_, 0));</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_; i++) {</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> Xd[i] = std::vector&lt;int&gt;(X[i].begin(), X[i].end());</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">auto</span> yp = model.predict(Xd);</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">return</span> yp;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> }</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> torch::Tensor Classifier::predict_proba(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> {</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">throw</span> std::logic_error(CLASSIFIER_NOT_FITTED);</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> model.predict_proba(X);</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> std::vector&lt;std::vector&lt;double&gt;&gt; Classifier::predict_proba(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> {</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">throw</span> std::logic_error(CLASSIFIER_NOT_FITTED);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keyword">auto</span> m_ = X[0].size();</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keyword">auto</span> n_ = X.size();</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::vector&lt;std::vector&lt;int&gt;&gt; Xd(n_, std::vector&lt;int&gt;(m_, 0));</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// Convert to nxm vector</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_; i++) {</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> Xd[i] = std::vector&lt;int&gt;(X[i].begin(), X[i].end());</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> }</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">auto</span> yp = model.predict_proba(Xd);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">return</span> yp;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordtype">float</span> Classifier::score(torch::Tensor&amp; X, torch::Tensor&amp; y)</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> {</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> torch::Tensor y_pred = predict(X);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">return</span> (y_pred == y).sum().item&lt;<span class="keywordtype">float</span>&gt;() / y.size(0);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordtype">float</span> Classifier::score(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y)</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> {</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">throw</span> std::logic_error(CLASSIFIER_NOT_FITTED);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> }</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">return</span> model.score(X, y);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> std::vector&lt;std::string&gt; Classifier::show()<span class="keyword"> const</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">return</span> model.show();</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> }</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="keywordtype">void</span> Classifier::addNodes()</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// Add all nodes to the network</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; feature : features) {</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> model.addNode(feature);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> model.addNode(className);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordtype">int</span> Classifier::getNumberOfNodes()<span class="keyword"> const</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="comment">// Features does not include class</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordflow">return</span> fitted ? model.getFeatures().size() : 0;</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> }</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordtype">int</span> Classifier::getNumberOfEdges()<span class="keyword"> const</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> fitted ? model.getNumEdges() : 0;</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> }</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordtype">int</span> Classifier::getNumberOfStates()<span class="keyword"> const</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">return</span> fitted ? model.getStates() : 0;</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordtype">int</span> Classifier::getClassNumStates()<span class="keyword"> const</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordflow">return</span> fitted ? model.getClassNumStates() : 0;</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> }</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> std::vector&lt;std::string&gt; Classifier::topological_order()</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> {</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="keywordflow">return</span> model.topological_sort();</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> }</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> std::string Classifier::dump_cpt()<span class="keyword"> const</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="keywordflow">return</span> model.dump_cpt();</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> }</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keywordtype">void</span> Classifier::setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters)</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> {</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordflow">if</span> (!hyperparameters.empty()) {</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Invalid hyperparameters&quot;</span> + hyperparameters.dump());</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> }</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> }</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>Classifier.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,184 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/Classifier.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_classifier_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Classifier.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef CLASSIFIER_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define CLASSIFIER_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;bayesnet/utils/BayesMetrics.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;bayesnet/network/Network.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;bayesnet/BaseClassifier.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_classifier.html"> 15</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a>(<a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a> model);</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">~Classifier</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a>&amp; fit(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a>&amp; fit(torch::Tensor&amp; X, torch::Tensor&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a>&amp; fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a>&amp; fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> addNodes();</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">int</span> getNumberOfNodes() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">int</span> getNumberOfEdges() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordtype">int</span> getNumberOfStates() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">int</span> getClassNumStates() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> torch::Tensor predict(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> std::vector&lt;int&gt; predict(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> torch::Tensor predict_proba(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> std::vector&lt;std::vector&lt;double&gt;&gt; predict_proba(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> status_t getStatus()<span class="keyword"> const override </span>{ <span class="keywordflow">return</span> status; }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::string getVersion()<span class="keyword"> override </span>{ <span class="keywordflow">return</span> { project_version.begin(), project_version.end() }; };</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">float</span> score(torch::Tensor&amp; X, torch::Tensor&amp; y) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">float</span> score(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> std::vector&lt;std::string&gt; show() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::vector&lt;std::string&gt; topological_order() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::vector&lt;std::string&gt; getNotes()<span class="keyword"> const override </span>{ <span class="keywordflow">return</span> notes; }</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> std::string dump_cpt() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">void</span> setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters) <span class="keyword">override</span>; <span class="comment">//For classifiers that don&#39;t have hyperparameters</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">bool</span> fitted;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m, n; <span class="comment">// m: number of samples, n: number of features</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a> model;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> Metrics metrics;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::vector&lt;std::string&gt; features;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::string className;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt; states;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> torch::Tensor dataset; <span class="comment">// (n+1)xm tensor</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> status_t status = NORMAL;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> std::vector&lt;std::string&gt; notes; <span class="comment">// Used to store messages occurred during the fit process</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">void</span> checkFitParameters();</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) = 0;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">void</span> trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">void</span> buildDataset(torch::Tensor&amp; y);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a>&amp; build(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> };</div>
</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>}</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="ttc" id="aclassbayesnet_1_1_base_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></div><div class="ttdef"><b>Definition</b> <a href="_base_classifier_8h_source.html#l00013">BaseClassifier.h:13</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></div><div class="ttdef"><b>Definition</b> <a href="#l00015">Classifier.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_network_html"><div class="ttname"><a href="classbayesnet_1_1_network.html">bayesnet::Network</a></div><div class="ttdef"><b>Definition</b> <a href="_network_8h_source.html#l00015">Network.h:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>Classifier.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,336 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/Ensemble.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_ensemble_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Ensemble.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;Ensemble.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> Ensemble::Ensemble(<span class="keywordtype">bool</span> predict_voting) : Classifier(Network()), n_models(0), predict_voting(predict_voting)</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> };</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">const</span> std::string ENSEMBLE_NOT_FITTED = <span class="stringliteral">&quot;Ensemble has not been fitted&quot;</span>;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">void</span> Ensemble::trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> n_models = models.size();</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="comment">// fit with std::vectors</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> models[i]-&gt;fit(dataset, features, className, states);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> }</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::vector&lt;int&gt; Ensemble::compute_arg_max(std::vector&lt;std::vector&lt;double&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> std::vector&lt;int&gt; y_pred;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; X.size(); ++i) {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">auto</span> max = std::max_element(X[i].begin(), X[i].end());</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> y_pred.push_back(std::distance(X[i].begin(), max));</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">return</span> y_pred;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> torch::Tensor Ensemble::compute_arg_max(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">auto</span> y_pred = torch::argmax(X, 1);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> y_pred;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> torch::Tensor Ensemble::voting(torch::Tensor&amp; votes)</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// Convert m x n_models tensor to a m x n_class_states with voting probabilities</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">auto</span> y_pred_ = votes.accessor&lt;int, 2&gt;();</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> std::vector&lt;int&gt; y_pred_final;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">int</span> numClasses = states.at(className).size();</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// votes is m x n_models with the prediction of every model for each sample</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">auto</span> result = torch::zeros({ votes.size(0), numClasses }, torch::kFloat32);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">auto</span> sum = std::reduce(significanceModels.begin(), significanceModels.end());</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; votes.size(0); ++i) {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// n_votes store in each index (value of class) the significance added by each model</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// i.e. n_votes[0] contains how much value has the value 0 of class. That value is generated by the models predictions</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> std::vector&lt;double&gt; n_votes(numClasses, 0.0);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; n_models; ++j) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> n_votes[y_pred_[i][j]] += significanceModels.at(j);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> result[i] = torch::tensor(n_votes);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="comment">// To only do one division and gain precision</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> result /= sum;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::vector&lt;std::vector&lt;double&gt;&gt; Ensemble::predict_proba(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">throw</span> std::logic_error(ENSEMBLE_NOT_FITTED);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> predict_voting ? predict_average_voting(X) : predict_average_proba(X);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> torch::Tensor Ensemble::predict_proba(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">throw</span> std::logic_error(ENSEMBLE_NOT_FITTED);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> }</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">return</span> predict_voting ? predict_average_voting(X) : predict_average_proba(X);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> std::vector&lt;int&gt; Ensemble::predict(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">auto</span> res = predict_proba(X);</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> compute_arg_max(res);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> torch::Tensor Ensemble::predict(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">auto</span> res = predict_proba(X);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">return</span> compute_arg_max(res);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> }</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> torch::Tensor Ensemble::predict_average_proba(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">auto</span> n_states = models[0]-&gt;getClassNumStates();</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> torch::Tensor y_pred = torch::zeros({ X.size(1), n_states }, torch::kFloat32);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">auto</span> threads{ std::vector&lt;std::thread&gt;() };</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::mutex mtx;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> threads.push_back(std::thread([&amp;, i]() {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keyword">auto</span> ypredict = models[i]-&gt;predict_proba(X);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::lock_guard&lt;std::mutex&gt; lock(mtx);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> y_pred += ypredict * significanceModels[i];</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }));</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; thread : threads) {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> thread.join();</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">auto</span> sum = std::reduce(significanceModels.begin(), significanceModels.end());</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> y_pred /= sum;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> y_pred;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::vector&lt;std::vector&lt;double&gt;&gt; Ensemble::predict_average_proba(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">auto</span> n_states = models[0]-&gt;getClassNumStates();</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::vector&lt;std::vector&lt;double&gt;&gt; y_pred(X[0].size(), std::vector&lt;double&gt;(n_states, 0.0));</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">auto</span> threads{ std::vector&lt;std::thread&gt;() };</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> std::mutex mtx;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> threads.push_back(std::thread([&amp;, i]() {</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keyword">auto</span> ypredict = models[i]-&gt;predict_proba(X);</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> assert(ypredict.size() == y_pred.size());</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> assert(ypredict[0].size() == y_pred[0].size());</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::lock_guard&lt;std::mutex&gt; lock(mtx);</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// Multiply each prediction by the significance of the model and then add it to the final prediction</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> j = 0; j &lt; ypredict.size(); ++j) {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::transform(y_pred[j].begin(), y_pred[j].end(), ypredict[j].begin(), y_pred[j].begin(),</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> [significanceModels = significanceModels[i]](<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y) { <span class="keywordflow">return</span> x + y * significanceModels; });</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> }</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }));</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> }</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; thread : threads) {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> thread.join();</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">auto</span> sum = std::reduce(significanceModels.begin(), significanceModels.end());</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="comment">//Divide each element of the prediction by the sum of the significances</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> j = 0; j &lt; y_pred.size(); ++j) {</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> std::transform(y_pred[j].begin(), y_pred[j].end(), y_pred[j].begin(), [sum](<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> x / sum; });</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> }</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">return</span> y_pred;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> }</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> std::vector&lt;std::vector&lt;double&gt;&gt; Ensemble::predict_average_voting(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X)</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> {</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> torch::Tensor Xt = bayesnet::vectorToTensor(X, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">auto</span> y_pred = predict_average_voting(Xt);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> std::vector&lt;std::vector&lt;double&gt;&gt; result = tensorToVectorDouble(y_pred);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> torch::Tensor Ensemble::predict_average_voting(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="comment">// Build a m x n_models tensor with the predictions of each model</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> torch::Tensor y_pred = torch::zeros({ X.size(1), n_models }, torch::kInt32);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keyword">auto</span> threads{ std::vector&lt;std::thread&gt;() };</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> std::mutex mtx;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> threads.push_back(std::thread([&amp;, i]() {</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keyword">auto</span> ypredict = models[i]-&gt;predict(X);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> std::lock_guard&lt;std::mutex&gt; lock(mtx);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> y_pred.index_put_({ <span class="stringliteral">&quot;...&quot;</span>, i }, ypredict);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }));</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; thread : threads) {</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> thread.join();</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">return</span> voting(y_pred);</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> }</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordtype">float</span> Ensemble::score(torch::Tensor&amp; X, torch::Tensor&amp; y)</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">auto</span> y_pred = predict(X);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordtype">int</span> correct = 0;</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; y_pred.size(0); ++i) {</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">if</span> (y_pred[i].item&lt;int&gt;() == y[i].item&lt;int&gt;()) {</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> correct++;</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> }</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)correct / y_pred.size(0);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> }</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordtype">float</span> Ensemble::score(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y)</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> {</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keyword">auto</span> y_pred = predict(X);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordtype">int</span> correct = 0;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; y_pred.size(); ++i) {</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">if</span> (y_pred[i] == y[i]) {</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> correct++;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> }</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> }</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)correct / y_pred.size();</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> }</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> std::vector&lt;std::string&gt; Ensemble::show()<span class="keyword"> const</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="keyword">auto</span> result = std::vector&lt;std::string&gt;();</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keyword">auto</span> res = models[i]-&gt;show();</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> result.insert(result.end(), res.begin(), res.end());</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> }</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> }</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> std::vector&lt;std::string&gt; Ensemble::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keyword">auto</span> result = std::vector&lt;std::string&gt;();</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="keyword">auto</span> res = models[i]-&gt;graph(title + <span class="stringliteral">&quot;_&quot;</span> + std::to_string(i));</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> result.insert(result.end(), res.begin(), res.end());</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> }</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> }</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="keywordtype">int</span> Ensemble::getNumberOfNodes()<span class="keyword"> const</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordtype">int</span> nodes = 0;</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> nodes += models[i]-&gt;getNumberOfNodes();</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> }</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keywordflow">return</span> nodes;</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> }</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keywordtype">int</span> Ensemble::getNumberOfEdges()<span class="keyword"> const</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordtype">int</span> edges = 0;</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> edges += models[i]-&gt;getNumberOfEdges();</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordflow">return</span> edges;</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> }</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keywordtype">int</span> Ensemble::getNumberOfStates()<span class="keyword"> const</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> <span class="keywordtype">int</span> nstates = 0;</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; n_models; ++i) {</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> nstates += models[i]-&gt;getNumberOfStates();</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> }</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keywordflow">return</span> nstates;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> }</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>Ensemble.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,171 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/ensembles/Ensemble.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_ensemble_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Ensemble.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef ENSEMBLE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define ENSEMBLE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;bayesnet/utils/BayesMetrics.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;bayesnet/utils/bayesnetUtils.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;bayesnet/classifiers/Classifier.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_ensemble.html"> 15</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_ensemble.html">Ensemble</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_class" href="classbayesnet_1_1_ensemble.html">Ensemble</a>(<span class="keywordtype">bool</span> predict_voting = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_ensemble.html">~Ensemble</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> torch::Tensor predict(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> std::vector&lt;int&gt; predict(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> torch::Tensor predict_proba(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> std::vector&lt;std::vector&lt;double&gt;&gt; predict_proba(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">float</span> score(torch::Tensor&amp; X, torch::Tensor&amp; y) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">float</span> score(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X, std::vector&lt;int&gt;&amp; y) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">int</span> getNumberOfNodes() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordtype">int</span> getNumberOfEdges() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">int</span> getNumberOfStates() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> std::vector&lt;std::string&gt; show() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; title) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> std::vector&lt;std::string&gt; topological_order()<span class="keyword"> override</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">return</span> std::vector&lt;std::string&gt;();</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> }</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> std::string dump_cpt()<span class="keyword"> const override</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> torch::Tensor predict_average_voting(torch::Tensor&amp; X);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> std::vector&lt;std::vector&lt;double&gt;&gt; predict_average_voting(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> torch::Tensor predict_average_proba(torch::Tensor&amp; X);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> std::vector&lt;std::vector&lt;double&gt;&gt; predict_average_proba(std::vector&lt;std::vector&lt;int&gt;&gt;&amp; X);</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> torch::Tensor compute_arg_max(torch::Tensor&amp; X);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> std::vector&lt;int&gt; compute_arg_max(std::vector&lt;std::vector&lt;double&gt;&gt;&amp; X);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> torch::Tensor voting(torch::Tensor&amp; votes);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">unsigned</span> n_models;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::vector&lt;std::unique_ptr&lt;Classifier&gt;&gt; models;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::vector&lt;double&gt; significanceModels;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">void</span> trainModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">bool</span> predict_voting;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> };</div>
</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>}</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></div><div class="ttdef"><b>Definition</b> <a href="_classifier_8h_source.html#l00015">Classifier.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_ensemble_html"><div class="ttname"><a href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></div><div class="ttdef"><b>Definition</b> <a href="#l00015">Ensemble.h:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_2f68445c4ac4316280c650d0a13b2741.html">ensembles</a></li><li class="navelem"><b>Ensemble.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,225 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/KDB.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_k_d_b_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">KDB.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;KDB.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> KDB::KDB(<span class="keywordtype">int</span> k, <span class="keywordtype">float</span> theta) : Classifier(Network()), k(k), theta(theta)</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> validHyperparameters = { <span class="stringliteral">&quot;k&quot;</span>, <span class="stringliteral">&quot;theta&quot;</span> };</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> }</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordtype">void</span> KDB::setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters_)</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">auto</span> hyperparameters = hyperparameters_;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;k&quot;</span>)) {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> k = hyperparameters[<span class="stringliteral">&quot;k&quot;</span>];</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> hyperparameters.erase(<span class="stringliteral">&quot;k&quot;</span>);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">if</span> (hyperparameters.contains(<span class="stringliteral">&quot;theta&quot;</span>)) {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> theta = hyperparameters[<span class="stringliteral">&quot;theta&quot;</span>];</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> hyperparameters.erase(<span class="stringliteral">&quot;theta&quot;</span>);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> }</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> Classifier::setHyperparameters(hyperparameters);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">void</span> KDB::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="comment">/*</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment"> 1. For each feature Xi, compute mutual information, I(X;C),</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="comment"> where C is the class.</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment"> 2. Compute class conditional mutual information I(Xi;XjIC), f or each</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment"> pair of features Xi and Xj, where i#j.</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment"> 3. Let the used variable list, S, be empty.</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment"> 4. Let the DAG network being constructed, BN, begin with a single</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment"> class node, C.</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment"> 5. Repeat until S includes all domain features</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment"> 5.1. Select feature Xmax which is not in S and has the largest value</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment"> I(Xmax;C).</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment"> 5.2. Add a node to BN representing Xmax.</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment"> 5.3. Add an arc from C to Xmax in BN.</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> 5.4. Add m = min(lSl,/c) arcs from m distinct features Xj in S with</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment"> the highest value for I(Xmax;X,jC).</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"> 5.5. Add Xmax to S.</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> Compute the conditional probabilility infered by the structure of BN by</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> using counts from DB, and output BN.</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"> */</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// 1. For each feature Xi, compute mutual information, I(X;C),</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="comment">// where C is the class.</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> addNodes();</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keyword">const</span> torch::Tensor&amp; y = dataset.index({ -1, <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> std::vector&lt;double&gt; mi;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; features.size(); i++) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> torch::Tensor firstFeature = dataset.index({ i, <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> mi.push_back(metrics.mutualInformation(firstFeature, y, weights));</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> }</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="comment">// 2. Compute class conditional mutual information I(Xi;XjIC), f or each</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">auto</span> conditionalEdgeWeights = metrics.conditionalEdge(weights);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// 3. Let the used variable list, S, be empty.</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> std::vector&lt;int&gt; S;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// 4. Let the DAG network being constructed, BN, begin with a single</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// class node, C.</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">// 5. Repeat until S includes all domain features</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// 5.1. Select feature Xmax which is not in S and has the largest value</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// I(Xmax;C).</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">auto</span> order = argsort(mi);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> idx : order) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// 5.2. Add a node to BN representing Xmax.</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// 5.3. Add an arc from C to Xmax in BN.</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> model.addEdge(className, features[idx]);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// 5.4. Add m = min(lSl,/c) arcs from m distinct features Xj in S with</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// the highest value for I(Xmax;X,jC).</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> add_m_edges(idx, S, conditionalEdgeWeights);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// 5.5. Add Xmax to S.</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> S.push_back(idx);</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> }</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">void</span> KDB::add_m_edges(<span class="keywordtype">int</span> idx, std::vector&lt;int&gt;&amp; S, torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">auto</span> n_edges = std::min(k, <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(S.size()));</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">auto</span> cond_w = clone(weights);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">bool</span> exit_cond = k == 0;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">int</span> num = 0;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">while</span> (!exit_cond) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">auto</span> max_minfo = argmax(cond_w.index({ idx, <span class="stringliteral">&quot;...&quot;</span> })).item&lt;<span class="keywordtype">int</span>&gt;();</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">auto</span> belongs = find(S.begin(), S.end(), max_minfo) != S.end();</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">if</span> (belongs &amp;&amp; cond_w.index({ idx, max_minfo }).item&lt;<span class="keywordtype">float</span>&gt;() &gt; theta) {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">try</span> {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> model.addEdge(features[max_minfo], features[idx]);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> num++;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::invalid_argument&amp; e) {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// Loops are not allowed</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> cond_w.index_put_({ idx, max_minfo }, -1);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">auto</span> candidates_mask = cond_w.index({ idx, <span class="stringliteral">&quot;...&quot;</span> }).gt(theta);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keyword">auto</span> candidates = candidates_mask.nonzero();</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> exit_cond = num == n_edges || candidates.size(0) == 0;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> }</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::vector&lt;std::string&gt; KDB::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::string header{ title };</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">if</span> (title == <span class="stringliteral">&quot;KDB&quot;</span>) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> header += <span class="stringliteral">&quot; (k=&quot;</span> + std::to_string(k) + <span class="stringliteral">&quot;, theta=&quot;</span> + std::to_string(theta) + <span class="stringliteral">&quot;)&quot;</span>;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> }</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> model.graph(header);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>KDB.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,145 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/KDB.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_k_d_b_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">KDB.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef KDB_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define KDB_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;bayesnet/utils/bayesnetUtils.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;Classifier.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_k_d_b.html"> 13</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_k_d_b.html">KDB</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordtype">int</span> k;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">float</span> theta;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordtype">void</span> add_m_edges(<span class="keywordtype">int</span> idx, std::vector&lt;int&gt;&amp; S, torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_k_d_b.html">KDB</a>(<span class="keywordtype">int</span> k, <span class="keywordtype">float</span> theta = 0.03);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_k_d_b.html">~KDB</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> setHyperparameters(<span class="keyword">const</span> nlohmann::json&amp; hyperparameters_) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;KDB&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> };</div>
</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span>}</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></div><div class="ttdef"><b>Definition</b> <a href="_classifier_8h_source.html#l00015">Classifier.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_k_d_b_html"><div class="ttname"><a href="classbayesnet_1_1_k_d_b.html">bayesnet::KDB</a></div><div class="ttdef"><b>Definition</b> <a href="#l00013">KDB.h:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>KDB.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,149 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/KDBLd.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_k_d_b_ld_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">KDBLd.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;KDBLd.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> KDBLd::KDBLd(<span class="keywordtype">int</span> k) : KDB(k), Proposal(dataset, features, className) {}</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> KDBLd&amp; KDBLd::fit(torch::Tensor&amp; X_, torch::Tensor&amp; y_, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_)</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> checkInput(X_, y_);</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> features = features_;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> className = className_;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> Xf = X_;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> y = y_;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// Fills std::vectors Xv &amp; yv with the data from tensors X_ (discretized) &amp; y</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> states = fit_local_discretization(y);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="comment">// We have discretized the input data</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// 1st we need to fit the model to build the normal KDB structure, KDB::fit initializes the base Bayesian network</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> KDB::fit(dataset, features, className, states);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> states = localDiscretizationProposal(states, model);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> }</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> torch::Tensor KDBLd::predict(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">auto</span> Xt = prepareX(X);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">return</span> KDB::predict(Xt);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> std::vector&lt;std::string&gt; KDBLd::graph(<span class="keyword">const</span> std::string&amp; name)<span class="keyword"> const</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> KDB::graph(name);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>KDBLd.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,143 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/KDBLd.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_k_d_b_ld_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">KDBLd.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef KDBLD_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define KDBLD_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;Proposal.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;KDB.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_k_d_b_ld.html"> 13</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_k_d_b_ld.html">KDBLd</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_k_d_b.html">KDB</a>, <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_proposal.html">Proposal</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_k_d_b_ld.html">KDBLd</a>(<span class="keywordtype">int</span> k);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_k_d_b_ld.html">~KDBLd</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <a class="code hl_class" href="classbayesnet_1_1_k_d_b_ld.html">KDBLd</a>&amp; fit(torch::Tensor&amp; X, torch::Tensor&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;KDB&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> torch::Tensor predict(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">static</span> <span class="keyword">inline</span> std::string version() { <span class="keywordflow">return</span> <span class="stringliteral">&quot;0.0.1&quot;</span>; };</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> };</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span>}</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#endif </span><span class="comment">// !KDBLD_H</span></div>
<div class="ttc" id="aclassbayesnet_1_1_k_d_b_html"><div class="ttname"><a href="classbayesnet_1_1_k_d_b.html">bayesnet::KDB</a></div><div class="ttdef"><b>Definition</b> <a href="_k_d_b_8h_source.html#l00013">KDB.h:13</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_k_d_b_ld_html"><div class="ttname"><a href="classbayesnet_1_1_k_d_b_ld.html">bayesnet::KDBLd</a></div><div class="ttdef"><b>Definition</b> <a href="#l00013">KDBLd.h:13</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_proposal_html"><div class="ttname"><a href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></div><div class="ttdef"><b>Definition</b> <a href="_proposal_8h_source.html#l00017">Proposal.h:17</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>KDBLd.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,543 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/network/Network.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_network_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Network.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;thread&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Network.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;bayesnet/utils/bayesnetUtils.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> Network::Network() : fitted{ false }, maxThreads{ 0.95 }, classNumStates{ 0 }, laplaceSmoothing{ 0 }</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> }</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> Network::Network(<span class="keywordtype">float</span> maxT) : fitted{ false }, maxThreads{ maxT }, classNumStates{ 0 }, laplaceSmoothing{ 0 }</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> }</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> Network::Network(<span class="keyword">const</span> Network&amp; other) : laplaceSmoothing(other.laplaceSmoothing), features(other.features), className(other.className), classNumStates(other.getClassNumStates()),</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> maxThreads(other.getMaxThreads()), fitted(other.fitted), samples(other.samples)</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">if</span> (samples.defined())</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> samples = samples.clone();</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; node : other.nodes) {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> nodes[node.first] = std::make_unique&lt;Node&gt;(*node.second);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> }</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">void</span> Network::initialize()</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> features.clear();</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> className = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> classNumStates = 0;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> fitted = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> nodes.clear();</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> samples = torch::Tensor();</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordtype">float</span> Network::getMaxThreads()<span class="keyword"> const</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">return</span> maxThreads;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> }</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> torch::Tensor&amp; Network::getSamples()</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> {</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> samples;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">void</span> Network::addNode(<span class="keyword">const</span> std::string&amp; name)</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">if</span> (name == <span class="stringliteral">&quot;&quot;</span>) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Node name cannot be empty&quot;</span>);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (nodes.find(name) != nodes.end()) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">if</span> (find(features.begin(), features.end(), name) == features.end()) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> features.push_back(name);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> }</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> nodes[name] = std::make_unique&lt;Node&gt;(name);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> std::vector&lt;std::string&gt; Network::getFeatures()<span class="keyword"> const</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> features;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> Network::getClassNumStates()<span class="keyword"> const</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> classNumStates;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordtype">int</span> Network::getStates()<span class="keyword"> const</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordtype">int</span> result = 0;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; node : nodes) {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> result += node.second-&gt;getNumStates();</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> }</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> }</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> std::string Network::getClassName()<span class="keyword"> const</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> className;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">bool</span> Network::isCyclic(<span class="keyword">const</span> std::string&amp; nodeId, std::unordered_set&lt;std::string&gt;&amp; visited, std::unordered_set&lt;std::string&gt;&amp; recStack)</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">if</span> (visited.find(nodeId) == visited.end()) <span class="comment">// if node hasn&#39;t been visited yet</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> visited.insert(nodeId);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> recStack.insert(nodeId);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">for</span> (Node* child : nodes[nodeId]-&gt;getChildren()) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">if</span> (visited.find(child-&gt;getName()) == visited.end() &amp;&amp; isCyclic(child-&gt;getName(), visited, recStack))</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">if</span> (recStack.find(child-&gt;getName()) != recStack.end())</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> recStack.erase(nodeId); <span class="comment">// remove node from recursion stack before function ends</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">void</span> Network::addEdge(<span class="keyword">const</span> std::string&amp; parent, <span class="keyword">const</span> std::string&amp; child)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">if</span> (nodes.find(parent) == nodes.end()) {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Parent node &quot;</span> + parent + <span class="stringliteral">&quot; does not exist&quot;</span>);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">if</span> (nodes.find(child) == nodes.end()) {</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Child node &quot;</span> + child + <span class="stringliteral">&quot; does not exist&quot;</span>);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// Temporarily add edge to check for cycles</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> nodes[parent]-&gt;addChild(nodes[child].get());</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> nodes[child]-&gt;addParent(nodes[parent].get());</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> std::unordered_set&lt;std::string&gt; visited;</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::unordered_set&lt;std::string&gt; recStack;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">if</span> (isCyclic(nodes[child]-&gt;getName(), visited, recStack)) <span class="comment">// if adding this edge forms a cycle</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// remove problematic edge</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> nodes[parent]-&gt;removeChild(nodes[child].get());</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> nodes[child]-&gt;removeParent(nodes[parent].get());</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Adding this edge forms a cycle in the graph.&quot;</span>);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> }</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::map&lt;std::string, std::unique_ptr&lt;Node&gt;&gt;&amp; Network::getNodes()</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> nodes;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">void</span> Network::checkFitData(<span class="keywordtype">int</span> n_samples, <span class="keywordtype">int</span> n_features, <span class="keywordtype">int</span> n_samples_y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">if</span> (weights.size(0) != n_samples) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Weights (&quot;</span> + std::to_string(weights.size(0)) + <span class="stringliteral">&quot;) must have the same number of elements as samples (&quot;</span> + std::to_string(n_samples) + <span class="stringliteral">&quot;) in Network::fit&quot;</span>);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> }</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">if</span> (n_samples != n_samples_y) {</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;X and y must have the same number of samples in Network::fit (&quot;</span> + std::to_string(n_samples) + <span class="stringliteral">&quot; != &quot;</span> + std::to_string(n_samples_y) + <span class="stringliteral">&quot;)&quot;</span>);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> }</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">if</span> (n_features != featureNames.size()) {</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;X and features must have the same number of features in Network::fit (&quot;</span> + std::to_string(n_features) + <span class="stringliteral">&quot; != &quot;</span> + std::to_string(featureNames.size()) + <span class="stringliteral">&quot;)&quot;</span>);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> }</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">if</span> (features.size() == 0) {</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;The network has not been initialized. You must call addNode() before calling fit()&quot;</span>);</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> }</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (n_features != features.size() - 1) {</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;X and local features must have the same number of features in Network::fit (&quot;</span> + std::to_string(n_features) + <span class="stringliteral">&quot; != &quot;</span> + std::to_string(features.size() - 1) + <span class="stringliteral">&quot;)&quot;</span>);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> }</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">if</span> (find(features.begin(), features.end(), className) == features.end()) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Class Name not found in Network::features&quot;</span>);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; feature : featureNames) {</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">if</span> (find(features.begin(), features.end(), feature) == features.end()) {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Feature &quot;</span> + feature + <span class="stringliteral">&quot; not found in Network::features&quot;</span>);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">if</span> (states.find(feature) == states.end()) {</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Feature &quot;</span> + feature + <span class="stringliteral">&quot; not found in states&quot;</span>);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> }</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> }</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">void</span> Network::setStates(<span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="comment">// Set states to every Node in the network</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> for_each(features.begin(), features.end(), [<span class="keyword">this</span>, &amp;states](<span class="keyword">const</span> std::string&amp; feature) {</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> nodes.at(feature)-&gt;setNumStates(states.at(feature).size());</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> });</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> classNumStates = nodes.at(className)-&gt;getNumStates();</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// X comes in nxm, where n is the number of features and m the number of samples</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordtype">void</span> Network::fit(<span class="keyword">const</span> torch::Tensor&amp; X, <span class="keyword">const</span> torch::Tensor&amp; y, <span class="keyword">const</span> torch::Tensor&amp; weights, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> checkFitData(X.size(1), X.size(0), y.size(0), featureNames, className, states, weights);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> this-&gt;className = className;</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> torch::Tensor ytmp = torch::transpose(y.view({ y.size(0), 1 }), 0, 1);</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> samples = torch::cat({ X , ytmp }, 0);</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; featureNames.size(); ++i) {</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keyword">auto</span> row_feature = X.index({ i, <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> completeFit(states, weights);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> }</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordtype">void</span> Network::fit(<span class="keyword">const</span> torch::Tensor&amp; samples, <span class="keyword">const</span> torch::Tensor&amp; weights, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> {</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> checkFitData(samples.size(1), samples.size(0) - 1, samples.size(1), featureNames, className, states, weights);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> this-&gt;className = className;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> this-&gt;samples = samples;</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> completeFit(states, weights);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="comment">// input_data comes in nxm, where n is the number of features and m the number of samples</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordtype">void</span> Network::fit(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp; input_data, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; labels, <span class="keyword">const</span> std::vector&lt;double&gt;&amp; weights_, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states)</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> {</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keyword">const</span> torch::Tensor weights = torch::tensor(weights_, torch::kFloat64);</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> checkFitData(input_data[0].size(), input_data.size(), labels.size(), featureNames, className, states, weights);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> this-&gt;className = className;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="comment">// Build tensor of samples (nxm) (n+1 because of the class)</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> samples = torch::zeros({ <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(input_data.size() + 1), <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(input_data[0].size()) }, torch::kInt32);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; featureNames.size(); ++i) {</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> samples.index_put_({ i, <span class="stringliteral">&quot;...&quot;</span> }, torch::tensor(input_data[i], torch::kInt32));</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> }</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> samples.index_put_({ -1, <span class="stringliteral">&quot;...&quot;</span> }, torch::tensor(labels, torch::kInt32));</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> completeFit(states, weights);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> }</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordtype">void</span> Network::completeFit(<span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> {</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> setStates(states);</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> laplaceSmoothing = 1.0 / samples.size(1); <span class="comment">// To use in CPT computation</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> std::vector&lt;std::thread&gt; threads;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; node : nodes) {</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> threads.emplace_back([<span class="keyword">this</span>, &amp;node, &amp;weights]() {</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> node.second-&gt;computeCPT(samples, features, laplaceSmoothing, weights);</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> });</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> }</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; thread : threads) {</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> thread.join();</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> }</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> fitted = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> }</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> torch::Tensor Network::predict_tensor(<span class="keyword">const</span> torch::Tensor&amp; samples, <span class="keyword">const</span> <span class="keywordtype">bool</span> proba)</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> {</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordflow">throw</span> std::logic_error(<span class="stringliteral">&quot;You must call fit() before calling predict()&quot;</span>);</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> torch::Tensor result;</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> result = torch::zeros({ samples.size(1), classNumStates }, torch::kFloat64);</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; samples.size(1); ++i) {</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="keyword">const</span> torch::Tensor sample = samples.index({ <span class="stringliteral">&quot;...&quot;</span>, i });</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keyword">auto</span> psample = predict_sample(sample);</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <span class="keyword">auto</span> temp = torch::tensor(psample, torch::kFloat64);</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> <span class="comment">// result.index_put_({ i, &quot;...&quot; }, torch::tensor(predict_sample(sample), torch::kFloat64));</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> result.index_put_({ i, <span class="stringliteral">&quot;...&quot;</span> }, temp);</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> }</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="keywordflow">if</span> (proba)</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keywordflow">return</span> result.argmax(1);</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> }</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="comment">// Return mxn tensor of probabilities</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> torch::Tensor Network::predict_proba(<span class="keyword">const</span> torch::Tensor&amp; samples)</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> {</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keywordflow">return</span> predict_tensor(samples, <span class="keyword">true</span>);</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> }</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> </div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="comment">// Return mxn tensor of probabilities</span></div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> torch::Tensor Network::predict(<span class="keyword">const</span> torch::Tensor&amp; samples)</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> {</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keywordflow">return</span> predict_tensor(samples, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> }</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="comment">// Return mx1 std::vector of predictions</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="comment">// tsamples is nxm std::vector of samples</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> std::vector&lt;int&gt; Network::predict(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp; tsamples)</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> {</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="keywordflow">throw</span> std::logic_error(<span class="stringliteral">&quot;You must call fit() before calling predict()&quot;</span>);</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> }</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> std::vector&lt;int&gt; predictions;</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> std::vector&lt;int&gt; sample;</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> row = 0; row &lt; tsamples[0].size(); ++row) {</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> sample.clear();</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> col = 0; col &lt; tsamples.size(); ++col) {</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> sample.push_back(tsamples[col][row]);</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> }</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> std::vector&lt;double&gt; classProbabilities = predict_sample(sample);</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="comment">// Find the class with the maximum posterior probability</span></div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keyword">auto</span> maxElem = max_element(classProbabilities.begin(), classProbabilities.end());</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="keywordtype">int</span> predictedClass = distance(classProbabilities.begin(), maxElem);</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> predictions.push_back(predictedClass);</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> }</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> <span class="keywordflow">return</span> predictions;</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> }</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="comment">// Return mxn std::vector of probabilities</span></div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="comment">// tsamples is nxm std::vector of samples</span></div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> std::vector&lt;std::vector&lt;double&gt;&gt; Network::predict_proba(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp; tsamples)</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> {</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <span class="keywordflow">if</span> (!fitted) {</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> <span class="keywordflow">throw</span> std::logic_error(<span class="stringliteral">&quot;You must call fit() before calling predict_proba()&quot;</span>);</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> }</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> std::vector&lt;std::vector&lt;double&gt;&gt; predictions;</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> std::vector&lt;int&gt; sample;</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> row = 0; row &lt; tsamples[0].size(); ++row) {</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> sample.clear();</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> col = 0; col &lt; tsamples.size(); ++col) {</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> sample.push_back(tsamples[col][row]);</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> }</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> predictions.push_back(predict_sample(sample));</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> }</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keywordflow">return</span> predictions;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> }</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="keywordtype">double</span> Network::score(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp; tsamples, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; labels)</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> {</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> std::vector&lt;int&gt; y_pred = predict(tsamples);</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="keywordtype">int</span> correct = 0;</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; y_pred.size(); ++i) {</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="keywordflow">if</span> (y_pred[i] == labels[i]) {</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> correct++;</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> }</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> }</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)correct / y_pred.size();</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> }</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> <span class="comment">// Return 1xn std::vector of probabilities</span></div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> std::vector&lt;double&gt; Network::predict_sample(<span class="keyword">const</span> std::vector&lt;int&gt;&amp; sample)</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> {</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <span class="comment">// Ensure the sample size is equal to the number of features</span></div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <span class="keywordflow">if</span> (sample.size() != features.size() - 1) {</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Sample size (&quot;</span> + std::to_string(sample.size()) +</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="stringliteral">&quot;) does not match the number of features (&quot;</span> + std::to_string(features.size() - 1) + <span class="stringliteral">&quot;)&quot;</span>);</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> }</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> std::map&lt;std::string, int&gt; evidence;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; sample.size(); ++i) {</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> evidence[features[i]] = sample[i];</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> }</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> <span class="keywordflow">return</span> exactInference(evidence);</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> }</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="comment">// Return 1xn std::vector of probabilities</span></div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> std::vector&lt;double&gt; Network::predict_sample(<span class="keyword">const</span> torch::Tensor&amp; sample)</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> {</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="comment">// Ensure the sample size is equal to the number of features</span></div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <span class="keywordflow">if</span> (sample.size(0) != features.size() - 1) {</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Sample size (&quot;</span> + std::to_string(sample.size(0)) +</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="stringliteral">&quot;) does not match the number of features (&quot;</span> + std::to_string(features.size() - 1) + <span class="stringliteral">&quot;)&quot;</span>);</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> }</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> std::map&lt;std::string, int&gt; evidence;</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; sample.size(0); ++i) {</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> evidence[features[i]] = sample[i].item&lt;<span class="keywordtype">int</span>&gt;();</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> }</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> <span class="keywordflow">return</span> exactInference(evidence);</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> }</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="keywordtype">double</span> Network::computeFactor(std::map&lt;std::string, int&gt;&amp; completeEvidence)</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> {</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <span class="keywordtype">double</span> result = 1.0;</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; node : getNodes()) {</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> result *= node.second-&gt;getFactorValue(completeEvidence);</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> }</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> }</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> std::vector&lt;double&gt; Network::exactInference(std::map&lt;std::string, int&gt;&amp; evidence)</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> {</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> std::vector&lt;double&gt; result(classNumStates, 0.0);</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> std::vector&lt;std::thread&gt; threads;</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> std::mutex mtx;</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; classNumStates; ++i) {</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> threads.emplace_back([<span class="keyword">this</span>, &amp;result, &amp;evidence, i, &amp;mtx]() {</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> <span class="keyword">auto</span> completeEvidence = std::map&lt;std::string, int&gt;(evidence);</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> completeEvidence[getClassName()] = i;</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> <span class="keywordtype">double</span> factor = computeFactor(completeEvidence);</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> std::lock_guard&lt;std::mutex&gt; lock(mtx);</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> result[i] = factor;</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> });</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> }</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; thread : threads) {</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> thread.join();</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> }</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> <span class="comment">// Normalize result</span></div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <span class="keywordtype">double</span> sum = accumulate(result.begin(), result.end(), 0.0);</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> transform(result.begin(), result.end(), result.begin(), [sum](<span class="keyword">const</span> <span class="keywordtype">double</span>&amp; value) { return value / sum; });</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> }</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> std::vector&lt;std::string&gt; Network::show()<span class="keyword"> const</span></div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> std::vector&lt;std::string&gt; result;</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> <span class="comment">// Draw the network</span></div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; node : nodes) {</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> std::string line = node.first + <span class="stringliteral">&quot; -&gt; &quot;</span>;</div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> child : node.second-&gt;getChildren()) {</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> line += child-&gt;getName() + <span class="stringliteral">&quot;, &quot;</span>;</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> }</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> result.push_back(line);</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> }</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> }</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> std::vector&lt;std::string&gt; Network::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> <span class="keyword">auto</span> output = std::vector&lt;std::string&gt;();</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> <span class="keyword">auto</span> prefix = <span class="stringliteral">&quot;digraph BayesNet {\nlabel=&lt;BayesNet &quot;</span>;</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> <span class="keyword">auto</span> suffix = <span class="stringliteral">&quot;&gt;\nfontsize=30\nfontcolor=blue\nlabelloc=t\nlayout=circo\n&quot;</span>;</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> std::string header = prefix + title + suffix;</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> output.push_back(header);</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; node : nodes) {</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> <span class="keyword">auto</span> result = node.second-&gt;graph(className);</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> output.insert(output.end(), result.begin(), result.end());</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> }</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span> output.push_back(<span class="stringliteral">&quot;}\n&quot;</span>);</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> <span class="keywordflow">return</span> output;</div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> }</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; Network::getEdges()<span class="keyword"> const</span></div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> <span class="keyword">auto</span> edges = std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt;();</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; node : nodes) {</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> <span class="keyword">auto</span> head = node.first;</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; child : node.second-&gt;getChildren()) {</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> <span class="keyword">auto</span> tail = child-&gt;getName();</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> edges.push_back({ head, tail });</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> }</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> }</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> <span class="keywordflow">return</span> edges;</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> }</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"> 383</span> <span class="keywordtype">int</span> Network::getNumEdges()<span class="keyword"> const</span></div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> <span class="keywordflow">return</span> getEdges().size();</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span> }</div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"> 387</span> std::vector&lt;std::string&gt; Network::topological_sort()</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span> {</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span> <span class="comment">/* Check if al the fathers of every node are before the node */</span></div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> <span class="keyword">auto</span> result = features;</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> result.erase(remove(result.begin(), result.end(), className), result.end());</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> <span class="keywordtype">bool</span> ending{ <span class="keyword">false</span> };</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <span class="keywordflow">while</span> (!ending) {</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> ending = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> feature : features) {</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> <span class="keyword">auto</span> fathers = nodes[feature]-&gt;getParents();</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; father : fathers) {</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> <span class="keyword">auto</span> fatherName = father-&gt;getName();</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> <span class="keywordflow">if</span> (fatherName == className) {</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> <span class="keywordflow">continue</span>;</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno"> 401</span> }</div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"> 402</span> <span class="comment">// Check if father is placed before the actual feature</span></div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"> 403</span> <span class="keyword">auto</span> it = find(result.begin(), result.end(), fatherName);</div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> <span class="keywordflow">if</span> (it != result.end()) {</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> <span class="keyword">auto</span> it2 = find(result.begin(), result.end(), feature);</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> <span class="keywordflow">if</span> (it2 != result.end()) {</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> <span class="keywordflow">if</span> (distance(it, it2) &lt; 0) {</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"> 408</span> <span class="comment">// if it is not, insert it before the feature</span></div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> result.erase(remove(result.begin(), result.end(), fatherName), result.end());</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> result.insert(it2, fatherName);</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> ending = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> }</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> }</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> }</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> }</div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> }</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> }</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> }</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> std::string Network::dump_cpt()<span class="keyword"> const</span></div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> std::stringstream oss;</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; node : nodes) {</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> oss &lt;&lt; <span class="stringliteral">&quot;* &quot;</span> &lt;&lt; node.first &lt;&lt; <span class="stringliteral">&quot;: (&quot;</span> &lt;&lt; node.second-&gt;getNumStates() &lt;&lt; <span class="stringliteral">&quot;) : &quot;</span> &lt;&lt; node.second-&gt;getCPT().sizes() &lt;&lt; std::endl;</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> oss &lt;&lt; node.second-&gt;getCPT() &lt;&lt; std::endl;</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> }</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> <span class="keywordflow">return</span> oss.str();</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> }</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_efcd97b18bba957e8e278307db4f845a.html">network</a></li><li class="navelem"><b>Network.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,186 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/network/Network.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_network_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Network.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef NETWORK_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define NETWORK_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;bayesnet/config.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;Node.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_network.html"> 15</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a>();</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a>(<span class="keywordtype">float</span>);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a>(<span class="keyword">const</span> <a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a>&amp;);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_class" href="classbayesnet_1_1_network.html">~Network</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> torch::Tensor&amp; getSamples();</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">float</span> getMaxThreads() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> addNode(<span class="keyword">const</span> std::string&amp;);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> addEdge(<span class="keyword">const</span> std::string&amp;, <span class="keyword">const</span> std::string&amp;);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::map&lt;std::string, std::unique_ptr&lt;Node&gt;&gt;&amp; getNodes();</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> std::vector&lt;std::string&gt; getFeatures() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">int</span> getStates() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; getEdges() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">int</span> getNumEdges() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">int</span> getClassNumStates() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> std::string getClassName() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="comment">/*</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment"> Notice: Nodes have to be inserted in the same order as they are in the dataset, i.e., first node is first column and so on.</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment"> */</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> fit(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp; input_data, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; labels, <span class="keyword">const</span> std::vector&lt;double&gt;&amp; weights, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordtype">void</span> fit(<span class="keyword">const</span> torch::Tensor&amp; X, <span class="keyword">const</span> torch::Tensor&amp; y, <span class="keyword">const</span> torch::Tensor&amp; weights, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">void</span> fit(<span class="keyword">const</span> torch::Tensor&amp; samples, <span class="keyword">const</span> torch::Tensor&amp; weights, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::vector&lt;int&gt; predict(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp;); <span class="comment">// Return mx1 std::vector of predictions</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> torch::Tensor predict(<span class="keyword">const</span> torch::Tensor&amp;); <span class="comment">// Return mx1 tensor of predictions</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> torch::Tensor predict_tensor(<span class="keyword">const</span> torch::Tensor&amp; samples, <span class="keyword">const</span> <span class="keywordtype">bool</span> proba);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> std::vector&lt;std::vector&lt;double&gt;&gt; predict_proba(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp;); <span class="comment">// Return mxn std::vector of probabilities</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> torch::Tensor predict_proba(<span class="keyword">const</span> torch::Tensor&amp;); <span class="comment">// Return mxn tensor of probabilities</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">double</span> score(<span class="keyword">const</span> std::vector&lt;std::vector&lt;int&gt;&gt;&amp;, <span class="keyword">const</span> std::vector&lt;int&gt;&amp;);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> std::vector&lt;std::string&gt; topological_sort();</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> std::vector&lt;std::string&gt; show() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; title) <span class="keyword">const</span>; <span class="comment">// Returns a std::vector of std::strings representing the graph in graphviz format</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">void</span> initialize();</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::string dump_cpt() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keyword">inline</span> std::string version() { <span class="keywordflow">return</span> { project_version.begin(), project_version.end() }; }</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> std::map&lt;std::string, std::unique_ptr&lt;Node&gt;&gt; nodes;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">bool</span> fitted;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">float</span> maxThreads = 0.95;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">int</span> classNumStates;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> std::vector&lt;std::string&gt; features; <span class="comment">// Including classname</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> std::string className;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">double</span> laplaceSmoothing;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> torch::Tensor samples; <span class="comment">// n+1xm tensor used to fit the model</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordtype">bool</span> isCyclic(<span class="keyword">const</span> std::string&amp;, std::unordered_set&lt;std::string&gt;&amp;, std::unordered_set&lt;std::string&gt;&amp;);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::vector&lt;double&gt; predict_sample(<span class="keyword">const</span> std::vector&lt;int&gt;&amp;);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> std::vector&lt;double&gt; predict_sample(<span class="keyword">const</span> torch::Tensor&amp;);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> std::vector&lt;double&gt; exactInference(std::map&lt;std::string, int&gt;&amp;);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">double</span> computeFactor(std::map&lt;std::string, int&gt;&amp;);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">void</span> completeFit(<span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">void</span> checkFitData(<span class="keywordtype">int</span> n_features, <span class="keywordtype">int</span> n_samples, <span class="keywordtype">int</span> n_samples_y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; featureNames, <span class="keyword">const</span> std::string&amp; className, <span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <span class="keyword">const</span> torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> setStates(<span class="keyword">const</span> std::map&lt;std::string, std::vector&lt;int&gt;&gt;&amp;);</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> };</div>
</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>}</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_network_html"><div class="ttname"><a href="classbayesnet_1_1_network.html">bayesnet::Network</a></div><div class="ttdef"><b>Definition</b> <a href="#l00015">Network.h:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_efcd97b18bba957e8e278307db4f845a.html">network</a></li><li class="navelem"><b>Network.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,254 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/network/Node.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_node_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Node.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;Node.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> Node::Node(<span class="keyword">const</span> std::string&amp; name)</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> : name(name)</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> }</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordtype">void</span> Node::clear()</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> parents.clear();</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> children.clear();</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> cpTable = torch::Tensor();</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> dimensions.clear();</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> numStates = 0;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> }</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::string Node::getName()<span class="keyword"> const</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">return</span> name;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> }</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">void</span> Node::addParent(Node* parent)</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> parents.push_back(parent);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">void</span> Node::removeParent(Node* parent)</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> parents.erase(std::remove(parents.begin(), parents.end(), parent), parents.end());</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> Node::removeChild(Node* child)</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> children.erase(std::remove(children.begin(), children.end(), child), children.end());</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> }</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">void</span> Node::addChild(Node* child)</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> children.push_back(child);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::vector&lt;Node*&gt;&amp; Node::getParents()</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">return</span> parents;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> }</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::vector&lt;Node*&gt;&amp; Node::getChildren()</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> children;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">int</span> Node::getNumStates()<span class="keyword"> const</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> numStates;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">void</span> Node::setNumStates(<span class="keywordtype">int</span> numStates)</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> this-&gt;numStates = numStates;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> torch::Tensor&amp; Node::getCPT()</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> cpTable;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">/*</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="comment"> The MinFill criterion is a heuristic for variable elimination.</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment"> The variable that minimizes the number of edges that need to be added to the graph to make it triangulated.</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> This is done by counting the number of edges that need to be added to the graph if the variable is eliminated.</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"> The variable with the minimum number of edges is chosen.</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"> Here this is done computing the length of the combinations of the node neighbors taken 2 by 2.</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"> */</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">unsigned</span> Node::minFill()</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> std::unordered_set&lt;std::string&gt; neighbors;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> child : children) {</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> neighbors.emplace(child-&gt;getName());</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> parent : parents) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> neighbors.emplace(parent-&gt;getName());</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keyword">auto</span> source = std::vector&lt;std::string&gt;(neighbors.begin(), neighbors.end());</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> combinations(source).size();</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; Node::combinations(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; source)</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; result;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; source.size(); ++i) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::string temp = source[i];</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; source.size(); ++j) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> result.push_back({ temp, source[j] });</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordtype">void</span> Node::computeCPT(<span class="keyword">const</span> torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> <span class="keywordtype">double</span> laplaceSmoothing, <span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> dimensions.clear();</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// Get dimensions of the CPT</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> dimensions.push_back(numStates);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> transform(parents.begin(), parents.end(), back_inserter(dimensions), [](<span class="keyword">const</span> <span class="keyword">auto</span>&amp; parent) { <span class="keywordflow">return</span> parent-&gt;getNumStates(); });</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// Create a tensor of zeros with the dimensions of the CPT</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> cpTable = torch::zeros(dimensions, torch::kFloat) + laplaceSmoothing;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// Fill table with counts</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">auto</span> pos = find(features.begin(), features.end(), name);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">if</span> (pos == features.end()) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">throw</span> std::logic_error(<span class="stringliteral">&quot;Feature &quot;</span> + name + <span class="stringliteral">&quot; not found in dataset&quot;</span>);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> }</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordtype">int</span> name_index = pos - features.begin();</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> n_sample = 0; n_sample &lt; dataset.size(1); ++n_sample) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> c10::List&lt;c10::optional&lt;at::Tensor&gt;&gt; coordinates;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> coordinates.push_back(dataset.index({ name_index, n_sample }));</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> parent : parents) {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> pos = find(features.begin(), features.end(), parent-&gt;getName());</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">if</span> (pos == features.end()) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">throw</span> std::logic_error(<span class="stringliteral">&quot;Feature parent &quot;</span> + parent-&gt;getName() + <span class="stringliteral">&quot; not found in dataset&quot;</span>);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> }</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordtype">int</span> parent_index = pos - features.begin();</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> coordinates.push_back(dataset.index({ parent_index, n_sample }));</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="comment">// Increment the count of the corresponding coordinate</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> cpTable.index_put_({ coordinates }, cpTable.index({ coordinates }) + weights.index({ n_sample }).item&lt;<span class="keywordtype">double</span>&gt;());</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> }</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="comment">// Normalize the counts</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> cpTable = cpTable / cpTable.sum(0);</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordtype">float</span> Node::getFactorValue(std::map&lt;std::string, int&gt;&amp; evidence)</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> {</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> c10::List&lt;c10::optional&lt;at::Tensor&gt;&gt; coordinates;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="comment">// following predetermined order of indices in the cpTable (see Node.h)</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> coordinates.push_back(at::tensor(evidence[name]));</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> transform(parents.begin(), parents.end(), std::back_inserter(coordinates), [&amp;evidence](<span class="keyword">const</span> <span class="keyword">auto</span>&amp; parent) { return at::tensor(evidence[parent-&gt;getName()]); });</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keywordflow">return</span> cpTable.index({ coordinates }).item&lt;float&gt;();</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> }</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> std::vector&lt;std::string&gt; Node::graph(<span class="keyword">const</span> std::string&amp; className)</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> {</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keyword">auto</span> output = std::vector&lt;std::string&gt;();</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keyword">auto</span> suffix = name == className ? <span class="stringliteral">&quot;, fontcolor=red, fillcolor=lightblue, style=filled &quot;</span> : <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> output.push_back(name + <span class="stringliteral">&quot; [shape=circle&quot;</span> + suffix + <span class="stringliteral">&quot;] \n&quot;</span>);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> transform(children.begin(), children.end(), back_inserter(output), [<span class="keyword">this</span>](<span class="keyword">const</span> <span class="keyword">auto</span>&amp; child) { <span class="keywordflow">return</span> name + <span class="stringliteral">&quot; -&gt; &quot;</span> + child-&gt;getName(); });</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">return</span> output;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_efcd97b18bba957e8e278307db4f845a.html">network</a></li><li class="navelem"><b>Node.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,159 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/network/Node.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_node_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Node.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef NODE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define NODE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;unordered_set&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00014" data-start="{" data-end="};">
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_node.html"> 14</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_node.html">Node</a> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_node.html">Node</a>(<span class="keyword">const</span> std::string&amp;);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordtype">void</span> clear();</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordtype">void</span> addParent(<a class="code hl_class" href="classbayesnet_1_1_node.html">Node</a>*);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">void</span> addChild(<a class="code hl_class" href="classbayesnet_1_1_node.html">Node</a>*);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">void</span> removeParent(<a class="code hl_class" href="classbayesnet_1_1_node.html">Node</a>*);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> removeChild(<a class="code hl_class" href="classbayesnet_1_1_node.html">Node</a>*);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> std::string getName() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::vector&lt;Node*&gt;&amp; getParents();</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::vector&lt;Node*&gt;&amp; getChildren();</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> torch::Tensor&amp; getCPT();</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordtype">void</span> computeCPT(<span class="keyword">const</span> torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> <span class="keywordtype">double</span> laplaceSmoothing, <span class="keyword">const</span> torch::Tensor&amp; weights);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">int</span> getNumStates() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">void</span> setNumStates(<span class="keywordtype">int</span>);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">unsigned</span> minFill();</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; clasName); <span class="comment">// Returns a std::vector of std::strings representing the graph in graphviz format</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">float</span> getFactorValue(std::map&lt;std::string, int&gt;&amp;);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::string name;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> std::vector&lt;Node*&gt; parents;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> std::vector&lt;Node*&gt; children;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordtype">int</span> numStates = 0; <span class="comment">// number of states of the variable</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> torch::Tensor cpTable; <span class="comment">// Order of indices is 0-&gt; node variable, 1-&gt; 1st parent, 2-&gt; 2nd parent, ...</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::vector&lt;int64_t&gt; dimensions; <span class="comment">// dimensions of the cpTable</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; combinations(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp;);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> };</div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span>}</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_node_html"><div class="ttname"><a href="classbayesnet_1_1_node.html">bayesnet::Node</a></div><div class="ttdef"><b>Definition</b> <a href="#l00014">Node.h:14</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_efcd97b18bba957e8e278307db4f845a.html">network</a></li><li class="navelem"><b>Node.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,243 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/Proposal.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_proposal_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Proposal.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;Proposal.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> Proposal::Proposal(torch::Tensor&amp; dataset_, std::vector&lt;std::string&gt;&amp; features_, std::string&amp; className_) : pDataset(dataset_), pFeatures(features_), pClassName(className_) {}</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> Proposal::~Proposal()</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; [key, value] : discretizers) {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">delete</span> value;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> }</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> }</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordtype">void</span> Proposal::checkInput(<span class="keyword">const</span> torch::Tensor&amp; X, <span class="keyword">const</span> torch::Tensor&amp; y)</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">if</span> (!torch::is_floating_point(X)) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;X must be a floating point tensor&quot;</span>);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">if</span> (torch::is_floating_point(y)) {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;y must be an integer tensor&quot;</span>);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> }</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> }</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> map&lt;std::string, std::vector&lt;int&gt;&gt; Proposal::localDiscretizationProposal(<span class="keyword">const</span> map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; oldStates, Network&amp; model)</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// order of local discretization is important. no good 0, 1, 2...</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// although we rediscretize features after the local discretization of every feature</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">auto</span> order = model.topological_sort();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">auto</span>&amp; nodes = model.getNodes();</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> map&lt;std::string, std::vector&lt;int&gt;&gt; states = oldStates;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::vector&lt;int&gt; indicesToReDiscretize;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">bool</span> upgrade = <span class="keyword">false</span>; <span class="comment">// Flag to check if we need to upgrade the model</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> feature : order) {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">auto</span> nodeParents = nodes[feature]-&gt;getParents();</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">if</span> (nodeParents.size() &lt; 2) <span class="keywordflow">continue</span>; <span class="comment">// Only has class as parent</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> upgrade = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">int</span> index = find(pFeatures.begin(), pFeatures.end(), feature) - pFeatures.begin();</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> indicesToReDiscretize.push_back(index); <span class="comment">// We need to re-discretize this feature</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> std::vector&lt;std::string&gt; parents;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> transform(nodeParents.begin(), nodeParents.end(), back_inserter(parents), [](<span class="keyword">const</span> <span class="keyword">auto</span>&amp; p) { <span class="keywordflow">return</span> p-&gt;getName(); });</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Remove class as parent as it will be added later</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> parents.erase(remove(parents.begin(), parents.end(), pClassName), parents.end());</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// Get the indices of the parents</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::vector&lt;int&gt; indices;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> indices.push_back(-1); <span class="comment">// Add class index</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> transform(parents.begin(), parents.end(), back_inserter(indices), [&amp;](<span class="keyword">const</span> <span class="keyword">auto</span>&amp; p) {<span class="keywordflow">return</span> find(pFeatures.begin(), pFeatures.end(), p) - pFeatures.begin(); });</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// Now we fit the discretizer of the feature, conditioned on its parents and the class i.e. discretizer.fit(X[index], X[indices] + y)</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> std::vector&lt;std::string&gt; yJoinParents(Xf.size(1));</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> idx : indices) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; Xf.size(1); ++i) {</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> yJoinParents[i] += to_string(pDataset.index({ idx, i }).item&lt;<span class="keywordtype">int</span>&gt;());</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">auto</span> yxv = factorize(yJoinParents);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">auto</span> xvf_ptr = Xf.index({ index }).data_ptr&lt;float&gt;();</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">auto</span> xvf = std::vector&lt;mdlp::precision_t&gt;(xvf_ptr, xvf_ptr + Xf.size(1));</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> discretizers[feature]-&gt;fit(xvf, yxv);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> }</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">if</span> (upgrade) {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// Discretize again X (only the affected indices) with the new fitted discretizers</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> index : indicesToReDiscretize) {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">auto</span> Xt_ptr = Xf.index({ index }).data_ptr&lt;float&gt;();</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">auto</span> Xt = std::vector&lt;float&gt;(Xt_ptr, Xt_ptr + Xf.size(1));</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> pDataset.index_put_({ index, <span class="stringliteral">&quot;...&quot;</span> }, torch::tensor(discretizers[pFeatures[index]]-&gt;transform(Xt)));</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">auto</span> xStates = std::vector&lt;int&gt;(discretizers[pFeatures[index]]-&gt;getCutPoints().size() + 1);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> iota(xStates.begin(), xStates.end(), 0);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">//Update new states of the feature/node</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> states[pFeatures[index]] = xStates;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> }</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keyword">const</span> torch::Tensor weights = torch::full({ pDataset.size(1) }, 1.0 / pDataset.size(1), torch::kDouble);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> model.fit(pDataset, weights, pFeatures, pClassName, states);</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> }</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">return</span> states;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> map&lt;std::string, std::vector&lt;int&gt;&gt; Proposal::fit_local_discretization(<span class="keyword">const</span> torch::Tensor&amp; y)</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Discretize the continuous input data and build pDataset (Classifier::dataset)</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordtype">int</span> m = Xf.size(1);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordtype">int</span> n = Xf.size(0);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> map&lt;std::string, std::vector&lt;int&gt;&gt; states;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> pDataset = torch::zeros({ n + 1, m }, torch::kInt32);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keyword">auto</span> yv = std::vector&lt;int&gt;(y.data_ptr&lt;<span class="keywordtype">int</span>&gt;(), y.data_ptr&lt;<span class="keywordtype">int</span>&gt;() + y.size(0));</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// discretize input data by feature(row)</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; pFeatures.size(); ++i) {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">auto</span>* discretizer = <span class="keyword">new</span> mdlp::CPPFImdlp();</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">auto</span> Xt_ptr = Xf.index({ i }).data_ptr&lt;float&gt;();</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keyword">auto</span> Xt = std::vector&lt;float&gt;(Xt_ptr, Xt_ptr + Xf.size(1));</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> discretizer-&gt;fit(Xt, yv);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> pDataset.index_put_({ i, <span class="stringliteral">&quot;...&quot;</span> }, torch::tensor(discretizer-&gt;transform(Xt)));</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keyword">auto</span> xStates = std::vector&lt;int&gt;(discretizer-&gt;getCutPoints().size() + 1);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> iota(xStates.begin(), xStates.end(), 0);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> states[pFeatures[i]] = xStates;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> discretizers[pFeatures[i]] = discretizer;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordtype">int</span> n_classes = torch::max(y).item&lt;<span class="keywordtype">int</span>&gt;() + 1;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">auto</span> yStates = std::vector&lt;int&gt;(n_classes);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> iota(yStates.begin(), yStates.end(), 0);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> states[pClassName] = yStates;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> pDataset.index_put_({ n, <span class="stringliteral">&quot;...&quot;</span> }, y);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> states;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> torch::Tensor Proposal::prepareX(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">auto</span> Xtd = torch::zeros_like(X, torch::kInt32);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; X.size(0); ++i) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">auto</span> Xt = std::vector&lt;float&gt;(X[i].data_ptr&lt;float&gt;(), X[i].data_ptr&lt;float&gt;() + X.size(1));</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keyword">auto</span> Xd = discretizers[pFeatures[i]]-&gt;transform(Xt);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> Xtd.index_put_({ i }, torch::tensor(Xd, torch::kInt32));</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> }</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> Xtd;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::vector&lt;int&gt; Proposal::factorize(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; labels_t)</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::vector&lt;int&gt; yy;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> yy.reserve(labels_t.size());</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::map&lt;std::string, int&gt; labelMap;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> std::string&amp; label : labels_t) {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (labelMap.find(label) == labelMap.end()) {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> labelMap[label] = i++;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordtype">bool</span> allDigits = std::all_of(label.begin(), label.end(), ::isdigit);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> }</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> yy.push_back(labelMap[label]);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> }</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> yy;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>Proposal.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,155 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/Proposal.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_proposal_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Proposal.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef PROPOSAL_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define PROPOSAL_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;torch/torch.h&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;CPPFImdlp.h&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &quot;bayesnet/network/Network.h&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &quot;Classifier.h&quot;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_proposal.html"> 17</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_proposal.html">Proposal</a> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <a class="code hl_class" href="classbayesnet_1_1_proposal.html">Proposal</a>(torch::Tensor&amp; pDataset, std::vector&lt;std::string&gt;&amp; features_, std::string&amp; className_);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_proposal.html">~Proposal</a>();</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> checkInput(<span class="keyword">const</span> torch::Tensor&amp; X, <span class="keyword">const</span> torch::Tensor&amp; y);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> torch::Tensor prepareX(torch::Tensor&amp; X);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> map&lt;std::string, std::vector&lt;int&gt;&gt; localDiscretizationProposal(<span class="keyword">const</span> map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states, <a class="code hl_class" href="classbayesnet_1_1_network.html">Network</a>&amp; model);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> map&lt;std::string, std::vector&lt;int&gt;&gt; fit_local_discretization(<span class="keyword">const</span> torch::Tensor&amp; y);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> torch::Tensor Xf; <span class="comment">// X continuous nxm tensor</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> torch::Tensor y; <span class="comment">// y discrete nx1 tensor</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> map&lt;std::string, mdlp::CPPFImdlp*&gt; discretizers;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> std::vector&lt;int&gt; factorize(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; labels_t);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> torch::Tensor&amp; pDataset; <span class="comment">// (n+1)xm tensor</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> std::vector&lt;std::string&gt;&amp; pFeatures;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::string&amp; pClassName;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> };</div>
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span>}</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor">#endif </span></div>
<div class="ttc" id="aclassbayesnet_1_1_network_html"><div class="ttname"><a href="classbayesnet_1_1_network.html">bayesnet::Network</a></div><div class="ttdef"><b>Definition</b> <a href="_network_8h_source.html#l00015">Network.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_proposal_html"><div class="ttname"><a href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></div><div class="ttdef"><b>Definition</b> <a href="#l00017">Proposal.h:17</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>Proposal.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,145 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/SPODE.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_s_p_o_d_e_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">SPODE.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;SPODE.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> SPODE::SPODE(<span class="keywordtype">int</span> root) : Classifier(Network()), root(root) {}</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keywordtype">void</span> SPODE::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// 0. Add all nodes to the model</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> addNodes();</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="comment">// 1. Add edges from the class node to all other nodes</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// 2. Add edges from the root node to all other nodes</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; static_cast&lt;int&gt;(features.size()); ++i) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> model.addEdge(className, features[i]);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> (i != root) {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> model.addEdge(features[root], features[i]);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> }</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> }</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> std::vector&lt;std::string&gt; SPODE::graph(<span class="keyword">const</span> std::string&amp; name)<span class="keyword"> const</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> model.graph(name);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> }</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>SPODE.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,141 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/SPODE.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_s_p_o_d_e_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">SPODE.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef SPODE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define SPODE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;Classifier.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="};">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_s_p_o_d_e.html"> 12</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e.html">SPODE</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">int</span> root;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e.html">SPODE</a>(<span class="keywordtype">int</span> root);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e.html">~SPODE</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;SPODE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> };</div>
</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>}</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></div><div class="ttdef"><b>Definition</b> <a href="_classifier_8h_source.html#l00015">Classifier.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_s_p_o_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_s_p_o_d_e.html">bayesnet::SPODE</a></div><div class="ttdef"><b>Definition</b> <a href="#l00012">SPODE.h:12</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>SPODE.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,164 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/SPODELd.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_s_p_o_d_e_ld_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">SPODELd.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;SPODELd.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> SPODELd::SPODELd(<span class="keywordtype">int</span> root) : SPODE(root), Proposal(dataset, features, className) {}</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> SPODELd&amp; SPODELd::fit(torch::Tensor&amp; X_, torch::Tensor&amp; y_, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_)</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> checkInput(X_, y_);</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> Xf = X_;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> y = y_;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordflow">return</span> commonFit(features_, className_, states_);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> }</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> SPODELd&amp; SPODELd::fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_)</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> (!torch::is_floating_point(dataset)) {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Dataset must be a floating point tensor&quot;</span>);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> Xf = dataset.index({ torch::indexing::Slice(0, dataset.size(0) - 1), <span class="stringliteral">&quot;...&quot;</span> }).clone();</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> y = dataset.index({ -1, <span class="stringliteral">&quot;...&quot;</span> }).clone().to(torch::kInt32);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> commonFit(features_, className_, states_);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> SPODELd&amp; SPODELd::commonFit(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_)</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> features = features_;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> className = className_;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// Fills std::vectors Xv &amp; yv with the data from tensors X_ (discretized) &amp; y</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> states = fit_local_discretization(y);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// We have discretized the input data</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// 1st we need to fit the model to build the normal SPODE structure, SPODE::fit initializes the base Bayesian network</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> SPODE::fit(dataset, features, className, states);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> states = localDiscretizationProposal(states, model);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> torch::Tensor SPODELd::predict(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">auto</span> Xt = prepareX(X);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> SPODE::predict(Xt);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::vector&lt;std::string&gt; SPODELd::graph(<span class="keyword">const</span> std::string&amp; name)<span class="keyword"> const</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">return</span> SPODE::graph(name);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> }</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>SPODELd.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/SPODELd.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_s_p_o_d_e_ld_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">SPODELd.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef SPODELD_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define SPODELD_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;SPODE.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Proposal.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_s_p_o_d_e_ld.html"> 13</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e_ld.html">SPODELd</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e.html">SPODE</a>, <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_proposal.html">Proposal</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e_ld.html">SPODELd</a>(<span class="keywordtype">int</span> root);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e_ld.html">~SPODELd</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e_ld.html">SPODELd</a>&amp; fit(torch::Tensor&amp; X, torch::Tensor&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e_ld.html">SPODELd</a>&amp; fit(torch::Tensor&amp; dataset, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <a class="code hl_class" href="classbayesnet_1_1_s_p_o_d_e_ld.html">SPODELd</a>&amp; commonFit(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;SPODE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> torch::Tensor predict(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">static</span> <span class="keyword">inline</span> std::string version() { <span class="keywordflow">return</span> <span class="stringliteral">&quot;0.0.1&quot;</span>; };</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> };</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span>}</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#endif </span><span class="comment">// !SPODELD_H</span></div>
<div class="ttc" id="aclassbayesnet_1_1_proposal_html"><div class="ttname"><a href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></div><div class="ttdef"><b>Definition</b> <a href="_proposal_8h_source.html#l00017">Proposal.h:17</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_s_p_o_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_s_p_o_d_e.html">bayesnet::SPODE</a></div><div class="ttdef"><b>Definition</b> <a href="_s_p_o_d_e_8h_source.html#l00012">SPODE.h:12</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_s_p_o_d_e_ld_html"><div class="ttname"><a href="classbayesnet_1_1_s_p_o_d_e_ld.html">bayesnet::SPODELd</a></div><div class="ttdef"><b>Definition</b> <a href="#l00013">SPODELd.h:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>SPODELd.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,152 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/SPnDE.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_s_pn_d_e_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">SPnDE.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;SPnDE.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> SPnDE::SPnDE(std::vector&lt;int&gt; parents) : Classifier(Network()), parents(parents) {}</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keywordtype">void</span> SPnDE::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// 0. Add all nodes to the model</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> addNodes();</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> std::vector&lt;int&gt; attributes;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; static_cast&lt;int&gt;(features.size()); ++i) {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">if</span> (std::find(parents.begin(), parents.end(), i) == parents.end()) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> attributes.push_back(i);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> }</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// 1. Add edges from the class node to all other nodes</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="comment">// 2. Add edges from the parents nodes to all other nodes</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; attribute : attributes) {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> model.addEdge(className, features[attribute]);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; root : parents) {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> model.addEdge(features[root], features[attribute]);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> std::vector&lt;std::string&gt; SPnDE::graph(<span class="keyword">const</span> std::string&amp; name)<span class="keyword"> const</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">return</span> model.graph(name);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> }</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>SPnDE.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/SPnDE.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_s_pn_d_e_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">SPnDE.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef SPnDE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define SPnDE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Classifier.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_s_pn_d_e.html"> 13</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_s_pn_d_e.html">SPnDE</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classbayesnet_1_1_s_pn_d_e.html">SPnDE</a>(std::vector&lt;int&gt; parents);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_s_pn_d_e.html">~SPnDE</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;SPnDE&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> std::vector&lt;int&gt; parents;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> };</div>
</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span>}</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></div><div class="ttdef"><b>Definition</b> <a href="_classifier_8h_source.html#l00015">Classifier.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_s_pn_d_e_html"><div class="ttname"><a href="classbayesnet_1_1_s_pn_d_e.html">bayesnet::SPnDE</a></div><div class="ttdef"><b>Definition</b> <a href="#l00013">SPnDE.h:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>SPnDE.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,159 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/TAN.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_t_a_n_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">TAN.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;TAN.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> TAN::TAN() : Classifier(Network()) {}</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordtype">void</span> TAN::buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights)</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// 0. Add all nodes to the model</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> addNodes();</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// 1. Compute mutual information between each feature and the class and set the root node</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="comment">// as the highest mutual information with the class</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">auto</span> mi = std::vector &lt;std::pair&lt;int, float &gt;&gt;();</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> torch::Tensor class_dataset = dataset.index({ -1, <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; static_cast&lt;int&gt;(features.size()); ++i) {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> torch::Tensor feature_dataset = dataset.index({ i, <span class="stringliteral">&quot;...&quot;</span> });</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">auto</span> mi_value = metrics.mutualInformation(class_dataset, feature_dataset, weights);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> mi.push_back({ i, mi_value });</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> }</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> sort(mi.begin(), mi.end(), [](<span class="keyword">const</span> <span class="keyword">auto</span>&amp; left, <span class="keyword">const</span> <span class="keyword">auto</span>&amp; right) {return left.second &lt; right.second;});</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">auto</span> root = mi[mi.size() - 1].first;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="comment">// 2. Compute mutual information between each feature and the class</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">auto</span> weights_matrix = metrics.conditionalEdge(weights);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// 3. Compute the maximum spanning tree</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">auto</span> mst = metrics.maximumSpanningTree(features, weights_matrix, root);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// 4. Add edges from the maximum spanning tree to the model</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; mst.size(); ++i) {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">auto</span> [from, to] = mst[i];</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> model.addEdge(features[from], features[to]);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// 5. Add edges from the class to all features</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> feature : features) {</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> model.addEdge(className, feature);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> }</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> std::vector&lt;std::string&gt; TAN::graph(<span class="keyword">const</span> std::string&amp; title)<span class="keyword"> const</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordflow">return</span> model.graph(title);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> }</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>TAN.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,139 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/TAN.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_t_a_n_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">TAN.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef TAN_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define TAN_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;Classifier.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00011" data-start="{" data-end="};">
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_t_a_n.html"> 11</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_t_a_n.html">TAN</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_classifier.html">Classifier</a> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">void</span> buildModel(<span class="keyword">const</span> torch::Tensor&amp; weights) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <a class="code hl_class" href="classbayesnet_1_1_t_a_n.html">TAN</a>();</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_t_a_n.html">~TAN</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;TAN&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> };</div>
</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span>}</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassbayesnet_1_1_classifier_html"><div class="ttname"><a href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></div><div class="ttdef"><b>Definition</b> <a href="_classifier_8h_source.html#l00015">Classifier.h:15</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_t_a_n_html"><div class="ttname"><a href="classbayesnet_1_1_t_a_n.html">bayesnet::TAN</a></div><div class="ttdef"><b>Definition</b> <a href="#l00011">TAN.h:11</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>TAN.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,150 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/TANLd.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_t_a_n_ld_8cc_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">TANLd.cc</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;TANLd.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> TANLd::TANLd() : TAN(), Proposal(dataset, features, className) {}</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> TANLd&amp; TANLd::fit(torch::Tensor&amp; X_, torch::Tensor&amp; y_, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features_, <span class="keyword">const</span> std::string&amp; className_, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states_)</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> checkInput(X_, y_);</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> features = features_;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> className = className_;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> Xf = X_;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> y = y_;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// Fills std::vectors Xv &amp; yv with the data from tensors X_ (discretized) &amp; y</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> states = fit_local_discretization(y);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="comment">// We have discretized the input data</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// 1st we need to fit the model to build the normal TAN structure, TAN::fit initializes the base Bayesian network</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> TAN::fit(dataset, features, className, states);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> states = localDiscretizationProposal(states, model);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> }</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> torch::Tensor TANLd::predict(torch::Tensor&amp; X)</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">auto</span> Xt = prepareX(X);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">return</span> TAN::predict(Xt);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> std::vector&lt;std::string&gt; TANLd::graph(<span class="keyword">const</span> std::string&amp; name)<span class="keyword"> const</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">return</span> TAN::graph(name);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>TANLd.cc</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,143 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: /Users/rmontanana/Code/BayesNet/bayesnet/classifiers/TANLd.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_t_a_n_ld_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">TANLd.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-FileType: SOURCE</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// ***************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef TANLD_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define TANLD_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;TAN.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Proposal.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>bayesnet {</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classbayesnet_1_1_t_a_n_ld.html"> 13</a></span> <span class="keyword">class </span><a class="code hl_class" href="classbayesnet_1_1_t_a_n_ld.html">TANLd</a> : <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_t_a_n.html">TAN</a>, <span class="keyword">public</span> <a class="code hl_class" href="classbayesnet_1_1_proposal.html">Proposal</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <a class="code hl_class" href="classbayesnet_1_1_t_a_n_ld.html">TANLd</a>();</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">virtual</span> <a class="code hl_class" href="classbayesnet_1_1_t_a_n_ld.html">~TANLd</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <a class="code hl_class" href="classbayesnet_1_1_t_a_n_ld.html">TANLd</a>&amp; fit(torch::Tensor&amp; X, torch::Tensor&amp; y, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; features, <span class="keyword">const</span> std::string&amp; className, map&lt;std::string, std::vector&lt;int&gt;&gt;&amp; states) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> std::vector&lt;std::string&gt; graph(<span class="keyword">const</span> std::string&amp; name = <span class="stringliteral">&quot;TAN&quot;</span>) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> torch::Tensor predict(torch::Tensor&amp; X) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">static</span> <span class="keyword">inline</span> std::string version() { <span class="keywordflow">return</span> <span class="stringliteral">&quot;0.0.1&quot;</span>; };</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> };</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span>}</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#endif </span><span class="comment">// !TANLD_H</span></div>
<div class="ttc" id="aclassbayesnet_1_1_proposal_html"><div class="ttname"><a href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></div><div class="ttdef"><b>Definition</b> <a href="_proposal_8h_source.html#l00017">Proposal.h:17</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_t_a_n_html"><div class="ttname"><a href="classbayesnet_1_1_t_a_n.html">bayesnet::TAN</a></div><div class="ttdef"><b>Definition</b> <a href="_t_a_n_8h_source.html#l00011">TAN.h:11</a></div></div>
<div class="ttc" id="aclassbayesnet_1_1_t_a_n_ld_html"><div class="ttname"><a href="classbayesnet_1_1_t_a_n_ld.html">bayesnet::TANLd</a></div><div class="ttdef"><b>Definition</b> <a href="#l00013">TANLd.h:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_40070fdff85d618b4d1d3ab4ac4f79bb.html">bayesnet</a></li><li class="navelem"><a class="el" href="dir_520a649ed2b1c3b658a695aeefe46a5a.html">classifiers</a></li><li class="navelem"><b>TANLd.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,137 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('annotated.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Class List</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:dynsection.toggleLevel(1);">1</span><span onclick="javascript:dynsection.toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="dynsection.toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><b>bayesnet</b></td><td class="desc"></td></tr>
<tr id="row_0_0_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_a2_d_e.html" target="_self">A2DE</a></td><td class="desc"></td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_a_o_d_e.html" target="_self">AODE</a></td><td class="desc"></td></tr>
<tr id="row_0_2_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html" target="_self">AODELd</a></td><td class="desc"></td></tr>
<tr id="row_0_3_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_base_classifier.html" target="_self">BaseClassifier</a></td><td class="desc"></td></tr>
<tr id="row_0_4_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_boost.html" target="_self">Boost</a></td><td class="desc"></td></tr>
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_boost_a2_d_e.html" target="_self">BoostA2DE</a></td><td class="desc"></td></tr>
<tr id="row_0_6_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_boost_a_o_d_e.html" target="_self">BoostAODE</a></td><td class="desc"></td></tr>
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_classifier.html" target="_self">Classifier</a></td><td class="desc"></td></tr>
<tr id="row_0_8_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_ensemble.html" target="_self">Ensemble</a></td><td class="desc"></td></tr>
<tr id="row_0_9_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_k_d_b.html" target="_self">KDB</a></td><td class="desc"></td></tr>
<tr id="row_0_10_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_k_d_b_ld.html" target="_self">KDBLd</a></td><td class="desc"></td></tr>
<tr id="row_0_11_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_network.html" target="_self">Network</a></td><td class="desc"></td></tr>
<tr id="row_0_12_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_node.html" target="_self">Node</a></td><td class="desc"></td></tr>
<tr id="row_0_13_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_proposal.html" target="_self">Proposal</a></td><td class="desc"></td></tr>
<tr id="row_0_14_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_s_pn_d_e.html" target="_self">SPnDE</a></td><td class="desc"></td></tr>
<tr id="row_0_15_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_s_p_o_d_e.html" target="_self">SPODE</a></td><td class="desc"></td></tr>
<tr id="row_0_16_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_s_p_o_d_e_ld.html" target="_self">SPODELd</a></td><td class="desc"></td></tr>
<tr id="row_0_17_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_t_a_n.html" target="_self">TAN</a></td><td class="desc"></td></tr>
<tr id="row_0_18_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbayesnet_1_1_t_a_n_ld.html" target="_self">TANLd</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,24 +0,0 @@
var annotated_dup =
[
[ "bayesnet", null, [
[ "A2DE", "classbayesnet_1_1_a2_d_e.html", null ],
[ "AODE", "classbayesnet_1_1_a_o_d_e.html", null ],
[ "AODELd", "classbayesnet_1_1_a_o_d_e_ld.html", null ],
[ "BaseClassifier", "classbayesnet_1_1_base_classifier.html", null ],
[ "Boost", "classbayesnet_1_1_boost.html", null ],
[ "BoostA2DE", "classbayesnet_1_1_boost_a2_d_e.html", null ],
[ "BoostAODE", "classbayesnet_1_1_boost_a_o_d_e.html", null ],
[ "Classifier", "classbayesnet_1_1_classifier.html", null ],
[ "Ensemble", "classbayesnet_1_1_ensemble.html", null ],
[ "KDB", "classbayesnet_1_1_k_d_b.html", null ],
[ "KDBLd", "classbayesnet_1_1_k_d_b_ld.html", null ],
[ "Network", "classbayesnet_1_1_network.html", null ],
[ "Node", "classbayesnet_1_1_node.html", null ],
[ "Proposal", "classbayesnet_1_1_proposal.html", null ],
[ "SPnDE", "classbayesnet_1_1_s_pn_d_e.html", null ],
[ "SPODE", "classbayesnet_1_1_s_p_o_d_e.html", null ],
[ "SPODELd", "classbayesnet_1_1_s_p_o_d_e_ld.html", null ],
[ "TAN", "classbayesnet_1_1_t_a_n.html", null ],
[ "TANLd", "classbayesnet_1_1_t_a_n_ld.html", null ]
] ]
];

Binary file not shown.

Binary file not shown.

View File

@ -1,174 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_a2_d_e.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bayesnet::A2DE Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>A2DE</b>(bool predict_voting=false) (defined in <a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>addNodes</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>buildDataset</b>(torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>buildModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>checkFitParameters</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Classifier</b>(Network model) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>className</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>compute_arg_max</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>compute_arg_max</b>(std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>dataset</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dump_cpt</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Ensemble</b>(bool predict_voting=true) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>features</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fitted</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getClassNumStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNotes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfEdges</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfNodes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getStatus</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getValidHyperparameters</b>() (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getVersion</b>() override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>graph</b>(const std::string &amp;title=&quot;A2DE&quot;) const override (defined in <a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>m</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>metrics</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>model</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>n</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n_models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>notes</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_proba</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_voting</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_voting</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_proba</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_voting</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>score</b>(torch::Tensor &amp;X, torch::Tensor &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>score</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>setHyperparameters</b>(const nlohmann::json &amp;hyperparameters) override (defined in <a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>show</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>significanceModels</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>states</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>status</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>topological_order</b>() override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>trainModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>validHyperparameters</b> (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>voting</b>(torch::Tensor &amp;votes) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~A2DE</b>() (defined in <a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a2_d_e.html">bayesnet::A2DE</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~BaseClassifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~Classifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Ensemble</b>()=default (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,420 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: bayesnet::A2DE Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_a2_d_e.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classbayesnet_1_1_a2_d_e-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">bayesnet::A2DE Class Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for bayesnet::A2DE:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_a2_d_e__inherit__graph.png" border="0" usemap="#abayesnet_1_1_a2_d_e_inherit__map" alt="Inheritance graph"/></div>
<map name="abayesnet_1_1_a2_d_e_inherit__map" id="abayesnet_1_1_a2_d_e_inherit__map">
<area shape="rect" title=" " alt="" coords="30,226,148,252"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="19,153,159,178"/>
<area shape="poly" title=" " alt="" coords="92,194,92,226,86,226,86,194"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="20,79,158,105"/>
<area shape="poly" title=" " alt="" coords="92,120,92,152,86,152,86,120"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="92,46,92,79,86,79,86,46"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for bayesnet::A2DE:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_a2_d_e__coll__graph.png" border="0" usemap="#abayesnet_1_1_a2_d_e_coll__map" alt="Collaboration graph"/></div>
<map name="abayesnet_1_1_a2_d_e_coll__map" id="abayesnet_1_1_a2_d_e_coll__map">
<area shape="rect" title=" " alt="" coords="117,241,234,267"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" title=" " alt="" coords="178,209,178,241,173,241,173,209"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" href="classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adffd540de8df913d8577bfd247dd767a" id="r_adffd540de8df913d8577bfd247dd767a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adffd540de8df913d8577bfd247dd767a">A2DE</a> (bool predict_voting=false)</td></tr>
<tr class="separator:adffd540de8df913d8577bfd247dd767a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec90b799ca3afb27d47f705268da6e01" id="r_aec90b799ca3afb27d47f705268da6e01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aec90b799ca3afb27d47f705268da6e01">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters) override</td></tr>
<tr class="separator:aec90b799ca3afb27d47f705268da6e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a269c337eca7712cfe7b210178ac7587d" id="r_a269c337eca7712cfe7b210178ac7587d"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a269c337eca7712cfe7b210178ac7587d">graph</a> (const std::string &amp;title=&quot;A2DE&quot;) const override</td></tr>
<tr class="separator:a269c337eca7712cfe7b210178ac7587d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a4fc54eae63053cbf3162de383010b60a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a4fc54eae63053cbf3162de383010b60a">Ensemble</a> (bool predict_voting=true)</td></tr>
<tr class="separator:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af1e09b3d229dbf6d8550ac8eefdcfb1c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af1e09b3d229dbf6d8550ac8eefdcfb1c">predict</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a8c66fd77aabb09ec25a030757e5caba6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8c66fd77aabb09ec25a030757e5caba6">predict</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ae975fa69541e28b7cd259ccc5e99f929"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ae975fa69541e28b7cd259ccc5e99f929">predict_proba</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad2041fc17c90ce3f91c44e399d54b811"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad2041fc17c90ce3f91c44e399d54b811">predict_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a9054a70158afe147e4c859211cd897ff"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9054a70158afe147e4c859211cd897ff">score</a> (torch::Tensor &amp;X, torch::Tensor &amp;y) override</td></tr>
<tr class="separator:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a2071f46dc78e4418a122b99e311cdbb8"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2071f46dc78e4418a122b99e311cdbb8">score</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override</td></tr>
<tr class="separator:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aac161a0a3b8692ccde0ddb3d7c2f25b5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aac161a0a3b8692ccde0ddb3d7c2f25b5">getNumberOfNodes</a> () const override</td></tr>
<tr class="separator:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad4c97a92c269dac84f8e8cc760671aa9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad4c97a92c269dac84f8e8cc760671aa9">getNumberOfEdges</a> () const override</td></tr>
<tr class="separator:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a7557710fe99620ea6cf4357183a6b930"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7557710fe99620ea6cf4357183a6b930">getNumberOfStates</a> () const override</td></tr>
<tr class="separator:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ac0e16a53cd3b6733abe68efc00bac2db"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ac0e16a53cd3b6733abe68efc00bac2db">show</a> () const override</td></tr>
<tr class="separator:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af96f5bd66371fb0f4b61fb0deeb0a2a6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af96f5bd66371fb0f4b61fb0deeb0a2a6">graph</a> (const std::string &amp;title) const override</td></tr>
<tr class="separator:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ab283458c6e8cd3cdfd8bafa60f31b7f4"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ab283458c6e8cd3cdfd8bafa60f31b7f4">topological_order</a> () override</td></tr>
<tr class="separator:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aa6a8b50e438797fe3920d71b878bde38"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aa6a8b50e438797fe3920d71b878bde38">dump_cpt</a> () const override</td></tr>
<tr class="separator:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a78801dffd989a4b88b6c9ac369778407"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a78801dffd989a4b88b6c9ac369778407">Classifier</a> (<a class="el" href="classbayesnet_1_1_network.html">Network</a> model)</td></tr>
<tr class="separator:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a4b05f68bcf29f29a57a3bd7b9db006b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a4b05f68bcf29f29a57a3bd7b9db006b8">fit</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a80b9b8b8ba6eac55e5ed7f4ac92bdf94"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80b9b8b8ba6eac55e5ed7f4ac92bdf94">fit</a> (torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a03d8bfae1f53370a2736ab2720e06966"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a03d8bfae1f53370a2736ab2720e06966">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier" id="r_ada042f438f2925dfbc8505190ac65134"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ada042f438f2925dfbc8505190ac65134">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a1d9ea38b8c9555fdbb83218046426a01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1d9ea38b8c9555fdbb83218046426a01">addNodes</a> ()</td></tr>
<tr class="separator:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a10b3dbdf42e1d42deb6e320911d95241"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a10b3dbdf42e1d42deb6e320911d95241">getClassNumStates</a> () const override</td></tr>
<tr class="separator:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier" id="r_a469fcb6f35fc1418861a0d39f7760def"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a469fcb6f35fc1418861a0d39f7760def">getStatus</a> () const override</td></tr>
<tr class="separator:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a3d1d2b50b214a035dfc29519a98cb823"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3d1d2b50b214a035dfc29519a98cb823">getVersion</a> () override</td></tr>
<tr class="separator:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier" id="r_ad5190e5b210953162d334c71eff43acd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ad5190e5b210953162d334c71eff43acd">getNotes</a> () const override</td></tr>
<tr class="separator:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier" id="r_a363db4d3edc674f6c65446f99cb9fa2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a363db4d3edc674f6c65446f99cb9fa2e">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters) override</td></tr>
<tr class="separator:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier" id="r_ac4e33e5450cbd7ffe7b8ba5608106722"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ac4e33e5450cbd7ffe7b8ba5608106722">getValidHyperparameters</a> ()</td></tr>
<tr class="separator:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a9f58a4c332782c592effd79e04204503" id="r_a9f58a4c332782c592effd79e04204503"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9f58a4c332782c592effd79e04204503">buildModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a9f58a4c332782c592effd79e04204503"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a77fbc0a1720fbca2210ec34d6de1e293"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a77fbc0a1720fbca2210ec34d6de1e293">predict_average_voting</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a8b21eabaff70af01d9f2794f4aa3f5bd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8b21eabaff70af01d9f2794f4aa3f5bd">predict_average_voting</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a2a077e5c89d179ab904ad9cb8c21465c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2a077e5c89d179ab904ad9cb8c21465c">predict_average_proba</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a180d71eb7859f96712911598678029bc"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a180d71eb7859f96712911598678029bc">predict_average_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a9abee06272ba403a8fb9f5312c98a43c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9abee06272ba403a8fb9f5312c98a43c">compute_arg_max</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_afce60aba82b7f026e8a88ee0ef9cdabd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#afce60aba82b7f026e8a88ee0ef9cdabd">compute_arg_max</a> (std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X)</td></tr>
<tr class="separator:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a47a49609634a7a127b3a1264ed55ec04"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a47a49609634a7a127b3a1264ed55ec04">voting</a> (torch::Tensor &amp;votes)</td></tr>
<tr class="separator:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a7857edca2bd2a407ec8404562219eb45"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7857edca2bd2a407ec8404562219eb45">trainModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier" id="r_a11d1d74615d8c844210dd0f9af7bba1c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a11d1d74615d8c844210dd0f9af7bba1c">checkFitParameters</a> ()</td></tr>
<tr class="separator:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier" id="r_a3247e1fdc38db1b22592a15e74c5c29f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3247e1fdc38db1b22592a15e74c5c29f">buildDataset</a> (torch::Tensor &amp;y)</td></tr>
<tr class="separator:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a65b82f7036d283358a756013f96bec8d"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a65b82f7036d283358a756013f96bec8d">n_models</a></td></tr>
<tr class="separator:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a76f6b6c16e9e771f059ad72cbd4571a9"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::unique_ptr&lt; <a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a76f6b6c16e9e771f059ad72cbd4571a9">models</a></td></tr>
<tr class="separator:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a27cb9d119dd817ec240d8a4deedf0350"><td class="memItemLeft" align="right" valign="top">std::vector&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a27cb9d119dd817ec240d8a4deedf0350">significanceModels</a></td></tr>
<tr class="separator:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a383156745d59959e0652645081c0257d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a383156745d59959e0652645081c0257d">predict_voting</a></td></tr>
<tr class="separator:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aea401da2c395732dcde94e565b53a485"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aea401da2c395732dcde94e565b53a485">fitted</a></td></tr>
<tr class="separator:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a0604b45141b3d8b541ca8aac03293232"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a0604b45141b3d8b541ca8aac03293232">m</a></td></tr>
<tr class="separator:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_ab34ab485d73d3f76e63bd7e8ecbddee9"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ab34ab485d73d3f76e63bd7e8ecbddee9">n</a></td></tr>
<tr class="separator:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aba373ae6dd67262e3d8cc8c113544897"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_network.html">Network</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aba373ae6dd67262e3d8cc8c113544897">model</a></td></tr>
<tr class="separator:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a80fde71d6dea24fd2d23a11aa5fb0d84"><td class="memItemLeft" align="right" valign="top">Metrics&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80fde71d6dea24fd2d23a11aa5fb0d84">metrics</a></td></tr>
<tr class="separator:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_abbff645d99c607cae1a4a843381b8db1"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#abbff645d99c607cae1a4a843381b8db1">features</a></td></tr>
<tr class="separator:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a9800be045e73f73ef3bef7c9cdc80bb1"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a9800be045e73f73ef3bef7c9cdc80bb1">className</a></td></tr>
<tr class="separator:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a725b62e1d3e4a856265613820efff77f"><td class="memItemLeft" align="right" valign="top">std::map&lt; std::string, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a725b62e1d3e4a856265613820efff77f">states</a></td></tr>
<tr class="separator:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a5d9c9d1bd115ead98bb0ddaf2df5d9a6"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a5d9c9d1bd115ead98bb0ddaf2df5d9a6">dataset</a></td></tr>
<tr class="separator:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a1fdceba49bf2398b6a4959ddadea177b"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1fdceba49bf2398b6a4959ddadea177b">status</a> = NORMAL</td></tr>
<tr class="separator:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a8ae8101963f78aefb61093ae66ba1c7d"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a8ae8101963f78aefb61093ae66ba1c7d">notes</a></td></tr>
<tr class="separator:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier" id="r_ae2d94700f470b5f4a623965b1c442c6a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ae2d94700f470b5f4a623965b1c442c6a">validHyperparameters</a></td></tr>
<tr class="separator:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_a2_d_e_8h_source.html#l00012">12</a> of file <a class="el" href="_a2_d_e_8h_source.html">A2DE.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="adffd540de8df913d8577bfd247dd767a" name="adffd540de8df913d8577bfd247dd767a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adffd540de8df913d8577bfd247dd767a">&#9670;&#160;</a></span>A2DE()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bayesnet::A2DE::A2DE </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>predict_voting</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_a2_d_e_8cc_source.html#l00010">10</a> of file <a class="el" href="_a2_d_e_8cc_source.html">A2DE.cc</a>.</p>
</div>
</div>
<a id="ac7663da702c7027c8372ad17f9aa677c" name="ac7663da702c7027c8372ad17f9aa677c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7663da702c7027c8372ad17f9aa677c">&#9670;&#160;</a></span>~A2DE()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bayesnet::A2DE::~A2DE </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_a2_d_e_8h_source.html#l00015">15</a> of file <a class="el" href="_a2_d_e_8h_source.html">A2DE.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9f58a4c332782c592effd79e04204503" name="a9f58a4c332782c592effd79e04204503"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f58a4c332782c592effd79e04204503">&#9670;&#160;</a></span>buildModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::A2DE::buildModel </td>
<td>(</td>
<td class="paramtype">const torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a2_d_e_8cc_source.html#l00023">23</a> of file <a class="el" href="_a2_d_e_8cc_source.html">A2DE.cc</a>.</p>
</div>
</div>
<a id="a269c337eca7712cfe7b210178ac7587d" name="a269c337eca7712cfe7b210178ac7587d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a269c337eca7712cfe7b210178ac7587d">&#9670;&#160;</a></span>graph()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; std::string &gt; bayesnet::A2DE::graph </td>
<td>(</td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>title</em></span><span class="paramdefsep"> = </span><span class="paramdefval">&quot;A2DE&quot;</span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a2_d_e_8cc_source.html#l00036">36</a> of file <a class="el" href="_a2_d_e_8cc_source.html">A2DE.cc</a>.</p>
</div>
</div>
<a id="aec90b799ca3afb27d47f705268da6e01" name="aec90b799ca3afb27d47f705268da6e01"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec90b799ca3afb27d47f705268da6e01">&#9670;&#160;</a></span>setHyperparameters()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::A2DE::setHyperparameters </td>
<td>(</td>
<td class="paramtype">const nlohmann::json &amp;</td> <td class="paramname"><span class="paramname"><em>hyperparameters</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a2_d_e_8cc_source.html#l00014">14</a> of file <a class="el" href="_a2_d_e_8cc_source.html">A2DE.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_a2_d_e_8h_source.html">A2DE.h</a></li>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_a2_d_e_8cc_source.html">A2DE.cc</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>bayesnet</b></li><li class="navelem"><a class="el" href="classbayesnet_1_1_a2_d_e.html">A2DE</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,11 +0,0 @@
<map id="bayesnet::A2DE" name="bayesnet::A2DE">
<area shape="rect" id="Node000001" title=" " alt="" coords="117,241,234,267"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="178,209,178,241,173,241,173,209"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
</map>

View File

@ -1 +0,0 @@
1a9d8b8ca8faca87b7939271324f2f54

View File

@ -1,9 +0,0 @@
<map id="bayesnet::A2DE" name="bayesnet::A2DE">
<area shape="rect" id="Node000001" title=" " alt="" coords="30,226,148,252"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="19,153,159,178"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="92,194,92,226,86,226,86,194"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="20,79,158,105"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="92,120,92,152,86,152,86,120"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="92,46,92,79,86,79,86,46"/>
</map>

View File

@ -1 +0,0 @@
2a4c640dc60ff5b335609cbf09ecb998

View File

@ -1,174 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_a_o_d_e.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bayesnet::AODE Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>addNodes</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>AODE</b>(bool predict_voting=false) (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>buildDataset</b>(torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>buildModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>checkFitParameters</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Classifier</b>(Network model) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>className</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>compute_arg_max</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>compute_arg_max</b>(std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>dataset</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dump_cpt</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Ensemble</b>(bool predict_voting=true) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>features</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fitted</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getClassNumStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNotes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfEdges</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfNodes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getStatus</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getValidHyperparameters</b>() (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getVersion</b>() override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>graph</b>(const std::string &amp;title=&quot;AODE&quot;) const override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>m</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>metrics</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>model</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>n</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n_models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>notes</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_proba</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_voting</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_voting</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_proba</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_voting</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>score</b>(torch::Tensor &amp;X, torch::Tensor &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>score</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>setHyperparameters</b>(const nlohmann::json &amp;hyperparameters) override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>show</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>significanceModels</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>states</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>status</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>topological_order</b>() override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>trainModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>validHyperparameters</b> (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>voting</b>(torch::Tensor &amp;votes) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~AODE</b>() (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e.html">bayesnet::AODE</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~BaseClassifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~Classifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Ensemble</b>()=default (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,420 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: bayesnet::AODE Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_a_o_d_e.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classbayesnet_1_1_a_o_d_e-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">bayesnet::AODE Class Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for bayesnet::AODE:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_a_o_d_e__inherit__graph.png" border="0" usemap="#abayesnet_1_1_a_o_d_e_inherit__map" alt="Inheritance graph"/></div>
<map name="abayesnet_1_1_a_o_d_e_inherit__map" id="abayesnet_1_1_a_o_d_e_inherit__map">
<area shape="rect" title=" " alt="" coords="29,226,149,252"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="19,153,159,178"/>
<area shape="poly" title=" " alt="" coords="92,194,92,226,86,226,86,194"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="20,79,158,105"/>
<area shape="poly" title=" " alt="" coords="92,120,92,152,86,152,86,120"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="92,46,92,79,86,79,86,46"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for bayesnet::AODE:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_a_o_d_e__coll__graph.png" border="0" usemap="#abayesnet_1_1_a_o_d_e_coll__map" alt="Collaboration graph"/></div>
<map name="abayesnet_1_1_a_o_d_e_coll__map" id="abayesnet_1_1_a_o_d_e_coll__map">
<area shape="rect" title=" " alt="" coords="116,241,236,267"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" title=" " alt="" coords="178,209,178,241,173,241,173,209"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" href="classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2bdd82edb16deaab0eae23fd0e283ccf" id="r_a2bdd82edb16deaab0eae23fd0e283ccf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2bdd82edb16deaab0eae23fd0e283ccf">AODE</a> (bool predict_voting=false)</td></tr>
<tr class="separator:a2bdd82edb16deaab0eae23fd0e283ccf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefb1836792cfb5bccdb6d4cbfbd30cb6" id="r_aefb1836792cfb5bccdb6d4cbfbd30cb6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aefb1836792cfb5bccdb6d4cbfbd30cb6">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters) override</td></tr>
<tr class="separator:aefb1836792cfb5bccdb6d4cbfbd30cb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9bdf8f49a11185ca4badfce8caeae59" id="r_aa9bdf8f49a11185ca4badfce8caeae59"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa9bdf8f49a11185ca4badfce8caeae59">graph</a> (const std::string &amp;title=&quot;AODE&quot;) const override</td></tr>
<tr class="separator:aa9bdf8f49a11185ca4badfce8caeae59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a4fc54eae63053cbf3162de383010b60a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a4fc54eae63053cbf3162de383010b60a">Ensemble</a> (bool predict_voting=true)</td></tr>
<tr class="separator:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af1e09b3d229dbf6d8550ac8eefdcfb1c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af1e09b3d229dbf6d8550ac8eefdcfb1c">predict</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a8c66fd77aabb09ec25a030757e5caba6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8c66fd77aabb09ec25a030757e5caba6">predict</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ae975fa69541e28b7cd259ccc5e99f929"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ae975fa69541e28b7cd259ccc5e99f929">predict_proba</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad2041fc17c90ce3f91c44e399d54b811"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad2041fc17c90ce3f91c44e399d54b811">predict_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a9054a70158afe147e4c859211cd897ff"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9054a70158afe147e4c859211cd897ff">score</a> (torch::Tensor &amp;X, torch::Tensor &amp;y) override</td></tr>
<tr class="separator:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a2071f46dc78e4418a122b99e311cdbb8"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2071f46dc78e4418a122b99e311cdbb8">score</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override</td></tr>
<tr class="separator:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aac161a0a3b8692ccde0ddb3d7c2f25b5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aac161a0a3b8692ccde0ddb3d7c2f25b5">getNumberOfNodes</a> () const override</td></tr>
<tr class="separator:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad4c97a92c269dac84f8e8cc760671aa9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad4c97a92c269dac84f8e8cc760671aa9">getNumberOfEdges</a> () const override</td></tr>
<tr class="separator:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a7557710fe99620ea6cf4357183a6b930"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7557710fe99620ea6cf4357183a6b930">getNumberOfStates</a> () const override</td></tr>
<tr class="separator:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ac0e16a53cd3b6733abe68efc00bac2db"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ac0e16a53cd3b6733abe68efc00bac2db">show</a> () const override</td></tr>
<tr class="separator:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af96f5bd66371fb0f4b61fb0deeb0a2a6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af96f5bd66371fb0f4b61fb0deeb0a2a6">graph</a> (const std::string &amp;title) const override</td></tr>
<tr class="separator:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ab283458c6e8cd3cdfd8bafa60f31b7f4"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ab283458c6e8cd3cdfd8bafa60f31b7f4">topological_order</a> () override</td></tr>
<tr class="separator:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aa6a8b50e438797fe3920d71b878bde38"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aa6a8b50e438797fe3920d71b878bde38">dump_cpt</a> () const override</td></tr>
<tr class="separator:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a78801dffd989a4b88b6c9ac369778407"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a78801dffd989a4b88b6c9ac369778407">Classifier</a> (<a class="el" href="classbayesnet_1_1_network.html">Network</a> model)</td></tr>
<tr class="separator:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a4b05f68bcf29f29a57a3bd7b9db006b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a4b05f68bcf29f29a57a3bd7b9db006b8">fit</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a80b9b8b8ba6eac55e5ed7f4ac92bdf94"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80b9b8b8ba6eac55e5ed7f4ac92bdf94">fit</a> (torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a03d8bfae1f53370a2736ab2720e06966"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a03d8bfae1f53370a2736ab2720e06966">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier" id="r_ada042f438f2925dfbc8505190ac65134"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ada042f438f2925dfbc8505190ac65134">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a1d9ea38b8c9555fdbb83218046426a01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1d9ea38b8c9555fdbb83218046426a01">addNodes</a> ()</td></tr>
<tr class="separator:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a10b3dbdf42e1d42deb6e320911d95241"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a10b3dbdf42e1d42deb6e320911d95241">getClassNumStates</a> () const override</td></tr>
<tr class="separator:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier" id="r_a469fcb6f35fc1418861a0d39f7760def"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a469fcb6f35fc1418861a0d39f7760def">getStatus</a> () const override</td></tr>
<tr class="separator:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a3d1d2b50b214a035dfc29519a98cb823"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3d1d2b50b214a035dfc29519a98cb823">getVersion</a> () override</td></tr>
<tr class="separator:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier" id="r_ad5190e5b210953162d334c71eff43acd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ad5190e5b210953162d334c71eff43acd">getNotes</a> () const override</td></tr>
<tr class="separator:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier" id="r_a363db4d3edc674f6c65446f99cb9fa2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a363db4d3edc674f6c65446f99cb9fa2e">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters) override</td></tr>
<tr class="separator:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier" id="r_ac4e33e5450cbd7ffe7b8ba5608106722"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ac4e33e5450cbd7ffe7b8ba5608106722">getValidHyperparameters</a> ()</td></tr>
<tr class="separator:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a170f0d129b3f47b55f82868e5b1a9d8e" id="r_a170f0d129b3f47b55f82868e5b1a9d8e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a170f0d129b3f47b55f82868e5b1a9d8e">buildModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a170f0d129b3f47b55f82868e5b1a9d8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a77fbc0a1720fbca2210ec34d6de1e293"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a77fbc0a1720fbca2210ec34d6de1e293">predict_average_voting</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a8b21eabaff70af01d9f2794f4aa3f5bd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8b21eabaff70af01d9f2794f4aa3f5bd">predict_average_voting</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a2a077e5c89d179ab904ad9cb8c21465c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2a077e5c89d179ab904ad9cb8c21465c">predict_average_proba</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a180d71eb7859f96712911598678029bc"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a180d71eb7859f96712911598678029bc">predict_average_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a9abee06272ba403a8fb9f5312c98a43c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9abee06272ba403a8fb9f5312c98a43c">compute_arg_max</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_afce60aba82b7f026e8a88ee0ef9cdabd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#afce60aba82b7f026e8a88ee0ef9cdabd">compute_arg_max</a> (std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X)</td></tr>
<tr class="separator:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a47a49609634a7a127b3a1264ed55ec04"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a47a49609634a7a127b3a1264ed55ec04">voting</a> (torch::Tensor &amp;votes)</td></tr>
<tr class="separator:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a7857edca2bd2a407ec8404562219eb45"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7857edca2bd2a407ec8404562219eb45">trainModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier" id="r_a11d1d74615d8c844210dd0f9af7bba1c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a11d1d74615d8c844210dd0f9af7bba1c">checkFitParameters</a> ()</td></tr>
<tr class="separator:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier" id="r_a3247e1fdc38db1b22592a15e74c5c29f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3247e1fdc38db1b22592a15e74c5c29f">buildDataset</a> (torch::Tensor &amp;y)</td></tr>
<tr class="separator:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a65b82f7036d283358a756013f96bec8d"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a65b82f7036d283358a756013f96bec8d">n_models</a></td></tr>
<tr class="separator:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a76f6b6c16e9e771f059ad72cbd4571a9"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::unique_ptr&lt; <a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a76f6b6c16e9e771f059ad72cbd4571a9">models</a></td></tr>
<tr class="separator:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a27cb9d119dd817ec240d8a4deedf0350"><td class="memItemLeft" align="right" valign="top">std::vector&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a27cb9d119dd817ec240d8a4deedf0350">significanceModels</a></td></tr>
<tr class="separator:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a383156745d59959e0652645081c0257d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a383156745d59959e0652645081c0257d">predict_voting</a></td></tr>
<tr class="separator:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aea401da2c395732dcde94e565b53a485"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aea401da2c395732dcde94e565b53a485">fitted</a></td></tr>
<tr class="separator:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a0604b45141b3d8b541ca8aac03293232"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a0604b45141b3d8b541ca8aac03293232">m</a></td></tr>
<tr class="separator:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_ab34ab485d73d3f76e63bd7e8ecbddee9"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ab34ab485d73d3f76e63bd7e8ecbddee9">n</a></td></tr>
<tr class="separator:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aba373ae6dd67262e3d8cc8c113544897"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_network.html">Network</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aba373ae6dd67262e3d8cc8c113544897">model</a></td></tr>
<tr class="separator:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a80fde71d6dea24fd2d23a11aa5fb0d84"><td class="memItemLeft" align="right" valign="top">Metrics&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80fde71d6dea24fd2d23a11aa5fb0d84">metrics</a></td></tr>
<tr class="separator:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_abbff645d99c607cae1a4a843381b8db1"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#abbff645d99c607cae1a4a843381b8db1">features</a></td></tr>
<tr class="separator:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a9800be045e73f73ef3bef7c9cdc80bb1"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a9800be045e73f73ef3bef7c9cdc80bb1">className</a></td></tr>
<tr class="separator:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a725b62e1d3e4a856265613820efff77f"><td class="memItemLeft" align="right" valign="top">std::map&lt; std::string, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a725b62e1d3e4a856265613820efff77f">states</a></td></tr>
<tr class="separator:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a5d9c9d1bd115ead98bb0ddaf2df5d9a6"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a5d9c9d1bd115ead98bb0ddaf2df5d9a6">dataset</a></td></tr>
<tr class="separator:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a1fdceba49bf2398b6a4959ddadea177b"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1fdceba49bf2398b6a4959ddadea177b">status</a> = NORMAL</td></tr>
<tr class="separator:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a8ae8101963f78aefb61093ae66ba1c7d"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a8ae8101963f78aefb61093ae66ba1c7d">notes</a></td></tr>
<tr class="separator:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier" id="r_ae2d94700f470b5f4a623965b1c442c6a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ae2d94700f470b5f4a623965b1c442c6a">validHyperparameters</a></td></tr>
<tr class="separator:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_8h_source.html#l00012">12</a> of file <a class="el" href="_a_o_d_e_8h_source.html">AODE.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a2bdd82edb16deaab0eae23fd0e283ccf" name="a2bdd82edb16deaab0eae23fd0e283ccf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2bdd82edb16deaab0eae23fd0e283ccf">&#9670;&#160;</a></span>AODE()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bayesnet::AODE::AODE </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>predict_voting</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_8cc_source.html#l00010">10</a> of file <a class="el" href="_a_o_d_e_8cc_source.html">AODE.cc</a>.</p>
</div>
</div>
<a id="a99b83fb08c294361e387eb3c535b823c" name="a99b83fb08c294361e387eb3c535b823c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99b83fb08c294361e387eb3c535b823c">&#9670;&#160;</a></span>~AODE()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bayesnet::AODE::~AODE </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_8h_source.html#l00015">15</a> of file <a class="el" href="_a_o_d_e_8h_source.html">AODE.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a170f0d129b3f47b55f82868e5b1a9d8e" name="a170f0d129b3f47b55f82868e5b1a9d8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a170f0d129b3f47b55f82868e5b1a9d8e">&#9670;&#160;</a></span>buildModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::AODE::buildModel </td>
<td>(</td>
<td class="paramtype">const torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_8cc_source.html#l00024">24</a> of file <a class="el" href="_a_o_d_e_8cc_source.html">AODE.cc</a>.</p>
</div>
</div>
<a id="aa9bdf8f49a11185ca4badfce8caeae59" name="aa9bdf8f49a11185ca4badfce8caeae59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9bdf8f49a11185ca4badfce8caeae59">&#9670;&#160;</a></span>graph()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; std::string &gt; bayesnet::AODE::graph </td>
<td>(</td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>title</em></span><span class="paramdefsep"> = </span><span class="paramdefval">&quot;AODE&quot;</span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_8cc_source.html#l00034">34</a> of file <a class="el" href="_a_o_d_e_8cc_source.html">AODE.cc</a>.</p>
</div>
</div>
<a id="aefb1836792cfb5bccdb6d4cbfbd30cb6" name="aefb1836792cfb5bccdb6d4cbfbd30cb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aefb1836792cfb5bccdb6d4cbfbd30cb6">&#9670;&#160;</a></span>setHyperparameters()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::AODE::setHyperparameters </td>
<td>(</td>
<td class="paramtype">const nlohmann::json &amp;</td> <td class="paramname"><span class="paramname"><em>hyperparameters</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_8cc_source.html#l00015">15</a> of file <a class="el" href="_a_o_d_e_8cc_source.html">AODE.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_a_o_d_e_8h_source.html">AODE.h</a></li>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_a_o_d_e_8cc_source.html">AODE.cc</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>bayesnet</b></li><li class="navelem"><a class="el" href="classbayesnet_1_1_a_o_d_e.html">AODE</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,11 +0,0 @@
<map id="bayesnet::AODE" name="bayesnet::AODE">
<area shape="rect" id="Node000001" title=" " alt="" coords="116,241,236,267"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="178,209,178,241,173,241,173,209"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
</map>

View File

@ -1 +0,0 @@
a8ecb4b4827a401aa13582922068e79f

View File

@ -1,9 +0,0 @@
<map id="bayesnet::AODE" name="bayesnet::AODE">
<area shape="rect" id="Node000001" title=" " alt="" coords="29,226,149,252"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="19,153,159,178"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="92,194,92,226,86,226,86,194"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="20,79,158,105"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="92,120,92,152,86,152,86,120"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="92,46,92,79,86,79,86,46"/>
</map>

View File

@ -1 +0,0 @@
6e36b83aa01980726c9835edea89fb3f

View File

@ -1,184 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_a_o_d_e_ld.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bayesnet::AODELd Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>addNodes</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>AODELd</b>(bool predict_voting=true) (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>buildDataset</b>(torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>buildModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>checkFitParameters</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>checkInput</b>(const torch::Tensor &amp;X, const torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Classifier</b>(Network model) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>className</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>compute_arg_max</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>compute_arg_max</b>(std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dataset</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>discretizers</b> (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dump_cpt</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Ensemble</b>(bool predict_voting=true) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>features</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;X_, torch::Tensor &amp;y_, const std::vector&lt; std::string &gt; &amp;features_, const std::string &amp;className_, map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states_) override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit_local_discretization</b>(const torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fitted</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getClassNumStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNotes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfEdges</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfNodes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getStatus</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getValidHyperparameters</b>() (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getVersion</b>() override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>graph</b>(const std::string &amp;name=&quot;AODELd&quot;) const override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>localDiscretizationProposal</b>(const map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, Network &amp;model) (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>m</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>metrics</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>model</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>n_models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>notes</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_proba</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_voting</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_voting</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_proba</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_voting</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>prepareX</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Proposal</b>(torch::Tensor &amp;pDataset, std::vector&lt; std::string &gt; &amp;features_, std::string &amp;className_) (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>score</b>(torch::Tensor &amp;X, torch::Tensor &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>score</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>setHyperparameters</b>(const nlohmann::json &amp;hyperparameters) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>show</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>significanceModels</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>states</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>status</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>topological_order</b>() override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>trainModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>validHyperparameters</b> (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>voting</b>(torch::Tensor &amp;votes) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Xf</b> (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>y</b> (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~AODELd</b>()=default (defined in <a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">bayesnet::AODELd</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~BaseClassifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Classifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~Ensemble</b>()=default (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Proposal</b>() (defined in <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,464 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: bayesnet::AODELd Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_a_o_d_e_ld.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classbayesnet_1_1_a_o_d_e_ld-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">bayesnet::AODELd Class Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for bayesnet::AODELd:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_a_o_d_e_ld__inherit__graph.png" border="0" usemap="#abayesnet_1_1_a_o_d_e_ld_inherit__map" alt="Inheritance graph"/></div>
<map name="abayesnet_1_1_a_o_d_e_ld_inherit__map" id="abayesnet_1_1_a_o_d_e_ld_inherit__map">
<area shape="rect" title=" " alt="" coords="102,226,236,252"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="19,153,159,178"/>
<area shape="poly" title=" " alt="" coords="116,187,157,224,154,228,112,191"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="20,79,158,105"/>
<area shape="poly" title=" " alt="" coords="92,120,92,152,86,152,86,120"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="92,46,92,79,86,79,86,46"/>
<area shape="rect" href="classbayesnet_1_1_proposal.html" title=" " alt="" coords="184,153,317,178"/>
<area shape="poly" title=" " alt="" coords="227,191,184,228,181,224,223,187"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for bayesnet::AODELd:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_a_o_d_e_ld__coll__graph.png" border="0" usemap="#abayesnet_1_1_a_o_d_e_ld_coll__map" alt="Collaboration graph"/></div>
<map name="abayesnet_1_1_a_o_d_e_ld_coll__map" id="abayesnet_1_1_a_o_d_e_ld_coll__map">
<area shape="rect" title=" " alt="" coords="189,241,323,267"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" title=" " alt="" coords="202,202,244,239,241,243,199,206"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" href="classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
<area shape="rect" href="classbayesnet_1_1_proposal.html" title=" " alt="" coords="270,168,404,193"/>
<area shape="poly" title=" " alt="" coords="314,206,271,243,268,239,310,202"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a6b31bba8f3dd93d388ab6888a407d13b" id="r_a6b31bba8f3dd93d388ab6888a407d13b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6b31bba8f3dd93d388ab6888a407d13b">AODELd</a> (bool predict_voting=true)</td></tr>
<tr class="separator:a6b31bba8f3dd93d388ab6888a407d13b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07234e9d9ed9590d857c666e97faf311" id="r_a07234e9d9ed9590d857c666e97faf311"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">AODELd</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a07234e9d9ed9590d857c666e97faf311">fit</a> (torch::Tensor &amp;X_, torch::Tensor &amp;y_, const std::vector&lt; std::string &gt; &amp;features_, const std::string &amp;className_, map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states_) override</td></tr>
<tr class="separator:a07234e9d9ed9590d857c666e97faf311"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d695d7ee5688d100104655259006ea2" id="r_a7d695d7ee5688d100104655259006ea2"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7d695d7ee5688d100104655259006ea2">graph</a> (const std::string &amp;name=&quot;AODELd&quot;) const override</td></tr>
<tr class="separator:a7d695d7ee5688d100104655259006ea2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a4fc54eae63053cbf3162de383010b60a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a4fc54eae63053cbf3162de383010b60a">Ensemble</a> (bool predict_voting=true)</td></tr>
<tr class="separator:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af1e09b3d229dbf6d8550ac8eefdcfb1c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af1e09b3d229dbf6d8550ac8eefdcfb1c">predict</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a8c66fd77aabb09ec25a030757e5caba6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8c66fd77aabb09ec25a030757e5caba6">predict</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ae975fa69541e28b7cd259ccc5e99f929"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ae975fa69541e28b7cd259ccc5e99f929">predict_proba</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad2041fc17c90ce3f91c44e399d54b811"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad2041fc17c90ce3f91c44e399d54b811">predict_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a9054a70158afe147e4c859211cd897ff"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9054a70158afe147e4c859211cd897ff">score</a> (torch::Tensor &amp;X, torch::Tensor &amp;y) override</td></tr>
<tr class="separator:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a2071f46dc78e4418a122b99e311cdbb8"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2071f46dc78e4418a122b99e311cdbb8">score</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override</td></tr>
<tr class="separator:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aac161a0a3b8692ccde0ddb3d7c2f25b5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aac161a0a3b8692ccde0ddb3d7c2f25b5">getNumberOfNodes</a> () const override</td></tr>
<tr class="separator:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad4c97a92c269dac84f8e8cc760671aa9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad4c97a92c269dac84f8e8cc760671aa9">getNumberOfEdges</a> () const override</td></tr>
<tr class="separator:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a7557710fe99620ea6cf4357183a6b930"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7557710fe99620ea6cf4357183a6b930">getNumberOfStates</a> () const override</td></tr>
<tr class="separator:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ac0e16a53cd3b6733abe68efc00bac2db"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ac0e16a53cd3b6733abe68efc00bac2db">show</a> () const override</td></tr>
<tr class="separator:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af96f5bd66371fb0f4b61fb0deeb0a2a6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af96f5bd66371fb0f4b61fb0deeb0a2a6">graph</a> (const std::string &amp;title) const override</td></tr>
<tr class="separator:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ab283458c6e8cd3cdfd8bafa60f31b7f4"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ab283458c6e8cd3cdfd8bafa60f31b7f4">topological_order</a> () override</td></tr>
<tr class="separator:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aa6a8b50e438797fe3920d71b878bde38"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aa6a8b50e438797fe3920d71b878bde38">dump_cpt</a> () const override</td></tr>
<tr class="separator:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a78801dffd989a4b88b6c9ac369778407"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a78801dffd989a4b88b6c9ac369778407">Classifier</a> (<a class="el" href="classbayesnet_1_1_network.html">Network</a> model)</td></tr>
<tr class="separator:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a4b05f68bcf29f29a57a3bd7b9db006b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a4b05f68bcf29f29a57a3bd7b9db006b8">fit</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a80b9b8b8ba6eac55e5ed7f4ac92bdf94"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80b9b8b8ba6eac55e5ed7f4ac92bdf94">fit</a> (torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a03d8bfae1f53370a2736ab2720e06966"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a03d8bfae1f53370a2736ab2720e06966">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier" id="r_ada042f438f2925dfbc8505190ac65134"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ada042f438f2925dfbc8505190ac65134">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a1d9ea38b8c9555fdbb83218046426a01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1d9ea38b8c9555fdbb83218046426a01">addNodes</a> ()</td></tr>
<tr class="separator:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a10b3dbdf42e1d42deb6e320911d95241"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a10b3dbdf42e1d42deb6e320911d95241">getClassNumStates</a> () const override</td></tr>
<tr class="separator:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier" id="r_a469fcb6f35fc1418861a0d39f7760def"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a469fcb6f35fc1418861a0d39f7760def">getStatus</a> () const override</td></tr>
<tr class="separator:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a3d1d2b50b214a035dfc29519a98cb823"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3d1d2b50b214a035dfc29519a98cb823">getVersion</a> () override</td></tr>
<tr class="separator:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier" id="r_ad5190e5b210953162d334c71eff43acd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ad5190e5b210953162d334c71eff43acd">getNotes</a> () const override</td></tr>
<tr class="separator:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier" id="r_a363db4d3edc674f6c65446f99cb9fa2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a363db4d3edc674f6c65446f99cb9fa2e">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters) override</td></tr>
<tr class="separator:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier" id="r_ac4e33e5450cbd7ffe7b8ba5608106722"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ac4e33e5450cbd7ffe7b8ba5608106722">getValidHyperparameters</a> ()</td></tr>
<tr class="separator:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_proposal"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_proposal')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td></tr>
<tr class="memitem:a74cb430a04f97fae86e675618a011275 inherit pub_methods_classbayesnet_1_1_proposal" id="r_a74cb430a04f97fae86e675618a011275"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#a74cb430a04f97fae86e675618a011275">Proposal</a> (torch::Tensor &amp;pDataset, std::vector&lt; std::string &gt; &amp;features_, std::string &amp;className_)</td></tr>
<tr class="separator:a74cb430a04f97fae86e675618a011275 inherit pub_methods_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ad4fe80d731bb0f6648fc540302f888d7" id="r_ad4fe80d731bb0f6648fc540302f888d7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad4fe80d731bb0f6648fc540302f888d7">trainModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:ad4fe80d731bb0f6648fc540302f888d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52ce4104acdc3ce94114230ea38f8516" id="r_a52ce4104acdc3ce94114230ea38f8516"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a52ce4104acdc3ce94114230ea38f8516">buildModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a52ce4104acdc3ce94114230ea38f8516"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a77fbc0a1720fbca2210ec34d6de1e293"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a77fbc0a1720fbca2210ec34d6de1e293">predict_average_voting</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a8b21eabaff70af01d9f2794f4aa3f5bd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8b21eabaff70af01d9f2794f4aa3f5bd">predict_average_voting</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a2a077e5c89d179ab904ad9cb8c21465c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2a077e5c89d179ab904ad9cb8c21465c">predict_average_proba</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a180d71eb7859f96712911598678029bc"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a180d71eb7859f96712911598678029bc">predict_average_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a9abee06272ba403a8fb9f5312c98a43c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9abee06272ba403a8fb9f5312c98a43c">compute_arg_max</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_afce60aba82b7f026e8a88ee0ef9cdabd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#afce60aba82b7f026e8a88ee0ef9cdabd">compute_arg_max</a> (std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X)</td></tr>
<tr class="separator:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a47a49609634a7a127b3a1264ed55ec04"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a47a49609634a7a127b3a1264ed55ec04">voting</a> (torch::Tensor &amp;votes)</td></tr>
<tr class="separator:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a7857edca2bd2a407ec8404562219eb45"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7857edca2bd2a407ec8404562219eb45">trainModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier" id="r_a11d1d74615d8c844210dd0f9af7bba1c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a11d1d74615d8c844210dd0f9af7bba1c">checkFitParameters</a> ()</td></tr>
<tr class="separator:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier" id="r_a3247e1fdc38db1b22592a15e74c5c29f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3247e1fdc38db1b22592a15e74c5c29f">buildDataset</a> (torch::Tensor &amp;y)</td></tr>
<tr class="separator:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_proposal"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_proposal')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td></tr>
<tr class="memitem:a4bb3ff09d7f6191775057193750fc2a2 inherit pro_methods_classbayesnet_1_1_proposal" id="r_a4bb3ff09d7f6191775057193750fc2a2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#a4bb3ff09d7f6191775057193750fc2a2">checkInput</a> (const torch::Tensor &amp;X, const torch::Tensor &amp;y)</td></tr>
<tr class="separator:a4bb3ff09d7f6191775057193750fc2a2 inherit pro_methods_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac12374f86c22798e152da4abe094cb1e inherit pro_methods_classbayesnet_1_1_proposal" id="r_ac12374f86c22798e152da4abe094cb1e"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#ac12374f86c22798e152da4abe094cb1e">prepareX</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:ac12374f86c22798e152da4abe094cb1e inherit pro_methods_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6088404577834de890622fc1a2a8ffb6 inherit pro_methods_classbayesnet_1_1_proposal" id="r_a6088404577834de890622fc1a2a8ffb6"><td class="memItemLeft" align="right" valign="top">map&lt; std::string, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#a6088404577834de890622fc1a2a8ffb6">localDiscretizationProposal</a> (const map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, <a class="el" href="classbayesnet_1_1_network.html">Network</a> &amp;model)</td></tr>
<tr class="separator:a6088404577834de890622fc1a2a8ffb6 inherit pro_methods_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26024ec85783a790ac46667d735e1941 inherit pro_methods_classbayesnet_1_1_proposal" id="r_a26024ec85783a790ac46667d735e1941"><td class="memItemLeft" align="right" valign="top">map&lt; std::string, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#a26024ec85783a790ac46667d735e1941">fit_local_discretization</a> (const torch::Tensor &amp;y)</td></tr>
<tr class="separator:a26024ec85783a790ac46667d735e1941 inherit pro_methods_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a65b82f7036d283358a756013f96bec8d"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a65b82f7036d283358a756013f96bec8d">n_models</a></td></tr>
<tr class="separator:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a76f6b6c16e9e771f059ad72cbd4571a9"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::unique_ptr&lt; <a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a76f6b6c16e9e771f059ad72cbd4571a9">models</a></td></tr>
<tr class="separator:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a27cb9d119dd817ec240d8a4deedf0350"><td class="memItemLeft" align="right" valign="top">std::vector&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a27cb9d119dd817ec240d8a4deedf0350">significanceModels</a></td></tr>
<tr class="separator:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a383156745d59959e0652645081c0257d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a383156745d59959e0652645081c0257d">predict_voting</a></td></tr>
<tr class="separator:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aea401da2c395732dcde94e565b53a485"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aea401da2c395732dcde94e565b53a485">fitted</a></td></tr>
<tr class="separator:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a0604b45141b3d8b541ca8aac03293232"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a0604b45141b3d8b541ca8aac03293232">m</a></td></tr>
<tr class="separator:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_ab34ab485d73d3f76e63bd7e8ecbddee9"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ab34ab485d73d3f76e63bd7e8ecbddee9">n</a></td></tr>
<tr class="separator:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aba373ae6dd67262e3d8cc8c113544897"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_network.html">Network</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aba373ae6dd67262e3d8cc8c113544897">model</a></td></tr>
<tr class="separator:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a80fde71d6dea24fd2d23a11aa5fb0d84"><td class="memItemLeft" align="right" valign="top">Metrics&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80fde71d6dea24fd2d23a11aa5fb0d84">metrics</a></td></tr>
<tr class="separator:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_abbff645d99c607cae1a4a843381b8db1"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#abbff645d99c607cae1a4a843381b8db1">features</a></td></tr>
<tr class="separator:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a9800be045e73f73ef3bef7c9cdc80bb1"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a9800be045e73f73ef3bef7c9cdc80bb1">className</a></td></tr>
<tr class="separator:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a725b62e1d3e4a856265613820efff77f"><td class="memItemLeft" align="right" valign="top">std::map&lt; std::string, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a725b62e1d3e4a856265613820efff77f">states</a></td></tr>
<tr class="separator:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a5d9c9d1bd115ead98bb0ddaf2df5d9a6"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a5d9c9d1bd115ead98bb0ddaf2df5d9a6">dataset</a></td></tr>
<tr class="separator:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a1fdceba49bf2398b6a4959ddadea177b"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1fdceba49bf2398b6a4959ddadea177b">status</a> = NORMAL</td></tr>
<tr class="separator:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a8ae8101963f78aefb61093ae66ba1c7d"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a8ae8101963f78aefb61093ae66ba1c7d">notes</a></td></tr>
<tr class="separator:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier" id="r_ae2d94700f470b5f4a623965b1c442c6a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ae2d94700f470b5f4a623965b1c442c6a">validHyperparameters</a></td></tr>
<tr class="separator:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_proposal"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_proposal')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_proposal.html">bayesnet::Proposal</a></td></tr>
<tr class="memitem:a3645c54c51f9445a66a1ce980be4694e inherit pro_attribs_classbayesnet_1_1_proposal" id="r_a3645c54c51f9445a66a1ce980be4694e"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#a3645c54c51f9445a66a1ce980be4694e">Xf</a></td></tr>
<tr class="separator:a3645c54c51f9445a66a1ce980be4694e inherit pro_attribs_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a420c1832930cac9d5d5ee9fdc847042e inherit pro_attribs_classbayesnet_1_1_proposal" id="r_a420c1832930cac9d5d5ee9fdc847042e"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#a420c1832930cac9d5d5ee9fdc847042e">y</a></td></tr>
<tr class="separator:a420c1832930cac9d5d5ee9fdc847042e inherit pro_attribs_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfedb22d5ee155cb593bfbfb01cfc773 inherit pro_attribs_classbayesnet_1_1_proposal" id="r_abfedb22d5ee155cb593bfbfb01cfc773"><td class="memItemLeft" align="right" valign="top">map&lt; std::string, mdlp::CPPFImdlp * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_proposal.html#abfedb22d5ee155cb593bfbfb01cfc773">discretizers</a></td></tr>
<tr class="separator:abfedb22d5ee155cb593bfbfb01cfc773 inherit pro_attribs_classbayesnet_1_1_proposal"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_ld_8h_source.html#l00014">14</a> of file <a class="el" href="_a_o_d_e_ld_8h_source.html">AODELd.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a6b31bba8f3dd93d388ab6888a407d13b" name="a6b31bba8f3dd93d388ab6888a407d13b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b31bba8f3dd93d388ab6888a407d13b">&#9670;&#160;</a></span>AODELd()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bayesnet::AODELd::AODELd </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>predict_voting</em></span><span class="paramdefsep"> = </span><span class="paramdefval">true</span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_ld_8cc_source.html#l00010">10</a> of file <a class="el" href="_a_o_d_e_ld_8cc_source.html">AODELd.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a52ce4104acdc3ce94114230ea38f8516" name="a52ce4104acdc3ce94114230ea38f8516"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52ce4104acdc3ce94114230ea38f8516">&#9670;&#160;</a></span>buildModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::AODELd::buildModel </td>
<td>(</td>
<td class="paramtype">const torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_ld_8cc_source.html#l00028">28</a> of file <a class="el" href="_a_o_d_e_ld_8cc_source.html">AODELd.cc</a>.</p>
</div>
</div>
<a id="a07234e9d9ed9590d857c666e97faf311" name="a07234e9d9ed9590d857c666e97faf311"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07234e9d9ed9590d857c666e97faf311">&#9670;&#160;</a></span>fit()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">AODELd</a> &amp; bayesnet::AODELd::fit </td>
<td>(</td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>X_</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>y_</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; std::string &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>features_</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>className_</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>states_</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_ld_8cc_source.html#l00013">13</a> of file <a class="el" href="_a_o_d_e_ld_8cc_source.html">AODELd.cc</a>.</p>
</div>
</div>
<a id="a7d695d7ee5688d100104655259006ea2" name="a7d695d7ee5688d100104655259006ea2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d695d7ee5688d100104655259006ea2">&#9670;&#160;</a></span>graph()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; std::string &gt; bayesnet::AODELd::graph </td>
<td>(</td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>name</em></span><span class="paramdefsep"> = </span><span class="paramdefval">&quot;AODELd&quot;</span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_ld_8cc_source.html#l00043">43</a> of file <a class="el" href="_a_o_d_e_ld_8cc_source.html">AODELd.cc</a>.</p>
</div>
</div>
<a id="ad4fe80d731bb0f6648fc540302f888d7" name="ad4fe80d731bb0f6648fc540302f888d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4fe80d731bb0f6648fc540302f888d7">&#9670;&#160;</a></span>trainModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::AODELd::trainModel </td>
<td>(</td>
<td class="paramtype">const torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_a_o_d_e_ld_8cc_source.html#l00037">37</a> of file <a class="el" href="_a_o_d_e_ld_8cc_source.html">AODELd.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_a_o_d_e_ld_8h_source.html">AODELd.h</a></li>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_a_o_d_e_ld_8cc_source.html">AODELd.cc</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>bayesnet</b></li><li class="navelem"><a class="el" href="classbayesnet_1_1_a_o_d_e_ld.html">AODELd</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,13 +0,0 @@
<map id="bayesnet::AODELd" name="bayesnet::AODELd">
<area shape="rect" id="Node000001" title=" " alt="" coords="189,241,323,267"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="202,202,244,239,241,243,199,206"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
<area shape="rect" id="Node000006" href="$classbayesnet_1_1_proposal.html" title=" " alt="" coords="270,168,404,193"/>
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="314,206,271,243,268,239,310,202"/>
</map>

View File

@ -1 +0,0 @@
f651d150c08db011384ec50dda3d8bd9

View File

@ -1,11 +0,0 @@
<map id="bayesnet::AODELd" name="bayesnet::AODELd">
<area shape="rect" id="Node000001" title=" " alt="" coords="102,226,236,252"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="19,153,159,178"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="116,187,157,224,154,228,112,191"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="20,79,158,105"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="92,120,92,152,86,152,86,120"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="92,46,92,79,86,79,86,46"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_proposal.html" title=" " alt="" coords="184,153,317,178"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="227,191,184,228,181,224,223,187"/>
</map>

View File

@ -1 +0,0 @@
cb0c139611e4782226f297a1cfe9fbfd

View File

@ -1,142 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_base_classifier.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bayesnet::BaseClassifier Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dump_cpt</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getClassNumStates</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNotes</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfEdges</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfNodes</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfStates</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getStatus</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getValidHyperparameters</b>() (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getVersion</b>()=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>graph</b>(const std::string &amp;title=&quot;&quot;) const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict</b>(torch::Tensor &amp;X)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_proba</b>(torch::Tensor &amp;X)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>score</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>score</b>(torch::Tensor &amp;X, torch::Tensor &amp;y)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>setHyperparameters</b>(const nlohmann::json &amp;hyperparameters)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>show</b>() const =0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>topological_order</b>()=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>trainModel</b>(const torch::Tensor &amp;weights)=0 (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>validHyperparameters</b> (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~BaseClassifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,299 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: bayesnet::BaseClassifier Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_base_classifier.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classbayesnet_1_1_base_classifier-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">bayesnet::BaseClassifier Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for bayesnet::BaseClassifier:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_base_classifier__inherit__graph.png" border="0" usemap="#abayesnet_1_1_base_classifier_inherit__map" alt="Inheritance graph"/></div>
<map name="abayesnet_1_1_base_classifier_inherit__map" id="abayesnet_1_1_base_classifier_inherit__map">
<area shape="rect" title=" " alt="" coords="5,252,173,278"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="221,252,358,278"/>
<area shape="poly" title=" " alt="" coords="188,262,220,262,220,268,188,268"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="406,104,546,130"/>
<area shape="poly" title=" " alt="" coords="317,240,457,128,460,132,321,244"/>
<area shape="rect" href="classbayesnet_1_1_k_d_b.html" title=" " alt="" coords="421,203,531,228"/>
<area shape="poly" title=" " alt="" coords="355,245,424,226,425,232,356,250"/>
<area shape="rect" href="classbayesnet_1_1_s_p_o_d_e.html" title=" " alt="" coords="412,252,541,278"/>
<area shape="poly" title=" " alt="" coords="373,262,411,262,411,268,373,268"/>
<area shape="rect" href="classbayesnet_1_1_s_pn_d_e.html" title=" " alt="" coords="413,301,539,327"/>
<area shape="poly" title=" " alt="" coords="356,280,425,298,424,303,355,285"/>
<area shape="rect" href="classbayesnet_1_1_t_a_n.html" title=" " alt="" coords="422,351,530,376"/>
<area shape="poly" title=" " alt="" coords="322,285,362,311,407,337,432,348,430,353,405,342,359,316,319,289"/>
<area shape="rect" href="classbayesnet_1_1_a2_d_e.html" title=" " alt="" coords="607,5,725,31"/>
<area shape="poly" title=" " alt="" coords="506,93,547,66,593,40,619,29,621,34,595,45,549,70,509,97"/>
<area shape="rect" href="classbayesnet_1_1_a_o_d_e.html" title=" " alt="" coords="606,55,726,80"/>
<area shape="poly" title=" " alt="" coords="543,97,613,78,614,84,544,102"/>
<area shape="rect" href="classbayesnet_1_1_a_o_d_e_ld.html" title=" " alt="" coords="599,104,733,130"/>
<area shape="poly" title=" " alt="" coords="562,114,598,114,598,120,562,120"/>
<area shape="rect" href="classbayesnet_1_1_boost.html" title=" " alt="" coords="608,153,724,179"/>
<area shape="poly" title=" " alt="" coords="544,132,614,150,613,155,543,137"/>
<area shape="rect" href="classbayesnet_1_1_boost_a2_d_e.html" title=" " alt="" coords="787,129,939,155"/>
<area shape="poly" title=" " alt="" coords="739,155,786,149,787,154,740,160"/>
<area shape="rect" href="classbayesnet_1_1_boost_a_o_d_e.html" title=" " alt="" coords="786,179,940,204"/>
<area shape="poly" title=" " alt="" coords="740,173,786,179,785,184,739,178"/>
<area shape="rect" href="classbayesnet_1_1_k_d_b_ld.html" title=" " alt="" coords="604,203,728,228"/>
<area shape="poly" title=" " alt="" coords="547,213,603,213,603,218,547,218"/>
<area shape="rect" href="classbayesnet_1_1_s_p_o_d_e_ld.html" title=" " alt="" coords="594,252,738,278"/>
<area shape="poly" title=" " alt="" coords="556,262,594,262,594,268,556,268"/>
<area shape="rect" href="classbayesnet_1_1_t_a_n_ld.html" title=" " alt="" coords="605,351,727,376"/>
<area shape="poly" title=" " alt="" coords="546,361,604,361,604,366,546,366"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adb5de0dbb35950189843ff123cae779a" id="r_adb5de0dbb35950189843ff123cae779a"><td class="memItemLeft" align="right" valign="top"><a id="adb5de0dbb35950189843ff123cae779a" name="adb5de0dbb35950189843ff123cae779a"></a>
virtual <a class="el" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>fit</b> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states)=0</td></tr>
<tr class="separator:adb5de0dbb35950189843ff123cae779a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2100871673e2e86c2c69161995619d7" id="r_ac2100871673e2e86c2c69161995619d7"><td class="memItemLeft" align="right" valign="top"><a id="ac2100871673e2e86c2c69161995619d7" name="ac2100871673e2e86c2c69161995619d7"></a>
virtual <a class="el" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>fit</b> (torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states)=0</td></tr>
<tr class="separator:ac2100871673e2e86c2c69161995619d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78c898bfd3e2416729324086ab2bf103" id="r_a78c898bfd3e2416729324086ab2bf103"><td class="memItemLeft" align="right" valign="top"><a id="a78c898bfd3e2416729324086ab2bf103" name="a78c898bfd3e2416729324086ab2bf103"></a>
virtual <a class="el" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>fit</b> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states)=0</td></tr>
<tr class="separator:a78c898bfd3e2416729324086ab2bf103"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae02545ac2d954733112f6f4d5bf68824" id="r_ae02545ac2d954733112f6f4d5bf68824"><td class="memItemLeft" align="right" valign="top"><a id="ae02545ac2d954733112f6f4d5bf68824" name="ae02545ac2d954733112f6f4d5bf68824"></a>
virtual <a class="el" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>fit</b> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights)=0</td></tr>
<tr class="separator:ae02545ac2d954733112f6f4d5bf68824"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ddf175d6893aac89a2ef611afe2aff5" id="r_a8ddf175d6893aac89a2ef611afe2aff5"><td class="memItemLeft" align="right" valign="top"><a id="a8ddf175d6893aac89a2ef611afe2aff5" name="a8ddf175d6893aac89a2ef611afe2aff5"></a>
virtual torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><b>predict</b> (torch::Tensor &amp;X)=0</td></tr>
<tr class="separator:a8ddf175d6893aac89a2ef611afe2aff5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd6fda8b5fcecabc21bedd2c02cab485" id="r_afd6fda8b5fcecabc21bedd2c02cab485"><td class="memItemLeft" align="right" valign="top"><a id="afd6fda8b5fcecabc21bedd2c02cab485" name="afd6fda8b5fcecabc21bedd2c02cab485"></a>
virtual std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>predict</b> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)=0</td></tr>
<tr class="separator:afd6fda8b5fcecabc21bedd2c02cab485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71d5bf298133a976bf201eb10389a64f" id="r_a71d5bf298133a976bf201eb10389a64f"><td class="memItemLeft" align="right" valign="top"><a id="a71d5bf298133a976bf201eb10389a64f" name="a71d5bf298133a976bf201eb10389a64f"></a>
virtual torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><b>predict_proba</b> (torch::Tensor &amp;X)=0</td></tr>
<tr class="separator:a71d5bf298133a976bf201eb10389a64f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac095c945916957d131fb161db0d69491" id="r_ac095c945916957d131fb161db0d69491"><td class="memItemLeft" align="right" valign="top"><a id="ac095c945916957d131fb161db0d69491" name="ac095c945916957d131fb161db0d69491"></a>
virtual std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>predict_proba</b> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)=0</td></tr>
<tr class="separator:ac095c945916957d131fb161db0d69491"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f4cd18f841e4522a66ce42f50dbad61" id="r_a6f4cd18f841e4522a66ce42f50dbad61"><td class="memItemLeft" align="right" valign="top"><a id="a6f4cd18f841e4522a66ce42f50dbad61" name="a6f4cd18f841e4522a66ce42f50dbad61"></a>
virtual status_t&#160;</td><td class="memItemRight" valign="bottom"><b>getStatus</b> () const =0</td></tr>
<tr class="separator:a6f4cd18f841e4522a66ce42f50dbad61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfad4f5338e97e053deca515ee2ec01f" id="r_acfad4f5338e97e053deca515ee2ec01f"><td class="memItemLeft" align="right" valign="top"><a id="acfad4f5338e97e053deca515ee2ec01f" name="acfad4f5338e97e053deca515ee2ec01f"></a>
virtual float&#160;</td><td class="memItemRight" valign="bottom"><b>score</b> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y)=0</td></tr>
<tr class="separator:acfad4f5338e97e053deca515ee2ec01f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4c8e4421870ba12305e7c8748ab3138" id="r_ab4c8e4421870ba12305e7c8748ab3138"><td class="memItemLeft" align="right" valign="top"><a id="ab4c8e4421870ba12305e7c8748ab3138" name="ab4c8e4421870ba12305e7c8748ab3138"></a>
virtual float&#160;</td><td class="memItemRight" valign="bottom"><b>score</b> (torch::Tensor &amp;X, torch::Tensor &amp;y)=0</td></tr>
<tr class="separator:ab4c8e4421870ba12305e7c8748ab3138"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9368faebff261f9628427c3932353f00" id="r_a9368faebff261f9628427c3932353f00"><td class="memItemLeft" align="right" valign="top"><a id="a9368faebff261f9628427c3932353f00" name="a9368faebff261f9628427c3932353f00"></a>
virtual int&#160;</td><td class="memItemRight" valign="bottom"><b>getNumberOfNodes</b> () const =0</td></tr>
<tr class="separator:a9368faebff261f9628427c3932353f00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a0280c78d7cc7f0ea0d1df0097b9184" id="r_a2a0280c78d7cc7f0ea0d1df0097b9184"><td class="memItemLeft" align="right" valign="top"><a id="a2a0280c78d7cc7f0ea0d1df0097b9184" name="a2a0280c78d7cc7f0ea0d1df0097b9184"></a>
virtual int&#160;</td><td class="memItemRight" valign="bottom"><b>getNumberOfEdges</b> () const =0</td></tr>
<tr class="separator:a2a0280c78d7cc7f0ea0d1df0097b9184"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace894eb18b2cd5de944f76f018e2eaa1" id="r_ace894eb18b2cd5de944f76f018e2eaa1"><td class="memItemLeft" align="right" valign="top"><a id="ace894eb18b2cd5de944f76f018e2eaa1" name="ace894eb18b2cd5de944f76f018e2eaa1"></a>
virtual int&#160;</td><td class="memItemRight" valign="bottom"><b>getNumberOfStates</b> () const =0</td></tr>
<tr class="separator:ace894eb18b2cd5de944f76f018e2eaa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abafcb76bd7b1ea1604a3dc93f5d71fa3" id="r_abafcb76bd7b1ea1604a3dc93f5d71fa3"><td class="memItemLeft" align="right" valign="top"><a id="abafcb76bd7b1ea1604a3dc93f5d71fa3" name="abafcb76bd7b1ea1604a3dc93f5d71fa3"></a>
virtual int&#160;</td><td class="memItemRight" valign="bottom"><b>getClassNumStates</b> () const =0</td></tr>
<tr class="separator:abafcb76bd7b1ea1604a3dc93f5d71fa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bbd90a23b7c7816d7588038b51f1ab1" id="r_a9bbd90a23b7c7816d7588038b51f1ab1"><td class="memItemLeft" align="right" valign="top"><a id="a9bbd90a23b7c7816d7588038b51f1ab1" name="a9bbd90a23b7c7816d7588038b51f1ab1"></a>
virtual std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>show</b> () const =0</td></tr>
<tr class="separator:a9bbd90a23b7c7816d7588038b51f1ab1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16a59775f8654aed7aeeba7a1ee401ae" id="r_a16a59775f8654aed7aeeba7a1ee401ae"><td class="memItemLeft" align="right" valign="top"><a id="a16a59775f8654aed7aeeba7a1ee401ae" name="a16a59775f8654aed7aeeba7a1ee401ae"></a>
virtual std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>graph</b> (const std::string &amp;title=&quot;&quot;) const =0</td></tr>
<tr class="separator:a16a59775f8654aed7aeeba7a1ee401ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a9ab2cff3efdef958a7e54bb52be562" id="r_a6a9ab2cff3efdef958a7e54bb52be562"><td class="memItemLeft" align="right" valign="top"><a id="a6a9ab2cff3efdef958a7e54bb52be562" name="a6a9ab2cff3efdef958a7e54bb52be562"></a>
virtual std::string&#160;</td><td class="memItemRight" valign="bottom"><b>getVersion</b> ()=0</td></tr>
<tr class="separator:a6a9ab2cff3efdef958a7e54bb52be562"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d9413bf2ee21aa4da43ae40e10cf532" id="r_a4d9413bf2ee21aa4da43ae40e10cf532"><td class="memItemLeft" align="right" valign="top"><a id="a4d9413bf2ee21aa4da43ae40e10cf532" name="a4d9413bf2ee21aa4da43ae40e10cf532"></a>
virtual std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>topological_order</b> ()=0</td></tr>
<tr class="separator:a4d9413bf2ee21aa4da43ae40e10cf532"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a918abe3abd2243fb37d87cdd768decf5" id="r_a918abe3abd2243fb37d87cdd768decf5"><td class="memItemLeft" align="right" valign="top"><a id="a918abe3abd2243fb37d87cdd768decf5" name="a918abe3abd2243fb37d87cdd768decf5"></a>
virtual std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>getNotes</b> () const =0</td></tr>
<tr class="separator:a918abe3abd2243fb37d87cdd768decf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad92d4c2d3d317093182c3bd47cc69a66" id="r_ad92d4c2d3d317093182c3bd47cc69a66"><td class="memItemLeft" align="right" valign="top"><a id="ad92d4c2d3d317093182c3bd47cc69a66" name="ad92d4c2d3d317093182c3bd47cc69a66"></a>
virtual std::string&#160;</td><td class="memItemRight" valign="bottom"><b>dump_cpt</b> () const =0</td></tr>
<tr class="separator:ad92d4c2d3d317093182c3bd47cc69a66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2339f26202a1c32f0747cd16fa81b081" id="r_a2339f26202a1c32f0747cd16fa81b081"><td class="memItemLeft" align="right" valign="top"><a id="a2339f26202a1c32f0747cd16fa81b081" name="a2339f26202a1c32f0747cd16fa81b081"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>setHyperparameters</b> (const nlohmann::json &amp;hyperparameters)=0</td></tr>
<tr class="separator:a2339f26202a1c32f0747cd16fa81b081"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4e33e5450cbd7ffe7b8ba5608106722" id="r_ac4e33e5450cbd7ffe7b8ba5608106722"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac4e33e5450cbd7ffe7b8ba5608106722">getValidHyperparameters</a> ()</td></tr>
<tr class="separator:ac4e33e5450cbd7ffe7b8ba5608106722"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ab244ac8e57aeaa72369688f484bffc9e" id="r_ab244ac8e57aeaa72369688f484bffc9e"><td class="memItemLeft" align="right" valign="top"><a id="ab244ac8e57aeaa72369688f484bffc9e" name="ab244ac8e57aeaa72369688f484bffc9e"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>trainModel</b> (const torch::Tensor &amp;weights)=0</td></tr>
<tr class="separator:ab244ac8e57aeaa72369688f484bffc9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ae2d94700f470b5f4a623965b1c442c6a" id="r_ae2d94700f470b5f4a623965b1c442c6a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae2d94700f470b5f4a623965b1c442c6a">validHyperparameters</a></td></tr>
<tr class="separator:ae2d94700f470b5f4a623965b1c442c6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_base_classifier_8h_source.html#l00013">13</a> of file <a class="el" href="_base_classifier_8h_source.html">BaseClassifier.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ac4e33e5450cbd7ffe7b8ba5608106722" name="ac4e33e5450cbd7ffe7b8ba5608106722"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4e33e5450cbd7ffe7b8ba5608106722">&#9670;&#160;</a></span>getValidHyperparameters()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; std::string &gt; &amp; bayesnet::BaseClassifier::getValidHyperparameters </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_base_classifier_8h_source.html#l00040">40</a> of file <a class="el" href="_base_classifier_8h_source.html">BaseClassifier.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ae2d94700f470b5f4a623965b1c442c6a" name="ae2d94700f470b5f4a623965b1c442c6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2d94700f470b5f4a623965b1c442c6a">&#9670;&#160;</a></span>validHyperparameters</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;std::string&gt; bayesnet::BaseClassifier::validHyperparameters</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_base_classifier_8h_source.html#l00043">43</a> of file <a class="el" href="_base_classifier_8h_source.html">BaseClassifier.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/<a class="el" href="_base_classifier_8h_source.html">BaseClassifier.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>bayesnet</b></li><li class="navelem"><a class="el" href="classbayesnet_1_1_base_classifier.html">BaseClassifier</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,33 +0,0 @@
<map id="bayesnet::BaseClassifier" name="bayesnet::BaseClassifier">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,252,173,278"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="221,252,358,278"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="188,262,220,262,220,268,188,268"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="406,104,546,130"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="317,240,457,128,460,132,321,244"/>
<area shape="rect" id="Node000010" href="$classbayesnet_1_1_k_d_b.html" title=" " alt="" coords="421,203,531,228"/>
<area shape="poly" id="edge9_Node000002_Node000010" title=" " alt="" coords="355,245,424,226,425,232,356,250"/>
<area shape="rect" id="Node000012" href="$classbayesnet_1_1_s_p_o_d_e.html" title=" " alt="" coords="412,252,541,278"/>
<area shape="poly" id="edge11_Node000002_Node000012" title=" " alt="" coords="373,262,411,262,411,268,373,268"/>
<area shape="rect" id="Node000014" href="$classbayesnet_1_1_s_pn_d_e.html" title=" " alt="" coords="413,301,539,327"/>
<area shape="poly" id="edge13_Node000002_Node000014" title=" " alt="" coords="356,280,425,298,424,303,355,285"/>
<area shape="rect" id="Node000015" href="$classbayesnet_1_1_t_a_n.html" title=" " alt="" coords="422,351,530,376"/>
<area shape="poly" id="edge14_Node000002_Node000015" title=" " alt="" coords="322,285,362,311,407,337,432,348,430,353,405,342,359,316,319,289"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_a2_d_e.html" title=" " alt="" coords="607,5,725,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="506,93,547,66,593,40,619,29,621,34,595,45,549,70,509,97"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_a_o_d_e.html" title=" " alt="" coords="606,55,726,80"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="543,97,613,78,614,84,544,102"/>
<area shape="rect" id="Node000006" href="$classbayesnet_1_1_a_o_d_e_ld.html" title=" " alt="" coords="599,104,733,130"/>
<area shape="poly" id="edge5_Node000003_Node000006" title=" " alt="" coords="562,114,598,114,598,120,562,120"/>
<area shape="rect" id="Node000007" href="$classbayesnet_1_1_boost.html" title=" " alt="" coords="608,153,724,179"/>
<area shape="poly" id="edge6_Node000003_Node000007" title=" " alt="" coords="544,132,614,150,613,155,543,137"/>
<area shape="rect" id="Node000008" href="$classbayesnet_1_1_boost_a2_d_e.html" title=" " alt="" coords="787,129,939,155"/>
<area shape="poly" id="edge7_Node000007_Node000008" title=" " alt="" coords="739,155,786,149,787,154,740,160"/>
<area shape="rect" id="Node000009" href="$classbayesnet_1_1_boost_a_o_d_e.html" title=" " alt="" coords="786,179,940,204"/>
<area shape="poly" id="edge8_Node000007_Node000009" title=" " alt="" coords="740,173,786,179,785,184,739,178"/>
<area shape="rect" id="Node000011" href="$classbayesnet_1_1_k_d_b_ld.html" title=" " alt="" coords="604,203,728,228"/>
<area shape="poly" id="edge10_Node000010_Node000011" title=" " alt="" coords="547,213,603,213,603,218,547,218"/>
<area shape="rect" id="Node000013" href="$classbayesnet_1_1_s_p_o_d_e_ld.html" title=" " alt="" coords="594,252,738,278"/>
<area shape="poly" id="edge12_Node000012_Node000013" title=" " alt="" coords="556,262,594,262,594,268,556,268"/>
<area shape="rect" id="Node000016" href="$classbayesnet_1_1_t_a_n_ld.html" title=" " alt="" coords="605,351,727,376"/>
<area shape="poly" id="edge15_Node000015_Node000016" title=" " alt="" coords="546,361,604,361,604,366,546,366"/>
</map>

View File

@ -1 +0,0 @@
db5ef66c6a031328c592dde37edf565d

View File

@ -1,191 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_boost.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bayesnet::Boost Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>addNodes</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>bisection</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>block_update</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Boost</b>(bool predict_voting=false) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>buildDataset</b>(torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>buildModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>checkFitParameters</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Classifier</b>(Network model) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>className</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>compute_arg_max</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>compute_arg_max</b>(std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>convergence</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>convergence_best</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>dataset</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dump_cpt</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Ensemble</b>(bool predict_voting=true) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>features</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>featureSelection</b>(torch::Tensor &amp;weights_) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>featureSelector</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fitted</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getClassNumStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNotes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfEdges</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfNodes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getStatus</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getValidHyperparameters</b>() (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getVersion</b>() override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>graph</b>(const std::string &amp;title) const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>m</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>maxTolerance</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>metrics</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>model</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>n_models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>notes</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>order_algorithm</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_proba</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_voting</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_voting</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_proba</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_voting</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>score</b>(torch::Tensor &amp;X, torch::Tensor &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>score</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>select_features_algorithm</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>selectFeatures</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>setHyperparameters</b>(const nlohmann::json &amp;hyperparameters_) override (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>show</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>significanceModels</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>states</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>status</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>threshold</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>topological_order</b>() override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>trainModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>update_weights</b>(torch::Tensor &amp;ytrain, torch::Tensor &amp;ypred, torch::Tensor &amp;weights) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>update_weights_block</b>(int k, torch::Tensor &amp;ytrain, torch::Tensor &amp;weights) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>validHyperparameters</b> (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>voting</b>(torch::Tensor &amp;votes) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>X_test</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>X_train</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>y_test</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>y_train</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~BaseClassifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~Boost</b>()=default (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Classifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~Ensemble</b>()=default (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,845 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: bayesnet::Boost Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_boost.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classbayesnet_1_1_boost-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">bayesnet::Boost Class Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for bayesnet::Boost:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_boost__inherit__graph.png" border="0" usemap="#abayesnet_1_1_boost_inherit__map" alt="Inheritance graph"/></div>
<map name="abayesnet_1_1_boost_inherit__map" id="abayesnet_1_1_boost_inherit__map">
<area shape="rect" title=" " alt="" coords="111,226,227,252"/>
<area shape="rect" href="classbayesnet_1_1_boost_a2_d_e.html" title=" " alt="" coords="5,300,157,326"/>
<area shape="poly" title=" " alt="" coords="144,264,97,302,94,298,141,260"/>
<area shape="rect" href="classbayesnet_1_1_boost_a_o_d_e.html" title=" " alt="" coords="181,300,336,326"/>
<area shape="poly" title=" " alt="" coords="197,260,245,298,242,302,194,264"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="99,153,239,178"/>
<area shape="poly" title=" " alt="" coords="172,194,172,226,166,226,166,194"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="100,79,238,105"/>
<area shape="poly" title=" " alt="" coords="172,120,172,152,166,152,166,120"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="85,5,253,31"/>
<area shape="poly" title=" " alt="" coords="172,46,172,79,166,79,166,46"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for bayesnet::Boost:</div>
<div class="dyncontent">
<div class="center"><img src="classbayesnet_1_1_boost__coll__graph.png" border="0" usemap="#abayesnet_1_1_boost_coll__map" alt="Collaboration graph"/></div>
<map name="abayesnet_1_1_boost_coll__map" id="abayesnet_1_1_boost_coll__map">
<area shape="rect" title=" " alt="" coords="118,241,234,267"/>
<area shape="rect" href="classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" title=" " alt="" coords="178,209,178,241,173,241,173,209"/>
<area shape="rect" href="classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" href="classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" href="classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a54bb9e01bfce0c4a3f3b1ae890d1f646" id="r_a54bb9e01bfce0c4a3f3b1ae890d1f646"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a54bb9e01bfce0c4a3f3b1ae890d1f646">Boost</a> (bool predict_voting=false)</td></tr>
<tr class="separator:a54bb9e01bfce0c4a3f3b1ae890d1f646"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2590c3315a7a6d40c5a5dffdd245bbfd" id="r_a2590c3315a7a6d40c5a5dffdd245bbfd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2590c3315a7a6d40c5a5dffdd245bbfd">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters_) override</td></tr>
<tr class="separator:a2590c3315a7a6d40c5a5dffdd245bbfd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a4fc54eae63053cbf3162de383010b60a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a4fc54eae63053cbf3162de383010b60a">Ensemble</a> (bool predict_voting=true)</td></tr>
<tr class="separator:a4fc54eae63053cbf3162de383010b60a inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af1e09b3d229dbf6d8550ac8eefdcfb1c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af1e09b3d229dbf6d8550ac8eefdcfb1c">predict</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:af1e09b3d229dbf6d8550ac8eefdcfb1c inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a8c66fd77aabb09ec25a030757e5caba6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8c66fd77aabb09ec25a030757e5caba6">predict</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:a8c66fd77aabb09ec25a030757e5caba6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ae975fa69541e28b7cd259ccc5e99f929"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ae975fa69541e28b7cd259ccc5e99f929">predict_proba</a> (torch::Tensor &amp;X) override</td></tr>
<tr class="separator:ae975fa69541e28b7cd259ccc5e99f929 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad2041fc17c90ce3f91c44e399d54b811"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad2041fc17c90ce3f91c44e399d54b811">predict_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override</td></tr>
<tr class="separator:ad2041fc17c90ce3f91c44e399d54b811 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a9054a70158afe147e4c859211cd897ff"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9054a70158afe147e4c859211cd897ff">score</a> (torch::Tensor &amp;X, torch::Tensor &amp;y) override</td></tr>
<tr class="separator:a9054a70158afe147e4c859211cd897ff inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a2071f46dc78e4418a122b99e311cdbb8"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2071f46dc78e4418a122b99e311cdbb8">score</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override</td></tr>
<tr class="separator:a2071f46dc78e4418a122b99e311cdbb8 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aac161a0a3b8692ccde0ddb3d7c2f25b5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aac161a0a3b8692ccde0ddb3d7c2f25b5">getNumberOfNodes</a> () const override</td></tr>
<tr class="separator:aac161a0a3b8692ccde0ddb3d7c2f25b5 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ad4c97a92c269dac84f8e8cc760671aa9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ad4c97a92c269dac84f8e8cc760671aa9">getNumberOfEdges</a> () const override</td></tr>
<tr class="separator:ad4c97a92c269dac84f8e8cc760671aa9 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_a7557710fe99620ea6cf4357183a6b930"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7557710fe99620ea6cf4357183a6b930">getNumberOfStates</a> () const override</td></tr>
<tr class="separator:a7557710fe99620ea6cf4357183a6b930 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ac0e16a53cd3b6733abe68efc00bac2db"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ac0e16a53cd3b6733abe68efc00bac2db">show</a> () const override</td></tr>
<tr class="separator:ac0e16a53cd3b6733abe68efc00bac2db inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_af96f5bd66371fb0f4b61fb0deeb0a2a6"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#af96f5bd66371fb0f4b61fb0deeb0a2a6">graph</a> (const std::string &amp;title) const override</td></tr>
<tr class="separator:af96f5bd66371fb0f4b61fb0deeb0a2a6 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_ab283458c6e8cd3cdfd8bafa60f31b7f4"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#ab283458c6e8cd3cdfd8bafa60f31b7f4">topological_order</a> () override</td></tr>
<tr class="separator:ab283458c6e8cd3cdfd8bafa60f31b7f4 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble" id="r_aa6a8b50e438797fe3920d71b878bde38"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#aa6a8b50e438797fe3920d71b878bde38">dump_cpt</a> () const override</td></tr>
<tr class="separator:aa6a8b50e438797fe3920d71b878bde38 inherit pub_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a78801dffd989a4b88b6c9ac369778407"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a78801dffd989a4b88b6c9ac369778407">Classifier</a> (<a class="el" href="classbayesnet_1_1_network.html">Network</a> model)</td></tr>
<tr class="separator:a78801dffd989a4b88b6c9ac369778407 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a4b05f68bcf29f29a57a3bd7b9db006b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a4b05f68bcf29f29a57a3bd7b9db006b8">fit</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a4b05f68bcf29f29a57a3bd7b9db006b8 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a80b9b8b8ba6eac55e5ed7f4ac92bdf94"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80b9b8b8ba6eac55e5ed7f4ac92bdf94">fit</a> (torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a80b9b8b8ba6eac55e5ed7f4ac92bdf94 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a03d8bfae1f53370a2736ab2720e06966"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a03d8bfae1f53370a2736ab2720e06966">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override</td></tr>
<tr class="separator:a03d8bfae1f53370a2736ab2720e06966 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier" id="r_ada042f438f2925dfbc8505190ac65134"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ada042f438f2925dfbc8505190ac65134">fit</a> (torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:ada042f438f2925dfbc8505190ac65134 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a1d9ea38b8c9555fdbb83218046426a01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1d9ea38b8c9555fdbb83218046426a01">addNodes</a> ()</td></tr>
<tr class="separator:a1d9ea38b8c9555fdbb83218046426a01 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a10b3dbdf42e1d42deb6e320911d95241"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a10b3dbdf42e1d42deb6e320911d95241">getClassNumStates</a> () const override</td></tr>
<tr class="separator:a10b3dbdf42e1d42deb6e320911d95241 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier" id="r_a469fcb6f35fc1418861a0d39f7760def"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a469fcb6f35fc1418861a0d39f7760def">getStatus</a> () const override</td></tr>
<tr class="separator:a469fcb6f35fc1418861a0d39f7760def inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier" id="r_a3d1d2b50b214a035dfc29519a98cb823"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3d1d2b50b214a035dfc29519a98cb823">getVersion</a> () override</td></tr>
<tr class="separator:a3d1d2b50b214a035dfc29519a98cb823 inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier" id="r_ad5190e5b210953162d334c71eff43acd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ad5190e5b210953162d334c71eff43acd">getNotes</a> () const override</td></tr>
<tr class="separator:ad5190e5b210953162d334c71eff43acd inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier" id="r_a363db4d3edc674f6c65446f99cb9fa2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a363db4d3edc674f6c65446f99cb9fa2e">setHyperparameters</a> (const nlohmann::json &amp;hyperparameters) override</td></tr>
<tr class="separator:a363db4d3edc674f6c65446f99cb9fa2e inherit pub_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier" id="r_ac4e33e5450cbd7ffe7b8ba5608106722"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ac4e33e5450cbd7ffe7b8ba5608106722">getValidHyperparameters</a> ()</td></tr>
<tr class="separator:ac4e33e5450cbd7ffe7b8ba5608106722 inherit pub_methods_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aac58b795401b3b7455fb2ce0831460d9" id="r_aac58b795401b3b7455fb2ce0831460d9"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aac58b795401b3b7455fb2ce0831460d9">featureSelection</a> (torch::Tensor &amp;weights_)</td></tr>
<tr class="separator:aac58b795401b3b7455fb2ce0831460d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a413f675b6c2d72515a0832e125f48fb0" id="r_a413f675b6c2d72515a0832e125f48fb0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a413f675b6c2d72515a0832e125f48fb0">buildModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a413f675b6c2d72515a0832e125f48fb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79e4c58021af69e26126c8f58d1c3b29" id="r_a79e4c58021af69e26126c8f58d1c3b29"><td class="memItemLeft" align="right" valign="top">std::tuple&lt; torch::Tensor &amp;, double, bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a79e4c58021af69e26126c8f58d1c3b29">update_weights</a> (torch::Tensor &amp;ytrain, torch::Tensor &amp;ypred, torch::Tensor &amp;weights)</td></tr>
<tr class="separator:a79e4c58021af69e26126c8f58d1c3b29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abee86d771210899db79678a2f31823cf" id="r_abee86d771210899db79678a2f31823cf"><td class="memItemLeft" align="right" valign="top">std::tuple&lt; torch::Tensor &amp;, double, bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abee86d771210899db79678a2f31823cf">update_weights_block</a> (int k, torch::Tensor &amp;ytrain, torch::Tensor &amp;weights)</td></tr>
<tr class="separator:abee86d771210899db79678a2f31823cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a77fbc0a1720fbca2210ec34d6de1e293"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a77fbc0a1720fbca2210ec34d6de1e293">predict_average_voting</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a77fbc0a1720fbca2210ec34d6de1e293 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a8b21eabaff70af01d9f2794f4aa3f5bd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a8b21eabaff70af01d9f2794f4aa3f5bd">predict_average_voting</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a8b21eabaff70af01d9f2794f4aa3f5bd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a2a077e5c89d179ab904ad9cb8c21465c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a2a077e5c89d179ab904ad9cb8c21465c">predict_average_proba</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a2a077e5c89d179ab904ad9cb8c21465c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a180d71eb7859f96712911598678029bc"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a180d71eb7859f96712911598678029bc">predict_average_proba</a> (std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X)</td></tr>
<tr class="separator:a180d71eb7859f96712911598678029bc inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a9abee06272ba403a8fb9f5312c98a43c"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a9abee06272ba403a8fb9f5312c98a43c">compute_arg_max</a> (torch::Tensor &amp;X)</td></tr>
<tr class="separator:a9abee06272ba403a8fb9f5312c98a43c inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble" id="r_afce60aba82b7f026e8a88ee0ef9cdabd"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#afce60aba82b7f026e8a88ee0ef9cdabd">compute_arg_max</a> (std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X)</td></tr>
<tr class="separator:afce60aba82b7f026e8a88ee0ef9cdabd inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a47a49609634a7a127b3a1264ed55ec04"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a47a49609634a7a127b3a1264ed55ec04">voting</a> (torch::Tensor &amp;votes)</td></tr>
<tr class="separator:a47a49609634a7a127b3a1264ed55ec04 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble" id="r_a7857edca2bd2a407ec8404562219eb45"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a7857edca2bd2a407ec8404562219eb45">trainModel</a> (const torch::Tensor &amp;weights) override</td></tr>
<tr class="separator:a7857edca2bd2a407ec8404562219eb45 inherit pro_methods_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_methods_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier" id="r_a11d1d74615d8c844210dd0f9af7bba1c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a11d1d74615d8c844210dd0f9af7bba1c">checkFitParameters</a> ()</td></tr>
<tr class="separator:a11d1d74615d8c844210dd0f9af7bba1c inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier" id="r_a3247e1fdc38db1b22592a15e74c5c29f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a3247e1fdc38db1b22592a15e74c5c29f">buildDataset</a> (torch::Tensor &amp;y)</td></tr>
<tr class="separator:a3247e1fdc38db1b22592a15e74c5c29f inherit pro_methods_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ae19dc6d4d70c74baf8b801a22a935a2f" id="r_ae19dc6d4d70c74baf8b801a22a935a2f"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae19dc6d4d70c74baf8b801a22a935a2f">X_train</a></td></tr>
<tr class="separator:ae19dc6d4d70c74baf8b801a22a935a2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a023913d253aeb83dba60a15f61a059a5" id="r_a023913d253aeb83dba60a15f61a059a5"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a023913d253aeb83dba60a15f61a059a5">y_train</a></td></tr>
<tr class="separator:a023913d253aeb83dba60a15f61a059a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3945ec0bb41206b421632fc999eb7252" id="r_a3945ec0bb41206b421632fc999eb7252"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3945ec0bb41206b421632fc999eb7252">X_test</a></td></tr>
<tr class="separator:a3945ec0bb41206b421632fc999eb7252"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88de19ffafabdcbc0cf8866d5c059138" id="r_a88de19ffafabdcbc0cf8866d5c059138"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a88de19ffafabdcbc0cf8866d5c059138">y_test</a></td></tr>
<tr class="separator:a88de19ffafabdcbc0cf8866d5c059138"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8a53b6bdb07aa4f8bfe43515da8228f" id="r_ac8a53b6bdb07aa4f8bfe43515da8228f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac8a53b6bdb07aa4f8bfe43515da8228f">bisection</a> = true</td></tr>
<tr class="separator:ac8a53b6bdb07aa4f8bfe43515da8228f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ed44d620c1f2e5c06c3695585e40860" id="r_a9ed44d620c1f2e5c06c3695585e40860"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9ed44d620c1f2e5c06c3695585e40860">maxTolerance</a> = 3</td></tr>
<tr class="separator:a9ed44d620c1f2e5c06c3695585e40860"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b4a91f940ebcfd532c73df0018acb3e" id="r_a5b4a91f940ebcfd532c73df0018acb3e"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5b4a91f940ebcfd532c73df0018acb3e">order_algorithm</a></td></tr>
<tr class="separator:a5b4a91f940ebcfd532c73df0018acb3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71e17067522a19e6d23ab503aa7cc16a" id="r_a71e17067522a19e6d23ab503aa7cc16a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a71e17067522a19e6d23ab503aa7cc16a">convergence</a> = true</td></tr>
<tr class="separator:a71e17067522a19e6d23ab503aa7cc16a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a985df40f71dd9a64d0fc9e66ed41595b" id="r_a985df40f71dd9a64d0fc9e66ed41595b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a985df40f71dd9a64d0fc9e66ed41595b">convergence_best</a> = false</td></tr>
<tr class="separator:a985df40f71dd9a64d0fc9e66ed41595b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57bf7c3a220afd538287f88be41f463e" id="r_a57bf7c3a220afd538287f88be41f463e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a57bf7c3a220afd538287f88be41f463e">selectFeatures</a> = false</td></tr>
<tr class="separator:a57bf7c3a220afd538287f88be41f463e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dd29281582d7815c7b3302d61492bde" id="r_a1dd29281582d7815c7b3302d61492bde"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1dd29281582d7815c7b3302d61492bde">select_features_algorithm</a> = Orders.DESC</td></tr>
<tr class="separator:a1dd29281582d7815c7b3302d61492bde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb59196a4e112d4c1921d78766d7b966" id="r_adb59196a4e112d4c1921d78766d7b966"><td class="memItemLeft" align="right" valign="top">FeatureSelect *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adb59196a4e112d4c1921d78766d7b966">featureSelector</a> = nullptr</td></tr>
<tr class="separator:adb59196a4e112d4c1921d78766d7b966"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cbc839445860d3e4c8f5a11359c58c3" id="r_a1cbc839445860d3e4c8f5a11359c58c3"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1cbc839445860d3e4c8f5a11359c58c3">threshold</a> = -1</td></tr>
<tr class="separator:a1cbc839445860d3e4c8f5a11359c58c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b290f030febf39c41ff679990d9cf4c" id="r_a4b290f030febf39c41ff679990d9cf4c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4b290f030febf39c41ff679990d9cf4c">block_update</a> = false</td></tr>
<tr class="separator:a4b290f030febf39c41ff679990d9cf4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_ensemble"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_ensemble')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td></tr>
<tr class="memitem:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a65b82f7036d283358a756013f96bec8d"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a65b82f7036d283358a756013f96bec8d">n_models</a></td></tr>
<tr class="separator:a65b82f7036d283358a756013f96bec8d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a76f6b6c16e9e771f059ad72cbd4571a9"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::unique_ptr&lt; <a class="el" href="classbayesnet_1_1_classifier.html">Classifier</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a76f6b6c16e9e771f059ad72cbd4571a9">models</a></td></tr>
<tr class="separator:a76f6b6c16e9e771f059ad72cbd4571a9 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a27cb9d119dd817ec240d8a4deedf0350"><td class="memItemLeft" align="right" valign="top">std::vector&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a27cb9d119dd817ec240d8a4deedf0350">significanceModels</a></td></tr>
<tr class="separator:a27cb9d119dd817ec240d8a4deedf0350 inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble" id="r_a383156745d59959e0652645081c0257d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_ensemble.html#a383156745d59959e0652645081c0257d">predict_voting</a></td></tr>
<tr class="separator:a383156745d59959e0652645081c0257d inherit pro_attribs_classbayesnet_1_1_ensemble"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td></tr>
<tr class="memitem:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aea401da2c395732dcde94e565b53a485"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aea401da2c395732dcde94e565b53a485">fitted</a></td></tr>
<tr class="separator:aea401da2c395732dcde94e565b53a485 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a0604b45141b3d8b541ca8aac03293232"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a0604b45141b3d8b541ca8aac03293232">m</a></td></tr>
<tr class="separator:a0604b45141b3d8b541ca8aac03293232 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_ab34ab485d73d3f76e63bd7e8ecbddee9"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#ab34ab485d73d3f76e63bd7e8ecbddee9">n</a></td></tr>
<tr class="separator:ab34ab485d73d3f76e63bd7e8ecbddee9 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_aba373ae6dd67262e3d8cc8c113544897"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbayesnet_1_1_network.html">Network</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#aba373ae6dd67262e3d8cc8c113544897">model</a></td></tr>
<tr class="separator:aba373ae6dd67262e3d8cc8c113544897 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a80fde71d6dea24fd2d23a11aa5fb0d84"><td class="memItemLeft" align="right" valign="top">Metrics&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a80fde71d6dea24fd2d23a11aa5fb0d84">metrics</a></td></tr>
<tr class="separator:a80fde71d6dea24fd2d23a11aa5fb0d84 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_abbff645d99c607cae1a4a843381b8db1"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#abbff645d99c607cae1a4a843381b8db1">features</a></td></tr>
<tr class="separator:abbff645d99c607cae1a4a843381b8db1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a9800be045e73f73ef3bef7c9cdc80bb1"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a9800be045e73f73ef3bef7c9cdc80bb1">className</a></td></tr>
<tr class="separator:a9800be045e73f73ef3bef7c9cdc80bb1 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a725b62e1d3e4a856265613820efff77f"><td class="memItemLeft" align="right" valign="top">std::map&lt; std::string, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a725b62e1d3e4a856265613820efff77f">states</a></td></tr>
<tr class="separator:a725b62e1d3e4a856265613820efff77f inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a5d9c9d1bd115ead98bb0ddaf2df5d9a6"><td class="memItemLeft" align="right" valign="top">torch::Tensor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a5d9c9d1bd115ead98bb0ddaf2df5d9a6">dataset</a></td></tr>
<tr class="separator:a5d9c9d1bd115ead98bb0ddaf2df5d9a6 inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a1fdceba49bf2398b6a4959ddadea177b"><td class="memItemLeft" align="right" valign="top">status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a1fdceba49bf2398b6a4959ddadea177b">status</a> = NORMAL</td></tr>
<tr class="separator:a1fdceba49bf2398b6a4959ddadea177b inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier" id="r_a8ae8101963f78aefb61093ae66ba1c7d"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_classifier.html#a8ae8101963f78aefb61093ae66ba1c7d">notes</a></td></tr>
<tr class="separator:a8ae8101963f78aefb61093ae66ba1c7d inherit pro_attribs_classbayesnet_1_1_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classbayesnet_1_1_base_classifier"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pro_attribs_classbayesnet_1_1_base_classifier')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td></tr>
<tr class="memitem:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier" id="r_ae2d94700f470b5f4a623965b1c442c6a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbayesnet_1_1_base_classifier.html#ae2d94700f470b5f4a623965b1c442c6a">validHyperparameters</a></td></tr>
<tr class="separator:ae2d94700f470b5f4a623965b1c442c6a inherit pro_attribs_classbayesnet_1_1_base_classifier"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00027">27</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a54bb9e01bfce0c4a3f3b1ae890d1f646" name="a54bb9e01bfce0c4a3f3b1ae890d1f646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54bb9e01bfce0c4a3f3b1ae890d1f646">&#9670;&#160;</a></span>Boost()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bayesnet::Boost::Boost </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>predict_voting</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8cc_source.html#l00013">13</a> of file <a class="el" href="_boost_8cc_source.html">Boost.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a413f675b6c2d72515a0832e125f48fb0" name="a413f675b6c2d72515a0832e125f48fb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a413f675b6c2d72515a0832e125f48fb0">&#9670;&#160;</a></span>buildModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::Boost::buildModel </td>
<td>(</td>
<td class="paramtype">const torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_boost_8cc_source.html#l00071">71</a> of file <a class="el" href="_boost_8cc_source.html">Boost.cc</a>.</p>
</div>
</div>
<a id="aac58b795401b3b7455fb2ce0831460d9" name="aac58b795401b3b7455fb2ce0831460d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac58b795401b3b7455fb2ce0831460d9">&#9670;&#160;</a></span>featureSelection()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; int &gt; bayesnet::Boost::featureSelection </td>
<td>(</td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights_</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8cc_source.html#l00102">102</a> of file <a class="el" href="_boost_8cc_source.html">Boost.cc</a>.</p>
</div>
</div>
<a id="a2590c3315a7a6d40c5a5dffdd245bbfd" name="a2590c3315a7a6d40c5a5dffdd245bbfd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2590c3315a7a6d40c5a5dffdd245bbfd">&#9670;&#160;</a></span>setHyperparameters()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void bayesnet::Boost::setHyperparameters </td>
<td>(</td>
<td class="paramtype">const nlohmann::json &amp;</td> <td class="paramname"><span class="paramname"><em>hyperparameters_</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>.</p>
<p class="definition">Definition at line <a class="el" href="_boost_8cc_source.html#l00018">18</a> of file <a class="el" href="_boost_8cc_source.html">Boost.cc</a>.</p>
</div>
</div>
<a id="a79e4c58021af69e26126c8f58d1c3b29" name="a79e4c58021af69e26126c8f58d1c3b29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79e4c58021af69e26126c8f58d1c3b29">&#9670;&#160;</a></span>update_weights()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::tuple&lt; torch::Tensor &amp;, double, bool &gt; bayesnet::Boost::update_weights </td>
<td>(</td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>ytrain</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>ypred</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8cc_source.html#l00123">123</a> of file <a class="el" href="_boost_8cc_source.html">Boost.cc</a>.</p>
</div>
</div>
<a id="abee86d771210899db79678a2f31823cf" name="abee86d771210899db79678a2f31823cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abee86d771210899db79678a2f31823cf">&#9670;&#160;</a></span>update_weights_block()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::tuple&lt; torch::Tensor &amp;, double, bool &gt; bayesnet::Boost::update_weights_block </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>k</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>ytrain</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">torch::Tensor &amp;</td> <td class="paramname"><span class="paramname"><em>weights</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8cc_source.html#l00150">150</a> of file <a class="el" href="_boost_8cc_source.html">Boost.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ac8a53b6bdb07aa4f8bfe43515da8228f" name="ac8a53b6bdb07aa4f8bfe43515da8228f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8a53b6bdb07aa4f8bfe43515da8228f">&#9670;&#160;</a></span>bisection</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool bayesnet::Boost::bisection = true</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00039">39</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a4b290f030febf39c41ff679990d9cf4c" name="a4b290f030febf39c41ff679990d9cf4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b290f030febf39c41ff679990d9cf4c">&#9670;&#160;</a></span>block_update</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool bayesnet::Boost::block_update = false</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00048">48</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a71e17067522a19e6d23ab503aa7cc16a" name="a71e17067522a19e6d23ab503aa7cc16a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71e17067522a19e6d23ab503aa7cc16a">&#9670;&#160;</a></span>convergence</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool bayesnet::Boost::convergence = true</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00042">42</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a985df40f71dd9a64d0fc9e66ed41595b" name="a985df40f71dd9a64d0fc9e66ed41595b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a985df40f71dd9a64d0fc9e66ed41595b">&#9670;&#160;</a></span>convergence_best</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool bayesnet::Boost::convergence_best = false</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00043">43</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="adb59196a4e112d4c1921d78766d7b966" name="adb59196a4e112d4c1921d78766d7b966"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb59196a4e112d4c1921d78766d7b966">&#9670;&#160;</a></span>featureSelector</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">FeatureSelect* bayesnet::Boost::featureSelector = nullptr</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00046">46</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a9ed44d620c1f2e5c06c3695585e40860" name="a9ed44d620c1f2e5c06c3695585e40860"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ed44d620c1f2e5c06c3695585e40860">&#9670;&#160;</a></span>maxTolerance</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int bayesnet::Boost::maxTolerance = 3</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00040">40</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a5b4a91f940ebcfd532c73df0018acb3e" name="a5b4a91f940ebcfd532c73df0018acb3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b4a91f940ebcfd532c73df0018acb3e">&#9670;&#160;</a></span>order_algorithm</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::string bayesnet::Boost::order_algorithm</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00041">41</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a1dd29281582d7815c7b3302d61492bde" name="a1dd29281582d7815c7b3302d61492bde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1dd29281582d7815c7b3302d61492bde">&#9670;&#160;</a></span>select_features_algorithm</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::string bayesnet::Boost::select_features_algorithm = Orders.DESC</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00045">45</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a57bf7c3a220afd538287f88be41f463e" name="a57bf7c3a220afd538287f88be41f463e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57bf7c3a220afd538287f88be41f463e">&#9670;&#160;</a></span>selectFeatures</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool bayesnet::Boost::selectFeatures = false</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00044">44</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a1cbc839445860d3e4c8f5a11359c58c3" name="a1cbc839445860d3e4c8f5a11359c58c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cbc839445860d3e4c8f5a11359c58c3">&#9670;&#160;</a></span>threshold</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double bayesnet::Boost::threshold = -1</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00047">47</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a3945ec0bb41206b421632fc999eb7252" name="a3945ec0bb41206b421632fc999eb7252"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3945ec0bb41206b421632fc999eb7252">&#9670;&#160;</a></span>X_test</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">torch::Tensor bayesnet::Boost::X_test</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00037">37</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="ae19dc6d4d70c74baf8b801a22a935a2f" name="ae19dc6d4d70c74baf8b801a22a935a2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae19dc6d4d70c74baf8b801a22a935a2f">&#9670;&#160;</a></span>X_train</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">torch::Tensor bayesnet::Boost::X_train</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00037">37</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a88de19ffafabdcbc0cf8866d5c059138" name="a88de19ffafabdcbc0cf8866d5c059138"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88de19ffafabdcbc0cf8866d5c059138">&#9670;&#160;</a></span>y_test</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">torch::Tensor bayesnet::Boost::y_test</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00037">37</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<a id="a023913d253aeb83dba60a15f61a059a5" name="a023913d253aeb83dba60a15f61a059a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a023913d253aeb83dba60a15f61a059a5">&#9670;&#160;</a></span>y_train</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">torch::Tensor bayesnet::Boost::y_train</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="_boost_8h_source.html#l00037">37</a> of file <a class="el" href="_boost_8h_source.html">Boost.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_boost_8h_source.html">Boost.h</a></li>
<li>/Users/rmontanana/Code/BayesNet/bayesnet/ensembles/<a class="el" href="_boost_8cc_source.html">Boost.cc</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>bayesnet</b></li><li class="navelem"><a class="el" href="classbayesnet_1_1_boost.html">Boost</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

View File

@ -1,11 +0,0 @@
<map id="bayesnet::Boost" name="bayesnet::Boost">
<area shape="rect" id="Node000001" title=" " alt="" coords="118,241,234,267"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="106,168,246,193"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="178,209,178,241,173,241,173,209"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="107,94,244,120"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="178,135,178,167,173,167,173,135"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="5,5,173,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="113,40,166,92,162,96,110,44"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_network.html" title=" " alt="" coords="197,5,328,31"/>
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="242,44,189,96,186,92,238,40"/>
</map>

View File

@ -1 +0,0 @@
33c55f91c7a5aad7b7e8fe161de0b44b

View File

@ -1,13 +0,0 @@
<map id="bayesnet::Boost" name="bayesnet::Boost">
<area shape="rect" id="Node000001" title=" " alt="" coords="111,226,227,252"/>
<area shape="rect" id="Node000005" href="$classbayesnet_1_1_boost_a2_d_e.html" title=" " alt="" coords="5,300,157,326"/>
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="144,264,97,302,94,298,141,260"/>
<area shape="rect" id="Node000006" href="$classbayesnet_1_1_boost_a_o_d_e.html" title=" " alt="" coords="181,300,336,326"/>
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="197,260,245,298,242,302,194,264"/>
<area shape="rect" id="Node000002" href="$classbayesnet_1_1_ensemble.html" title=" " alt="" coords="99,153,239,178"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="172,194,172,226,166,226,166,194"/>
<area shape="rect" id="Node000003" href="$classbayesnet_1_1_classifier.html" title=" " alt="" coords="100,79,238,105"/>
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="172,120,172,152,166,152,166,120"/>
<area shape="rect" id="Node000004" href="$classbayesnet_1_1_base_classifier.html" title=" " alt="" coords="85,5,253,31"/>
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="172,46,172,79,166,79,166,46"/>
</map>

View File

@ -1 +0,0 @@
e24f4aa87c4b3d0cdd0c5eb01ce7479b

View File

@ -1,193 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BayesNet: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="logo_small.png"/></td>
<td id="projectalign">
<div id="projectname">BayesNet<span id="projectnumber">&#160;1.0.5</span>
</div>
<div id="projectbrief">Bayesian Network Classifiers using libtorch from scratch</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classbayesnet_1_1_boost_a2_d_e.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bayesnet::BoostA2DE Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>addNodes</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>bisection</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>block_update</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>Boost</b>(bool predict_voting=false) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BoostA2DE</b>(bool predict_voting=false) (defined in <a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>buildDataset</b>(torch::Tensor &amp;y) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>buildModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>checkFitParameters</b>() (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Classifier</b>(Network model) (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>className</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>compute_arg_max</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>compute_arg_max</b>(std::vector&lt; std::vector&lt; double &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>convergence</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>convergence_best</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dataset</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>dump_cpt</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Ensemble</b>(bool predict_voting=true) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>features</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>featureSelection</b>(torch::Tensor &amp;weights_) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>featureSelector</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;X, torch::Tensor &amp;y, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>fit</b>(torch::Tensor &amp;dataset, const std::vector&lt; std::string &gt; &amp;features, const std::string &amp;className, std::map&lt; std::string, std::vector&lt; int &gt; &gt; &amp;states, const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>fitted</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getClassNumStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNotes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfEdges</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getNumberOfNodes</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getNumberOfStates</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getStatus</b>() const override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>getValidHyperparameters</b>() (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>getVersion</b>() override (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>graph</b>(const std::string &amp;title=&quot;BoostA2DE&quot;) const override (defined in <a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>m</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>maxTolerance</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>metrics</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>model</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>n</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n_models</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>notes</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>order_algorithm</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_proba</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_average_voting</b>(torch::Tensor &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_average_voting</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_proba</b>(torch::Tensor &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>predict_proba</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>predict_voting</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>score</b>(torch::Tensor &amp;X, torch::Tensor &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>score</b>(std::vector&lt; std::vector&lt; int &gt; &gt; &amp;X, std::vector&lt; int &gt; &amp;y) override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>select_features_algorithm</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>selectFeatures</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>setHyperparameters</b>(const nlohmann::json &amp;hyperparameters_) override (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>show</b>() const override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>significanceModels</b> (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>states</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>status</b> (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>threshold</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>topological_order</b>() override (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>trainModel</b>(const torch::Tensor &amp;weights) override (defined in <a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>update_weights</b>(torch::Tensor &amp;ytrain, torch::Tensor &amp;ypred, torch::Tensor &amp;weights) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>update_weights_block</b>(int k, torch::Tensor &amp;ytrain, torch::Tensor &amp;weights) (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>validHyperparameters</b> (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>voting</b>(torch::Tensor &amp;votes) (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>X_test</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>X_train</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>y_test</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>y_train</b> (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~BaseClassifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_base_classifier.html">bayesnet::BaseClassifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Boost</b>()=default (defined in <a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost.html">bayesnet::Boost</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~BoostA2DE</b>()=default (defined in <a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_boost_a2_d_e.html">bayesnet::BoostA2DE</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~Classifier</b>()=default (defined in <a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_classifier.html">bayesnet::Classifier</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>~Ensemble</b>()=default (defined in <a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a>)</td><td class="entry"><a class="el" href="classbayesnet_1_1_ensemble.html">bayesnet::Ensemble</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
</ul>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More