Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pickle

app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
model = pickle.load(open('model2.pkl', 'rb'))

@app.route('/')
def home():
Expand Down
Binary file modified model.pkl
Binary file not shown.
19 changes: 12 additions & 7 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

dataset['experience'].fillna(0, inplace=True)

dataset['test_score'].fillna(dataset['test_score'].mean(), inplace=True)
dataset['test_score'].fillna(dataset['test_score'].median(), inplace=True)

X = dataset.iloc[:, :3]

Expand All @@ -25,15 +25,20 @@ def convert_to_int(word):
#Splitting Training and Test Set
#Since we have a very small dataset, we will train our model with all availabe data.

from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
#from sklearn.linear_model import LinearRegression
#regressor = LinearRegression()
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC

#Fitting model with trainig data
regressor.fit(X, y)

#regressor.fit(X, y)
#regressor.score(X, y)
clf = make_pipeline(StandardScaler(), SVC(gamma='auto'))
clf.fit(X, y)
# Saving model to disk
pickle.dump(regressor, open('model.pkl','wb'))
pickle.dump(clf, open('model2.pkl','wb'))

# Loading model to compare the results
model = pickle.load(open('model.pkl','rb'))
model = pickle.load(open('model2.pkl','rb'))
print(model.predict([[2, 9, 6]]))
Binary file added model2.pkl
Binary file not shown.
2 changes: 1 addition & 1 deletion static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body {
width: 100%;
height:100%;
font-family: 'Open Sans', sans-serif;
background: #092756;
background: #1d4852;
color: #fff;
font-size: 18px;
text-align:center;
Expand Down