cerlymarco / linear-tree

A python library to build Model Trees with Linear Models at the leaves.
MIT License
338 stars 54 forks source link

LinearTree does not fit well #37

Closed dieguisgs closed 9 months ago

dieguisgs commented 9 months ago

Hi There!

I was handling with the library when i figured out that the LinearTree doesnt fit to the data, triying to overfitting it. Like in the following image:

image

¿Is there a reason for that?

Thanks

cerlymarco commented 9 months ago

Hi, The splits are computed until there is "some utility" and at least 3 points are available. In other words, if an improvement (a decrease in loss of 1e-5) is detected by adding a split the model continues to grow. If not, the model remains as is. In the left part of your plot, these conditions are not met. I suggest you to check also your model summary. If you support the project don't forget to leave a star ;-)

dieguisgs commented 9 months ago

And it makes any sense that there is no improvement? Just by wathing the chart. My objective is to overfiti it in max_depth. So it learn all the data.

I appreciate any comment

:)

cerlymarco commented 9 months ago

Maybe yes, if you simply want to overfit them a simple DecisionTreeRegressor from sklearn suits well