Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
6c383e0e
Commit
6c383e0e
authored
Feb 12, 2018
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update data implementation
parent
4a6cf837
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
models.py
alphamind/data/dbmodel/models.py
+1
-0
linearmodel.py
alphamind/model/linearmodel.py
+3
-3
treemodel.py
alphamind/model/treemodel.py
+4
-5
No files found.
alphamind/data/dbmodel/models.py
View file @
6c383e0e
...
...
@@ -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
)
...
...
alphamind/model/linearmodel.py
View file @
6c383e0e
...
...
@@ -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
)
...
...
alphamind/model/treemodel.py
View file @
6c383e0e
...
...
@@ -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.
,
feature
s
:
List
=
None
,
feature
=
None
,
random_state
:
int
=
0
,
n_jobs
:
int
=
1
,
**
kwargs
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment