compare_to_all_games #1
File diff suppressed because one or more lines are too long
@ -14,6 +14,11 @@ it will generate .json file which can be presented by running all cells of `Fuzz
|
|||||||
|
|
||||||
python main.py --pres -r True
|
python main.py --pres -r True
|
||||||
|
|
||||||
|
#### Evaluation mode
|
||||||
|
|
||||||
|
python main.py --pres --eval
|
||||||
|
generates result.json file with 10 random games and 10 recomendations for each game, results can be evaluated in `Fuzzy_presentation.ipynb` file, with Jaccard Similiarity
|
||||||
|
|
||||||
Processed dataset files are already provided, but can be created from the base ``games.csv`` file by running:
|
Processed dataset files are already provided, but can be created from the base ``games.csv`` file by running:
|
||||||
|
|
||||||
python process_dataset.py
|
python process_dataset.py
|
||||||
|
Binary file not shown.
12
main.py
12
main.py
@ -100,19 +100,29 @@ def main(argv):
|
|||||||
|
|
||||||
test_mode = False
|
test_mode = False
|
||||||
random_mode = False
|
random_mode = False
|
||||||
|
eval_mode = False
|
||||||
|
eval_random_mode = False
|
||||||
|
|
||||||
opts, args = getopt.getopt(argv, "r:", ["pres"])
|
opts, args = getopt.getopt(argv, "r:", ["pres", "eval", "evalrandom"])
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if "--pres" == opt:
|
if "--pres" == opt:
|
||||||
test_mode = True
|
test_mode = True
|
||||||
|
if "--eval" == opt:
|
||||||
|
eval_mode = True
|
||||||
|
if "--evalrandom" == opt:
|
||||||
|
eval_random_mode = True
|
||||||
if "-r" == opt:
|
if "-r" == opt:
|
||||||
random_mode = arg
|
random_mode = arg
|
||||||
if (True == test_mode):
|
if (True == test_mode):
|
||||||
game_list = ["Call of Duty®: Modern Warfare® 2", "Project CARS", "DayZ", "STAR WARS™ Jedi Knight - Mysteries of the Sith™", "Overcooked"]
|
game_list = ["Call of Duty®: Modern Warfare® 2", "Project CARS", "DayZ", "STAR WARS™ Jedi Knight - Mysteries of the Sith™", "Overcooked"]
|
||||||
if (random_mode): game_list = [random.choice(title_list)]
|
if (random_mode): game_list = [random.choice(title_list)]
|
||||||
|
if (eval_mode or eval_random_mode): game_list = [random.choice(title_list) for i in range(10)]
|
||||||
result_dict = {"results": []}
|
result_dict = {"results": []}
|
||||||
for item in game_list:
|
for item in game_list:
|
||||||
|
if not eval_random_mode:
|
||||||
titles_results = calculate_similarities(game_title=item, title_list=title_list, df=df, test=test_mode)
|
titles_results = calculate_similarities(game_title=item, title_list=title_list, df=df, test=test_mode)
|
||||||
|
if eval_random_mode:
|
||||||
|
titles_results = [{"title": random.choice(title_list)} for i in range(10)]
|
||||||
game_result = get_game_info_from_df(df, item)
|
game_result = get_game_info_from_df(df, item)
|
||||||
game_result["fuzzy_similiar"] = [get_game_info_from_df(df, title_item["title"]) for title_item in titles_results[:10]]
|
game_result["fuzzy_similiar"] = [get_game_info_from_df(df, title_item["title"]) for title_item in titles_results[:10]]
|
||||||
result_dict["results"].append(game_result)
|
result_dict["results"].append(game_result)
|
||||||
|
Loading…
Reference in New Issue
Block a user