File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1005,7 +1005,7 @@ def get_reg_r_sq(X, y):
10051005
10061006 elif metric == 'corr' :
10071007 rho , _ = sstats .pearsonr (mdl .predict (X [train_idx , :]),
1008- y [train_idx ])
1008+ y [train_idx ])
10091009 train_metric .append (rho )
10101010
10111011 # prediction on test set
@@ -1015,9 +1015,9 @@ def get_reg_r_sq(X, y):
10151015 SS_Residual = sum ((y [test_idx ] - yhat ) ** 2 )
10161016 SS_Total = sum ((y [test_idx ] - np .mean (y [test_idx ])) ** 2 )
10171017 r_squared = 1 - (float (SS_Residual )) / SS_Total
1018- adjusted_r_squared = 1 - ( 1 - r_squared )* ((len (y [test_idx ]) - 1 ) /
1019- (len (y [test_idx ]) -
1020- X .shape [1 ]- 1 ))
1018+ adjusted_r_squared = 1 - ( 1 - r_squared ) * ((len (y [test_idx ]) - 1 )
1019+ / (len (y [test_idx ])
1020+ - X .shape [1 ] - 1 ))
10211021 test_metric .append (adjusted_r_squared )
10221022
10231023 elif metric == 'corr' :
You can’t perform that action at this time.
0 commit comments