MCPcopy Create free account
hub / github.com/Stream-AD/MIDAS / ReproduceROC

Function ReproduceROC

example/Experiment.cpp:115–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void ReproduceROC(int n, const char* pathGroundTruth, int numColumn, float threshold, int seed, const int* source, const int* destination, const int* timestamp) {
116 srand(seed);
117
118 const auto score = new float[n];
119 // MIDAS::NormalCore midas(2, numColumn);
120 // MIDAS::RelationalCore midas(2, numColumn);
121 MIDAS::FilteringCore midas(2, numColumn, threshold);
122 for (int i = 0; i < n; i++)
123 score[i] = midas(source[i], destination[i], timestamp[i]);
124
125 const auto pathScore = SOLUTION_DIR"temp/Score.txt";
126 const auto fileScore = fopen(pathScore, "w");
127 for (int i = 0; i < n; i++)
128 fprintf(fileScore, "%f\n", score[i]);
129 fclose(fileScore);
130
131 printf("// Reproduction is done, python is generating the ROC curve\n");
132
133 char command[1024];
134 sprintf(command, "python %s %s %s", SOLUTION_DIR"util/ReproduceROC.py", pathGroundTruth, pathScore);
135 system(command);
136
137 delete[] score;
138}
139
140void NumRecordVsTime(int numColumn, float threshold, const std::vector<int>& numsRecord, int numRepeat, const int* source, const int* destination, const int* timestamp) {
141 const auto time = new long long[numsRecord.size() * numRepeat];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected