Skip to content

Commit 386cad5

Browse files
committed
do not use cache for knn model
1 parent 3c9c664 commit 386cad5

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

jupyter-notebooks/crop-classification/segment-knn.ipynb

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@
690690
"source": [
691691
"Finally, we fit the classifier.\n",
692692
"\n",
693-
"By default, the classifier is loaded from cache to save processing time. "
693+
"We do not use cache for this model because the saved model is so bit (350M) and it does not take long to fit the model."
694694
]
695695
},
696696
{
@@ -713,33 +713,14 @@
713713
},
714714
{
715715
"cell_type": "code",
716-
"execution_count": 21,
717-
"metadata": {},
718-
"outputs": [],
719-
"source": [
720-
"clf_cache_file = os.path.join('pre-data', 'segment-knn-clf.sav')\n",
721-
"\n",
722-
"load_clf = True\n",
723-
"if load_clf:\n",
724-
" assert os.path.isfile(clf_cache_file)\n",
725-
" clf = pickle.load(open(clf_cache_file, 'rb'))\n",
726-
"else:\n",
727-
" clf = fit_classifier(train_scene_filename,\n",
728-
" train_ground_truth_filename,\n",
729-
" train_metadata_filename,\n",
730-
" n_neighbors)"
731-
]
732-
},
733-
{
734-
"cell_type": "code",
735-
"execution_count": 22,
716+
"execution_count": 25,
736717
"metadata": {},
737718
"outputs": [],
738719
"source": [
739-
"# optionally save ps clf model\n",
740-
"save_clf = False\n",
741-
"if save_clf:\n",
742-
" pickle.dump(clf, open(clf_cache_file, 'wb'))"
720+
"clf = fit_classifier(train_scene_filename,\n",
721+
" train_ground_truth_filename,\n",
722+
" train_metadata_filename,\n",
723+
" n_neighbors)"
743724
]
744725
},
745726
{

0 commit comments

Comments
 (0)