Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def custom_accuracy_score(Y_test, Y_pred):
- """
- Считает accuracy как процент попадания в отрезок +-0.1% от реальной цены
- Params:
- Y_pred -- вектор предсказаний
- Y_test -- таргет
- Returns:
- custom_accuracy_score -- результат подсчёта accuracy
- """
- interval_array = np.array([[x - x*0.085, x + x*0.085] for x in Y_test]).T
- custom_accuracy_score = sum((Y_pred >= interval_array[0]) & (Y_pred <= interval_array[1]))/len(Y_pred)
- return custom_accuracy_score
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement