virgo-modules 0.0.85__tar.gz → 0.0.87__tar.gz
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.
Potentially problematic release.
This version of virgo-modules might be problematic. Click here for more details.
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/PKG-INFO +1 -1
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/setup.py +1 -1
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/edge_utils.py +7 -1
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/re_utils.py +7 -2
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/PKG-INFO +1 -1
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/LICENSE +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/README.md +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/setup.cfg +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/__init__.py +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/__init__.py +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/aws_utils.py +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/pull_artifacts.py +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/ticketer_source.py +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/SOURCES.txt +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/dependency_links.txt +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/requires.txt +0 -0
- {virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ with open("virgo_app/README.md", "r") as f:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="virgo_modules",
|
|
8
|
-
version="0.0.
|
|
8
|
+
version="0.0.87",
|
|
9
9
|
description="data processing and statistical modeling using stock market data",
|
|
10
10
|
package_dir={"": "virgo_app"},
|
|
11
11
|
packages=find_packages(where="virgo_app"),
|
|
@@ -8,6 +8,7 @@ from feature_engine.selection import DropFeatures, DropCorrelatedFeatures
|
|
|
8
8
|
from feature_engine.imputation import MeanMedianImputer
|
|
9
9
|
from virgo_modules.src.ticketer_source import FeatureSelector
|
|
10
10
|
from feature_engine.discretisation import EqualWidthDiscretiser
|
|
11
|
+
from feature_engine.datetime import DatetimeFeatures
|
|
11
12
|
|
|
12
13
|
from .ticketer_source import VirgoWinsorizerFeature, InverseHyperbolicSine
|
|
13
14
|
|
|
@@ -215,7 +216,9 @@ def data_processing_pipeline_classifier(
|
|
|
215
216
|
features_base,features_to_drop = False, winsorizer_conf = False, discretize_columns = False,
|
|
216
217
|
bins_discretize = 10, correlation = 0.85, fillna = True,
|
|
217
218
|
invhypervolsin_features = False,
|
|
218
|
-
|
|
219
|
+
date_features_list = False,
|
|
220
|
+
pipeline_order = 'selector//winzorizer//discretizer//median_inputer//drop//correlation'
|
|
221
|
+
):
|
|
219
222
|
|
|
220
223
|
'''
|
|
221
224
|
pipeline builder
|
|
@@ -229,6 +232,7 @@ def data_processing_pipeline_classifier(
|
|
|
229
232
|
correlation (float): correlation threshold to discard correlated features
|
|
230
233
|
fillna (boolean): if true to fill na features
|
|
231
234
|
invhypervolsin_features (list): list of features to apply inverse hyperbolic sine
|
|
235
|
+
date_features_list (list): list of features to compute from Date field. (list of features from feature_engine)
|
|
232
236
|
pipeline_order (str): custom pipeline order eg. selector//winzorizer//discretizer//median_inputer//drop//correlation
|
|
233
237
|
Returns:
|
|
234
238
|
pipe (obj): pipeline object
|
|
@@ -240,6 +244,7 @@ def data_processing_pipeline_classifier(
|
|
|
240
244
|
drop_corr = [('drop_corr', DropCorrelatedFeatures(threshold=correlation, method = 'spearman'))] if correlation else []
|
|
241
245
|
median_imputer_pipe = [('median_imputer', MeanMedianImputer())] if fillna else []
|
|
242
246
|
invhypersin_pipe = [('invhypervolsin scaler', InverseHyperbolicSine(features = invhypervolsin_features))] if invhypervolsin_features else []
|
|
247
|
+
datetimeFeatures_pipe = [('date features', DatetimeFeatures(features_to_extract = date_features_list, variables = 'Date', drop_original = False))] if date_features_list else []
|
|
243
248
|
|
|
244
249
|
pipe_dictionary = {
|
|
245
250
|
'selector': select_pipe,
|
|
@@ -249,6 +254,7 @@ def data_processing_pipeline_classifier(
|
|
|
249
254
|
'correlation': drop_corr,
|
|
250
255
|
'median_inputer':median_imputer_pipe,
|
|
251
256
|
'arcsinh_scaler': invhypersin_pipe,
|
|
257
|
+
'date_features': datetimeFeatures_pipe,
|
|
252
258
|
}
|
|
253
259
|
|
|
254
260
|
pipeline_steps = pipeline_order.split('//')
|
|
@@ -1028,7 +1028,6 @@ class produce_plotly_plots:
|
|
|
1028
1028
|
if len(states_subtitles)%2 == 1:
|
|
1029
1029
|
states_subtitles = states_subtitles + [None]
|
|
1030
1030
|
|
|
1031
|
-
|
|
1032
1031
|
fig = make_subplots(
|
|
1033
1032
|
rows= rows_subplot, cols=2,
|
|
1034
1033
|
specs = [[{"type": "scatter"},{"type": "scatter"}]]*state_rows,
|
|
@@ -1107,6 +1106,11 @@ class produce_plotly_plots:
|
|
|
1107
1106
|
df_ = df[['Date','hmm_feature','Close',"chain_return"]].sort_values('Date')
|
|
1108
1107
|
df_['Daily_Returns'] = df['Close'].pct_change(7)
|
|
1109
1108
|
|
|
1109
|
+
df_agg_returns = df_.groupby('hmm_feature', as_index = False).agg(median =('Daily_Returns','median')).copy()
|
|
1110
|
+
current_state = df_.iloc[-1,:].hmm_feature
|
|
1111
|
+
medain_state_return = df_agg_returns[ df_agg_returns.hmm_feature == current_state]['median'].values[0]
|
|
1112
|
+
type_state = 'low state' if medain_state_return < 0 else 'high state'
|
|
1113
|
+
|
|
1110
1114
|
for state in states:
|
|
1111
1115
|
dfi = df_[df_.hmm_feature == state]
|
|
1112
1116
|
fig.add_trace(go.Box(y = dfi.chain_return, name=str(state),showlegend=False, marker_color = color_map[state] ),row=1, col=1)
|
|
@@ -1151,7 +1155,6 @@ class produce_plotly_plots:
|
|
|
1151
1155
|
fig.add_trace(go.Box(x = dfi.importance, name=str(feature),showlegend=False ),row=2, col=2)
|
|
1152
1156
|
fig.update_yaxes(visible=False, title="feature",row=2, col=2)
|
|
1153
1157
|
|
|
1154
|
-
|
|
1155
1158
|
fig.update_layout(height=height_plot, width=1600, title_text = f'State model analysis: {self.ticket_name}', coloraxis=dict(colorbar_len=0.50))
|
|
1156
1159
|
|
|
1157
1160
|
date_execution = datetime.datetime.today().strftime('%Y-%m-%d')
|
|
@@ -1165,6 +1168,7 @@ class produce_plotly_plots:
|
|
|
1165
1168
|
'current state':message1,
|
|
1166
1169
|
'current step in state': message2,
|
|
1167
1170
|
'execution date':message3,
|
|
1171
|
+
'type state':type_state,
|
|
1168
1172
|
}
|
|
1169
1173
|
|
|
1170
1174
|
if self.show_plot:
|
|
@@ -1196,6 +1200,7 @@ class produce_plotly_plots:
|
|
|
1196
1200
|
|
|
1197
1201
|
if self.return_figs:
|
|
1198
1202
|
return fig, messages
|
|
1203
|
+
|
|
1199
1204
|
def produce_forecasting_plot(self,predictions):
|
|
1200
1205
|
"""
|
|
1201
1206
|
display forecasting plots
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules/src/ticketer_source.py
RENAMED
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.85 → virgo_modules-0.0.87}/virgo_app/virgo_modules.egg-info/top_level.txt
RENAMED
|
File without changes
|