Hi sklearn developers,
I am a huge R fan and R user but I am trying to use sklearn for predictive
analytics purposes.
I found sklearn is very-well made package. But there are still a few
limitations.
1) there is a lack of statistical terminologies and correct equations in
Documentation.
this makes a hard to understand the meaning of each metrics and how the
method does.
2) sklearn is not really good enough to do descriptive analytics (
explanation purpose)
It would be great if we can see the actual equation (like R) when we do
linear regression etc.
Additionally, I just noticed there is no adjusted R square calculation
function in sklearn.
Thus I quickly made my own adjusted R square function. I am sharing my
function with you.
please add adjusted R square function when you update the version:
def adj_r2_score(model,y,yhat):
"""Adjusted R square — put fitted linear model, y value, estimated y
value in order
Example:
In [142]: metrics.r2_score(diabetes_y_train,yhat)
Out[142]: 0.51222621477934993
In [144]: adj_r2_score(lm,diabetes_y_train,yhat)
Out[144]: 0.50035823946984515"""
from sklearn import metrics
adj = 1 - float(len(y)-1)/(len(y)-len(model.coef_)-1)*(1 -
metrics.r2_score(y,yhat))
return adj
Thanks,
Joon
--
*Joon Lim*
Master of Science in Analytics
Department of Industrial Engineering and Management Science
Northwestern University
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general