Advertisement
themaleem

Test Module

Apr 16th, 2023
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.60 KB | None | 0 0
  1. import distance, statictics
  2.  
  3.  
  4. def test():
  5.     while True:
  6.         print(
  7.             """
  8. This module is used as test
  9. Input 1 to compute the distance between any two transactions of a user.
  10. Input 2 to compute the distance of transactions of any two users.
  11. Input 3 to calculate the average transactions of any user and of all users.
  12. Input 4 to calculate the mode of transactions of any user and that of all users.
  13. Input 5 to calculate the median of all transactions of a user and that of all users.
  14. Input 6 to calculate the interquartile range of any user’s transactions and of all users.
  15. Input 7 to calculate returns the location centroid of any user based on their transaction locations.
  16. Input 8 to determine whether a transaction is fraudulent or not. It should provide details of such transactions.
  17. Input 9 to calculate the standard deviation of any specific user’s transaction.
  18. Input 10 to determine if user transaction is abnormal.
  19. Input 11 to calculate the Z-score of any user’s transactions and for all users’ transactions
  20. Input 12 to compute those frequencies of transactions at any given location.
  21. Input 13 to determine outlier of any location and of any user.
  22. Input 14 to calculate nth percentiles of transactions of any user and of all users.
  23. """
  24.         )
  25.         option = input("Choose one of the above options or any other key to exit: ")
  26.  
  27.         if option == "1":
  28.             distance.calculate_user_distance()
  29.  
  30.         elif option == "2":
  31.             distance.calculate_any_two_users_distance()
  32.  
  33.         elif option == "3":
  34.             statictics.get_average_of_user_or_all()
  35.  
  36.         elif option == "4":
  37.             statictics.get_mode_of_user_or_all()
  38.  
  39.         elif option == "5":
  40.             statictics.get_median_of_user_or_all()
  41.  
  42.         elif option == "6":
  43.             statictics.get_interquartile_of_user_or_all()
  44.  
  45.         elif option == "7":
  46.             statictics.get_user_location_centroid()
  47.  
  48.         elif option == "8":
  49.             statictics.is_fraudulent_transaction()
  50.  
  51.         elif option == "9":
  52.             statictics.get_standard_deviation_of_user_or_all()
  53.  
  54.         elif option == "10":
  55.             pass
  56.  
  57.         elif option == "11":
  58.             statictics.get_z_score_of_user_or_all()
  59.  
  60.         elif option == "12":
  61.             pass
  62.  
  63.         elif option == "13":
  64.             pass
  65.  
  66.         elif option == "14":
  67.             statictics.get_nth_percentile_of_user_or_all()
  68.  
  69.         else:
  70.             print("User has exited the program")
  71.             break
  72.  
  73.  
  74. if __name__ == "__main__":
  75.     # code to be executed if this is the main program
  76.     test()
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement