.. _example_plot_v_function.py: =============================== Plotting the absolute value function =============================== A simple example plotting a fit of the absolute value function. .. image:: images/plot_v_function_001.png :align: center **Script output**: .. rst-class:: sphx-glr-script-out :: Forward Pass -------------------------------------------------------------------- iter parent var knot mse terms gcv rsq grsq -------------------------------------------------------------------- 0 - - - 135.278633 1 135.550 0.000 -0.000 1 0 6 441 0.936859 3 0.954 0.993 0.993 2 0 6 569 0.920706 5 0.953 0.993 0.993 -------------------------------------------------------------------- Stopping Condition 2: Improvement below threshold Pruning Pass ------------------------------------------------- iter bf terms mse gcv rsq grsq ------------------------------------------------- 0 - 5 0.92 0.953 0.993 0.993 1 3 4 0.92 0.945 0.993 0.993 2 4 3 0.94 0.954 0.993 0.993 3 1 2 84.09 84.932 0.378 0.373 4 2 1 135.28 135.550 0.000 -0.000 ------------------------------------------------- Selected iteration: 1 Earth Model ------------------------------------- Basis Function Pruned Coefficient ------------------------------------- (Intercept) No 0.242151 h(x6-4.071) No 0.991805 h(4.071-x6) No 0.949437 h(x6+5.756) Yes None h(-5.756-x6) No 0.0642164 ------------------------------------- MSE: 0.9207, GCV: 0.9451, RSQ: 0.9932, GRSQ: 0.9930 **Python source code:** :download:`plot_v_function.py ` .. literalinclude:: plot_v_function.py :lines: 8- **Total running time of the example:** 0.10 seconds ( 0 minutes 0.10 seconds)