Skip to content

Commit 52d042c

Browse files
author
Vasileios Vittis
committed
SNAPSHOT 1.1 (DDM)
1 parent 8a756e0 commit 52d042c

File tree

6 files changed

+51
-4
lines changed

6 files changed

+51
-4
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ int weighted_voting_option = Integer.parseInt(params.get("weighted_voting_option
3131
int age_of_maturity = Integer.parseInt(params.get("age_of_maturity"));
3232
```
3333
``` java
34-
/* Drift Detection Method used */
34+
/* Drift Detection Method used
35+
* If drift_detection_method_id = 0 then No Concept Drift
36+
* If drift_detection_method_id = 1 then DDM
37+
* If drift_detection_method_id = 2 then EDDM
38+
*/
3539
int drift_detection_method_id = Integer.parseInt(params.get("drift_detection_method_id"));
3640
```
3741
#### Kafka Input Stream

analysis.md

+26
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,31 @@ Not done yet
7979

8080
2) Implement DDM inside State
8181

82+
I did it and uploaded the chart comparisons in Github.
83+
They seem all good. Except the fact that my version (Hoeffding Tree) scores better both with and without a concept drift detector.
8284

85+
There are two explenations for that. Either my base learner is just better, or the datasets are different.
8386

87+
The latter is a little of because both datasets in papaer has been produced by the same generator.
88+
89+
Let's assume that CHVT is better that C4.5
90+
91+
92+
How i did the testing. I implemented a mechanism in which when the user assigns to the variable drift_detection_method_id the value of 0 then they dictate that they do not want to use any dirft detection algorithm.
93+
94+
Therefore, I changed the code of my pycharm script and I added two kafkaconnector listenning to two different kafka topics.
95+
96+
I ran DistributedLearningJava without a drift detection method (by assigning 0) writing to kafka topic and then I reran my project with (option 1 aka DDM) writing it to a different kafka topic. The script reads from both of them and merges the plots into one.
97+
98+
21/7
99+
100+
101+
'application_1614183653371_0143'.
102+
103+
Latest Apache Flink Job http://clu02.softnet.tuc.gr:33418
104+
105+
cd /usr/local/flink;
106+
107+
./bin/flink run -d -p 3 -m yarn-cluster -yid application_1614183653371_0143 /home/vvittis/DistributedLearningJava/target/DistributedLearningJava-1.1-SNAPSHOT.jar --number_of_HT 1 --age_of_maturity 1000 --combination_function 3 --weighted_voting_parameter 1 --drift_detection_method_id 3
108+
109+
already a kafka topic vvittis_SineTopic

dependency-reduced-pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.example</groupId>
55
<artifactId>DistributedLearningJava</artifactId>
6-
<version>1.0-SNAPSHOT</version>
6+
<version>1.1-SNAPSHOT</version>
77
<build>
88
<plugins>
99
<plugin>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.example</groupId>
88
<artifactId>DistributedLearningJava</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>1.1-SNAPSHOT</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/ConceptDriftDetector/EDDM.java

+15
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,19 @@ public void FindConceptDrift(double error_rate) {
1616
public int getCurrentDriftStatus() {
1717
return 0;
1818
}
19+
20+
@Override
21+
public int getSignal() {
22+
return 0;
23+
}
24+
25+
@Override
26+
public void updateCurrentDriftStatus() {
27+
28+
}
29+
30+
@Override
31+
public void ResetConceptDrift() {
32+
33+
}
1934
}

src/main/java/HoeffdingTree/HoeffdingTree.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class HoeffdingTree implements Serializable {
1010
public double instances_seen;
1111
public double correctly_classified;
1212
public double weight;
13+
public int tree_phase;
1314
public int combination_function;
1415
public int hoeffding_tree_id;
1516
public int[] m_features; // list of labels corresponding to samples of node
@@ -28,14 +29,15 @@ public HoeffdingTree() {
2829
* <p> Create the Hoeffding tree for given parameters </p>
2930
*/
3031

31-
public void CreateHoeffdingTree(int m_features, int Max, int max_examples_seen, double delta, double tie_threshold, int combination_function_id, int hoeffding_tree_id) {
32+
public void CreateHoeffdingTree(int m_features, int Max, int max_examples_seen, double delta, double tie_threshold, int combination_function_id, int hoeffding_tree_id, int background_tree_indicator) {
3233
root.CreateHT(m_features, max_examples_seen, delta, tie_threshold);
3334
instances_seen = 0.0;
3435
correctly_classified = 0.0;
3536
weight = 0.0;
3637
this.hoeffding_tree_id = hoeffding_tree_id;
3738
combination_function = combination_function_id;
3839
initialize_m_features(m_features, Max - 1, hoeffding_tree_id);
40+
this.tree_phase = background_tree_indicator;
3941
}
4042

4143
/**

0 commit comments

Comments
 (0)