.
X.iloc[test_idx], y[target].iloc[test_idx] pipe.fit(X=X_train, y=y_train) y_pred = pipe.predict(X_test) preds = y_test.to_frame('actuals').assign(predicted=y_pred) preds_by_day = preds.groupby(level='date') scores = pd.concat([preds_by_day.apply(lambda x: spearmanr(x.predicted, x.actuals)[0] * 100)