Compare commits

...

1 Commits

Author SHA1 Message Date
Jan Przybylski
664548c299 update 2021-04-26 21:38:04 +02:00
4 changed files with 2048 additions and 0 deletions

1000
dev-0/out.tsv Normal file

File diff suppressed because it is too large Load Diff

24
program-dev0.py Normal file
View File

@ -0,0 +1,24 @@
import numpy as np
from sklearn import preprocessing
from sklearn.pipeline import make_pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LinearRegression
from sklearn import linear_model
import pandas as pd
train=pd.read_csv('train/train.tsv',sep='\t',names=['price','mileage','year','brand','engineType','engineCapacity'])
df = pd.DataFrame(train,columns=['price','mileage','year','brand','engineType','engineCapacity'])
Y=df[['price']]
X=df[['year','mileage','engineCapacity']]
reg = linear_model.LinearRegression()
reg.fit(X, Y)
inn=pd.read_csv('dev-0/in.tsv',sep='\t',names=['mileage','year','brand','engineType','engineCapacity'])
df = pd.DataFrame(inn,columns=['mileage','year','brand','engineType','engineCapacity'])
r=df[['year','mileage','engineCapacity']]
y_pred=reg.predict(r)
y_pred=np.concatenate(y_pred)
t=np.array2string(y_pred, precision=5, separator='\n',suppress_small=True)
t=t.lstrip('[').rstrip(']')
f = open("dev-0/out.tsv", "a")
f.write(t)

24
program-testA.py Normal file
View File

@ -0,0 +1,24 @@
import numpy as np
from sklearn import preprocessing
from sklearn.pipeline import make_pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LinearRegression
from sklearn import linear_model
import pandas as pd
train=pd.read_csv('train/train.tsv',sep='\t',names=['price','mileage','year','brand','engineType','engineCapacity'])
df = pd.DataFrame(train,columns=['price','mileage','year','brand','engineType','engineCapacity'])
Y=df[['price']]
X=df[['year','mileage','engineCapacity']]
reg = linear_model.LinearRegression()
reg.fit(X, Y)
inn=pd.read_csv('test-A/in.tsv',sep='\t',names=['mileage','year','brand','engineType','engineCapacity'])
df = pd.DataFrame(inn,columns=['mileage','year','brand','engineType','engineCapacity'])
r=df[['year','mileage','engineCapacity']]
y_pred=reg.predict(r)
y_pred=np.concatenate(y_pred)
t=np.array2string(y_pred, precision=5, separator='\n',suppress_small=True)
t=t.lstrip('[').rstrip(']')
f = open("test-A/out.tsv", "a")
f.write(t)

1000
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff