def validate_known_curve():
    """Validate on a sin function."""
    plt.figure()
    N = 100
    x = numpy.linspace(-1, 1, N)
    y = numpy.sin(4 * x)
    smoother.DEFAULT_BASIC_SMOOTHER = smoother.BasicFixedSpanSmootherSlowUpdate
    smooth = smoother.perform_smooth(x, y, smoother_cls=supersmoother.SuperSmoother)
    plt.plot(x, smooth.smooth_result, label='Slow')
    smoother.DEFAULT_BASIC_SMOOTHER = smoother.BasicFixedSpanSmoother
    smooth = smoother.perform_smooth(x, y, smoother_cls=supersmoother.SuperSmoother)
    plt.plot(x, smooth.smooth_result, label='Fast')
    plt.plot(x, y, '.', label='data')
    plt.legend()
    plt.show()
def validate_known_curve ( ) : plt . figure ( ) N = 100 x = numpy . linspace ( - 1 , 1 , N ) y = numpy . sin ( 4 * x ) smoother . DEFAULT_BASIC_SMOOTHER = smoother . BasicFixedSpanSmootherSlowUpdate smooth = smoother . perform_smooth ( x , y , smoother_cls = supersmoother . SuperSmoother ) plt . plot ( x , smooth . smooth_result , label = 'Slow' ) smoother . DEFAULT_BASIC_SMOOTHER = smoother . BasicFixedSpanSmoother smooth = smoother . perform_smooth ( x , y , smoother_cls = supersmoother . SuperSmoother ) plt . plot ( x , smooth . smooth_result , label = 'Fast' ) plt . plot ( x , y , '.' , label = 'data' ) plt . legend ( ) plt . show ( )
Validate on a sin function.