Linear Regression Model operator in Rapidminer how to adjusted R Square value

lanemlanem Member, University Professor Posts: 29 Maven
Dear Colleagues
I using North Textbook example for Linear regression model (and Chapter04.csv data set) and using apply model operator and performance (regression) operator to get model performance metrics for the linear regression model

Rapidminer Performance (Regression) operator provides R Square but not the adjusted R Square value

If there anyway I can get Rapidminer to calculate and provide adjusted R Square value - formulae is 1 - ((1-R Sq) (N-1) / (N-P-1)) where N = Sample size; P = Number of Predictor/Independent variables and R Sq = R Square value

Any help/clarification on above will be much appreciated

Kind regards Michael

Best Answers

  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Solution Accepted
    You can have RapidMiner calculate the adjusted R squared using the formula you provided above or any other similar formula you like.
    All the elements of that formula can be extracted using macros (see the Extract Macro operator) and the Performance to Data operator (you will need to download and install the free Converters extension from the marketplace).
    Then just use the "Generate Attributes" operator and use the formula you want with the values you want.

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
  • ceaperezceaperez Member Posts: 521 Unicorn
    Solution Accepted
    Hi @lanem

    You can use the Performance to Data operator to create a dataset with the performace results. Then you can use your formula  with that dataset and the Generate Operator. 

    regards

Answers

  • lanemlanem Member, University Professor Posts: 29 Maven
    Many thanks Telcontar and ceaperez you both provided some really useful advice, great ambassadors for Rapidminer Community

    I used following:
    Performance to data operator (need to install Converters extension to access this operator) to get Linear regression model metrics in exampleset, used Extract Macro to obtain N and P values from relevant exampleset used test Linear Regression model and then calculated formula in Generate Attributes operator using If Statement Criterion == squared_correlation to select R square and then eval Macro Values N and P to calculate adjusted R Square, otherwise false

    best regards Michael
Sign In or Register to comment.