Complete TAN with Maximum Spanning Tree

This commit is contained in:
2023-07-15 18:31:50 +02:00
parent e311c27d43
commit e3863387bb
7 changed files with 172 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
#include "Metrics.hpp"
#include "Mst.h"
using namespace std;
namespace bayesnet {
Metrics::Metrics(torch::Tensor& samples, vector<string>& features, string& className, int classNumStates)
@@ -121,14 +122,11 @@ namespace bayesnet {
and the indices of the weights as nodes of this square matrix using
Kruskal algorithm
*/
vector<pair<int, int>> Metrics::maximumSpanningTree(int root, Tensor& weights)
vector<pair<int, int>> Metrics::maximumSpanningTree(vector<string> features, Tensor& weights, int root)
{
auto result = vector<pair<int, int>>();
auto mst = MST(features, weights, root);
return mst.maximumSpanningTree();
return result;
}
}