Compare commits

..

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

4 changed files with 0 additions and 2037 deletions

37
app.py
View File

@ -1,37 +0,0 @@
import gzip
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.utils import shuffle
from sklearn.metrics import accuracy_score
def preprocess(x):
x = pd.concat([x, x['engineType'].str.get_dummies().astype(bool)], axis=1)
x = x.drop(['engineType', 'brand'], axis=1)
return x
def makePrediction(path):
x_pred = pd.read_table(path + '/in.tsv', error_bad_lines=False, header=None,
names=names[1:])
x_pred = preprocess(x_pred)
y_pred = model.predict(x_pred)
y_pred.tofile(path + '/out.tsv', sep='\n')
names = ['price', 'mileage', 'year', 'brand', 'engineType', 'engineCap']
train = pd.read_table('train/train.tsv', error_bad_lines=False, header=None,
names=names)
y_train = train['price']
x_train = train.iloc[:, 1:]
x_train = preprocess(x_train)
model = LinearRegression()
model.fit(x_train, y_train)
makePrediction('dev-0')
makePrediction('test-A')

File diff suppressed because it is too large Load Diff

BIN
geval

Binary file not shown.

File diff suppressed because it is too large Load Diff