Fix nan issue in features
[trackerpp.git] / test / TestPredictor.cpp
index e3add17..0b2a6b6 100644 (file)
@@ -1,7 +1,9 @@
 #include "gtest/gtest.h"
 #include "PredictorWrapper.h"
+#include <iostream>
 
 using namespace suanzi;
+using namespace std;
 
 TEST(Predictor, load)
 {
@@ -10,4 +12,21 @@ TEST(Predictor, load)
     predictor->dump();
     std::vector<double> ff (40, 1);
     double prob = predictor->predict(4, ff);
+    cout << prob << endl;
 }
+
+
+//
+//TEST(Predictor, predict)
+//{
+//    PredictorWrapperPtr predictor (new PredictorWrapper("predictor", "../python"));
+//    predictor->load("../resources/model.pkl");
+//    predictor->dump();
+//    //std::vector<double> ff (40, 1);
+//
+//    std::vector<double> ff = { 6.9154247185294e-310, 6.91542471861144e-310, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 6.9154247185294e-310, 6.91542471861144e-310, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, -3.0949108904043924e+217, -3.0949108904066356e+217, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 6.91542471837167e-310, 6.9154247185979e-310, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 6.9154247183334e-310, 6.9154247185946e-310, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 };
+//    int index = 4;
+//    double prob = predictor->predict(index, ff);
+//    cout << prob << endl;
+//}
+//