News for hackers. Stuff that matters.
Re:How to Score 0.8134 in Titanic Kaggle Challenge by in9 on Thursday May 11, 2017 @11:59PM (#14321341)
why do people do this:

    def compute_score(clf, X, y,scoring='accuracy'):

        xval = cross_val_score(clf, X, y, cv = 5,scoring=scoring)
    
        return np.mean(xval)
when they could have done:

    np.mean(cross_val_score(clf, X, y, cv = 5,scoring='accuracy'))
Re:How to Score 0.8134 in Titanic Kaggle Challenge by mmierz on Friday May 12, 2017 @09:17AM (#14323688)
A) they find it more readable to have less stuff on each line

B) they think they might want to look at the intermediate results, or compute additional statistics

Re:How to Score 0.8134 in Titanic Kaggle Challenge by 88e282102ae2e5b on Friday May 12, 2017 @09:15AM (#14323677)
It conveys intent better. The function name is effectively a way of documenting what the result of np.mean should be interpreted as.

xval is a terrible name, but it does make it easier to see what's being passed into np.mean.