Tuesday, February 14, 2012

Calculating R-Squared from Decision Trees

Hello.

I am trying to build a decision tree to predict prices. I have created the tree and looked at the lift charts, but I have not seen any of the traditional statistics I am used to from other programs (R-Squared, F statistics, etc.).

Does anyone have an example of how they calculated R-Squared for a decision tree on a continuous variable?

Thanks,
Brian

Hello

This example (http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4264.aspx) contains a stored procedure that returns the covariance and correlation matrix for a mining model. Hope this helps

|||This is helpful.

But are there stored procedures that calculate R-Squared, or MSE, or the F-Test for regression trees?

Or are there stored procedures others use to evaluate the performance on data mining models for continuous variables like profits or prices?

Thanks.
|||

No, there are no system stored procedures to compute these accuracy measures. The stored procedure I indicated previously shows the main steps for such a test, in case you decide to write your own: drillthrough to fetch the training cases (for the whole model or for a single node) then compute the accuracy scores.

We consider adding more advanced accuracy measures for future versions

thanks

|||

We have another tip that shows how to calculates Lack of Fit for Microsoft Decision Trees and some other models:

http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/2271.aspx

We have a tip on how to calculate R square ready and will be published later.

Thanks,

|||

This tip is now available (it includes source code for a stored proc and sample app):

Calculating R-Squared for Microsoft regression models

|||Thanks for the stored procedure. It looks to be exactly what I am looking for.

I am not a Visual Studio Developer. Is there more basic/detailed instructions on how to build and deploy stored procedures in Visual Studio 2005.

When I try to open the project using Visual Studio 2005 I receive the following error:

"The Application for project Rsquarehelper.csproj is not installed"

Thanks. And I love the Excel 2007 DM Add Ins.

No comments:

Post a Comment