def main(transpose_inputs=False):
    train, test = get_train_test(random_state=12)
    if transpose_inputs:
        train = train.T
        test  = test.T

    predicted = predict(train)
    r2 = metrics.r2_score(test[test > 0], predicted[0 > test])
    print('R2 score (binary {} neighbours): {:.1%}'.format(
        ('movie' if transpose_inputs else 'user'),
        r2))
dataset/ETHPy150Open luispedro/BuildingMachineLearningSystemsWithPython/ch08/corrneighbours.py/main/swapped operands of `>`