List of commits:
Subject Hash Author Date (UTC)
Set fileformat to unix 61f3f7853368dbc753f1ae020e696d3b59714f73 Vasilis Ververis 2017-03-16 09:52:39
Add redis configuration, set file format to unix 263501b46ec5cd4126afa11a0cd5a2ceaf4c2d7d Vasilis Ververis 2017-03-13 19:36:18
removed comments and unneded file 008e4a2b2b6cafc966904bec4b5f1de56aecbb2e mcehlert 2014-03-18 13:42:30
changed profiling output timestamp format e0969fdab8ecab90177fa11d7459dc46d45f5418 mcehlert 2014-02-24 15:55:31
added profiling option to start script 634b3664b6b694303fb9787781e074432967ead5 mcehlert 2014-02-24 15:45:06
added usage to readme 8125b1f4f8cb59d96c8444accab88d77bf6dd42a mcehlert 2014-01-09 16:02:47
a lot of refactoring for more modular structure 660e0d15e9b18aa9c1100c874e2140220f1c5860 mcehlert 2014-01-09 15:51:02
a lot of refactoring for more modular structure dcf7bd73ccc2f871ab8d48c43d11a8e5b392b6de mcehlert 2014-01-09 15:50:53
initial commit - pre colloquim state 655c77556f9d8e40b52893887cdb0d90f726fdbf Mathias Ehlert 2013-11-22 13:47:29
Initial commit f53ec7a3f25d55c53aa12c2682b216e16570cdc7 Mathias Ehlert 2013-11-22 13:37:47
Commit 61f3f7853368dbc753f1ae020e696d3b59714f73 - Set fileformat to unix
Author: Vasilis Ververis
Author date (UTC): 2017-03-16 09:52
Committer name: Vasilis Ververis
Committer date (UTC): 2017-03-16 09:52
Parent(s): 263501b46ec5cd4126afa11a0cd5a2ceaf4c2d7d
Signing key:
Tree: 88ded5fee1639f0cfcde6166735ed6cf4e02b5f5
File Lines added Lines deleted
config.py 86 86
File config.py changed (mode: 100644) (index b770edd..1cf7629)
1 #config.py
2 import metrics
3 import normalizations
4 import advancedscores
5
6 #redis keys for indexes and values
7 node_index_key = 'all_nodes'
8 metric_index_key = 'all_metrics'
9 score_index_key = 'all_scores'
10
11 node_neighbors_prefix = 'node_neighbors:'
12 node_prefix = 'node_metrics:'
13 metric_prefix = 'metric:'
14 score_prefix = 'score:'
15 statistics_prefix = 'statistics:'
16
17 normalization_suffix = '_normalized'
18
19 # definition of all base metrics for which absolute values will be calculcated for each node in the first step
20 # key is the name of the metric and value is the implemented method which exposes the required interface
21 # interface: each method takes the node as the single parameter, performs the necessary calculation and
22 # returns a float containing the value for the specified node
23
24 base_metrics = { 'clustering_coefficient' : metrics.clustering_coefficient,
25 'degree' : metrics.degree,
26 'average_neighbor_degree' : metrics.average_neighbor_degree,
27 'iterated_average_neighbor_degree': metrics.iterated_average_neighbor_degree,
28 'betweenness_centrality' : metrics.betweenness_centrality,
29 'eccentricity' : metrics.eccentricity,
30 'average_shortest_path_length' : metrics.average_shortest_path_length
31 }
32
33
34 # some metrics might require some corrections or post processing which relies on the value of other metrics or normalizations
35 # key is the metric name and value the method for correction
36
37 advanced_metrics = {'corrected_clustering_coefficient' : metrics.correct_clustering_coefficient,
38 'corrected_average_neighbor_degree' : metrics.correct_average_neighbor_degree,
39 'corrected_iterated_average_neighbor_degree': metrics.correct_iterated_average_neighbor_degree}
40
41
42 # for every metric, a normalization method has to be specified
43 # key is the name of the metric and value is the normalization method which also has to expose the required interface
44 # interface: normalization methods, take the name of the (absolute) metric as the single argument, no return value is required
45 # the method itself shall access the data which is required for normalization from the redis instance
46 # and the corresponding keys/values for the specified metric
47 # it shall then loop over all nodes and calculate the normalized value for the node and the metric
48 # afterwards it should save the result to redis using "metric_name_normalized" as the key
49 # the result is stored inside the node's hash for metrics
50
51 # also needs to include corrected metrics with their respective names
52 #
53 normalization_methods = { 'clustering_coefficient' : normalizations.min_max,
54 'corrected_clustering_coefficient' : normalizations.min_max,
55 'degree' : normalizations.min_max,
56 'average_neighbor_degree' : normalizations.min_max,
57 'corrected_average_neighbor_degree' : normalizations.min_max,
58 'iterated_average_neighbor_degree' : normalizations.min_max,
59 'corrected_iterated_average_neighbor_degree': normalizations.min_max,
60 'betweenness_centrality' : normalizations.min_max,
61 'eccentricity' : normalizations.max_min,
62 'average_shortest_path_length' : normalizations.max_min
63 }
64
65
66 # the easiest case for a score is a combination of normalized metric values with a weight which adds up to 1
67 # such scores can easily be defined here
68 # note: names are not methods but redis keys
69
70 scores = {'unified_risk_score': { 'degree': 0.25,
71 'corrected_average_neighbor_degree': 0.15,
72 'corrected_iterated_average_neighbor_degree': 0.1,
73 'betweenness_centrality': 0.25,
74 'eccentricity': 0.125,
75 'average_shortest_path_length': 0.125}
76 }
77
78
79 # other scores might require a more sophisticated algorithm to be calculated
80 # such scores need to be added here and implemented like the example below
81
82 advanced_scores = {'advanced_unified_risk_score': advancedscores.adv_unified_risk_score}
83
84 # Redis
85 REDIS_PORT = 6379
86 REDIS_HOST = 'redis'
1 #config.py
2 import metrics
3 import normalizations
4 import advancedscores
5
6 #redis keys for indexes and values
7 node_index_key = 'all_nodes'
8 metric_index_key = 'all_metrics'
9 score_index_key = 'all_scores'
10
11 node_neighbors_prefix = 'node_neighbors:'
12 node_prefix = 'node_metrics:'
13 metric_prefix = 'metric:'
14 score_prefix = 'score:'
15 statistics_prefix = 'statistics:'
16
17 normalization_suffix = '_normalized'
18
19 # definition of all base metrics for which absolute values will be calculcated for each node in the first step
20 # key is the name of the metric and value is the implemented method which exposes the required interface
21 # interface: each method takes the node as the single parameter, performs the necessary calculation and
22 # returns a float containing the value for the specified node
23
24 base_metrics = { 'clustering_coefficient' : metrics.clustering_coefficient,
25 'degree' : metrics.degree,
26 'average_neighbor_degree' : metrics.average_neighbor_degree,
27 'iterated_average_neighbor_degree': metrics.iterated_average_neighbor_degree,
28 'betweenness_centrality' : metrics.betweenness_centrality,
29 'eccentricity' : metrics.eccentricity,
30 'average_shortest_path_length' : metrics.average_shortest_path_length
31 }
32
33
34 # some metrics might require some corrections or post processing which relies on the value of other metrics or normalizations
35 # key is the metric name and value the method for correction
36
37 advanced_metrics = {'corrected_clustering_coefficient' : metrics.correct_clustering_coefficient,
38 'corrected_average_neighbor_degree' : metrics.correct_average_neighbor_degree,
39 'corrected_iterated_average_neighbor_degree': metrics.correct_iterated_average_neighbor_degree}
40
41
42 # for every metric, a normalization method has to be specified
43 # key is the name of the metric and value is the normalization method which also has to expose the required interface
44 # interface: normalization methods, take the name of the (absolute) metric as the single argument, no return value is required
45 # the method itself shall access the data which is required for normalization from the redis instance
46 # and the corresponding keys/values for the specified metric
47 # it shall then loop over all nodes and calculate the normalized value for the node and the metric
48 # afterwards it should save the result to redis using "metric_name_normalized" as the key
49 # the result is stored inside the node's hash for metrics
50
51 # also needs to include corrected metrics with their respective names
52 #
53 normalization_methods = { 'clustering_coefficient' : normalizations.min_max,
54 'corrected_clustering_coefficient' : normalizations.min_max,
55 'degree' : normalizations.min_max,
56 'average_neighbor_degree' : normalizations.min_max,
57 'corrected_average_neighbor_degree' : normalizations.min_max,
58 'iterated_average_neighbor_degree' : normalizations.min_max,
59 'corrected_iterated_average_neighbor_degree': normalizations.min_max,
60 'betweenness_centrality' : normalizations.min_max,
61 'eccentricity' : normalizations.max_min,
62 'average_shortest_path_length' : normalizations.max_min
63 }
64
65
66 # the easiest case for a score is a combination of normalized metric values with a weight which adds up to 1
67 # such scores can easily be defined here
68 # note: names are not methods but redis keys
69
70 scores = {'unified_risk_score': { 'degree': 0.25,
71 'corrected_average_neighbor_degree': 0.15,
72 'corrected_iterated_average_neighbor_degree': 0.1,
73 'betweenness_centrality': 0.25,
74 'eccentricity': 0.125,
75 'average_shortest_path_length': 0.125}
76 }
77
78
79 # other scores might require a more sophisticated algorithm to be calculated
80 # such scores need to be added here and implemented like the example below
81
82 advanced_scores = {'advanced_unified_risk_score': advancedscores.adv_unified_risk_score}
83
84 # Redis
85 REDIS_PORT = 6379
86 REDIS_HOST = 'redis'
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/coria/coria-backend

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/coria/coria-backend

Clone this repository using git:
git clone git://git.rocketgit.com/user/coria/coria-backend

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main