-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
56 lines (45 loc) · 1.54 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from sqlalchemy import Column, Float, Integer, String
from sqlalchemy.orm import declarative_base
Base = declarative_base()
class LinearRegressionPredictionTable(Base):
"""Table for storing features with corresponding predictions for Linear Regression model."""
__tablename__ = 'linear_regression_prediction'
id = Column(Integer, primary_key=True, autoincrement=True)
fid = Column(String)
# Numerical features
fat = Column(Float)
saturatedFat = Column(Float)
transFat = Column(Float)
cholesterol = Column(Float)
sodium = Column(Float)
carbohydrates = Column(Float)
fiber = Column(Float)
sugars = Column(Float)
protein = Column(Float)
calcium = Column(Float)
iron = Column(Float)
potassium = Column(Float)
calories = Column(Float)
score = Column(Float)
predictions = Column(Float)
class XGBoostPredictionTable(Base):
"""Table for storing features with corresponding predictions for XGBoost model."""
__tablename__ = 'xgboost_prediction'
id = Column(Integer, primary_key=True, autoincrement=True)
fid = Column(String)
# Numerical features
fat = Column(Float)
saturatedFat = Column(Float)
transFat = Column(Float)
cholesterol = Column(Float)
sodium = Column(Float)
carbohydrates = Column(Float)
fiber = Column(Float)
sugars = Column(Float)
protein = Column(Float)
calcium = Column(Float)
iron = Column(Float)
potassium = Column(Float)
calories = Column(Float)
score = Column(Float)
predictions = Column(Float)