coinsignal 1.3.4__cp312-cp312-win_amd64.whl → 1.4.10__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- coinsignal/__init__.py +1 -1
- coinsignal/_ext.pyd +0 -0
- coinsignal/data.py +4 -2
- coinsignal/feature.py +21 -16
- coinsignal/label.py +8 -5
- coinsignal/model.py +5 -2
- coinsignal/parallel.py +6 -1
- coinsignal/sampler.py +3 -15
- coinsignal/tools.py +3 -8
- {coinsignal-1.3.4.dist-info → coinsignal-1.4.10.dist-info}/METADATA +1 -1
- coinsignal-1.4.10.dist-info/RECORD +14 -0
- coinsignal-1.3.4.dist-info/RECORD +0 -14
- {coinsignal-1.3.4.dist-info → coinsignal-1.4.10.dist-info}/WHEEL +0 -0
- {coinsignal-1.3.4.dist-info → coinsignal-1.4.10.dist-info}/top_level.txt +0 -0
coinsignal/__init__.py
CHANGED
coinsignal/_ext.pyd
CHANGED
|
Binary file
|
coinsignal/data.py
CHANGED
|
@@ -24,7 +24,9 @@ DEFAULT_DATA_PARAMS_DICT = {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def read_data_to_features_map(data_dir, date, look_back_days, look_ahead_days, data_params_dict):
|
|
27
|
-
|
|
27
|
+
features_map, read_data_errors = _data.read_data_to_features_map(data_dir, date, look_back_days, look_ahead_days, data_params_dict)
|
|
28
|
+
return features_map, read_data_errors
|
|
28
29
|
|
|
29
30
|
def transform_features_map_to_full_features_df(features_map):
|
|
30
|
-
|
|
31
|
+
full_features_df = _data.transform_features_map_to_full_features_df(features_map)
|
|
32
|
+
return full_features_df
|
coinsignal/feature.py
CHANGED
|
@@ -12,23 +12,28 @@ import _ext.feature as _feature
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
DEFAULT_FEATURE_PARAMS_DICT = {
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
'features':
|
|
16
|
+
{
|
|
17
|
+
'time': [],
|
|
18
|
+
'macd': [],
|
|
19
|
+
'rsi': [],
|
|
20
|
+
'price_move_range': [],
|
|
21
|
+
'price_trend': [],
|
|
22
|
+
'price_volume_corr': [],
|
|
23
|
+
'ohlcv': [],
|
|
24
|
+
'volatility': [],
|
|
25
|
+
'high_low_time': [],
|
|
26
|
+
'volume': [],
|
|
27
|
+
'basis': [],
|
|
28
|
+
'fixedstart': [],
|
|
29
|
+
'funding_rate': [],
|
|
30
|
+
'funding_time': [],
|
|
31
|
+
'index': []
|
|
32
|
+
},
|
|
33
|
+
'is_validating': False
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
def add_features(features_map, feature_params_dict):
|
|
34
|
-
|
|
38
|
+
features_map = _feature.add_features(features_map, feature_params_dict)
|
|
39
|
+
return features_map
|
coinsignal/label.py
CHANGED
|
@@ -14,22 +14,25 @@ import _ext.label as _label
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
DEFAULT_RETURN_PARAMS_DICT = {
|
|
17
|
-
'
|
|
17
|
+
'pred_horizons': [600],
|
|
18
18
|
'decay_multipliers': [0.5, 0.8, 1, 1.5, 2, 3, 5, 10],
|
|
19
19
|
'return_type': 'time',
|
|
20
|
+
'range_direction': 'forward',
|
|
21
|
+
'range_horizon_limits': [0, 1000],
|
|
20
22
|
'range_merge_step': 1,
|
|
21
|
-
'horizon_limit': 1,
|
|
22
23
|
'n_multi': 1,
|
|
23
24
|
'multi_limits': [1, 1],
|
|
24
25
|
'half_life': 0,
|
|
25
26
|
'duration_vlimits': None,
|
|
26
27
|
'duration_qlimits': [0, 1],
|
|
27
|
-
'duration_handling':
|
|
28
|
-
'
|
|
28
|
+
'duration_handling': False,
|
|
29
|
+
'is_funding_adjusting': False,
|
|
30
|
+
'is_horizon_adjusting': False,
|
|
29
31
|
'is_discrete': False,
|
|
30
32
|
'y_multiplier': 10000
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
|
|
34
36
|
def calculate_return(features_map, return_params_dict):
|
|
35
|
-
|
|
37
|
+
features_map = _label.calculate_return(features_map, return_params_dict)
|
|
38
|
+
return features_map
|
coinsignal/model.py
CHANGED
|
@@ -18,6 +18,8 @@ DEFAULT_MODEL_PARAMS_DICT = {
|
|
|
18
18
|
'valid_sub_ratio': 0.25,
|
|
19
19
|
'test_isolate_time': 0,
|
|
20
20
|
'is_random_start': False,
|
|
21
|
+
'weight_limit': 1,
|
|
22
|
+
'is_sign_balanced': False,
|
|
21
23
|
'is_cv': True,
|
|
22
24
|
'cv_split_count': 4,
|
|
23
25
|
'cv_eval_train_metric': True,
|
|
@@ -44,7 +46,7 @@ DEFAULT_MODEL_PARAMS_DICT = {
|
|
|
44
46
|
'model_dir': '',
|
|
45
47
|
'vlimits': None,
|
|
46
48
|
'qlimits': [0, 1],
|
|
47
|
-
'
|
|
49
|
+
'sampling_modes': ['train', 'evaluate']
|
|
48
50
|
},
|
|
49
51
|
'loss_sub_params': {
|
|
50
52
|
'name': '',
|
|
@@ -70,4 +72,5 @@ DEFAULT_MODEL_PARAMS_DICT = {
|
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
def run_model(full_features_df, model_params_dict):
|
|
73
|
-
|
|
75
|
+
model_evaluations = _model.run_model(full_features_df, model_params_dict)
|
|
76
|
+
return model_evaluations
|
coinsignal/parallel.py
CHANGED
|
@@ -12,5 +12,10 @@
|
|
|
12
12
|
import _ext.parallel as _parallel
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def prepare_sub_full_features_df(data_dir, date, look_back_days, look_ahead_days, constants_dict, data_params_dict, feature_params_dict, return_params_dict, sampler_params_dict, N, n_completed, progress_update_event):
|
|
16
|
+
df, mft_df, mft_feature_plan, errors = _parallel.prepare_sub_full_features_df(data_dir, date, look_back_days, look_ahead_days, constants_dict, data_params_dict, feature_params_dict, return_params_dict, sampler_params_dict, N, n_completed, progress_update_event)
|
|
17
|
+
return df, mft_df, mft_feature_plan, errors
|
|
18
|
+
|
|
15
19
|
def prepare_full_features_df(data_dir, start_date, end_date, look_back_days, look_ahead_days, constants_dict, data_params_dict, feature_params_dict, return_params_dict, sampler_params_dict):
|
|
16
|
-
|
|
20
|
+
full_features_df, mft_full_features_df, mft_feature_plan, read_data_errors = _parallel.prepare_full_features_df(prepare_sub_full_features_df, data_dir, start_date, end_date, look_back_days, look_ahead_days, constants_dict, data_params_dict, feature_params_dict, return_params_dict, sampler_params_dict)
|
|
21
|
+
return full_features_df, mft_full_features_df, mft_feature_plan, read_data_errors
|
coinsignal/sampler.py
CHANGED
|
@@ -17,22 +17,10 @@ DEFAULT_SAMPLER_PARAMS_DICT = {
|
|
|
17
17
|
'sampling_time': 0,
|
|
18
18
|
'is_time_random': False,
|
|
19
19
|
'sampling_bp': 0,
|
|
20
|
-
'rolling_step': 0
|
|
21
|
-
'is_sampling_on_ret': False,
|
|
22
|
-
'fraction': 1,
|
|
23
|
-
'weight_limit': 1,
|
|
24
|
-
'is_sign_balanced': False,
|
|
20
|
+
'rolling_step': 0
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
|
|
28
|
-
def sample_data_on_time(price, sampling_time, is_time_random):
|
|
29
|
-
return _sampler.sample_data_on_time(price, sampling_time, is_time_random)
|
|
30
|
-
|
|
31
|
-
def sample_data_on_move(price, sampling_bp, rolling_step):
|
|
32
|
-
return _sampler.sample_data_on_move(price, sampling_bp, rolling_step)
|
|
33
|
-
|
|
34
|
-
def sample_data_on_ret(ret, fraction, weight_limit, is_sign_balanced):
|
|
35
|
-
return _sampler.sample_data_on_ret(ret, fraction, weight_limit, is_sign_balanced)
|
|
36
|
-
|
|
37
24
|
def sample_data(features_map, sampler_params_dict):
|
|
38
|
-
|
|
25
|
+
features_map = _sampler.sample_data(features_map, sampler_params_dict)
|
|
26
|
+
return features_map
|
coinsignal/tools.py
CHANGED
|
@@ -110,14 +110,9 @@ def copy_scripts(current_dir, output_dir, model_name, random_seed, scripts_folde
|
|
|
110
110
|
else:
|
|
111
111
|
copy_scripts(f'{current_dir}/{f}', output_dir, model_name, random_seed, f'{scripts_folder}/{f}')
|
|
112
112
|
|
|
113
|
-
def
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def calculate_rolling_lr_on_merged_interval(df1, df2, merge_step, rolling_step, interpolate=False, cdf1=None, cdf2=None):
|
|
117
|
-
return _tools.calculate_rolling_lr_on_merged_interval(df1, df2, merge_step, rolling_step, interpolate, cdf1, cdf2)
|
|
118
|
-
|
|
119
|
-
def calculate_rolling_corr_on_merged_interval(df1, df2, merge_step, rolling_step, interpolate=False, cdf1=None, cdf2=None):
|
|
120
|
-
return _tools.calculate_rolling_corr_on_merged_interval(df1, df2, merge_step, rolling_step, interpolate, cdf1, cdf2)
|
|
113
|
+
def validate_and_save_features(output_dir, model_name, full_features_df, mft_full_features_df, mft_feature_plan):
|
|
114
|
+
comparison_df = _tools.validate_and_save_features(output_dir, model_name, full_features_df, mft_full_features_df, mft_feature_plan)
|
|
115
|
+
return comparison_df
|
|
121
116
|
|
|
122
117
|
def summarize_and_save_results(output_dir, model_name, model_evaluations):
|
|
123
118
|
_tools.summarize_and_save_results(output_dir, model_name, model_evaluations)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
coinsignal-1.4.10.dist-info/METADATA,sha256=Qw0MQK5XHrKRPixdOg8SgjNRfkrYhzkosUopMl5j5OA,650
|
|
2
|
+
coinsignal-1.4.10.dist-info/RECORD,sha256=Va6vYW4B1vAuv5anLGy2xxMilVnEi1NVY4kJiGHXOG4,1027
|
|
3
|
+
coinsignal-1.4.10.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
|
|
4
|
+
coinsignal-1.4.10.dist-info/top_level.txt,sha256=8xBBVxKSVz2DM3nreUe-A7OGl7vCbK-3njdPu-JtUjw,11
|
|
5
|
+
coinsignal/__init__.py,sha256=yHbAPRaZTq92LsXEdNauikle3gMiX8aRZm-r7Z0NR5k,282
|
|
6
|
+
coinsignal/_ext.pyd,sha256=9o-PUlegsQQEpFa9_dEfgTLQsjtBR_k97Fkwls1gSTs,1128448
|
|
7
|
+
coinsignal/data.py,sha256=7KPRna6ELPnKqu5c9ExI67c9iTV-OZ2TGh8CMNxau5c,1108
|
|
8
|
+
coinsignal/feature.py,sha256=GMjjv5STX5liEe-d0XewEvENdy72EC20vP2BlbARoCs,1050
|
|
9
|
+
coinsignal/label.py,sha256=i8Thnww-1-htiKPbJ7mcbFAGf8-AqKh8MQEBlYp9aF0,1244
|
|
10
|
+
coinsignal/model.py,sha256=stSFHLt8EqeK179ZAoGMKXpIU6vvvMftsHdQvS6mVWY,2126
|
|
11
|
+
coinsignal/parallel.py,sha256=2-5s_WAUPfAuH_Ec_hKfXYXMDVzRIPWMC2EjyhrKBU0,1612
|
|
12
|
+
coinsignal/sampler.py,sha256=EJR-cQrhJS0figS_GPKWoEHAjEDg0encbX-dMTr69FM,783
|
|
13
|
+
coinsignal/tools.py,sha256=F5LYojctdJatfMSiJA75hsS9EVreBFkrDw2WvBQDJoQ,4602
|
|
14
|
+
coinsignal-1.4.10.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
coinsignal-1.3.4.dist-info/METADATA,sha256=yXK3vGF7p1moYL8P8Fl1LflOhfcRSVAD65jGAKTNUzU,649
|
|
2
|
-
coinsignal-1.3.4.dist-info/RECORD,sha256=MK5Fba4miFDWYphZ9e6QFW_Bp20nrybnq_G6kWW99NE,1020
|
|
3
|
-
coinsignal-1.3.4.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
|
|
4
|
-
coinsignal-1.3.4.dist-info/top_level.txt,sha256=8xBBVxKSVz2DM3nreUe-A7OGl7vCbK-3njdPu-JtUjw,11
|
|
5
|
-
coinsignal/__init__.py,sha256=M_ZGfNy8qVBnye8UVrzgm2Lacn_IYjMZnB9VeUXlQB0,281
|
|
6
|
-
coinsignal/_ext.pyd,sha256=wNKp7Hab7iS0aaCLQmVz30dOOREuhQaWc8WSCHj7kec,785920
|
|
7
|
-
coinsignal/data.py,sha256=cQUgt83ysHuuQ6ZRQziYUUTI53XxJdJTCX1FD9wG7F0,998
|
|
8
|
-
coinsignal/feature.py,sha256=AX3Yk2nc1hqEcRvoxoQ2K7MhprfAT15aXGJprYrcxf8,898
|
|
9
|
-
coinsignal/label.py,sha256=FMMz8T8CK9REzeJZxmSVhCpeRqVdJC8tH3E8NQ3qLbY,1116
|
|
10
|
-
coinsignal/model.py,sha256=njBvNTNXEhdbxXNC2O0d68fMLdUE2K-OZ2--1l6_4NY,2011
|
|
11
|
-
coinsignal/parallel.py,sha256=qcqKZOAT2TTkDD8sqBag5fOlcKpcZ3jQSDTO5M_oDe8,888
|
|
12
|
-
coinsignal/sampler.py,sha256=oFoR3rf0mh5u678JJpeWOfl072Y1P1mjcLfbTsdcWhU,1304
|
|
13
|
-
coinsignal/tools.py,sha256=jH0iy2RJQEPQSPCSJKxHxn0W-cTi0W7qwjt9sHNZKw0,5068
|
|
14
|
-
coinsignal-1.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|