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
4d6de4ea
Commit
4d6de4ea
authored
May 10, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/wegamekinglc/alpha-mind
parents
4faceefc
62f5ccf7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
47 deletions
+20
-47
.travis.yml
.travis.yml
+4
-4
README.md
README.md
+16
-1
standardize.py
alphamind/data/standardize.py
+0
-10
winsorize.py
alphamind/data/winsorize.py
+0
-12
percentbuilder.py
alphamind/portfolio/percentbuilder.py
+0
-1
rankbuilder.py
alphamind/portfolio/rankbuilder.py
+0
-11
simplesettle.py
alphamind/settlement/simplesettle.py
+0
-8
No files found.
.travis.yml
View file @
4d6de4ea
...
...
@@ -37,15 +37,15 @@ install:
-
conda install pandas
-
conda install cython
-
conda install scikit-learn
-
pip install coveralls
-
pip install cvxopt
-
pip install cvxpy
-
pip install simpleutils
# command to run test
s
-
pip install coverall
s
script
:
-
python setup.py build_ext --inplace
-
export NUMBA_DISABLE_JIT=1
-
python setup.py build_ext --line_trace --inplace
-
coverage run --rcfile=./.coveragerc alphamind/tests/test_suite.py
-
coverage report --rcfile=./.coveragerc -i
-
coverage html --rcfile=./.coveragerc -i
after_success
:
-
coveralls
\ No newline at end of file
-
coveralls
README.md
View file @
4d6de4ea
# Alpha - Mind
\ No newline at end of file
# Alpha - Mind
<table>
<tr>
<td>
Build Status
</td>
<td>
<a
href=
"https://travis-ci.org/wegamekinglc/alpha-mind"
>
<img
src=
"https://travis-ci.org/wegamekinglc/alpha-mind.svg?branch=master"
alt=
"travis build status"
/>
</a>
</td>
</tr>
<tr>
<td>
Coverage
</td>
<td><img
src=
"https://coveralls.io/repos/github/wegamekinglc/alpha-mind/badge.svg?branch=master"
alt=
"coverage"
/></td>
</tr>
</table>
alphamind/data/standardize.py
View file @
4d6de4ea
...
...
@@ -22,13 +22,3 @@ def standardize(x: np.ndarray, groups: np.ndarray=None, ddof=1) -> np.ndarray:
return
(
x
-
mean_values
)
/
std_values
else
:
return
(
x
-
simple_mean
(
x
,
axis
=
0
))
/
simple_std
(
x
,
axis
=
0
)
if
__name__
==
'__main__'
:
import
pandas
as
pd
df
=
pd
.
read_csv
(
'd:/test_data.csv'
,
index_col
=
0
)
x
=
df
.
values
groups
=
df
.
index
.
values
.
astype
(
int
)
standardize
(
x
,
groups
)
alphamind/data/winsorize.py
View file @
4d6de4ea
...
...
@@ -63,15 +63,3 @@ def winsorize_normal(x: np.ndarray, num_stds: int = 3, groups: np.ndarray = None
mean_values
=
simple_mean
(
x
,
axis
=
0
)
res
=
mask_values_1d
(
x
,
mean_values
,
std_values
,
num_stds
)
return
res
if
__name__
==
'__main__'
:
x
=
np
.
random
.
randn
(
3000
,
10
)
groups
=
np
.
random
.
randint
(
0
,
20
,
size
=
3000
)
import
datetime
as
dt
start
=
dt
.
datetime
.
now
()
for
_
in
range
(
3000
):
winsorize_normal
(
x
,
2
,
groups
)
print
(
dt
.
datetime
.
now
()
-
start
)
alphamind/portfolio/percentbuilder.py
View file @
4d6de4ea
...
...
@@ -46,4 +46,3 @@ def percent_build(er: np.ndarray, percent: float, groups: np.ndarray=None) -> np
use_rank
=
int
(
percent
*
len
(
neg_er
))
set_value
(
weights
,
ordering
[:
use_rank
],
1.
)
return
weights
alphamind/portfolio/rankbuilder.py
View file @
4d6de4ea
...
...
@@ -42,14 +42,3 @@ def rank_build(er: np.ndarray, use_rank: int, groups: np.ndarray=None) -> np.nda
ordering
=
neg_er
.
argsort
(
axis
=
0
)
set_value
(
weights
,
ordering
[:
use_rank
],
1.
)
return
weights
if
__name__
==
'__main__'
:
n_sample
=
6
n_groups
=
3
x
=
np
.
random
.
randn
(
n_sample
)
groups
=
np
.
array
([
1
,
1
,
2
,
1
,
0
,
2
])
print
(
groups
)
print
(
groupby
(
groups
))
print
(
rank_build
(
x
,
1
,
groups
))
\ No newline at end of file
alphamind/settlement/simplesettle.py
View file @
4d6de4ea
...
...
@@ -24,11 +24,3 @@ def simple_settle(weights: np.ndarray, ret_series: np.ndarray, groups: np.ndarra
if
ret_mat
.
ndim
==
1
:
ret_mat
=
ret_mat
.
reshape
((
-
1
,
1
))
return
simple_sum
(
ret_mat
,
axis
=
0
)
if
__name__
==
'__main__'
:
from
alphamind.aggregate
import
group_mapping_test
s
=
np
.
random
.
randint
(
2
,
5
,
size
=
6
)
print
(
s
)
print
(
group_mapping_test
(
s
))
\ No newline at end of file
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