Complete predict and score of kdb
Change new/delete to make_unique
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
#include <torch/torch.h>
|
||||
#include "BaseClassifier.h"
|
||||
#include "Metrics.hpp"
|
||||
#include "utils.h"
|
||||
using namespace std;
|
||||
using namespace torch;
|
||||
|
||||
namespace bayesnet {
|
||||
class Ensemble {
|
||||
private:
|
||||
long n_models;
|
||||
Ensemble& build(vector<string>& features, string className, map<string, vector<int>>& states);
|
||||
protected:
|
||||
BaseClassifier& model;
|
||||
vector<BaseClassifier> models;
|
||||
int m, n; // m: number of samples, n: number of features
|
||||
Tensor X;
|
||||
@@ -23,7 +24,8 @@ namespace bayesnet {
|
||||
map<string, vector<int>> states;
|
||||
void virtual train() = 0;
|
||||
public:
|
||||
Ensemble(BaseClassifier& model);
|
||||
Ensemble();
|
||||
virtual ~Ensemble() = default;
|
||||
Ensemble& fit(Tensor& X, Tensor& y, vector<string>& features, string className, map<string, vector<int>>& states);
|
||||
Ensemble& fit(vector<vector<int>>& X, vector<int>& y, vector<string>& features, string className, map<string, vector<int>>& states);
|
||||
Tensor predict(Tensor& X);
|
||||
|
Reference in New Issue
Block a user