This commit is contained in:
Sebastian 2022-05-18 00:53:58 +02:00
parent f6a8309517
commit 3ade31cf7d
5 changed files with 34229 additions and 34229 deletions

View File

@ -44,7 +44,7 @@
"source": [
"train = pd.read_csv('train/train.tsv', header=None, sep='\\t', error_bad_lines=False)\n",
"print(len(train))\n",
"train = train.head(40000)"
"train = train.head(10000)"
]
},
{
@ -122,7 +122,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"4289.2810262872745\n"
"4086.3369441409172\n"
]
}
],

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@
"source": [
"train = pd.read_csv('train/train.tsv', header=None, sep='\\t', error_bad_lines=False)\n",
"print(len(train))\n",
"train = train.head(40000)"
"train = train.head(10000)"
]
},
{
@ -122,7 +122,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"4289.2810262872745\n"
"4086.3369441409172\n"
]
}
],

10
run.py
View File

@ -39,14 +39,14 @@ x_dev[20000] = "a ten tekst jest najbardziej testowy"
y_dev = pd.read_csv('dev-0/expected.tsv', header=None, sep='\t')
# In[ ]:
# In[5]:
model = make_pipeline(TfidfVectorizer(), LinearRegression())
model.fit(x_train, y_train)
# In[ ]:
# In[6]:
dev_predicted = model.predict(x_dev)
@ -59,13 +59,13 @@ dev_out = pd.read_csv('dev-0/out.tsv', header=None, sep='\t')
dev_expected = pd.read_csv('dev-0/expected.tsv', header=None, sep='\t')
# In[ ]:
# In[7]:
print(mean_squared_error(dev_out, dev_expected))
# In[ ]:
# In[8]:
with open('test-A/in.tsv', 'r', encoding = 'utf-8') as f:
@ -81,7 +81,7 @@ with open('test-A/out.tsv', 'wt') as f:
f.write(str(i)+'\n')
# In[ ]:
# In[9]:
get_ipython().system('jupyter nbconvert --to script run.ipynb')

File diff suppressed because it is too large Load Diff