Commit d8cfd339 authored by tpetaja1's avatar tpetaja1
Browse files

round precision to 1 in networks

parent f7ee1bb6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,4 +64,4 @@ class DynamicGL(TVGL):
        p.close()
        p.join()
        self.run_time = '{0:.3g}'.format(time.time() - start_time)
        self.thetas = [np.round(theta, 3) for theta in self.thetas]
        self.thetas = [np.round(theta, self.roundup) for theta in self.thetas]
+2 −2
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ def mp_parallel_tvgl((thetas, z0s, z1s, z2s, u0s, u1s, u2s,
        if prev_pipe is not None:
            prev_pipe.send(None)
        out_queue.put((final_thetas, iteration))
        print "Process %s finished" % proc_index
        #print "Process %s finished" % proc_index
    except Exception as e:
        traceback.print_exc()
        raise e
@@ -192,4 +192,4 @@ class ParallelTVGL(TVGL):
        self.iteration = iteration
        print self.iteration
        self.run_time = '{0:.3g}'.format(time.time() - start_time)
        self.thetas = [np.round(theta, 3) for theta in self.thetas]
        self.thetas = [np.round(theta, self.roundup) for theta in self.thetas]
+2 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ class TVGL(object):
        self.u2s = [np.zeros((self.dimension, self.dimension))] * self.blocks
        self.nju = float(self.obs)/float(3*self.rho)
        self.e = 1e-5
        self.roundup = 1

    def read_data(self, filename, comment="#", splitter=","):
        with open(filename, "r") as f:
@@ -165,7 +166,7 @@ class TVGL(object):
        pass

    def final_tuning(self, stopping_criteria, max_iter):
        self.thetas = [np.round(theta, 3) for theta in self.thetas]
        self.thetas = [np.round(theta, self.roundup) for theta in self.thetas]
        self.terminate_pools()
        if stopping_criteria:
            print "\nIterations to complete: %s" % self.iteration
+24 −0
Original line number Diff line number Diff line
# Information
Run datetime: 2017-09-07 00:10:12
Data file: synthetic_data/1000x20_20170823203622.csv
Algorithm type: DynamicGL
Penalty function: n/a
Data dimension: 20
Blocks: 50
Observations in a block: 20
Rho: 21
Beta: 0
Lambda: 22
Processes used: 25
Total edges: 1000
Total edgeless: 8500

# Results
Algorithm run time: 0.555 seconds
Iterations to complete: n/a

Correct positive edges: 406
All positives: 667
F1 Score: 0.487
Temporal deviations ratio (max/mean): 2.194
Temporal deviations: 0.666 0.409 0.563 0.261 0.433 0.503 0.460 0.433 0.396 0.506 0.475 0.383 0.676 0.581 0.519 0.566 0.405 0.449 0.453 0.346 0.542 0.445 0.489 0.535 1.000 0.441 0.437 0.445 0.581 0.485 0.365 0.542 0.478 0.413 0.478 0.396 0.482 0.456 0.441 0.482 0.341 0.392 0.355 0.274 0.226 0.437 0.280 0.325 0.286 
+24 −0
Original line number Diff line number Diff line
# Information
Run datetime: 2017-09-07 00:09:08
Data file: synthetic_data/1000x20_20170823203622.csv
Algorithm type: ParallelTVGL
Penalty function: Group Lasso
Data dimension: 20
Blocks: 50
Observations in a block: 20
Rho: 6.7
Beta: 50
Lambda: 7
Processes used: 25
Total edges: 1000
Total edgeless: 8500

# Results
Algorithm run time: 16.2 seconds
Iterations to complete: 1622

Correct positive edges: 873
All positives: 884
F1 Score: 0.927
Temporal deviations ratio (max/mean): 26.417
Temporal deviations: 0.000 0.000 0.000 0.053 0.000 0.053 0.000 0.000 0.000 0.000 0.000 0.000 0.053 0.000 0.074 0.053 0.000 0.053 0.000 0.000 0.000 0.000 0.000 0.053 1.000 0.053 0.074 0.053 0.000 0.053 0.053 0.000 0.000 0.000 0.053 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.053 0.074 
Loading