48afd8f2c4ee6f746769642ffac135f3caab3a65,arviz/stats/stats.py,,r2_score,#Any#Any#Any#,513

Before Change


    
    y_pred = np.atleast_2d(y_pred).mean(0)

    y_pred_ = []
    for _ in range(1000):
        idx = np.random.randint(0, len(y_true), size=len(y_true))
        y_pred_.append(_r_square(y_true, y_pred, idx))

After Change


    
    if y_pred.ndim == 1:
        var_y_est = np.var(y_pred)
        var_e = np.var(y_true - y_pred)
    else:
        var_y_est = np.var(y_pred.mean(0))
        var_e = np.var(y_true - y_pred, 0)

    r2 = var_y_est / (var_y_est + var_e)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: arviz-devs/arviz
Commit Name: 48afd8f2c4ee6f746769642ffac135f3caab3a65
Time: 2018-07-09
Author: aloctavodia@gmail.com
File Name: arviz/stats/stats.py
Class Name:
Method Name: r2_score


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: e70bdb2d089ae283781c45b8d97963823a984baa
Time: 2017-12-15
Author: max.lapan@gmail.com
File Name: ch10/00_pong_pg.py
Class Name:
Method Name:


Project Name: automl/ParameterImportance
Commit Name: b8fb87ecd382c603f01fa126f1c0ad7ca141e47a
Time: 2018-11-19
Author: shukon@users.noreply.github.com
File Name: pimp/evaluator/local_parameter_importance.py
Class Name: LPI
Method Name: run