This commit is contained in:
Jan Przybylski 2021-05-07 17:32:24 +02:00
parent 647c099815
commit dd7b246c4e
4 changed files with 45803 additions and 0 deletions

20000
dev-0/out.tsv Normal file

File diff suppressed because it is too large Load Diff

11563
dev-1/out.tsv Normal file

File diff suppressed because it is too large Load Diff

20
program.py Normal file
View File

@ -0,0 +1,20 @@
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LinearRegression
from stop_words import get_stop_words
import pandas as pd
vectorizer = TfidfVectorizer(stop_words=get_stop_words('polish'))
reg = LinearRegression()
colnames = ['start_date', 'end_date', 'title', 'sort_title', 'data']
t = pd.read_csv('test-A/in.tsv', sep="\t", names=colnames)
df = pd.read_csv('train/train.tsv', sep="\t", names=colnames)
date = (df['start_date'] + df['end_date']) / 2
train = vectorizer.fit_transform(df['data'])
reg.fit(train, date)
r = vectorizer.transform(t['data'])
pred = reg.predict(r)
with open('test-A/out.tsv', 'w') as file:
for e in pred:
file.write("%f\n" % e)

14220
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff