Skip to content

Commit

Permalink
Confirmed values files for level 4 and 5 of PPDT. We need this for up…
Browse files Browse the repository at this point in the history
…dating the table of performance results
  • Loading branch information
AndrewQuijano committed Jan 7, 2024
1 parent 50fcba6 commit 1189fd7
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 17 deletions.
6 changes: 4 additions & 2 deletions data/answers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ D3.arff,D3.values,190 (3.0)
D4.arff,D4.values,157 (3.0/2.0)
D5.arff,D5.values,19 (2.0)
diabetes.arff,diabetes.values,tested_positive (4.0)
hypothyroid.arff,hypothyroid.values,negative (2.0/1.0)
iris.arff,iris.values,Iris-virginica (3.0)
iris2D.arff,iris2D.values,Iris-versicolor (48.0/1.0)
labor.arff,labor.values,good (3.99)
hypothyroid.arff,hypothyroid-min.values,negative (3366.31/2.0)
hypothyroid.arff,hypothyroid-2.values,negative (3366.31/2.0)
hypothyroid.arff,hypothyroid-4.values,negative (56.17)
hypothyroid.arff,hypothyroid-5.values,negative (30.75)
hypothyroid.arff,hypothyroid-9.values,negative (2.0/1.0)
File renamed without changes.
9 changes: 9 additions & 0 deletions data/hypothyroid-4.values
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
TSH 7
FTI 70
TSH measured t
on thyroxine t
T4U measured t
thyroid surgery f
T3 2.1
TT4 40
referral source other
9 changes: 9 additions & 0 deletions data/hypothyroid-5.values
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
TSH 7
FTI 70
TSH measured f
on thyroxine f
T4U measured t
thyroid surgery f
T3 2.1
TT4 40
referral source other
16 changes: 8 additions & 8 deletions data/hypothyroid.values → data/hypothyroid-9.values
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TSH 7
FTI 65
TSH measured t
on thyroxine f
T4U measured t
thyroid surgery f
T3 2.1
TT4 40
TSH 7
FTI 65
TSH measured t
on thyroxine f
T4U measured t
thyroid surgery f
T3 2.1
TT4 40
referral source other
Binary file modified libs/crypto.jar
Binary file not shown.
7 changes: 3 additions & 4 deletions src/main/java/weka/finito/client.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import security.paillier.PaillierKeyPairGenerator;
import security.paillier.PaillierPrivateKey;
import security.paillier.PaillierPublicKey;
import security.socialistmillionaire.bob;
import security.socialistmillionaire.bob_joye;
import weka.finito.structs.BigIntegers;

Expand Down Expand Up @@ -291,7 +290,7 @@ private Hashtable<String, BigIntegers> read_features(String path,
private void evaluate_with_server_site(Socket server_site) throws IOException, HomomorphicException, ClassNotFoundException {
// Communicate with each Level-Site
Object o;
bob client;
bob_joye client;

// Create I/O streams
ObjectOutputStream to_server_site = new ObjectOutputStream(server_site.getOutputStream());
Expand Down Expand Up @@ -334,7 +333,7 @@ private void communicate_with_level_site(Socket level_site)
throws IOException, ClassNotFoundException, HomomorphicException {
// Communicate with each Level-Site
Object o;
bob client;
bob_joye client;

// Create I/O streams
ObjectOutputStream to_level_site = new ObjectOutputStream(level_site.getOutputStream());
Expand Down Expand Up @@ -412,7 +411,7 @@ public void run() {
// Client needs to give server-site public key (to give to level-sites)
// Client needs to know all possible classes...
if (talk_to_server_site) {
// Don't send keys to server-site to ask for classes since now it is assumed level-sites are up
// Don't send keys to server-site to ask for classes now it is assumed level-sites are up
setup_with_server_site(paillier_public_key, dgk_public_key);
for (String aClass : classes) {
hashed_classification.put(hash(aClass), aClass);
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/weka/finito/level_site_thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.lang.System;

import security.socialistmillionaire.alice;
import security.socialistmillionaire.alice_joye;
import weka.finito.structs.BigIntegers;
import weka.finito.structs.NodeInfo;
Expand Down Expand Up @@ -42,7 +41,7 @@ public level_site_thread(Socket client_socket, level_order_site level_site_data)
this.toClient.writeBoolean(true);
closeClientConnection();
} else if (x instanceof Hashtable) {
for (Map.Entry<?, ?> entry: ((Hashtable<?, ?>) x).entrySet()){
for (Map.Entry<?, ?> entry: ((Hashtable<?, ?>) x).entrySet()) {
if (entry.getKey() instanceof String && entry.getValue() instanceof BigIntegers) {
encrypted_features.put((String) entry.getKey(), (BigIntegers) entry.getValue());
}
Expand Down Expand Up @@ -76,7 +75,7 @@ public final void run() {
long start_time = System.nanoTime();

try {
alice niu = new alice_joye();
alice_joye niu = new alice_joye();
niu.set_socket(client_socket);
if (this.level_site_data == null) {
toClient.writeInt(-2);
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/PrivacyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void test_single_site() throws Exception {
String full_feature_path = new File(data_directory, features).toString();
String full_data_set_path = new File(data_directory, data_set).toString();
System.out.println(full_data_set_path);
System.out.println("Features Vector: " + full_feature_path);
String classification = test_server_case(full_data_set_path, full_feature_path, key_size, precision,
server_ip, server_port);
System.out.println(expected_classification + " =!= " + classification);
Expand Down Expand Up @@ -113,6 +114,7 @@ public void test_all_level_sites() throws Exception {
String full_feature_path = new File(data_directory, features).toString();
String full_data_set_path = new File(data_directory, data_set).toString();
System.out.println(full_data_set_path);
System.out.println("Feature Vector Path: " + full_feature_path);
String classification = test_level_site(full_data_set_path, full_feature_path, levels, key_size, precision,
level_site_ips, level_site_ports_string, server_ip, server_port);
System.out.println(expected_classification + " =!= " + classification);
Expand Down

0 comments on commit 1189fd7

Please sign in to comment.