print("\ntest cost time :%d" % (time.time() - test_start)) print("\n" + "=" * 50 + "Test result" + "=" * 50) print("\n test accuracy :%f" % (test_accuracy / test_iter)) print("\n true positives :%d" % true_positives) print("\n false positives :%d" % false_positives) print("\n true negatives :%d" % true_negatives) print("\n false negatives :%d" % false_negatives) print("\n" + "=" * 50 + " DataSet Describe " + "=" * 50) print( "\nAll DataSet Number:%s Trainging DataSet Number:%s Test DataSet Number:%s" % (totalnum, trainnum, testnum)) mP = true_positives / (true_positives + false_positives) mR = true_positives / (true_positives + false_negatives) mF1_score = 2 * mP * mR / (mP + mR) print("\nPrecision:%f" % mP) print("\nRecall:%f" % mR) print("\nF1-Score:%f" % mF1_score) conmat = confusion_matrix(mlabel, preLabel) print("\nConfusion Matraics:") print(conmat) from Visualization import Visual matrix = Visual() matrix.cm_plot(mlabel, preLabel, ['Benign', 'Attack'], '1DCNN_LSTM_2_1') print('finish image confusion') print('train time:', duarion) # ------------------------------------------------------------------------------------------
vis.plot(desired_force, PAM_goal, env.object_goal, PAM_path_predicted, object_path_actual, object_path_planned, PAM_path_actual, PAM_path_planned) if __name__ == '__main__': rospy.init_node('high_level_controller', anonymous=True) desiredInput = rospy.Publisher('controlInput', controlInput, queue_size=10) rospy.Subscriber('feedback', feedback, callback, queue_size=1, buff_size=2**24) vis = Visual() desired_force = force() object_path_actual = Path() object_path_actual.header.frame_id = 'frame_0' PAM_path_actual = Path() PAM_path_actual.header.frame_id = 'frame_0' object_path_planned = Path() PAM_path_planned = Path() old_walker_state = state() old_bed_state = state() old_blue_chair_state = state() env = environment() env.example_2() # object parameters : Rho(4), Omega(3), width(1), length(1) #Rho[0,1,2,3]=[mass, inertia, x_c, y_c] walker_params = [
print("\n false negatives :%d" % false_negatives) print("\n" + "=" * 50 + " DataSet Describe " + "=" * 50) print( "\nAll DataSet Number:%s Trainging DataSet Number:%s Test DataSet Number:%s" % (totalnum, trainnum, testnum)) mP = true_positives / (true_positives + false_positives) mR = true_positives / (true_positives + false_negatives) mF1_score = 2 * mP * mR / (mP + mR) print("\nPrecision:%f" % mP) print("\nRecall:%f" % mR) print("\nF1-Score:%f" % mF1_score) conmat = confusion_matrix(mlabel, preLabel) print("\nConfusion Matraics:") print(conmat) # print(len(mlabel)) from Visualization import Visual matrix = Visual() matrix.cm_plot( mlabel, preLabel, ['Benign', 'Bot', 'DDoS', 'DoS', 'Patator', 'PortScan', 'WebAttack'], '1DCNN_LSTM_7_1') print('finish image confusion') print('train time:', duarion) # ------------------ # # ------------------------------------------------------------------------
print("\n test accuracy :%f" % (test_accuracy / test_iter)) print("\n true positives :%d" % true_positives) print("\n false positives :%d" % false_positives) print("\n true negatives :%d" % true_negatives) print("\n false negatives :%d" % false_negatives) print("\n" + "=" * 50 + " DataSet Describe " + "=" * 50) print("\nAll DataSet Number:%s Trainging DataSet Number:%s Test DataSet Number:%s" % ( totalnum, trainnum, testnum)) mP = true_positives / (true_positives + false_positives) mR = true_positives / (true_positives + false_negatives) mF1_score = 2 * mP * mR / (mP + mR) print("\nPrecision:%f" % mP) print("\nRecall:%f" % mR) print("\nF1-Score:%f" % mF1_score) conmat = confusion_matrix(mlabel, preLabel) print("\nConfusion Matraics:") print(conmat) print(len(mlabel)) from Visualization import Visual matrix = Visual() label12=['Benign','Bot','DDoS','DoSGoldenEye','DoSHulk','DoSSlowhttptest','DoSslowloris','FTPPatator','PortScan','SSHPatator','WebAttackBruteForce','WebAttackXSS'] matrix.cm_plot(mlabel,preLabel,label12,'1DCNN_12_1') print('finish image confusion') print('train time:',duarion) # ------------------------------------------------------------------------------------------
print("\ntest cost time :%d" % (time.time() - test_start)) print("\n" + "=" * 50 + "Test result" + "=" * 50) print("\n test accuracy :%f" % (test_accuracy / test_iter)) print("\n true positives :%d" % true_positives) print("\n false positives :%d" % false_positives) print("\n true negatives :%d" % true_negatives) print("\n false negatives :%d" % false_negatives) print("\n" + "=" * 50 + " DataSet Describe " + "=" * 50) print("\nAll DataSet Number:%s Trainging DataSet Number:%s Test DataSet Number:%s" % ( totalnum, trainnum, testnum)) mP = true_positives / (true_positives + false_positives) mR = true_positives / (true_positives + false_negatives) mF1_score = 2 * mP * mR / (mP + mR) print("\nPrecision:%f" % mP) print("\nRecall:%f" % mR) print("\nF1-Score:%f" % mF1_score) conmat = confusion_matrix(mlabel, preLabel) print("\nConfusion Matraics:") print(conmat) print(len(mlabel)) from Visualization import Visual matrix = Visual() label12=['Benign','Bot','DDoS','DoSGoldenEye','DoSHulk','DoSSlowhttptest','DoSslowloris','FTPPatator','PortScan','SSHPatator','WebAttackBruteForce','WebAttackXSS'] matrix.cm_plot(mlabel,preLabel,label12,'LSTM_12_1') print('finish image confusion') print('train time:',duarion)