Skip to content

Commit

Permalink
move joblib files to root
Browse files Browse the repository at this point in the history
  • Loading branch information
dmhliu committed Jul 28, 2020
1 parent 97ecbe9 commit e05799c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
Empty file added Package.json
Empty file.
4 changes: 2 additions & 2 deletions app/api/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ async def dummy_predict(item: Item):

@ router.post('/predict')
async def kpredict(item: Item):
#model = load('/home/dliu/lambda/build/app/api/subreddit_mvp.joblib') # for local debug
#tfidf = load('/home/dliu/lambda/build/app/api/reddit_mvp_tfidf.joblib')
# model = load('/home/dliu/lambda/build/app/api/subreddit_mvp.joblib') # for local debug
# tfidf = load('/home/dliu/lambda/build/app/api/reddit_mvp_tfidf.joblib')
model = load('subreddit_mvp.joblib')
tfidf = load('reddit_mvp_tfidf.joblib')

Expand Down
45 changes: 41 additions & 4 deletions notebooks/selftext_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"metadata": {},
"outputs": [
{
Expand All @@ -383,8 +383,33 @@
"output_type": "stream",
"text": [
"[Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.\n",
"[Parallel(n_jobs=-1)]: Done 2 tasks | elapsed: 58.4min\n"
"[Parallel(n_jobs=-1)]: Done 2 tasks | elapsed: 58.4min\n",
"[Parallel(n_jobs=-1)]: Done 22 out of 30 | elapsed: 212.9min remaining: 77.4min\n",
"[Parallel(n_jobs=-1)]: Done 30 out of 30 | elapsed: 270.0min finished\n"
]
},
{
"data": {
"text/plain": [
"RandomizedSearchCV(cv=3, error_score=nan,\n",
" estimator=SVC(C=1.0, break_ties=False, cache_size=200,\n",
" class_weight=None, coef0=0.0,\n",
" decision_function_shape='ovr', degree=3,\n",
" gamma='scale', kernel='rbf', max_iter=-1,\n",
" probability=False, random_state=8,\n",
" shrinking=True, tol=0.001, verbose=False),\n",
" iid='deprecated', n_iter=10, n_jobs=-1,\n",
" param_distributions={'C': [0.01, 0.1], 'degree': [3, 4, 5],\n",
" 'gamma': [0.001, 0.01, 0.1, 1, 10],\n",
" 'kernel': ['linear', 'poly'],\n",
" 'probability': [True]},\n",
" pre_dispatch='2*n_jobs', random_state=8, refit=True,\n",
" return_train_score=False, scoring='accuracy', verbose=5)"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
Expand All @@ -405,9 +430,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The best hyperparameters from Random Search are:\n",
"{'probability': True, 'kernel': 'poly', 'gamma': 10, 'degree': 3, 'C': 0.1}\n",
"\n",
"The mean accuracy of a model with these hyperparameters is:\n",
"0.019743336623889437\n"
]
}
],
"source": [
"\n",
"print(\"The best hyperparameters from Random Search are:\")\n",
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit e05799c

Please sign in to comment.