Commit 6c383e0e authored by Dr.李's avatar Dr.李

update data implementation

parent 4a6cf837
......@@ -858,6 +858,7 @@ class Models(Base):
model_version = Column(BigInteger, nullable=False)
update_time = Column(DateTime, nullable=False)
model_desc = Column(JSONB, nullable=False)
data_meta = Column(JSONB, nullable=True)
is_primary = Column(Boolean)
model_id = Column(Integer, primary_key=True, autoincrement=True)
......
......@@ -57,7 +57,7 @@ class ConstLinearModel(ModelBase):
class LinearRegression(ModelBase):
def __init__(self, features: list = None, fit_intercept: bool = False, **kwargs):
def __init__(self, features=None, fit_intercept: bool = False, **kwargs):
super().__init__(features)
self.impl = LinearRegressionImpl(fit_intercept=fit_intercept, **kwargs)
......@@ -84,7 +84,7 @@ class LinearRegression(ModelBase):
class LassoRegression(ModelBase):
def __init__(self, alpha=0.01, features: list = None, fit_intercept: bool = False, **kwargs):
def __init__(self, alpha=0.01, features=None, fit_intercept: bool = False, **kwargs):
super().__init__(features)
self.impl = Lasso(alpha=alpha, fit_intercept=fit_intercept, **kwargs)
......@@ -111,7 +111,7 @@ class LassoRegression(ModelBase):
class LogisticRegression(ModelBase):
def __init__(self, features: list = None, fit_intercept: bool = False, **kwargs):
def __init__(self, features=None, fit_intercept: bool = False, **kwargs):
super().__init__(features)
self.impl = LogisticRegressionImpl(fit_intercept=fit_intercept, **kwargs)
......
......@@ -5,7 +5,6 @@ Created on 2017-12-4
@author: cheng.li
"""
from typing import List
from distutils.version import LooseVersion
import arrow
import numpy as np
......@@ -27,7 +26,7 @@ class RandomForestRegressor(ModelBase):
def __init__(self,
n_estimators: int=100,
max_features: str='auto',
features: List=None,
features=None,
**kwargs):
super().__init__(features)
self.impl = RandomForestRegressorImpl(n_estimators=n_estimators,
......@@ -59,7 +58,7 @@ class RandomForestClassifier(ModelBase):
def __init__(self,
n_estimators: int=100,
max_features: str='auto',
features: List = None,
features=None,
**kwargs):
super().__init__(features)
self.impl = RandomForestClassifierImpl(n_estimators=n_estimators,
......@@ -92,7 +91,7 @@ class XGBRegressor(ModelBase):
n_estimators: int=100,
learning_rate: float=0.1,
max_depth: int=3,
features: List=None,
features=None,
n_jobs: int=1,
**kwargs):
super().__init__(features)
......@@ -171,7 +170,7 @@ class XGBTrainer(ModelBase):
early_stopping_rounds=None,
subsample=1.,
colsample_bytree=1.,
features: List = None,
feature=None,
random_state: int=0,
n_jobs: int=1,
**kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment