Advertisement
Guest User

Exam 3

a guest
Nov 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #!/usr/bin/python2.7
  2.  
  3. #Create a function that returns the mean absolute error percentage, given 2 lists in the following dictionary as input (35pts)
  4. import numpy as np
  5.  
  6.  
  7. dataDict= {'x1':[2,6,3,5,7,9,1,6,9,1,2,5,7,2,9], 'x2':[3,5,2,5,7,3,3,3,8,1,2,5,5,9,1]}
  8.  
  9. def JodyHighRoller(aquaberry, BASED):
  10.     Laflare = np.mean(np.abs((np.array(aquaberry) - np.array(BASED))/ np.array(aquaberry))*100)
  11.     return Laflare
  12.  
  13. Trap = dataDict['x1']
  14. Mami = dataDict['x2']
  15.  
  16. #Test the function by calling it with the following inputs (15 pts):
  17. print JodyHighRoller(Trap, Mami)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement