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
3e1adcd1
Unverified
Commit
3e1adcd1
authored
Aug 21, 2018
by
Dr.李
Committed by
GitHub
Aug 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from iLampard/master
Add Tensorflow notebook example
parents
20cc62c1
8c83fcda
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1058 additions
and
2 deletions
+1058
-2
data_preparing.py
alphamind/model/data_preparing.py
+8
-2
Example 14 - Deep Learning Model Prediction - Tensorflow Application.ipynb
... Learning Model Prediction - Tensorflow Application.ipynb
+542
-0
Example 15 - Deep Learning Model Prediction - Keras Application.ipynb
... Deep Learning Model Prediction - Keras Application.ipynb
+508
-0
No files found.
alphamind/model/data_preparing.py
View file @
3e1adcd1
...
@@ -176,7 +176,10 @@ def batch_processing(names,
...
@@ -176,7 +176,10 @@ def batch_processing(names,
inner_left_index
=
bisect
.
bisect_left
(
sub_dates
,
end
)
inner_left_index
=
bisect
.
bisect_left
(
sub_dates
,
end
)
inner_right_index
=
bisect
.
bisect_right
(
sub_dates
,
end
)
inner_right_index
=
bisect
.
bisect_right
(
sub_dates
,
end
)
predict_x_buckets
[
end
]
=
pd
.
DataFrame
(
ne_x
[
inner_left_index
:
inner_right_index
],
columns
=
names
)
predict_x_buckets
[
end
]
=
pd
.
DataFrame
(
ne_x
[
inner_left_index
:
inner_right_index
],
columns
=
names
)
predict_risk_buckets
[
end
]
=
this_risk_exp
[
inner_left_index
:
inner_right_index
]
if
risk_exp
is
not
None
:
predict_risk_buckets
[
end
]
=
this_risk_exp
[
inner_left_index
:
inner_right_index
]
else
:
predict_risk_buckets
=
None
predict_codes_bucket
[
end
]
=
this_codes
[
inner_left_index
:
inner_right_index
]
predict_codes_bucket
[
end
]
=
this_codes
[
inner_left_index
:
inner_right_index
]
this_raw_y
=
y_values
[
left_index
:
right_index
]
this_raw_y
=
y_values
[
left_index
:
right_index
]
...
@@ -262,7 +265,10 @@ def fetch_data_package(engine: SqlEngine,
...
@@ -262,7 +265,10 @@ def fetch_data_package(engine: SqlEngine,
predict_x_buckets
=
{
k
:
predict_x_buckets
[
k
]
for
k
in
predict_x_buckets
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
predict_x_buckets
=
{
k
:
predict_x_buckets
[
k
]
for
k
in
predict_x_buckets
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
predict_y_buckets
=
{
k
:
predict_y_buckets
[
k
]
for
k
in
predict_y_buckets
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
predict_y_buckets
=
{
k
:
predict_y_buckets
[
k
]
for
k
in
predict_y_buckets
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
predict_risk_buckets
=
{
k
:
predict_risk_buckets
[
k
]
for
k
in
predict_risk_buckets
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
if
neutralized_risk
:
predict_risk_buckets
=
{
k
:
predict_risk_buckets
[
k
]
for
k
in
predict_risk_buckets
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
else
:
predict_risk_buckets
=
None
predict_codes_bucket
=
{
k
:
predict_codes_bucket
[
k
]
for
k
in
predict_codes_bucket
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
predict_codes_bucket
=
{
k
:
predict_codes_bucket
[
k
]
for
k
in
predict_codes_bucket
if
k
.
strftime
(
'
%
Y-
%
m-
%
d'
)
>=
start_date
}
ret
[
'train'
]
=
{
'x'
:
train_x_buckets
,
'y'
:
train_y_buckets
,
'risk'
:
train_risk_buckets
}
ret
[
'train'
]
=
{
'x'
:
train_x_buckets
,
'y'
:
train_y_buckets
,
'risk'
:
train_risk_buckets
}
...
...
notebooks/Example 14 - Deep Learning Model Prediction - Tensorflow Application.ipynb
0 → 100644
View file @
3e1adcd1
This diff is collapsed.
Click to expand it.
notebooks/Example 15 - Deep Learning Model Prediction - Keras Application.ipynb
0 → 100644
View file @
3e1adcd1
This diff is collapsed.
Click to expand it.
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