projects
/
trackerpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
readme file
[trackerpp.git]
/
include
/
PredictorWrapper.h
diff --git
a/include/PredictorWrapper.h
b/include/PredictorWrapper.h
index
ac54f73
..
18ea862
100644
(file)
--- a/
include/PredictorWrapper.h
+++ b/
include/PredictorWrapper.h
@@
-3,6
+3,7
@@
#include "SharedPtr.h"
#include <boost/python.hpp>
#include "SharedPtr.h"
#include <boost/python.hpp>
+#include <vector>
namespace suanzi {
namespace suanzi {
@@
-13,18
+14,14
@@
namespace suanzi {
class PredictorWrapper
{
public:
class PredictorWrapper
{
public:
-
static PredictorWrapperPtr create(const std::string& fname
);
+
PredictorWrapper(const std::string& module="predictor", const std::string& pydir = "./python"
);
~PredictorWrapper(){}
void dump();
~PredictorWrapper(){}
void dump();
- double predict();
+ double predict(int index, const std::vector<double>& f);
+ bool load(const std::string& fname); // load pkl file
private:
private:
- PredictorWrapper(const std::string& fname);
- static PredictorWrapperWPtr instance;
-
- PY_FUN dump_func;
- PY_FUN predict_func;
-
+ boost::python::object m_module;
};
}
};
}