prob
This commit is contained in:
parent
9124afa7e9
commit
a436681bec
5273
dev-0/out.tsv
Normal file
5273
dev-0/out.tsv
Normal file
File diff suppressed because it is too large
Load Diff
25
predict_rm.py
Normal file
25
predict_rm.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
import csv
|
||||||
|
import pickle
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
def predict():
|
||||||
|
dev0 = pd.read_csv("dev-0/in.tsv", delimiter="\t", header=None, names=["document","date"], quoting=csv.QUOTE_NONE)["document"]
|
||||||
|
testA = pd.read_csv("test-A/in.tsv", delimiter="\t", header=None, names=["document","date"], quoting=csv.QUOTE_NONE)["document"]
|
||||||
|
|
||||||
|
clf = pickle.load(open("clf.model", "rb"))
|
||||||
|
vectorizer = pickle.load(open("vectorizer.model", "rb"))
|
||||||
|
|
||||||
|
dev0_vectorizer = vectorizer.transform(dev0)
|
||||||
|
testA_vectorizer = vectorizer.transform(testA)
|
||||||
|
|
||||||
|
y_dev = clf.predict_proba(dev0_vectorizer)[:, 1]
|
||||||
|
y_test = clf.predict_proba(testA_vectorizer)[:, 1]
|
||||||
|
|
||||||
|
np.savetxt('test-A/out.tsv', y_test, '%f')
|
||||||
|
np.savetxt('dev-0/out.tsv', y_dev, '%f')
|
||||||
|
|
||||||
|
predict()
|
||||||
|
|
5153
test-A/out.tsv
Normal file
5153
test-A/out.tsv
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user