From 8da828c8176bd057a7306a772ea4e4bce3fc08ad Mon Sep 17 00:00:00 2001 From: Peter Vacho Date: Mon, 9 Dec 2024 12:52:55 +0100 Subject: [PATCH] Make mnist downsizing easily configurable --- src/__main__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/__main__.py b/src/__main__.py index ec84bf7..5337c71 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -16,6 +16,10 @@ from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn.utils import Bunch + +# Set to -1 to disable downsizing +DOWNSIZE_MNIST: int = 8000 + # pyqt6 only bundles Windows & Fusion styles, which means that if you use a # different preferred qt style, a warning would be produced. This gets rid # of that warning and removes the env-var override. @@ -132,7 +136,10 @@ def main() -> None: # Working with the entire dataset would be way too computationally expensive # (TSNE would take hours, if not more), instead, downsize the dataset and work # with a smaller sample - mnist = load_data().downsize(8000) + if DOWNSIZE_MNIST != -1: + mnist = load_data().downsize(DOWNSIZE_MNIST) + else: + mnist = load_data() print()