6161# adds column that indicates the difference between the two classifiers
6262evaluations ['diff' ] = evaluations [flow_ids [0 ]] - evaluations [flow_ids [1 ]]
6363
64+
65+ ##############################################################################
6466# makes the s-plot
67+
6568fig_splot , ax_splot = plt .subplots ()
6669ax_splot .plot (range (len (evaluations )), sorted (evaluations ['diff' ]))
6770ax_splot .set_title (classifier_family )
7174plt .show ()
7275
7376
74- # adds column that indicates the difference between the two classifiers
77+ ##############################################################################
78+ # adds column that indicates the difference between the two classifiers,
79+ # needed for the scatter plot
80+
7581def determine_class (val_lin , val_nonlin ):
7682 if val_lin < val_nonlin :
7783 return class_values [0 ]
@@ -84,7 +90,7 @@ def determine_class(val_lin, val_nonlin):
8490evaluations ['class' ] = evaluations .apply (
8591 lambda row : determine_class (row [flow_ids [0 ]], row [flow_ids [1 ]]), axis = 1 )
8692
87- # makes the scatter plot
93+ # does the plotting and formatting
8894fig_scatter , ax_scatter = plt .subplots ()
8995for class_val in class_values :
9096 df_class = evaluations [evaluations ['class' ] == class_val ]
@@ -99,8 +105,10 @@ def determine_class(val_lin, val_nonlin):
99105ax_scatter .set_yscale ('log' )
100106plt .show ()
101107
102- # makes a scatter plot where each data point represents the performance of the two algorithms on various axis
103- # (not in the paper)
108+ ##############################################################################
109+ # makes a scatter plot where each data point represents the performance of the
110+ # two algorithms on various axis (not in the paper)
111+
104112fig_diagplot , ax_diagplot = plt .subplots ()
105113ax_diagplot .grid (linestyle = '--' )
106114ax_diagplot .plot ([0 , 1 ], ls = "-" , color = "black" )
0 commit comments