def plot_influence(conf, mse_values, prediction_times, complexities):
 plt.figure(figsize=(12, 6))
 host = host_subplot(111, axes_class=Axes)
 plt.subplots_adjust(right=0.75)
 par1 = host.twinx()
 host.set_xlabel(('Model Complexity (%s)' % conf['complexity_label']))
 y1_label = conf['prediction_performance_label']
 y2_label = 'Time (s)'
 host.set_ylabel(y1_label)
 par1.set_ylabel(y2_label)
 (p1,) = host.plot(complexities, mse_values, 'b-', label='prediction error')
 (p2,) = par1.plot(complexities, prediction_times, 'r-', label='latency')
 host.legend(loc='upper right')
 host.axis['left'].label.set_color(p1.get_color())
 par1.axis['right'].label.set_color(p2.get_color())
 plt.title(('Influence of Model Complexity - %s' % conf['estimator'].__name__))
 plt.show()

def plot_influence ( conf , mse_values , prediction_times , complexities ) : plt . figure ( figsize = ( 12 , 6 ) ) host = host_subplot ( 111 , axes_class = Axes ) plt . subplots_adjust ( right = 0.75 ) par1 = host . twinx ( ) host . set_xlabel ( ( 'Model Complexity (%s)' % conf [ 'complexity_label' ] ) ) y1_label = conf [ 'prediction_performance_label' ] y2_label = 'Time (s)' host . set_ylabel ( y1_label ) par1 . set_ylabel ( y2_label ) ( p1 , ) = host . plot ( complexities , mse_values , 'b-' , label = 'prediction error' ) ( p2 , ) = par1 . plot ( complexities , prediction_times , 'r-' , label = 'latency' ) host . legend ( loc = 'upper right' ) host . axis [ 'left' ] . label . set_color ( p1 . get_color ( ) ) par1 . axis [ 'right' ] . label . set_color ( p2 . get_color ( ) ) plt . title ( ( 'Influence of Model Complexity - %s' % conf [ 'estimator' ] . __name__ ) ) plt . show ( )
plot influence of model complexity on both accuracy and latency .