Commit 4d6de4ea authored by Dr.李's avatar Dr.李
parents 4faceefc 62f5ccf7
......@@ -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 tests
- pip install coveralls
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
# 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>
......@@ -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)
......@@ -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)
......@@ -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
......@@ -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
......@@ -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
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