Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

6 changed files with 0 additions and 153284 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
geval

Binary file not shown.

View File

@ -1,30 +0,0 @@
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LinearRegression
import numpy as np
import pandas as pd
import csv
def getData(path):
with open(path, encoding="utf-8") as source:
return source.readlines()
def changeToDf(input):
return pd.read_csv(input, sep="\t")
vectorizer = TfidfVectorizer()
linear = LinearRegression()
train = pd.read_csv("./train/train.tsv", sep="\t", names=['start_date', 'end_date', 'title', 'sort_title', 'data'])
mean = (train['start_date'] + train['end_date']) / 2
tv = vectorizer.fit_transform(train['data'])
linear.fit(tv, mean)
def calculateResult(in_, out):
tmp = getData(in_)
df = pd.DataFrame(data = tmp)
data = vectorizer.transform(df[0])
evaluate = linear.predict(data)
np.savetxt(out, evaluate, fmt='%f', delimiter='\n')
calculateResult("./dev-0/in.tsv", "./dev-0/out.tsv")
calculateResult("./dev-1/in.tsv", "./dev-1/out.tsv")
calculateResult("./test-A/in.tsv", "./test-A/out.tsv")

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long