BayesNet 1.0.7.
Bayesian Network and basic classifiers Library.
Loading...
Searching...
No Matches
bayesnet::Network Class Reference

Public Member Functions

 Network (const Network &)
 
torch::Tensor & getSamples ()
 
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, const Smoothing_t smoothing)
 
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, const Smoothing_t smoothing)
 
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, const Smoothing_t smoothing)
 
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 ()
 

Detailed Description

Definition at line 17 of file Network.h.

Constructor & Destructor Documentation

◆ Network() [1/2]

bayesnet::Network::Network ( )

Definition at line 17 of file Network.cc.

◆ Network() [2/2]

bayesnet::Network::Network ( const Network & other)
explicit

Definition at line 20 of file Network.cc.

Member Function Documentation

◆ addEdge()

void bayesnet::Network::addEdge ( const std::string & parent,
const std::string & child )

Definition at line 94 of file Network.cc.

◆ addNode()

void bayesnet::Network::addNode ( const std::string & name)

Definition at line 42 of file Network.cc.

◆ dump_cpt()

std::string bayesnet::Network::dump_cpt ( ) const

Definition at line 497 of file Network.cc.

◆ fit() [1/3]

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,
const Smoothing_t smoothing )

Definition at line 185 of file Network.cc.

◆ fit() [2/3]

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,
const Smoothing_t smoothing )

Definition at line 177 of file Network.cc.

◆ fit() [3/3]

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,
const Smoothing_t smoothing )

Definition at line 166 of file Network.cc.

◆ getClassName()

std::string bayesnet::Network::getClassName ( ) const

Definition at line 74 of file Network.cc.

◆ getClassNumStates()

int bayesnet::Network::getClassNumStates ( ) const

Definition at line 62 of file Network.cc.

◆ getEdges()

std::vector< std::pair< std::string, std::string > > bayesnet::Network::getEdges ( ) const

Definition at line 448 of file Network.cc.

◆ getFeatures()

std::vector< std::string > bayesnet::Network::getFeatures ( ) const

Definition at line 58 of file Network.cc.

◆ getNodes()

std::map< std::string, std::unique_ptr< Node > > & bayesnet::Network::getNodes ( )

Definition at line 124 of file Network.cc.

◆ getNumEdges()

int bayesnet::Network::getNumEdges ( ) const

Definition at line 460 of file Network.cc.

◆ getSamples()

torch::Tensor & bayesnet::Network::getSamples ( )

Definition at line 38 of file Network.cc.

◆ getStates()

int bayesnet::Network::getStates ( ) const

Definition at line 66 of file Network.cc.

◆ graph()

std::vector< std::string > bayesnet::Network::graph ( const std::string & title) const

Definition at line 434 of file Network.cc.

◆ initialize()

void bayesnet::Network::initialize ( )

Definition at line 29 of file Network.cc.

◆ predict() [1/2]

std::vector< int > bayesnet::Network::predict ( const std::vector< std::vector< int > > & tsamples)

Definition at line 295 of file Network.cc.

◆ predict() [2/2]

torch::Tensor bayesnet::Network::predict ( const torch::Tensor & samples)

Definition at line 288 of file Network.cc.

◆ predict_proba() [1/2]

std::vector< std::vector< double > > bayesnet::Network::predict_proba ( const std::vector< std::vector< int > > & tsamples)

Definition at line 337 of file Network.cc.

◆ predict_proba() [2/2]

torch::Tensor bayesnet::Network::predict_proba ( const torch::Tensor & samples)

Definition at line 282 of file Network.cc.

◆ predict_tensor()

torch::Tensor bayesnet::Network::predict_tensor ( const torch::Tensor & samples,
const bool proba )

Definition at line 239 of file Network.cc.

◆ score()

double bayesnet::Network::score ( const std::vector< std::vector< int > > & tsamples,
const std::vector< int > & labels )

Definition at line 375 of file Network.cc.

◆ show()

std::vector< std::string > bayesnet::Network::show ( ) const

Definition at line 421 of file Network.cc.

◆ topological_sort()

std::vector< std::string > bayesnet::Network::topological_sort ( )

Definition at line 464 of file Network.cc.

◆ version()

std::string bayesnet::Network::version ( )
inline

Definition at line 49 of file Network.h.


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