update
This commit is contained in:
parent
3e252b2968
commit
c35c5819c9
@ -3,7 +3,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"id": "5e807436",
|
||||
"id": "c333fcd7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -15,7 +15,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"id": "fa414610",
|
||||
"id": "e550c221",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -36,7 +36,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"id": "180143ed",
|
||||
"id": "57585a3e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -57,8 +57,8 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"id": "3f5ddebd",
|
||||
"execution_count": 35,
|
||||
"id": "a3a5ea9a",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -88,7 +88,7 @@
|
||||
" \n",
|
||||
"data['train_input'] = data.apply(lambda row: to_vowpalwabbit(row, categories), axis=1)\n",
|
||||
"\n",
|
||||
"model = vowpalwabbit.Workspace('--oaa 7 --learning_rate 0.5')\n",
|
||||
"model = vowpalwabbit.Workspace('--oaa 7 --learning_rate 0.95')\n",
|
||||
"\n",
|
||||
"for example in data['train_input']:\n",
|
||||
" model.learn(example)\n",
|
||||
@ -100,8 +100,8 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"id": "5c1c1cb1",
|
||||
"execution_count": 36,
|
||||
"id": "ee80e14d",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -109,7 +109,7 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[NbConvertApp] Converting notebook run.ipynb to script\n",
|
||||
"[NbConvertApp] Writing 1950 bytes to run.py\n"
|
||||
"[NbConvertApp] Writing 1951 bytes to run.py\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
1098
dev-0/out.tsv
1098
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
18
run.ipynb
18
run.ipynb
@ -3,7 +3,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"id": "5e807436",
|
||||
"id": "c333fcd7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -15,7 +15,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"id": "fa414610",
|
||||
"id": "e550c221",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -36,7 +36,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"id": "180143ed",
|
||||
"id": "57585a3e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -57,8 +57,8 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"id": "3f5ddebd",
|
||||
"execution_count": 35,
|
||||
"id": "a3a5ea9a",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -88,7 +88,7 @@
|
||||
" \n",
|
||||
"data['train_input'] = data.apply(lambda row: to_vowpalwabbit(row, categories), axis=1)\n",
|
||||
"\n",
|
||||
"model = vowpalwabbit.Workspace('--oaa 7 --learning_rate 0.5')\n",
|
||||
"model = vowpalwabbit.Workspace('--oaa 7 --learning_rate 0.95')\n",
|
||||
"\n",
|
||||
"for example in data['train_input']:\n",
|
||||
" model.learn(example)\n",
|
||||
@ -100,8 +100,8 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"id": "5c1c1cb1",
|
||||
"execution_count": 36,
|
||||
"id": "ee80e14d",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -109,7 +109,7 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[NbConvertApp] Converting notebook run.ipynb to script\n",
|
||||
"[NbConvertApp] Writing 1950 bytes to run.py\n"
|
||||
"[NbConvertApp] Writing 1951 bytes to run.py\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
6
run.py
6
run.py
@ -44,7 +44,7 @@ def to_vowpalwabbit(row, categories):
|
||||
return vw
|
||||
|
||||
|
||||
# In[31]:
|
||||
# In[ ]:
|
||||
|
||||
|
||||
x_train = pd.read_csv('train/in.tsv', header=None, sep='\t')
|
||||
@ -65,7 +65,7 @@ print(categories)
|
||||
|
||||
data['train_input'] = data.apply(lambda row: to_vowpalwabbit(row, categories), axis=1)
|
||||
|
||||
model = vowpalwabbit.Workspace('--oaa 7 --learning_rate 0.5')
|
||||
model = vowpalwabbit.Workspace('--oaa 7 --learning_rate 0.95')
|
||||
|
||||
for example in data['train_input']:
|
||||
model.learn(example)
|
||||
@ -75,7 +75,7 @@ prediction('test-A/in.tsv', 'test-A/out.tsv', model, categories)
|
||||
prediction('test-B/in.tsv', 'test-B/out.tsv', model, categories)
|
||||
|
||||
|
||||
# In[32]:
|
||||
# In[34]:
|
||||
|
||||
|
||||
get_ipython().system('jupyter nbconvert --to script run.ipynb')
|
||||
|
1130
test-A/out.tsv
1130
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
614
test-B/out.tsv
614
test-B/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user