Skip to content
Snippets Groups Projects
Commit 1fb89c0d authored by delacal's avatar delacal
Browse files

Fixed CAD not generating CSV file

parent adf54245
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
F1_SCORE_MACRO F1_SCORE_WEIGHTED BALANCED_ACCURACY PRECISION_SCORE RECALL_SCORE OVERALL_ACCURACY CRYPTO_ACCURACY TOTAL_PREDICTIONS TOTAL_POSITIVES F_POSITIVES T_NEGATIVES F_NEGATIVES CONFIDENCE TIMESTAMP_START TIMESTAMP_FINISH SAMPLING_SNAPSHOTS SAMPLING_RATE SAMPLING_MODE TIME_TO_STABILIZE
\ No newline at end of file
F1_SCORE_MACRO F1_SCORE_WEIGHTED BALANCED_ACCURACY PRECISION_SCORE RECALL_SCORE OVERALL_ACCURACY CRYPTO_ACCURACY TOTAL_PREDICTIONS TOTAL_POSITIVES F_POSITIVES T_NEGATIVES F_NEGATIVES CONFIDENCE TIMESTAMP_START TIMESTAMP_FINISH SAMPLING_SNAPSHOTS SAMPLING_RATE SAMPLING_MODE TIME_TO_STABILIZE
1.0 1.0 1.0 1.0 1.0 1.0 0.0 2242.0 0.0 0.0 2242.0 0.0 1.0 09/05/2023-10:24:06 09/05/2023-10:26:06 100.0 0.800000011920929 Last 2.0
1.0 1.0 1.0 1.0 1.0 1.0 0.0 2259.0 0.0 0.0 2259.0 0.0 1.0 09/05/2023-10:37:24 09/05/2023-10:39:24 100.0 0.800000011920929 Last 2.0
0.9380793571472168 0.9988300800323486 0.8902438879013062 0.99944669008255 0.8902438879013062 0.9988977313041687 1.0 8166.0 32.0 0.0 8134.0 9.0 1.0 09/05/2023-10:56:39 09/05/2023-11:06:39 100.0 0.800000011920929 Random 10.0
......@@ -724,8 +724,8 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto
# Wait for the system to stabilize
time.sleep(self.time_to_stabilize * 60)
np.save("y_true_max_conn_{}_time_to_stabilize_{}_exp2.npy".format(self.max_connection_time, self.time_to_stabilize), self.y_true)
np.save("y_pred_max_conn_{}_time_to_stabilize_{}_exp2.npy".format(self.max_connection_time, self.time_to_stabilize), self.y_pred)
np.save("y_true_snapshots_{}_rate_{}_mode_{}_time_to_stabilize_{}_exp3.npy".format(self.sampling_snapshots, self.sampling_rate, self.sampling_mode, self.time_to_stabilize), self.y_true)
np.save("y_pred_snapshots_{}_rate_{}_mode_{}_time_to_stabilize_{}_exp3.npy".format(self.sampling_snapshots, self.sampling_rate, self.sampling_mode, self.time_to_stabilize), self.y_pred)
LOGGER.debug("Scalability csv started")
with open("/var/teraflow/scalability_accuracy.csv", 'a', newline='') as f:
......@@ -754,9 +754,9 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto
self.sampling_snapshots = request.sampling_snapshots
self.sampling_rate = request.sampling_rate
if request.sampling_mode == SamplingMode.RANDOM:
if request.sampling_mode == SamplingMode.RANDOM.value:
self.sampling_mode = "Random"
elif request.sampling_mode == SamplingMode.FIRST:
elif request.sampling_mode == SamplingMode.FIRST.value:
self.sampling_mode = "First"
else:
self.sampling_mode = "Last"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment