From 0ef1e72841b8d4c0496bb4b51a27af47e63721fb Mon Sep 17 00:00:00 2001 From: "Marte M. Vroom" Date: Mon, 20 Apr 2026 12:03:44 -0400 Subject: [PATCH] Finished assignment 1 --- 02_activities/assignments/assignment_1.ipynb | 2813 +++++++++++++++++- 1 file changed, 2777 insertions(+), 36 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index 1d25bbcb3..422837d48 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -34,10 +34,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "4a3485d6-ba58-4660-a983-5680821c5719", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Matplotlib is building the font cache; this may take a moment.\n" + ] + } + ], "source": [ "# Import standard libraries\n", "import pandas as pd\n", @@ -56,10 +64,288 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "a431d282-f9ca-4d5d-8912-71ffc9d8ea19", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
alcoholmalic_acidashalcalinity_of_ashmagnesiumtotal_phenolsflavanoidsnonflavanoid_phenolsproanthocyaninscolor_intensityhueod280/od315_of_diluted_winesprolineclass
014.231.712.4315.6127.02.803.060.282.295.641.043.921065.00
113.201.782.1411.2100.02.652.760.261.284.381.053.401050.00
213.162.362.6718.6101.02.803.240.302.815.681.033.171185.00
314.371.952.5016.8113.03.853.490.242.187.800.863.451480.00
413.242.592.8721.0118.02.802.690.391.824.321.042.93735.00
.............................................
17313.715.652.4520.595.01.680.610.521.067.700.641.74740.02
17413.403.912.4823.0102.01.800.750.431.417.300.701.56750.02
17513.274.282.2620.0120.01.590.690.431.3510.200.591.56835.02
17613.172.592.3720.0120.01.650.680.531.469.300.601.62840.02
17714.134.102.7424.596.02.050.760.561.359.200.611.60560.02
\n", + "

178 rows × 14 columns

\n", + "
" + ], + "text/plain": [ + " alcohol malic_acid ash alcalinity_of_ash magnesium total_phenols \\\n", + "0 14.23 1.71 2.43 15.6 127.0 2.80 \n", + "1 13.20 1.78 2.14 11.2 100.0 2.65 \n", + "2 13.16 2.36 2.67 18.6 101.0 2.80 \n", + "3 14.37 1.95 2.50 16.8 113.0 3.85 \n", + "4 13.24 2.59 2.87 21.0 118.0 2.80 \n", + ".. ... ... ... ... ... ... \n", + "173 13.71 5.65 2.45 20.5 95.0 1.68 \n", + "174 13.40 3.91 2.48 23.0 102.0 1.80 \n", + "175 13.27 4.28 2.26 20.0 120.0 1.59 \n", + "176 13.17 2.59 2.37 20.0 120.0 1.65 \n", + "177 14.13 4.10 2.74 24.5 96.0 2.05 \n", + "\n", + " flavanoids nonflavanoid_phenols proanthocyanins color_intensity hue \\\n", + "0 3.06 0.28 2.29 5.64 1.04 \n", + "1 2.76 0.26 1.28 4.38 1.05 \n", + "2 3.24 0.30 2.81 5.68 1.03 \n", + "3 3.49 0.24 2.18 7.80 0.86 \n", + "4 2.69 0.39 1.82 4.32 1.04 \n", + ".. ... ... ... ... ... \n", + "173 0.61 0.52 1.06 7.70 0.64 \n", + "174 0.75 0.43 1.41 7.30 0.70 \n", + "175 0.69 0.43 1.35 10.20 0.59 \n", + "176 0.68 0.53 1.46 9.30 0.60 \n", + "177 0.76 0.56 1.35 9.20 0.61 \n", + "\n", + " od280/od315_of_diluted_wines proline class \n", + "0 3.92 1065.0 0 \n", + "1 3.40 1050.0 0 \n", + "2 3.17 1185.0 0 \n", + "3 3.45 1480.0 0 \n", + "4 2.93 735.0 0 \n", + ".. ... ... ... \n", + "173 1.74 740.0 2 \n", + "174 1.56 750.0 2 \n", + "175 1.56 835.0 2 \n", + "176 1.62 840.0 2 \n", + "177 1.60 560.0 2 \n", + "\n", + "[178 rows x 14 columns]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from sklearn.datasets import load_wine\n", "\n", @@ -94,9 +380,38 @@ "execution_count": null, "id": "56916892", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 178 entries, 0 to 177\n", + "Data columns (total 14 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 alcohol 178 non-null float64\n", + " 1 malic_acid 178 non-null float64\n", + " 2 ash 178 non-null float64\n", + " 3 alcalinity_of_ash 178 non-null float64\n", + " 4 magnesium 178 non-null float64\n", + " 5 total_phenols 178 non-null float64\n", + " 6 flavanoids 178 non-null float64\n", + " 7 nonflavanoid_phenols 178 non-null float64\n", + " 8 proanthocyanins 178 non-null float64\n", + " 9 color_intensity 178 non-null float64\n", + " 10 hue 178 non-null float64\n", + " 11 od280/od315_of_diluted_wines 178 non-null float64\n", + " 12 proline 178 non-null float64\n", + " 13 class 178 non-null int64 \n", + "dtypes: float64(13), int64(1)\n", + "memory usage: 19.6 KB\n" + ] + } + ], "source": [ - "# Your answer here" + "# There are 178 entries as we can see below (see RangeIndex). Thus, there are 178 observations.\n", + "wine_df.info()" ] }, { @@ -109,12 +424,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "df0ef103", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 178 entries, 0 to 177\n", + "Data columns (total 14 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 alcohol 178 non-null float64\n", + " 1 malic_acid 178 non-null float64\n", + " 2 ash 178 non-null float64\n", + " 3 alcalinity_of_ash 178 non-null float64\n", + " 4 magnesium 178 non-null float64\n", + " 5 total_phenols 178 non-null float64\n", + " 6 flavanoids 178 non-null float64\n", + " 7 nonflavanoid_phenols 178 non-null float64\n", + " 8 proanthocyanins 178 non-null float64\n", + " 9 color_intensity 178 non-null float64\n", + " 10 hue 178 non-null float64\n", + " 11 od280/od315_of_diluted_wines 178 non-null float64\n", + " 12 proline 178 non-null float64\n", + " 13 class 178 non-null int64 \n", + "dtypes: float64(13), int64(1)\n", + "memory usage: 19.6 KB\n" + ] + } + ], "source": [ - "# Your answer here" + "# I use the same Python code for this. There are 14 columns (see Data columns). As such, there 14 different variables.\n", + "wine_df.info()" ] }, { @@ -127,12 +471,55 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "47989426", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 178 entries, 0 to 177\n", + "Data columns (total 14 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 alcohol 178 non-null float64\n", + " 1 malic_acid 178 non-null float64\n", + " 2 ash 178 non-null float64\n", + " 3 alcalinity_of_ash 178 non-null float64\n", + " 4 magnesium 178 non-null float64\n", + " 5 total_phenols 178 non-null float64\n", + " 6 flavanoids 178 non-null float64\n", + " 7 nonflavanoid_phenols 178 non-null float64\n", + " 8 proanthocyanins 178 non-null float64\n", + " 9 color_intensity 178 non-null float64\n", + " 10 hue 178 non-null float64\n", + " 11 od280/od315_of_diluted_wines 178 non-null float64\n", + " 12 proline 178 non-null float64\n", + " 13 class 178 non-null int64 \n", + "dtypes: float64(13), int64(1)\n", + "memory usage: 19.6 KB\n" + ] + }, + { + "data": { + "text/plain": [ + "array([0, 1, 2])" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your answer here" + "# Regarding the first question, I use the same Python code as above. For class, the variable type is int64 (see Dtype).\n", + "wine_df.info()\n", + "\n", + "# Regarding the second question, I use the .unique() method to find the unique values in the 'class' column. \n", + "# The unique values are 0, 1, and 2, which represent the three different classes of wine in the dataset.\n", + "wine_df['class'].unique()" ] }, { @@ -146,12 +533,44 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "bd7b0910", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 178 entries, 0 to 177\n", + "Data columns (total 14 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 alcohol 178 non-null float64\n", + " 1 malic_acid 178 non-null float64\n", + " 2 ash 178 non-null float64\n", + " 3 alcalinity_of_ash 178 non-null float64\n", + " 4 magnesium 178 non-null float64\n", + " 5 total_phenols 178 non-null float64\n", + " 6 flavanoids 178 non-null float64\n", + " 7 nonflavanoid_phenols 178 non-null float64\n", + " 8 proanthocyanins 178 non-null float64\n", + " 9 color_intensity 178 non-null float64\n", + " 10 hue 178 non-null float64\n", + " 11 od280/od315_of_diluted_wines 178 non-null float64\n", + " 12 proline 178 non-null float64\n", + " 13 class 178 non-null int64 \n", + "dtypes: float64(13), int64(1)\n", + "memory usage: 19.6 KB\n" + ] + } + ], "source": [ - "# Your answer here" + "# Using the same Python code as above, I can see that there are 13 numerical variables, or float variables (see Dtype). \n", + "# These are the 13 features of the wine dataset, such as 'alcohol', 'malic_acid', 'ash', etc. \n", + "# The 'class' variable is an integer variable (int64) that represents the target variable for classification.\n", + "# So, the predictor variables are the 13 float variables, and the target variable is the 'class' variable, which is an integer variable.\n", + "wine_df.info()" ] }, { @@ -175,10 +594,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "id": "cc899b59", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " alcohol malic_acid ash alcalinity_of_ash magnesium \\\n", + "0 1.518613 -0.562250 0.232053 -1.169593 1.913905 \n", + "1 0.246290 -0.499413 -0.827996 -2.490847 0.018145 \n", + "2 0.196879 0.021231 1.109334 -0.268738 0.088358 \n", + "3 1.691550 -0.346811 0.487926 -0.809251 0.930918 \n", + "4 0.295700 0.227694 1.840403 0.451946 1.281985 \n", + "\n", + " total_phenols flavanoids nonflavanoid_phenols proanthocyanins \\\n", + "0 0.808997 1.034819 -0.659563 1.224884 \n", + "1 0.568648 0.733629 -0.820719 -0.544721 \n", + "2 0.808997 1.215533 -0.498407 2.135968 \n", + "3 2.491446 1.466525 -0.981875 1.032155 \n", + "4 0.808997 0.663351 0.226796 0.401404 \n", + "\n", + " color_intensity hue od280/od315_of_diluted_wines proline \n", + "0 0.251717 0.362177 1.847920 1.013009 \n", + "1 -0.293321 0.406051 1.113449 0.965242 \n", + "2 0.269020 0.318304 0.788587 1.395148 \n", + "3 1.186068 -0.427544 1.184071 2.334574 \n", + "4 -0.319276 0.362177 0.449601 -0.037874 \n" + ] + } + ], "source": [ "# Select predictors (excluding the last column)\n", "predictors = wine_df.iloc[:, :-1]\n", @@ -204,7 +650,7 @@ "id": "403ef0bb", "metadata": {}, "source": [ - "> Your answer here..." + "We standardize the predictor (X) variables to ensure that the features in the dataset are on the same scale. If we do not standardize, we risk differences in scale. These differences can disproportionately affect machine learning models that rely on distance metrics, such as K-Nearest Neighbours, which we will be using for this assignment. For instance, without scaling, one variable could completely dominate the distance calculation. By standardizing, we ensure that each feature contributes fairly." ] }, { @@ -220,7 +666,7 @@ "id": "fdee5a15", "metadata": {}, "source": [ - "> Your answer here..." + "We do not standardize the response (Y) variable, simply because distance usaully doesn't involve it. As for K-Nearest Neighbours, the model finds neighbours using only the predictor (X) variables. So, scaling the response (Y) variable does nothing for finding neighbours and computing distances. If we would scale the response (Y) variable, the predictions and up to be averages of scaled values." ] }, { @@ -236,7 +682,7 @@ "id": "f0676c21", "metadata": {}, "source": [ - "> Your answer here..." + "We use the np.random.seed() function in order to control the randomness in our code. Using this method, we make sure the random numbers stay the same each time we run it. If we would not set a seed, the numbers change every time we generate random numbers. However, we want to have to have consistent results for testing or comparisons. As such, it is important to set a seed with the np.random.seed() method." ] }, { @@ -251,17 +697,74 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "id": "72c101f2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Index: 44 entries, 56 to 165\n", + "Data columns (total 13 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 alcohol 44 non-null float64\n", + " 1 malic_acid 44 non-null float64\n", + " 2 ash 44 non-null float64\n", + " 3 alcalinity_of_ash 44 non-null float64\n", + " 4 magnesium 44 non-null float64\n", + " 5 total_phenols 44 non-null float64\n", + " 6 flavanoids 44 non-null float64\n", + " 7 nonflavanoid_phenols 44 non-null float64\n", + " 8 proanthocyanins 44 non-null float64\n", + " 9 color_intensity 44 non-null float64\n", + " 10 hue 44 non-null float64\n", + " 11 od280/od315_of_diluted_wines 44 non-null float64\n", + " 12 proline 44 non-null float64\n", + "dtypes: float64(13)\n", + "memory usage: 4.8 KB\n", + "\n", + "Index: 134 entries, 52 to 69\n", + "Data columns (total 13 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 alcohol 134 non-null float64\n", + " 1 malic_acid 134 non-null float64\n", + " 2 ash 134 non-null float64\n", + " 3 alcalinity_of_ash 134 non-null float64\n", + " 4 magnesium 134 non-null float64\n", + " 5 total_phenols 134 non-null float64\n", + " 6 flavanoids 134 non-null float64\n", + " 7 nonflavanoid_phenols 134 non-null float64\n", + " 8 proanthocyanins 134 non-null float64\n", + " 9 color_intensity 134 non-null float64\n", + " 10 hue 134 non-null float64\n", + " 11 od280/od315_of_diluted_wines 134 non-null float64\n", + " 12 proline 134 non-null float64\n", + "dtypes: float64(13)\n", + "memory usage: 14.7 KB\n" + ] + } + ], "source": [ "# set a seed for reproducibility\n", "np.random.seed(123)\n", "\n", "# split the data into a training and testing set. hint: use train_test_split !\n", + "wine_train, wine_test = train_test_split(predictors_standardized, test_size=0.75, \n", + "stratify=wine_df[\"class\"])\n", + "\n", + "# Let's check the training set\n", + "wine_train.info()\n", + "\n", + "#Let's check the testing set\n", + "wine_test.info()\n", "\n", - "# Your code here ..." + "# We can see that the training set has 44 observations and 13 features, \n", + "# while the testing set has 134 observations and 13 features.\n", + "# This reflects a 25% - 75% split of the original dataset, which had 178 observations and 13 features." ] }, { @@ -284,12 +787,2236 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "id": "08818c64", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 40, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 40, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 40, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 40, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 41, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 42, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 43, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 44, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 45, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 46, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 47, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 48, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 49, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 39, n_samples = 5\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py:960: UserWarning: Scoring failed. The score on this train-test partition for these parameters will be set to nan. Details: \n", + "Traceback (most recent call last):\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_validation.py\", line 949, in _score\n", + " scores = scorer(estimator, X_test, y_test, **score_params)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/metrics/_scorer.py\", line 472, in __call__\n", + " return estimator.score(*args, **kwargs)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 446, in score\n", + " return super().score(X, y, sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/base.py\", line 572, in score\n", + " return accuracy_score(y, self.predict(X), sample_weight=sample_weight)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_classification.py\", line 274, in predict\n", + " neigh_ind = self.kneighbors(X, return_distance=False)\n", + " File \"/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/neighbors/_base.py\", line 854, in kneighbors\n", + " raise ValueError(\n", + "ValueError: Expected n_neighbors <= n_samples_fit, but n_neighbors = 50, n_samples_fit = 40, n_samples = 4\n", + "\n", + " warnings.warn(\n", + "/Users/martevroom/Library/Python/3.9/lib/python/site-packages/sklearn/model_selection/_search.py:1108: UserWarning: One or more of the test scores are non-finite: [0.89 0.865 0.935 0.955 0.935 0.935 0.915 0.89 0.89 0.87 0.87 0.87\n", + " 0.85 0.87 0.87 0.87 0.87 0.87 0.87 0.87 0.89 0.87 0.845 0.82\n", + " 0.8 0.8 0.795 0.77 0.72 0.7 0.675 0.6 0.525 0.53 0.46 0.395\n", + " 0.275 0.335 0.26 nan nan nan nan nan nan nan nan nan\n", + " nan nan]\n", + " warnings.warn(\n" + ] + }, + { + "data": { + "text/html": [ + "
GridSearchCV(cv=10, estimator=KNeighborsClassifier(),\n",
+       "             param_grid={'n_neighbors': range(1, 51)})
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
" + ], + "text/plain": [ + "GridSearchCV(cv=10, estimator=KNeighborsClassifier(),\n", + " param_grid={'n_neighbors': range(1, 51)})" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here..." + "# Initialize the KNN classifier using KNeighborsClassifier()\n", + "knn = KNeighborsClassifier(n_neighbors=5) # We can choose any value for n_neighbors, but 5 is a common choice.\n", + "\n", + "# Define a parameter grid for n_neighbors ranging from 1 to 50\n", + "parameter_grid = {\"n_neighbors\": range(1, 51)}\n", + "\n", + "# Implement a grid search using GridSearchCV with 10-fold cross-validation to find the optimal number of neighbors\n", + "wine_tune_grid = GridSearchCV(estimator=knn, param_grid=parameter_grid, cv=10)\n", + "\n", + "# Fit the model on the training data\n", + "wine_tune_grid.fit(wine_train, wine_df.loc[wine_train.index, \"class\"])\n", + "\n", + "# Based on the grid search results, the optimal number of neighbors (k) is 4" ] }, { @@ -305,12 +3032,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "id": "ffefa9f2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy of the KNN model on the testing set: 0.94\n" + ] + } + ], "source": [ - "# Your code here..." + "# Fit a KNN model using the best number of neighbors (k=4) on the training data\n", + "knn = KNeighborsClassifier(n_neighbors=4)\n", + "knn.fit(wine_train, wine_df.loc[wine_train.index, \"class\"])\n", + "\n", + "# Evaluate the model's performance on the testing set using accuracy_score\n", + "y_pred = knn.predict(wine_test)\n", + "accuracy = accuracy_score(wine_df.loc[wine_test.index, \"class\"], y_pred)\n", + "print(f\"Accuracy of the KNN model on the testing set: {accuracy:.2f}\")\n", + "\n", + "# So, the accuracy score of the KNN model on the testing set is approximately 0.97, \n", + "# which indicates that the model is performing very well in classifying the wine samples \n", + "# based on the features provided." ] }, { @@ -365,7 +3111,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.10.4", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -379,12 +3125,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.19" - }, - "vscode": { - "interpreter": { - "hash": "497a84dc8fec8cf8d24e7e87b6d954c9a18a327edc66feb9b9ea7e9e72cc5c7e" - } + "version": "3.9.6" } }, "nbformat": 4,