diff --git a/.clang-uml b/.clang-uml new file mode 100644 index 0000000..2e36a4f --- /dev/null +++ b/.clang-uml @@ -0,0 +1,39 @@ +compilation_database_dir: build_debug +output_directory: diagrams +diagrams: + BayesNet: + type: class + glob: + - bayesnet/*.h + - bayesnet/classifiers/*.h + - bayesnet/classifiers/*.cc + - bayesnet/ensembles/*.h + - bayesnet/ensembles/*.cc + - bayesnet/feature_selection/*.h + - bayesnet/feature_selection/*.cc + - bayesnet/network/*.h + - bayesnet/network/*.cc + - bayesnet/utils/*.h + - bayesnet/utils/*.cc + include: + # Only include entities from the following namespaces + namespaces: + - bayesnet + exclude: + access: + - private + plantuml: + style: + # Apply this style to all classes in the diagram + class: "#aliceblue;line:blue;line.dotted;text:blue" + # Apply this style to all packages in the diagram + package: "#back:grey" + # Make all template instantiation relations point upwards and draw them + # as green and dotted lines + instantiation: "up[#green,dotted]" + cmd: "/usr/bin/plantuml -tsvg \"diagrams/{}.puml\"" + before: + - 'title clang-uml class diagram model' + mermaid: + before: + - 'classDiagram' \ No newline at end of file diff --git a/Makefile b/Makefile index 58707a5..2187a73 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ SHELL := /bin/bash .DEFAULT_GOAL := help -.PHONY: viewcoverage coverage setup help install uninstall buildr buildd test clean debug release sample updatebadge +.PHONY: viewcoverage coverage setup help install uninstall diagrams buildr buildd test clean debug release sample updatebadge f_release = build_release f_debug = build_debug +f_diagrams = diagrams app_targets = BayesNet test_targets = TestBayesNet n_procs = -j 16 @@ -31,11 +32,18 @@ setup: ## Install dependencies for tests and coverage pip install gcovr; \ sudo dnf install lcov;\ fi + @echo "* You should install plantuml & graphviz for the diagrams" -dependency: ## Create a dependency graph diagram of the project (build/dependency.png) +diagrams: ## Create an UML class diagram & depnendency of the project (diagrams/BayesNet.png) + @export PLANTUML_LIMIT_SIZE=16384 + @echo ">>> Creating UML class diagram of the project..."; + @clang-uml -p + @cd $(f_diagrams); \ + plantuml -tsvg BayesNet.puml @echo ">>> Creating dependency graph diagram of the project..."; $(MAKE) debug - cd $(f_debug) && cmake .. --graphviz=dependency.dot && dot -Tpng dependency.dot -o dependency.png + cd $(f_debug) && cmake .. --graphviz=dependency.dot + @dot -Tsvg $(f_debug)/dependency.dot -o $(f_diagrams)/dependency.svg buildd: ## Build the debug targets cmake --build $(f_debug) -t $(app_targets) $(n_procs) diff --git a/README.md b/README.md index 3db71e2..e989210 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,13 @@ make sample fname=tests/data/glass.arff ## Models ### [BoostAODE](docs/BoostAODE.md) + +## Diagrams + +### UML Class Diagram + +![BayesNet UML Class Diagram](diagrams/BayesNet.svg) + +### Dependency Diagram + +![BayesNet Dependency Diagram](diagrams/dependency.svg) diff --git a/diagrams/BayesNet.pdf b/diagrams/BayesNet.pdf deleted file mode 100755 index dd478da..0000000 Binary files a/diagrams/BayesNet.pdf and /dev/null differ diff --git a/diagrams/BayesNet.puml b/diagrams/BayesNet.puml new file mode 100644 index 0000000..c6b487b --- /dev/null +++ b/diagrams/BayesNet.puml @@ -0,0 +1,412 @@ +@startuml +title clang-uml class diagram model +class "bayesnet::Metrics" as C_0000736965376885623323 +class C_0000736965376885623323 #aliceblue;line:blue;line.dotted;text:blue { ++Metrics() = default : void ++Metrics(const torch::Tensor & samples, const std::vector & features, const std::string & className, const int classNumStates) : void ++Metrics(const std::vector> & vsamples, const std::vector & labels, const std::vector & features, const std::string & className, const int classNumStates) : void +.. ++SelectKBestWeighted(const torch::Tensor & weights, bool ascending = false, unsigned int k = 0) : std::vector ++conditionalEdge(const torch::Tensor & weights) : torch::Tensor ++conditionalEdgeWeights(std::vector & weights) : std::vector +#doCombinations(const std::vector & source) : std::vector > +#entropy(const torch::Tensor & feature, const torch::Tensor & weights) : double ++getScoresKBest() const : std::vector ++maximumSpanningTree(const std::vector & features, const torch::Tensor & weights, const int root) : std::vector> ++mutualInformation(const torch::Tensor & firstFeature, const torch::Tensor & secondFeature, const torch::Tensor & weights) : double +#pop_first(std::vector & v) : T +__ +#className : std::string +#features : std::vector +#samples : torch::Tensor +} +class "bayesnet::Node" as C_0001303524929067080934 +class C_0001303524929067080934 #aliceblue;line:blue;line.dotted;text:blue { ++Node(const std::string &) : void +.. ++addChild(Node *) : void ++addParent(Node *) : void ++clear() : void ++computeCPT(const torch::Tensor & dataset, const std::vector & features, const double laplaceSmoothing, const torch::Tensor & weights) : void ++getCPT() : torch::Tensor & ++getChildren() : std::vector & ++getFactorValue(std::map &) : float ++getName() const : std::string ++getNumStates() const : int ++getParents() : std::vector & ++graph(const std::string & clasName) : std::vector ++minFill() : unsigned int ++removeChild(Node *) : void ++removeParent(Node *) : void ++setNumStates(int) : void +__ +} +class "bayesnet::Network" as C_0001186707649890429575 +class C_0001186707649890429575 #aliceblue;line:blue;line.dotted;text:blue { ++Network() : void ++Network(float) : void ++Network(const Network &) : void ++~Network() = default : void +.. ++addEdge(const std::string &, const std::string &) : void ++addNode(const std::string &) : void ++dump_cpt() const : std::string ++fit(const torch::Tensor & samples, const torch::Tensor & weights, const std::vector & featureNames, const std::string & className, const std::map> & states) : void ++fit(const torch::Tensor & X, const torch::Tensor & y, const torch::Tensor & weights, const std::vector & featureNames, const std::string & className, const std::map> & states) : void ++fit(const std::vector> & input_data, const std::vector & labels, const std::vector & weights, const std::vector & featureNames, const std::string & className, const std::map> & states) : void ++getClassName() const : std::string ++getClassNumStates() const : int ++getEdges() const : std::vector> ++getFeatures() const : std::vector ++getMaxThreads() const : float ++getNodes() : std::map> & ++getNumEdges() const : int ++getSamples() : torch::Tensor & ++getStates() const : int ++graph(const std::string & title) const : std::vector ++initialize() : void ++predict(const std::vector> &) : std::vector ++predict(const torch::Tensor &) : torch::Tensor ++predict_proba(const std::vector> &) : std::vector> ++predict_proba(const torch::Tensor &) : torch::Tensor ++predict_tensor(const torch::Tensor & samples, const bool proba) : torch::Tensor ++score(const std::vector> &, const std::vector &) : double ++show() const : std::vector ++topological_sort() : std::vector ++version() : std::string +__ +} +enum "bayesnet::status_t" as C_0000738420730783851375 +enum C_0000738420730783851375 { +NORMAL +WARNING +ERROR +} +abstract "bayesnet::BaseClassifier" as C_0000327135989451974539 +abstract C_0000327135989451974539 #aliceblue;line:blue;line.dotted;text:blue { ++~BaseClassifier() = default : void +.. +{abstract} +dump_cpt() const = 0 : std::string +{abstract} +fit(torch::Tensor & X, torch::Tensor & y, const std::vector & features, const std::string & className, std::map> & states) = 0 : BaseClassifier & +{abstract} +fit(torch::Tensor & dataset, const std::vector & features, const std::string & className, std::map> & states) = 0 : BaseClassifier & +{abstract} +fit(torch::Tensor & dataset, const std::vector & features, const std::string & className, std::map> & states, const torch::Tensor & weights) = 0 : BaseClassifier & +{abstract} +fit(std::vector> & X, std::vector & y, const std::vector & features, const std::string & className, std::map> & states) = 0 : BaseClassifier & +{abstract} +getClassNumStates() const = 0 : int +{abstract} +getNotes() const = 0 : std::vector +{abstract} +getNumberOfEdges() const = 0 : int +{abstract} +getNumberOfNodes() const = 0 : int +{abstract} +getNumberOfStates() const = 0 : int +{abstract} +getStatus() const = 0 : status_t ++getValidHyperparameters() : std::vector & +{abstract} +getVersion() = 0 : std::string +{abstract} +graph(const std::string & title = "") const = 0 : std::vector +{abstract} +predict(std::vector> & X) = 0 : std::vector +{abstract} +predict(torch::Tensor & X) = 0 : torch::Tensor +{abstract} +predict_proba(std::vector> & X) = 0 : std::vector> +{abstract} +predict_proba(torch::Tensor & X) = 0 : torch::Tensor +{abstract} +score(std::vector> & X, std::vector & y) = 0 : float +{abstract} +score(torch::Tensor & X, torch::Tensor & y) = 0 : float +{abstract} +setHyperparameters(const nlohmann::json & hyperparameters) = 0 : void +{abstract} +show() const = 0 : std::vector +{abstract} +topological_order() = 0 : std::vector +{abstract} #trainModel(const torch::Tensor & weights) = 0 : void +__ +#validHyperparameters : std::vector +} +abstract "bayesnet::Classifier" as C_0002043996622900301644 +abstract C_0002043996622900301644 #aliceblue;line:blue;line.dotted;text:blue { ++Classifier(Network model) : void ++~Classifier() = default : void +.. ++addNodes() : void +#buildDataset(torch::Tensor & y) : void +{abstract} #buildModel(const torch::Tensor & weights) = 0 : void +#checkFitParameters() : void ++dump_cpt() const : std::string ++fit(torch::Tensor & X, torch::Tensor & y, const std::vector & features, const std::string & className, std::map> & states) : Classifier & ++fit(std::vector> & X, std::vector & y, const std::vector & features, const std::string & className, std::map> & states) : Classifier & ++fit(torch::Tensor & dataset, const std::vector & features, const std::string & className, std::map> & states) : Classifier & ++fit(torch::Tensor & dataset, const std::vector & features, const std::string & className, std::map> & states, const torch::Tensor & weights) : Classifier & ++getClassNumStates() const : int ++getNotes() const : std::vector ++getNumberOfEdges() const : int ++getNumberOfNodes() const : int ++getNumberOfStates() const : int ++getStatus() const : status_t ++getVersion() : std::string ++predict(std::vector> & X) : std::vector ++predict(torch::Tensor & X) : torch::Tensor ++predict_proba(std::vector> & X) : std::vector> ++predict_proba(torch::Tensor & X) : torch::Tensor ++score(torch::Tensor & X, torch::Tensor & y) : float ++score(std::vector> & X, std::vector & y) : float ++setHyperparameters(const nlohmann::json & hyperparameters) : void ++show() const : std::vector ++topological_order() : std::vector +#trainModel(const torch::Tensor & weights) : void +__ +#className : std::string +#dataset : torch::Tensor +#features : std::vector +#fitted : bool +#m : unsigned int +#metrics : Metrics +#model : Network +#n : unsigned int +#notes : std::vector +#states : std::map> +#status : status_t +} +class "bayesnet::KDB" as C_0001112865019015250005 +class C_0001112865019015250005 #aliceblue;line:blue;line.dotted;text:blue { ++KDB(int k, float theta = 0.03) : void ++~KDB() = default : void +.. +#buildModel(const torch::Tensor & weights) : void ++graph(const std::string & name = "KDB") const : std::vector ++setHyperparameters(const nlohmann::json & hyperparameters_) : void +__ +} +class "bayesnet::TAN" as C_0001760994424884323017 +class C_0001760994424884323017 #aliceblue;line:blue;line.dotted;text:blue { ++TAN() : void ++~TAN() = default : void +.. +#buildModel(const torch::Tensor & weights) : void ++graph(const std::string & name = "TAN") const : std::vector +__ +} +class "bayesnet::Proposal" as C_0002219995589162262979 +class C_0002219995589162262979 #aliceblue;line:blue;line.dotted;text:blue { ++Proposal(torch::Tensor & pDataset, std::vector & features_, std::string & className_) : void ++~Proposal() : void +.. +#checkInput(const torch::Tensor & X, const torch::Tensor & y) : void +#fit_local_discretization(const torch::Tensor & y) : std::map> +#localDiscretizationProposal(const std::map> & states, Network & model) : std::map> +#prepareX(torch::Tensor & X) : torch::Tensor +__ +#Xf : torch::Tensor +#discretizers : map +#y : torch::Tensor +} +class "bayesnet::TANLd" as C_0001668829096702037834 +class C_0001668829096702037834 #aliceblue;line:blue;line.dotted;text:blue { ++TANLd() : void ++~TANLd() = default : void +.. ++fit(torch::Tensor & X, torch::Tensor & y, const std::vector & features, const std::string & className, std::map> & states) : TANLd & ++graph(const std::string & name = "TAN") const : std::vector ++predict(torch::Tensor & X) : torch::Tensor +{static} +version() : std::string +__ +} +abstract "bayesnet::FeatureSelect" as C_0001695326193250580823 +abstract C_0001695326193250580823 #aliceblue;line:blue;line.dotted;text:blue { ++FeatureSelect(const torch::Tensor & samples, const std::vector & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights) : void ++~FeatureSelect() : void +.. +#computeMeritCFS() : double +#computeSuFeatures(const int a, const int b) : double +#computeSuLabels() : void +{abstract} +fit() = 0 : void ++getFeatures() const : std::vector ++getScores() const : std::vector +#initialize() : void +#symmetricalUncertainty(int a, int b) : double +__ +#fitted : bool +#maxFeatures : int +#selectedFeatures : std::vector +#selectedScores : std::vector +#suFeatures : std::map,double> +#suLabels : std::vector +#weights : const torch::Tensor & +} +class "bayesnet::CFS" as C_0000011627355691342494 +class C_0000011627355691342494 #aliceblue;line:blue;line.dotted;text:blue { ++CFS(const torch::Tensor & samples, const std::vector & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights) : void ++~CFS() : void +.. ++fit() : void +__ +} +class "bayesnet::FCBF" as C_0000144682015341746929 +class C_0000144682015341746929 #aliceblue;line:blue;line.dotted;text:blue { ++FCBF(const torch::Tensor & samples, const std::vector & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights, const double threshold) : void ++~FCBF() : void +.. ++fit() : void +__ +} +class "bayesnet::IWSS" as C_0000008268514674428553 +class C_0000008268514674428553 #aliceblue;line:blue;line.dotted;text:blue { ++IWSS(const torch::Tensor & samples, const std::vector & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights, const double threshold) : void ++~IWSS() : void +.. ++fit() : void +__ +} +class "bayesnet::SPODE" as C_0000512022813807538451 +class C_0000512022813807538451 #aliceblue;line:blue;line.dotted;text:blue { ++SPODE(int root) : void ++~SPODE() = default : void +.. +#buildModel(const torch::Tensor & weights) : void ++graph(const std::string & name = "SPODE") const : std::vector +__ +} +class "bayesnet::Ensemble" as C_0001985241386355360576 +class C_0001985241386355360576 #aliceblue;line:blue;line.dotted;text:blue { ++Ensemble(bool predict_voting = true) : void ++~Ensemble() = default : void +.. +#compute_arg_max(std::vector> & X) : std::vector +#compute_arg_max(torch::Tensor & X) : torch::Tensor ++dump_cpt() const : std::string ++getNumberOfEdges() const : int ++getNumberOfNodes() const : int ++getNumberOfStates() const : int ++graph(const std::string & title) const : std::vector ++predict(std::vector> & X) : std::vector ++predict(torch::Tensor & X) : torch::Tensor +#predict_average_proba(torch::Tensor & X) : torch::Tensor +#predict_average_proba(std::vector> & X) : std::vector> +#predict_average_voting(torch::Tensor & X) : torch::Tensor +#predict_average_voting(std::vector> & X) : std::vector> ++predict_proba(std::vector> & X) : std::vector> ++predict_proba(torch::Tensor & X) : torch::Tensor ++score(std::vector> & X, std::vector & y) : float ++score(torch::Tensor & X, torch::Tensor & y) : float ++show() const : std::vector ++topological_order() : std::vector +#trainModel(const torch::Tensor & weights) : void +#voting(torch::Tensor & votes) : torch::Tensor +__ +#models : std::vector> +#n_models : unsigned int +#predict_voting : bool +#significanceModels : std::vector +} +class "bayesnet::(anonymous_45089536)" as C_0001186398587753535158 +class C_0001186398587753535158 #aliceblue;line:blue;line.dotted;text:blue { +__ ++CFS : std::string ++FCBF : std::string ++IWSS : std::string +} +class "bayesnet::(anonymous_45090163)" as C_0000602764946063116717 +class C_0000602764946063116717 #aliceblue;line:blue;line.dotted;text:blue { +__ ++ASC : std::string ++DESC : std::string ++RAND : std::string +} +class "bayesnet::BoostAODE" as C_0000358471592399852382 +class C_0000358471592399852382 #aliceblue;line:blue;line.dotted;text:blue { ++BoostAODE(bool predict_voting = false) : void ++~BoostAODE() = default : void +.. +#buildModel(const torch::Tensor & weights) : void ++graph(const std::string & title = "BoostAODE") const : std::vector ++setHyperparameters(const nlohmann::json & hyperparameters_) : void +#trainModel(const torch::Tensor & weights) : void +__ +} +class "bayesnet::MST" as C_0000131858426172291700 +class C_0000131858426172291700 #aliceblue;line:blue;line.dotted;text:blue { ++MST() = default : void ++MST(const std::vector & features, const torch::Tensor & weights, const int root) : void +.. ++maximumSpanningTree() : std::vector> +__ +} +class "bayesnet::Graph" as C_0001197041682001898467 +class C_0001197041682001898467 #aliceblue;line:blue;line.dotted;text:blue { ++Graph(int V) : void +.. ++addEdge(int u, int v, float wt) : void ++find_set(int i) : int ++get_mst() : std::vector>> ++kruskal_algorithm() : void ++union_set(int u, int v) : void +__ +} +class "bayesnet::KDBLd" as C_0000344502277874806837 +class C_0000344502277874806837 #aliceblue;line:blue;line.dotted;text:blue { ++KDBLd(int k) : void ++~KDBLd() = default : void +.. ++fit(torch::Tensor & X, torch::Tensor & y, const std::vector & features, const std::string & className, std::map> & states) : KDBLd & ++graph(const std::string & name = "KDB") const : std::vector ++predict(torch::Tensor & X) : torch::Tensor +{static} +version() : std::string +__ +} +class "bayesnet::AODE" as C_0000786111576121788282 +class C_0000786111576121788282 #aliceblue;line:blue;line.dotted;text:blue { ++AODE(bool predict_voting = false) : void ++~AODE() : void +.. +#buildModel(const torch::Tensor & weights) : void ++graph(const std::string & title = "AODE") const : std::vector ++setHyperparameters(const nlohmann::json & hyperparameters) : void +__ +} +class "bayesnet::SPODELd" as C_0001369655639257755354 +class C_0001369655639257755354 #aliceblue;line:blue;line.dotted;text:blue { ++SPODELd(int root) : void ++~SPODELd() = default : void +.. ++commonFit(const std::vector & features, const std::string & className, std::map> & states) : SPODELd & ++fit(torch::Tensor & X, torch::Tensor & y, const std::vector & features, const std::string & className, std::map> & states) : SPODELd & ++fit(torch::Tensor & dataset, const std::vector & features, const std::string & className, std::map> & states) : SPODELd & ++graph(const std::string & name = "SPODE") const : std::vector ++predict(torch::Tensor & X) : torch::Tensor +{static} +version() : std::string +__ +} +class "bayesnet::AODELd" as C_0000487273479333793647 +class C_0000487273479333793647 #aliceblue;line:blue;line.dotted;text:blue { ++AODELd(bool predict_voting = true) : void ++~AODELd() = default : void +.. +#buildModel(const torch::Tensor & weights) : void ++fit(torch::Tensor & X_, torch::Tensor & y_, const std::vector & features_, const std::string & className_, std::map> & states_) : AODELd & ++graph(const std::string & name = "AODELd") const : std::vector +#trainModel(const torch::Tensor & weights) : void +__ +} +C_0001303524929067080934 --> C_0001303524929067080934 : -parents +C_0001303524929067080934 --> C_0001303524929067080934 : -children +C_0001186707649890429575 o-- C_0001303524929067080934 : -nodes +C_0000327135989451974539 ..> C_0000738420730783851375 +C_0002043996622900301644 o-- C_0001186707649890429575 : #model +C_0002043996622900301644 o-- C_0000736965376885623323 : #metrics +C_0002043996622900301644 o-- C_0000738420730783851375 : #status +C_0000327135989451974539 <|-- C_0002043996622900301644 +C_0002043996622900301644 <|-- C_0001112865019015250005 +C_0002043996622900301644 <|-- C_0001760994424884323017 +C_0002219995589162262979 ..> C_0001186707649890429575 +C_0001760994424884323017 <|-- C_0001668829096702037834 +C_0002219995589162262979 <|-- C_0001668829096702037834 +C_0000736965376885623323 <|-- C_0001695326193250580823 +C_0001695326193250580823 <|-- C_0000011627355691342494 +C_0001695326193250580823 <|-- C_0000144682015341746929 +C_0001695326193250580823 <|-- C_0000008268514674428553 +C_0002043996622900301644 <|-- C_0000512022813807538451 +C_0001985241386355360576 o-- C_0002043996622900301644 : #models +C_0002043996622900301644 <|-- C_0001985241386355360576 +C_0000358471592399852382 --> C_0001695326193250580823 : -featureSelector +C_0001985241386355360576 <|-- C_0000358471592399852382 +C_0001112865019015250005 <|-- C_0000344502277874806837 +C_0002219995589162262979 <|-- C_0000344502277874806837 +C_0001985241386355360576 <|-- C_0000786111576121788282 +C_0000512022813807538451 <|-- C_0001369655639257755354 +C_0002219995589162262979 <|-- C_0001369655639257755354 +C_0001985241386355360576 <|-- C_0000487273479333793647 +C_0002219995589162262979 <|-- C_0000487273479333793647 + +'Generated with clang-uml, version 0.5.1 +'LLVM version clang version 17.0.6 (Fedora 17.0.6-2.fc39) +@enduml diff --git a/diagrams/BayesNet.svg b/diagrams/BayesNet.svg new file mode 100644 index 0000000..a3bda9c --- /dev/null +++ b/diagrams/BayesNet.svg @@ -0,0 +1 @@ +clang-uml class diagram modelbayesnet::MetricsMetrics() = default : voidMetrics(const torch::Tensor & samples, const std::vector<std::string> & features, const std::string & className, const int classNumStates) : voidMetrics(const std::vector<std::vector<int>> & vsamples, const std::vector<int> & labels, const std::vector<std::string> & features, const std::string & className, const int classNumStates) : voidSelectKBestWeighted(const torch::Tensor & weights, bool ascending = false, unsigned int k = 0) : std::vector<int>conditionalEdge(const torch::Tensor & weights) : torch::TensorconditionalEdgeWeights(std::vector<float> & weights) : std::vector<float>doCombinations<T>(const std::vector<T> & source) : std::vector<std::pair<T, T> >entropy(const torch::Tensor & feature, const torch::Tensor & weights) : doublegetScoresKBest() const : std::vector<double>maximumSpanningTree(const std::vector<std::string> & features, const torch::Tensor & weights, const int root) : std::vector<std::pair<int,int>>mutualInformation(const torch::Tensor & firstFeature, const torch::Tensor & secondFeature, const torch::Tensor & weights) : doublepop_first<T>(std::vector<T> & v) : TclassName : std::stringfeatures : std::vector<std::string>samples : torch::Tensorbayesnet::NodeNode(const std::string &) : voidaddChild(Node *) : voidaddParent(Node *) : voidclear() : voidcomputeCPT(const torch::Tensor & dataset, const std::vector<std::string> & features, const double laplaceSmoothing, const torch::Tensor & weights) : voidgetCPT() : torch::Tensor &getChildren() : std::vector<Node *> &getFactorValue(std::map<std::string,int> &) : floatgetName() const : std::stringgetNumStates() const : intgetParents() : std::vector<Node *> &graph(const std::string & clasName) : std::vector<std::string>minFill() : unsigned intremoveChild(Node *) : voidremoveParent(Node *) : voidsetNumStates(int) : voidbayesnet::NetworkNetwork() : voidNetwork(float) : voidNetwork(const Network &) : void~Network() = default : voidaddEdge(const std::string &, const std::string &) : voidaddNode(const std::string &) : voiddump_cpt() const : std::stringfit(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) : voidfit(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) : voidfit(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) : voidgetClassName() const : std::stringgetClassNumStates() const : intgetEdges() const : std::vector<std::pair<std::string,std::string>>getFeatures() const : std::vector<std::string>getMaxThreads() const : floatgetNodes() : std::map<std::string,std::unique_ptr<Node>> &getNumEdges() const : intgetSamples() : torch::Tensor &getStates() const : intgraph(const std::string & title) const : std::vector<std::string>initialize() : voidpredict(const std::vector<std::vector<int>> &) : std::vector<int>predict(const torch::Tensor &) : torch::Tensorpredict_proba(const std::vector<std::vector<int>> &) : std::vector<std::vector<double>>predict_proba(const torch::Tensor &) : torch::Tensorpredict_tensor(const torch::Tensor & samples, const bool proba) : torch::Tensorscore(const std::vector<std::vector<int>> &, const std::vector<int> &) : doubleshow() const : std::vector<std::string>topological_sort() : std::vector<std::string>version() : std::stringbayesnet::status_tNORMALWARNINGERRORbayesnet::BaseClassifier~BaseClassifier() = default : voiddump_cpt() const = 0 : std::stringfit(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 : BaseClassifier &fit(torch::Tensor & dataset, const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) = 0 : BaseClassifier &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) = 0 : BaseClassifier &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) = 0 : BaseClassifier &getClassNumStates() const = 0 : intgetNotes() const = 0 : std::vector<std::string>getNumberOfEdges() const = 0 : intgetNumberOfNodes() const = 0 : intgetNumberOfStates() const = 0 : intgetStatus() const = 0 : status_tgetValidHyperparameters() : std::vector<std::string> &getVersion() = 0 : std::stringgraph(const std::string & title = "") const = 0 : std::vector<std::string>predict(std::vector<std::vector<int>> & X) = 0 : std::vector<int>predict(torch::Tensor & X) = 0 : torch::Tensorpredict_proba(std::vector<std::vector<int>> & X) = 0 : std::vector<std::vector<double>>predict_proba(torch::Tensor & X) = 0 : torch::Tensorscore(std::vector<std::vector<int>> & X, std::vector<int> & y) = 0 : floatscore(torch::Tensor & X, torch::Tensor & y) = 0 : floatsetHyperparameters(const nlohmann::json & hyperparameters) = 0 : voidshow() const = 0 : std::vector<std::string>topological_order() = 0 : std::vector<std::string>trainModel(const torch::Tensor & weights) = 0 : voidvalidHyperparameters : std::vector<std::string>bayesnet::ClassifierClassifier(Network model) : void~Classifier() = default : voidaddNodes() : voidbuildDataset(torch::Tensor & y) : voidbuildModel(const torch::Tensor & weights) = 0 : voidcheckFitParameters() : voiddump_cpt() const : std::stringfit(torch::Tensor & X, torch::Tensor & y, const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) : 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) : Classifier &fit(torch::Tensor & dataset, const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) : 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) : Classifier &getClassNumStates() const : intgetNotes() const : std::vector<std::string>getNumberOfEdges() const : intgetNumberOfNodes() const : intgetNumberOfStates() const : intgetStatus() const : status_tgetVersion() : std::stringpredict(std::vector<std::vector<int>> & X) : std::vector<int>predict(torch::Tensor & X) : torch::Tensorpredict_proba(std::vector<std::vector<int>> & X) : std::vector<std::vector<double>>predict_proba(torch::Tensor & X) : torch::Tensorscore(torch::Tensor & X, torch::Tensor & y) : floatscore(std::vector<std::vector<int>> & X, std::vector<int> & y) : floatsetHyperparameters(const nlohmann::json & hyperparameters) : voidshow() const : std::vector<std::string>topological_order() : std::vector<std::string>trainModel(const torch::Tensor & weights) : voidclassName : std::stringdataset : torch::Tensorfeatures : std::vector<std::string>fitted : boolm : unsigned intmetrics : Metricsmodel : Networkn : unsigned intnotes : std::vector<std::string>states : std::map<std::string,std::vector<int>>status : status_tbayesnet::KDBKDB(int k, float theta = 0.03) : void~KDB() = default : voidbuildModel(const torch::Tensor & weights) : voidgraph(const std::string & name = "KDB") const : std::vector<std::string>setHyperparameters(const nlohmann::json & hyperparameters_) : voidbayesnet::TANTAN() : void~TAN() = default : voidbuildModel(const torch::Tensor & weights) : voidgraph(const std::string & name = "TAN") const : std::vector<std::string>bayesnet::ProposalProposal(torch::Tensor & pDataset, std::vector<std::string> & features_, std::string & className_) : void~Proposal() : voidcheckInput(const torch::Tensor & X, const torch::Tensor & y) : voidfit_local_discretization(const torch::Tensor & y) : std::map<std::string,std::vector<int>>localDiscretizationProposal(const std::map<std::string,std::vector<int>> & states, Network & model) : std::map<std::string,std::vector<int>>prepareX(torch::Tensor & X) : torch::TensorXf : torch::Tensordiscretizers : map<std::string,mdlp::CPPFImdlp *>y : torch::Tensorbayesnet::TANLdTANLd() : void~TANLd() = default : voidfit(torch::Tensor & X, torch::Tensor & y, const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) : TANLd &graph(const std::string & name = "TAN") const : std::vector<std::string>predict(torch::Tensor & X) : torch::Tensorversion() : std::stringbayesnet::FeatureSelectFeatureSelect(const torch::Tensor & samples, const std::vector<std::string> & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights) : void~FeatureSelect() : voidcomputeMeritCFS() : doublecomputeSuFeatures(const int a, const int b) : doublecomputeSuLabels() : voidfit() = 0 : voidgetFeatures() const : std::vector<int>getScores() const : std::vector<double>initialize() : voidsymmetricalUncertainty(int a, int b) : doublefitted : boolmaxFeatures : intselectedFeatures : std::vector<int>selectedScores : std::vector<double>suFeatures : std::map<std::pair<int,int>,double>suLabels : std::vector<double>weights : const torch::Tensor &bayesnet::CFSCFS(const torch::Tensor & samples, const std::vector<std::string> & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights) : void~CFS() : voidfit() : voidbayesnet::FCBFFCBF(const torch::Tensor & samples, const std::vector<std::string> & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights, const double threshold) : void~FCBF() : voidfit() : voidbayesnet::IWSSIWSS(const torch::Tensor & samples, const std::vector<std::string> & features, const std::string & className, const int maxFeatures, const int classNumStates, const torch::Tensor & weights, const double threshold) : void~IWSS() : voidfit() : voidbayesnet::SPODESPODE(int root) : void~SPODE() = default : voidbuildModel(const torch::Tensor & weights) : voidgraph(const std::string & name = "SPODE") const : std::vector<std::string>bayesnet::EnsembleEnsemble(bool predict_voting = true) : void~Ensemble() = default : voidcompute_arg_max(std::vector<std::vector<double>> & X) : std::vector<int>compute_arg_max(torch::Tensor & X) : torch::Tensordump_cpt() const : std::stringgetNumberOfEdges() const : intgetNumberOfNodes() const : intgetNumberOfStates() const : intgraph(const std::string & title) const : std::vector<std::string>predict(std::vector<std::vector<int>> & X) : std::vector<int>predict(torch::Tensor & X) : torch::Tensorpredict_average_proba(torch::Tensor & X) : torch::Tensorpredict_average_proba(std::vector<std::vector<int>> & X) : std::vector<std::vector<double>>predict_average_voting(torch::Tensor & X) : torch::Tensorpredict_average_voting(std::vector<std::vector<int>> & X) : std::vector<std::vector<double>>predict_proba(std::vector<std::vector<int>> & X) : std::vector<std::vector<double>>predict_proba(torch::Tensor & X) : torch::Tensorscore(std::vector<std::vector<int>> & X, std::vector<int> & y) : floatscore(torch::Tensor & X, torch::Tensor & y) : floatshow() const : std::vector<std::string>topological_order() : std::vector<std::string>trainModel(const torch::Tensor & weights) : voidvoting(torch::Tensor & votes) : torch::Tensormodels : std::vector<std::unique_ptr<Classifier>>n_models : unsigned intpredict_voting : boolsignificanceModels : std::vector<double>bayesnet::(anonymous_45089536)CFS : std::stringFCBF : std::stringIWSS : std::stringbayesnet::(anonymous_45090163)ASC : std::stringDESC : std::stringRAND : std::stringbayesnet::BoostAODEBoostAODE(bool predict_voting = false) : void~BoostAODE() = default : voidbuildModel(const torch::Tensor & weights) : voidgraph(const std::string & title = "BoostAODE") const : std::vector<std::string>setHyperparameters(const nlohmann::json & hyperparameters_) : voidtrainModel(const torch::Tensor & weights) : voidbayesnet::MSTMST() = default : voidMST(const std::vector<std::string> & features, const torch::Tensor & weights, const int root) : voidmaximumSpanningTree() : std::vector<std::pair<int,int>>bayesnet::GraphGraph(int V) : voidaddEdge(int u, int v, float wt) : voidfind_set(int i) : intget_mst() : std::vector<std::pair<float,std::pair<int,int>>>kruskal_algorithm() : voidunion_set(int u, int v) : voidbayesnet::KDBLdKDBLd(int k) : void~KDBLd() = default : voidfit(torch::Tensor & X, torch::Tensor & y, const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) : KDBLd &graph(const std::string & name = "KDB") const : std::vector<std::string>predict(torch::Tensor & X) : torch::Tensorversion() : std::stringbayesnet::AODEAODE(bool predict_voting = false) : void~AODE() : voidbuildModel(const torch::Tensor & weights) : voidgraph(const std::string & title = "AODE") const : std::vector<std::string>setHyperparameters(const nlohmann::json & hyperparameters) : voidbayesnet::SPODELdSPODELd(int root) : void~SPODELd() = default : voidcommonFit(const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) : SPODELd &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) : SPODELd &fit(torch::Tensor & dataset, const std::vector<std::string> & features, const std::string & className, std::map<std::string,std::vector<int>> & states) : SPODELd &graph(const std::string & name = "SPODE") const : std::vector<std::string>predict(torch::Tensor & X) : torch::Tensorversion() : std::stringbayesnet::AODELdAODELd(bool predict_voting = true) : void~AODELd() = default : voidbuildModel(const torch::Tensor & weights) : voidfit(torch::Tensor & X_, torch::Tensor & y_, const std::vector<std::string> & features_, const std::string & className_, std::map<std::string,std::vector<int>> & states_) : AODELd &graph(const std::string & name = "AODELd") const : std::vector<std::string>trainModel(const torch::Tensor & weights) : voidparentschildrennodesmodelmetricsstatusmodelsfeatureSelector \ No newline at end of file diff --git a/diagrams/dependency.svg b/diagrams/dependency.svg new file mode 100644 index 0000000..e41bb9d --- /dev/null +++ b/diagrams/dependency.svg @@ -0,0 +1,449 @@ + + + + + + +BayesNet + + +clusterLegend + +Legend + + + +legendNode0 + +Executable + + + +legendNode1 + +Static Library + + + +legendNode0->legendNode1 + + + + + +legendNode2 + + +Shared Library + + + +legendNode0->legendNode2 + + + + + +legendNode3 + + + +Module Library + + + + +legendNode7 + +Custom Target + + + + +legendNode4 + +Interface Library + + + +legendNode1->legendNode4 + + +Interface + + + +legendNode5 + +Object Library + + + +legendNode2->legendNode5 + + +Private + + + +legendNode6 + +Unknown Library + + + +legendNode3->legendNode6 + + + + + +node0 + +ArffFiles + + + +node1 + +BayesNet + + + +node2 + +/home/rmontanana/Code/libtorch/lib/libc10.so + + + +node1->node2 + + + + + +node3 + +/home/rmontanana/Code/libtorch/lib/libkineto.a + + + +node1->node3 + + + + + +node4 + +mdlp + + + +node1->node4 + + + + + +node5 + + +torch + + + +node1->node5 + + + + + +node11 + +torch_library + + + +node1->node11 + + + + + +node6 + +torch_cpu_library + + + +node5->node6 + + + + + +node7 + +-Wl,--no-as-needed,"/home/rmontanana/Code/libtorch/lib/libtorch_cpu.so" -Wl,--as-needed + + + +node6->node7 + + + + + +node8 + + +c10 + + + +node6->node8 + + + + + +node9 + +caffe2::mkl + + + +node6->node9 + + + + + +node10 + +dummy +(protobuf::libprotobuf) + + + +node6->node10 + + + + + +node11->node6 + + + + + +node12 + +-Wl,--no-as-needed,"/home/rmontanana/Code/libtorch/lib/libtorch.so" -Wl,--as-needed + + + +node11->node12 + + + + + +node13 + +Catch2 +(Catch2::Catch2) + + + +node14 + +Catch2WithMain +(Catch2::Catch2WithMain) + + + +node14->node13 + + + + + +node15 + +FImdlp_unittest + + + +node15->node15 + + + + + +node16 + +gtest_main +(GTest::gtest_main) + + + +node15->node16 + + + + + +node17 + +Threads::Threads + + + +node16->node17 + + + + + +node18 + +gtest +(GTest::gtest) + + + +node16->node18 + + + + + +node18->node17 + + + + + +node19 + +Metrics_unittest + + + +node19->node16 + + + + + +node19->node19 + + + + + +node20 + +TestBayesNet + + + +node20->node0 + + + + + +node20->node2 + + + + + +node20->node3 + + + + + +node20->node4 + + + + + +node20->node5 + + + + + +node20->node11 + + + + + +node20->node14 + + + + + +node21 + +gmock +(GTest::gmock) + + + +node21->node17 + + + + + +node21->node18 + + + + + +node22 + +gmock_main +(GTest::gmock_main) + + + +node22->node17 + + + + + +node22->node21 + + + + + +node23 + +nlohmann_json +(nlohmann_json::nlohmann_json) + + + +node24 + +sample + + +