From d41a9b3a85fbc5bf5ceab080cf565a7a1b11132f Mon Sep 17 00:00:00 2001 From: Deepthi Pathare Date: Tue, 18 May 2021 14:07:55 +0200 Subject: [PATCH] Grid size chosen such that node count=5*sqrt(N), closes #20 --- german_analysis.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/german_analysis.py b/german_analysis.py index 66579cc..a363452 100755 --- a/german_analysis.py +++ b/german_analysis.py @@ -6,8 +6,9 @@ import voting_lib.voting_analysis as va import numpy as np # Training Paramters -grid_h = 2 # Grid height -grid_w = 2 # Grid width +# Grid size is chosen such that node count = 5*sqrt(N) +grid_h = 11 # Grid height +grid_w = 11 # Grid width radius = 2 # Neighbour radius step = 0.5 ep = 300 # No of epochs @@ -15,7 +16,6 @@ ep = 300 # No of epochs # Load data dataset = ld.load_german_data() - for period, df in dataset.items(): print("Election Period ", period) @@ -27,5 +27,4 @@ for period, df in dataset.items(): model = va.train_model(X, grid_h, grid_w, radius, step, ep) # Predict and visualize output - va.predict(model, data, grid_h, grid_w) - + va.predict(model, data, grid_h, grid_w) \ No newline at end of file