-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestDataSets.cpp
More file actions
83 lines (61 loc) · 1.85 KB
/
TestDataSets.cpp
File metadata and controls
83 lines (61 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <iostream>
#include <string>
#include <fstream>
#include <ctime>
#include "vtkGNGGraph.h"
#include "vtkINGGraph.h"
#include "vtkENGGraph.h"
int main()
{
std::string nameOfDataSet;
std::string nameOfDataSetPath;
std::string nameOfResultPath;
//nameOfResultPath >> C:/dataset/
std::cin >> nameOfDataSet;
std::cin >> nameOfDataSetPath;
std::cin >> nameOfResultPath;
std::cout << (nameOfDataSetPath + nameOfDataSet + ".tra").c_str() << std::endl;
std::cout << (nameOfDataSetPath + nameOfDataSet ".tes").c_str() << std::endl;
std::cout << (nameOfResultPath + nameOfDataSet).c_str() << std::endl;
std::ifstream inputDataSetTrain( (nameOfDataSetPath + nameOfDataSet + ".tra").c_str() );
std::ifstream inputDataSetTest( (nameOfDataSetPath + nameOfDataSet ".tes").c_str() );
std::ofstream outputTraining( (nameOfResultPath + nameOfDataSet).c_str() );
clock_t start, end;
int numberOfObjects,
dimension,
i,
j;
//compilar para cada datasets, modificando en point DIMENSION...
inputDataSetTrain >> numberOfObjects;
inputDataSetTrain >> dimension;
stGNG* gng = stGNG::New();
Point p(dimension);
Point p1(dimension);
Point p2(dimension);
char coma;
int countOfObjects = 0;
for (i = 0; i < dimension - 1; i++) {
inputDataSetTrain >> p1[i] >> coma;
}
inputDataSetTrain >> p1[i] ;
for (i = 0; i < dimension - 1; i++) {
inputDataSetTrain >> p2[i] >> coma;
}
inputDataSetTrain >> p2[i] ;
gng->InsertNewUnits(p1, p2, 0);
start = clock();
while(!inputDataSetTrain.eof()) {
for (i = 0; i < dimension - 1; i++) {
inputDataSetTrain >> p[i] >> coma;
}
inputDataSetTrain >> p[i] ;
gng->InsertNextPattern(p);
countOfObjects++;
if( ( numberOfObjects / 10) % countOfObjects == 0) {
end = clock();
outputTraining << numberOfDC << "\n";
outputTraining << ((double )end-(double )start) / 1000.0 << "\n";
}
}
return 0;
}