Skip to content
Advertisement

plotting a 3d graph of a regressor made with sklearn

I have been using this tutorial to learn decision tree learning, and am now trying to understand how it works with higher dimensional datasets.

Currently my regressor predicts a Z value for an (x,y) pair that you pass to it.

JavaScript

I want to use a 3d graph to visualise it, but I have struggled with the way regressor.predict() expects its inputs to be vs the way programs like matplotlib wireframes expect their inputs to be. As a result I have not been able to make them work together.

Advertisement

Answer

Try this, I do not have all the packages installed, so I tested this on google colab. Let me know if this is what you expected.

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement