-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_calc.py
executable file
·25 lines (23 loc) · 1.16 KB
/
test_calc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python2.7
from app import test
from app import yumbot
from app import means_shift
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Add or remove recipes from the database. Set the number of recipes to add/remove from the database')
parser.add_argument('--action', default='distance', type=str,
help='action can be distance,test,kmeans, or meansshift. Distance allows you to add a set of ingredients broken up by a comma. Test saves the distance between all ingredients and stats. Kmeans creates kmeans clusters.')
parser.add_argument('--ingredients', default='garlic,thyme', type=str,
help='Ingredients separated by a comma')
args = parser.parse_args()
if args.action == 'distance':
ingredients = args.ingredients.split(",")
test.test_pca(ingredients, True)
elif args.action == 'test':
test.create_database_snapshot()
elif args.action == 'kmeans':
test.kmeans_test()
elif args.action == 'meansshift':
means_shift.mean_shift_test()
elif args.action == 'yumbot':
print(yumbot.get_random_recipe())