![]() |
BayesNet 1.0.5
Bayesian Network Classifiers using libtorch from scratch
|
Public Member Functions | |
Network (float) | |
Network (const Network &) | |
torch::Tensor & | getSamples () |
float | getMaxThreads () const |
void | addNode (const std::string &) |
void | addEdge (const std::string &, const std::string &) |
std::map< std::string, std::unique_ptr< Node > > & | getNodes () |
std::vector< std::string > | getFeatures () const |
int | getStates () const |
std::vector< std::pair< std::string, std::string > > | getEdges () const |
int | getNumEdges () const |
int | getClassNumStates () const |
std::string | getClassName () const |
void | 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) |
void | 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) |
void | 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) |
std::vector< int > | predict (const std::vector< std::vector< int > > &) |
torch::Tensor | predict (const torch::Tensor &) |
torch::Tensor | predict_tensor (const torch::Tensor &samples, const bool proba) |
std::vector< std::vector< double > > | predict_proba (const std::vector< std::vector< int > > &) |
torch::Tensor | predict_proba (const torch::Tensor &) |
double | score (const std::vector< std::vector< int > > &, const std::vector< int > &) |
std::vector< std::string > | topological_sort () |
std::vector< std::string > | show () const |
std::vector< std::string > | graph (const std::string &title) const |
void | initialize () |
std::string | dump_cpt () const |
std::string | version () |
bayesnet::Network::Network | ( | ) |
Definition at line 13 of file Network.cc.
|
explicit |
Definition at line 16 of file Network.cc.
|
explicit |
Definition at line 20 of file Network.cc.
void bayesnet::Network::addEdge | ( | const std::string & | parent, |
const std::string & | child ) |
Definition at line 95 of file Network.cc.
void bayesnet::Network::addNode | ( | const std::string & | name | ) |
Definition at line 46 of file Network.cc.
std::string bayesnet::Network::dump_cpt | ( | ) | const |
Definition at line 420 of file Network.cc.
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 ) |
Definition at line 177 of file Network.cc.
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 ) |
Definition at line 169 of file Network.cc.
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 ) |
Definition at line 158 of file Network.cc.
std::string bayesnet::Network::getClassName | ( | ) | const |
Definition at line 75 of file Network.cc.
int bayesnet::Network::getClassNumStates | ( | ) | const |
Definition at line 63 of file Network.cc.
std::vector< std::pair< std::string, std::string > > bayesnet::Network::getEdges | ( | ) | const |
Definition at line 371 of file Network.cc.
std::vector< std::string > bayesnet::Network::getFeatures | ( | ) | const |
Definition at line 59 of file Network.cc.
float bayesnet::Network::getMaxThreads | ( | ) | const |
Definition at line 38 of file Network.cc.
std::map< std::string, std::unique_ptr< Node > > & bayesnet::Network::getNodes | ( | ) |
Definition at line 116 of file Network.cc.
int bayesnet::Network::getNumEdges | ( | ) | const |
Definition at line 383 of file Network.cc.
torch::Tensor & bayesnet::Network::getSamples | ( | ) |
Definition at line 42 of file Network.cc.
int bayesnet::Network::getStates | ( | ) | const |
Definition at line 67 of file Network.cc.
std::vector< std::string > bayesnet::Network::graph | ( | const std::string & | title | ) | const |
Definition at line 357 of file Network.cc.
void bayesnet::Network::initialize | ( | ) |
Definition at line 29 of file Network.cc.
std::vector< int > bayesnet::Network::predict | ( | const std::vector< std::vector< int > > & | tsamples | ) |
Definition at line 237 of file Network.cc.
torch::Tensor bayesnet::Network::predict | ( | const torch::Tensor & | samples | ) |
Definition at line 230 of file Network.cc.
std::vector< std::vector< double > > bayesnet::Network::predict_proba | ( | const std::vector< std::vector< int > > & | tsamples | ) |
Definition at line 259 of file Network.cc.
torch::Tensor bayesnet::Network::predict_proba | ( | const torch::Tensor & | samples | ) |
Definition at line 224 of file Network.cc.
torch::Tensor bayesnet::Network::predict_tensor | ( | const torch::Tensor & | samples, |
const bool | proba ) |
Definition at line 205 of file Network.cc.
double bayesnet::Network::score | ( | const std::vector< std::vector< int > > & | tsamples, |
const std::vector< int > & | labels ) |
Definition at line 275 of file Network.cc.
std::vector< std::string > bayesnet::Network::show | ( | ) | const |
Definition at line 344 of file Network.cc.
std::vector< std::string > bayesnet::Network::topological_sort | ( | ) |
Definition at line 387 of file Network.cc.