forked from kubapok/retroc2
Compare commits
No commits in common. "master" and "master" have entirely different histories.
19
Main.py
19
Main.py
@ -1,19 +0,0 @@
|
|||||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
|
||||||
from sklearn.linear_model import LinearRegression
|
|
||||||
from stop_words import get_stop_words
|
|
||||||
|
|
||||||
import pandas as pd
|
|
||||||
|
|
||||||
meh = TfidfVectorizer(stop_words = get_stop_words('polish'))
|
|
||||||
linReg = LinearRegression()
|
|
||||||
colnames = ['start_date', 'end_date', 'title', 'sort_title', 'data']
|
|
||||||
t = pd.read_csv('test-A/in.tsv', sep = "\t", names = colnames)
|
|
||||||
datFin = pd.read_csv('train/train.tsv', sep = "\t", names = colnames)
|
|
||||||
date = (datFin['start_date'] + datFin['end_date']) / 2
|
|
||||||
trn = meh.fit_transform(datFin['data'])
|
|
||||||
linReg.fit(trn, date)
|
|
||||||
r = meh.transform(t['data'])
|
|
||||||
x = linReg.predict(r)
|
|
||||||
with open('test-A/out.tsv', 'w') as file:
|
|
||||||
for each in x:
|
|
||||||
file.write("%f\n" % each)
|
|
20000
dev-0/out.tsv
20000
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
11563
dev-1/out.tsv
11563
dev-1/out.tsv
File diff suppressed because it is too large
Load Diff
14220
test-A/out.tsv
14220
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
107471
train/meta.tsv
107471
train/meta.tsv
File diff suppressed because it is too large
Load Diff
107471
train/train.tsv
107471
train/train.tsv
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user