virgo-modules 0.0.89__tar.gz → 0.0.90__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.89 → virgo_modules-0.0.90}/PKG-INFO +1 -1
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/setup.py +1 -1
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/edge_utils.py +14 -3
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/ticketer_source.py +6 -7
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules.egg-info/PKG-INFO +1 -1
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/LICENSE +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/README.md +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/setup.cfg +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/__init__.py +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/__init__.py +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/aws_utils.py +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/pull_artifacts.py +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/re_utils.py +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules.egg-info/SOURCES.txt +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules.egg-info/dependency_links.txt +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules.egg-info/requires.txt +0 -0
- {virgo_modules-0.0.89 → virgo_modules-0.0.90}/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.90",
|
|
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"),
|
|
@@ -10,7 +10,7 @@ from virgo_modules.src.ticketer_source import FeatureSelector
|
|
|
10
10
|
from feature_engine.discretisation import EqualWidthDiscretiser
|
|
11
11
|
from feature_engine.datetime import DatetimeFeatures
|
|
12
12
|
|
|
13
|
-
from .ticketer_source import VirgoWinsorizerFeature, InverseHyperbolicSine
|
|
13
|
+
from .ticketer_source import VirgoWinsorizerFeature, InverseHyperbolicSine, FeaturesEntropy
|
|
14
14
|
|
|
15
15
|
class produce_model_wrapper:
|
|
16
16
|
"""
|
|
@@ -90,8 +90,8 @@ class produce_model_wrapper:
|
|
|
90
90
|
self.model = model
|
|
91
91
|
self.pipe_transform = pipe
|
|
92
92
|
self.pipeline = Pipeline([('pipe_transform',self.pipe_transform), ('model',self.model)])
|
|
93
|
-
self.features_to_model = self.pipe_transform.fit_transform(self.X_train).columns
|
|
94
93
|
self.pipeline.fit(self.X_train, self.y_train)
|
|
94
|
+
self.features_to_model = self.pipeline[:-1].transform(self.X_train).columns
|
|
95
95
|
|
|
96
96
|
class register_results():
|
|
97
97
|
"""
|
|
@@ -217,6 +217,7 @@ def data_processing_pipeline_classifier(
|
|
|
217
217
|
bins_discretize = 10, correlation = 0.85, fillna = True,
|
|
218
218
|
invhypervolsin_features = False,
|
|
219
219
|
date_features_list = False,
|
|
220
|
+
entropy_set_list = False,
|
|
220
221
|
pipeline_order = 'selector//winzorizer//discretizer//median_inputer//drop//correlation'
|
|
221
222
|
):
|
|
222
223
|
|
|
@@ -233,6 +234,7 @@ def data_processing_pipeline_classifier(
|
|
|
233
234
|
fillna (boolean): if true to fill na features
|
|
234
235
|
invhypervolsin_features (list): list of features to apply inverse hyperbolic sine
|
|
235
236
|
date_features_list (list): list of features to compute from Date field. (list of features from feature_engine)
|
|
237
|
+
entropy_set_list (list): list of dictionaries that contains features and targets to compute entropy
|
|
236
238
|
pipeline_order (str): custom pipeline order eg. selector//winzorizer//discretizer//median_inputer//drop//correlation
|
|
237
239
|
Returns:
|
|
238
240
|
pipe (obj): pipeline object
|
|
@@ -245,7 +247,15 @@ def data_processing_pipeline_classifier(
|
|
|
245
247
|
median_imputer_pipe = [('median_imputer', MeanMedianImputer())] if fillna else []
|
|
246
248
|
invhypersin_pipe = [('invhypervolsin scaler', InverseHyperbolicSine(features = invhypervolsin_features))] if invhypervolsin_features else []
|
|
247
249
|
datetimeFeatures_pipe = [('date features', DatetimeFeatures(features_to_extract = date_features_list, variables = 'Date', drop_original = False))] if date_features_list else []
|
|
248
|
-
|
|
250
|
+
|
|
251
|
+
entropy_pipe = list()
|
|
252
|
+
if entropy_set_list:
|
|
253
|
+
for setx_ in entropy_set_list:
|
|
254
|
+
setx = setx_['set'].split('//')
|
|
255
|
+
target_ = setx_['target']
|
|
256
|
+
subpipe_name = '_'.join(setx) + 'entropy'
|
|
257
|
+
entropy_pipe.append((subpipe_name, FeaturesEntropy(features = setx, target = target_)))
|
|
258
|
+
|
|
249
259
|
pipe_dictionary = {
|
|
250
260
|
'selector': select_pipe,
|
|
251
261
|
'winzorizer':winzorizer_pipe,
|
|
@@ -255,6 +265,7 @@ def data_processing_pipeline_classifier(
|
|
|
255
265
|
'median_inputer':median_imputer_pipe,
|
|
256
266
|
'arcsinh_scaler': invhypersin_pipe,
|
|
257
267
|
'date_features': datetimeFeatures_pipe,
|
|
268
|
+
'entropy_features' : entropy_pipe,
|
|
258
269
|
}
|
|
259
270
|
|
|
260
271
|
pipeline_steps = pipeline_order.split('//')
|
{virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules/src/ticketer_source.py
RENAMED
|
@@ -147,7 +147,7 @@ class FeatureSelector(BaseEstimator, TransformerMixin):
|
|
|
147
147
|
def transform(self, X, y=None):
|
|
148
148
|
return X[self.columns]
|
|
149
149
|
|
|
150
|
-
class
|
|
150
|
+
class FeaturesEntropy(BaseEstimator, TransformerMixin):
|
|
151
151
|
"""
|
|
152
152
|
Class that creates a feature that calculate entropy for a given feature classes, but it might get some leackeage in the training set.
|
|
153
153
|
this class is compatible with scikitlearn pipeline
|
|
@@ -193,8 +193,8 @@ class features_entropy(BaseEstimator, TransformerMixin):
|
|
|
193
193
|
train_dates = unique_dates[:cut]
|
|
194
194
|
max_train_date = max(train_dates)
|
|
195
195
|
|
|
196
|
-
X_ = X[X['Date'] <= max_train_date]
|
|
197
|
-
df =
|
|
196
|
+
X_ = X[X['Date'] <= max_train_date].copy()
|
|
197
|
+
df = X_.join(y, how = 'left')
|
|
198
198
|
|
|
199
199
|
column_list = [f'{self.feature_type}_signal_{colx}' for colx in self.features]
|
|
200
200
|
|
|
@@ -241,12 +241,12 @@ class features_entropy(BaseEstimator, TransformerMixin):
|
|
|
241
241
|
.copy()
|
|
242
242
|
)
|
|
243
243
|
|
|
244
|
-
del df, df_aggr
|
|
244
|
+
del df, df_aggr, X_
|
|
245
245
|
return self
|
|
246
246
|
|
|
247
247
|
def transform(self, X, y=None):
|
|
248
248
|
|
|
249
|
-
X = X.
|
|
249
|
+
X = X.join(self.entropy_map.set_index(self.column_list), on=self.column_list, how = 'left')
|
|
250
250
|
X[self.feature_name] = X[self.feature_name].fillna(self.default_null)
|
|
251
251
|
return X
|
|
252
252
|
|
|
@@ -2598,9 +2598,8 @@ class produce_model:
|
|
|
2598
2598
|
self.model = model
|
|
2599
2599
|
self.pipe_transform = pipe
|
|
2600
2600
|
self.pipeline = Pipeline([('pipe_transform',self.pipe_transform), ('model',self.model)])
|
|
2601
|
-
self.features_to_model = self.pipe_transform.fit_transform(self.X_train).columns
|
|
2602
2601
|
self.pipeline.fit(self.X_train, self.y_train)
|
|
2603
|
-
|
|
2602
|
+
self.features_to_model = self.pipeline[:-1].transform(self.X_train).columns
|
|
2604
2603
|
|
|
2605
2604
|
class hmm_feature_selector():
|
|
2606
2605
|
"""
|
|
File without changes
|
|
File without changes
|
|
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.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{virgo_modules-0.0.89 → virgo_modules-0.0.90}/virgo_app/virgo_modules.egg-info/top_level.txt
RENAMED
|
File without changes
|