Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assignment_2/ass2_notes.ipynb

Large diffs are not rendered by default.

54 changes: 51 additions & 3 deletions assignment_2/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"from sklearn import svm, datasets\n",
"import sklearn.model_selection as model_selection\n",
"from sklearn.metrics import accuracy_score\n",
"from sklearn.metrics import f1_score\n"
"from sklearn.metrics import f1_score\n",
"import pandas as pd\n",
"import numpy as np"
]
},
{
Expand Down Expand Up @@ -187,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -390,6 +392,52 @@
"print('Accuracy(Polynomial Kernel):{:.2f}'.format(poly_accuracy*100))\n",
"print('F1(Polynomial Kernel):{:.2f}'.format(poly_f1*100))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 200., 400., 600., 800., 1000., 1200., 1400., 1600., 1800.,\n",
" 2000.])"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.linspace(start=200,stop=2000,num=10)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0.025, 0.05 , 0.075, 0.1 , 0.125, 0.15 , 0.175, 0.2 , 0.225,\n",
" 0.25 , 0.275, 0.3 , 0.325, 0.35 , 0.375, 0.4 , 0.425, 0.45 ,\n",
" 0.475, 0.5 , 0.525, 0.55 , 0.575, 0.6 , 0.625, 0.65 , 0.675,\n",
" 0.7 , 0.725, 0.75 , 0.775, 0.8 , 0.825, 0.85 , 0.875, 0.9 ,\n",
" 0.925, 0.95 , 0.975])"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_size = np.arange(0.025,1,0.025)\n",
"train_size"
]
}
],
"metadata": {
Expand Down