From 3ae43b2714ee91c1b63cbbace65ff766659ce090 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 2 Feb 2023 15:16:46 +0100 Subject: [PATCH] Do not create a dataset with just 2 and 4 reviews --- unimore_bda_6/database.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unimore_bda_6/database.py b/unimore_bda_6/database.py index f4c2564..b31f7d6 100644 --- a/unimore_bda_6/database.py +++ b/unimore_bda_6/database.py @@ -114,13 +114,13 @@ def get_reviews_dataset_uniform(collection: pymongo.collection.Collection, amoun great = sample_reviews_by_rating(collection, rating=5.0, amount=amount) # Randomness here does not matter, so just merge the lists - both = [*positive, *negative] + full = [*terrible, *negative, *mixed, *positive, *great] # Shuffle the dataset, just in case it affects the performance # TODO: does it actually? - random.shuffle(both) + random.shuffle(full) - return both + return full __all__ = (