Ml/machine_learning/decision_trees.ipynb

Hello,

Is it possible to provide line by line description/comment for the following function in ml/machine_learning/decision_trees.ipynb example:

Function Name: plot_regression_predictions(…)

Especially., i don’t understand following code:

  1. Parameter ylabel="$y$"
  2. plt.axis(axes)
  3. plt.xlabel("$x_1$", fontsize=18)
  4. if ylabel:
    plt.ylabel(ylabel, fontsize=18, rotation=0)
  5. plt.plot(X, y, “b.”)
    plt.plot(x1, y_pred, “r.-”, linewidth=2, label=r"$\hat{y}$")

Thanks,
Rakesh

Could you pls update on this ?

Hi Rakesh,

These are just dimensions and labelling of the plot for the visualisation. They are mostly self explainable. Please try to comment different different lines one by one and see what changes are you seeing there in the visualisations generated. You ll totally figure out the changes and eventually you ll get hold of it.

I hope it helps.

Regards.