Advertisement
manul1537

Untitled

Jan 26th, 2024
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. def mae(target, predictions):
  4.     error = 0
  5.     for i in range(target.shape[0]):
  6.         error += abs(target - predictions)
  7.        
  8.     return error/ target.shape[0]
  9.     # < напишите код здесь >
  10.  
  11. target = pd.Series([-0.5, 2.1, 1.5, 0.3])
  12. predictions = pd.Series([-0.6, 1.7, 1.6, 0.2])
  13.  
  14. print(mae(target, predictions))
  15.            
  16.            
  17.            
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement