imsciences 0.9.5.3__py3-none-any.whl → 0.9.5.5__py3-none-any.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.
Potentially problematic release.
This version of imsciences might be problematic. Click here for more details.
- imsciences/mmm.py +139 -2
- imsciences/pull.py +726 -577
- imsciences/unittesting.py +0 -1
- {imsciences-0.9.5.3.dist-info → imsciences-0.9.5.5.dist-info}/METADATA +33 -23
- {imsciences-0.9.5.3.dist-info → imsciences-0.9.5.5.dist-info}/RECORD +9 -9
- {imsciences-0.9.5.3.dist-info → imsciences-0.9.5.5.dist-info}/LICENSE.txt +0 -0
- {imsciences-0.9.5.3.dist-info → imsciences-0.9.5.5.dist-info}/PKG-INFO-IMS-24Ltp-3 +0 -0
- {imsciences-0.9.5.3.dist-info → imsciences-0.9.5.5.dist-info}/WHEEL +0 -0
- {imsciences-0.9.5.3.dist-info → imsciences-0.9.5.5.dist-info}/top_level.txt +0 -0
imsciences/unittesting.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: imsciences
|
|
3
|
-
Version: 0.9.5.
|
|
3
|
+
Version: 0.9.5.5
|
|
4
4
|
Summary: IMS Data Processing Package
|
|
5
5
|
Author: IMS
|
|
6
6
|
Author-email: cam@im-sciences.com
|
|
7
|
-
Keywords:
|
|
7
|
+
Keywords: data processing,apis,data analysis,data visualization,machine learning
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -17,6 +17,8 @@ Requires-Dist: pandas
|
|
|
17
17
|
Requires-Dist: plotly
|
|
18
18
|
Requires-Dist: numpy
|
|
19
19
|
Requires-Dist: fredapi
|
|
20
|
+
Requires-Dist: xgboost
|
|
21
|
+
Requires-Dist: scikit-learn
|
|
20
22
|
Requires-Dist: bs4
|
|
21
23
|
Requires-Dist: yfinance
|
|
22
24
|
Requires-Dist: holidays
|
|
@@ -33,23 +35,33 @@ The **Independent Marketing Sciences** package is a Python library designed to p
|
|
|
33
35
|
- Seamless data processing for time series workflows.
|
|
34
36
|
- Aggregation, filtering, and transformation of time series data.
|
|
35
37
|
- Visualising Data
|
|
36
|
-
- Integration with external data sources like FRED, Bank of England
|
|
38
|
+
- Integration with external data sources like FRED, Bank of England and ONS.
|
|
37
39
|
|
|
38
40
|
---
|
|
39
41
|
|
|
40
42
|
Table of Contents
|
|
41
43
|
=================
|
|
42
44
|
|
|
43
|
-
1. [
|
|
44
|
-
2. [Data Processing for
|
|
45
|
-
3. [Data
|
|
46
|
-
4. [Data
|
|
47
|
-
5. [
|
|
48
|
-
6. [
|
|
45
|
+
1. [Usage](#usage)
|
|
46
|
+
2. [Data Processing for Time Series](#data-processing-for-time-series)
|
|
47
|
+
3. [Data Processing for Incrementality Testing](#data-processing-for-incrementality-testing)
|
|
48
|
+
4. [Data Visualisations](#data-visualisations)
|
|
49
|
+
5. [Data Pulling](#data-pulling)
|
|
50
|
+
6. [Installation](#installation)
|
|
49
51
|
7. [License](#license)
|
|
50
52
|
|
|
51
53
|
---
|
|
52
54
|
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
from imsciences import dataprocessing, geoprocessing, datapull, datavis
|
|
59
|
+
ims_proc = dataprocessing()
|
|
60
|
+
ims_geo = geoprocessing()
|
|
61
|
+
ims_pull = datapull()
|
|
62
|
+
ims_vis = datavis()
|
|
63
|
+
```
|
|
64
|
+
|
|
53
65
|
## Data Processing for Time Series
|
|
54
66
|
|
|
55
67
|
## 1. `get_wd_levels`
|
|
@@ -222,6 +234,11 @@ Table of Contents
|
|
|
222
234
|
- **Usage**: `week_commencing_2_week_commencing_conversion_isoweekday(df, date_col, week_commencing='mon')`
|
|
223
235
|
- **Example**: `week_commencing_2_week_commencing_conversion_isoweekday(df, 'date_col', week_commencing='fri')`
|
|
224
236
|
|
|
237
|
+
## 35. `seasonality_feature_extraction`
|
|
238
|
+
- **Description**: Splits data into train/test sets, trains XGBoost and Random Forest on all features, extracts top features based on feature importance, merges them, optionally retrains models on top and combined features, and returns a dict of results.
|
|
239
|
+
- **Usage**: `seasonality_feature_extraction(df, kpi_var, n_features=10, test_size=0.1, random_state=42, shuffle=False)`
|
|
240
|
+
- **Example**: `seasonality_feature_extraction(df, 'kpi_total_sales', n_features=5, test_size=0.2, random_state=123, shuffle=True)`
|
|
241
|
+
|
|
225
242
|
---
|
|
226
243
|
|
|
227
244
|
## Data Processing for Incrementality Testing
|
|
@@ -291,8 +308,8 @@ Table of Contents
|
|
|
291
308
|
|
|
292
309
|
## 6. `pull_weather`
|
|
293
310
|
- **Description**: Fetch and process historical weather data for the specified country.
|
|
294
|
-
- **Usage**: `pull_weather(week_commencing, country)`
|
|
295
|
-
- **Example**: `pull_weather('mon', 'GBR')`
|
|
311
|
+
- **Usage**: `pull_weather(week_commencing, start_date, country)`
|
|
312
|
+
- **Example**: `pull_weather('mon', '2020-01-01', 'GBR')`
|
|
296
313
|
|
|
297
314
|
## 7. `pull_macro_ons_uk`
|
|
298
315
|
- **Description**: Fetch and process time series data from the Beta ONS API.
|
|
@@ -304,6 +321,11 @@ Table of Contents
|
|
|
304
321
|
- **Usage**: `pull_yfinance(tickers, week_start_day)`
|
|
305
322
|
- **Example**: `pull_yfinance(['^FTMC', '^IXIC'], 'mon')`
|
|
306
323
|
|
|
324
|
+
## 9. `pull_sports_events`
|
|
325
|
+
- **Description**: Pull a veriety of sports events primaraly football and rugby.
|
|
326
|
+
- **Usage**: `pull_sports_events(start_date, week_commencing)`
|
|
327
|
+
- **Example**: `pull_sports_events('2020-01-01', 'mon')`
|
|
328
|
+
|
|
307
329
|
---
|
|
308
330
|
|
|
309
331
|
## Installation
|
|
@@ -316,18 +338,6 @@ pip install imsciences
|
|
|
316
338
|
|
|
317
339
|
---
|
|
318
340
|
|
|
319
|
-
## Usage
|
|
320
|
-
|
|
321
|
-
```bash
|
|
322
|
-
from imsciences import *
|
|
323
|
-
ims_proc = dataprocessing()
|
|
324
|
-
ims_geo = geoprocessing()
|
|
325
|
-
ims_pull = datapull()
|
|
326
|
-
ims_vis = datavis()
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
341
|
## License
|
|
332
342
|
|
|
333
343
|
This project is licensed under the MIT License. 
|
|
@@ -6,17 +6,17 @@ imsciences/datafunctions-IMS-24Ltp-3.py,sha256=3Snv-0iE_03StmyjtT-riOU9f4v8TaJWL
|
|
|
6
6
|
imsciences/datafunctions.py,sha256=WZrXNLO-SYrCuFt0pAbha74psMOZPY7meWJ7yWEbRpk,169953
|
|
7
7
|
imsciences/datapull.py,sha256=TPY0LDgOkcKTBk8OekbD0Grg5x0SomAK2dZ7MuT6X1E,19000
|
|
8
8
|
imsciences/geo.py,sha256=J8AkLk1Nyty3VBkPFqcseXjtlSvXVNkHW_nymERz3nA,13472
|
|
9
|
-
imsciences/mmm.py,sha256=
|
|
10
|
-
imsciences/pull.py,sha256=
|
|
11
|
-
imsciences/unittesting.py,sha256=
|
|
9
|
+
imsciences/mmm.py,sha256=w2A90eJPvMH0Mp3jh8booKaLGm0BKFqW-H92FR4OpV8,80490
|
|
10
|
+
imsciences/pull.py,sha256=8j4k9hnQ9IuxY8W_PvO6afutPm4Pz_SJRjZfU47qxX0,81654
|
|
11
|
+
imsciences/unittesting.py,sha256=U177_Txg0Lqn49zYRu5bl9OVe_X7MkNJ6V_Zd6DHOsU,45656
|
|
12
12
|
imsciences/vis.py,sha256=2izdHQhmWEReerRqIxhY4Ai10VjL7xoUqyWyZC7-2XI,8931
|
|
13
13
|
imsciencesdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
14
14
|
imsciencesdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
15
15
|
imsdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
16
16
|
imsdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
17
|
-
imsciences-0.9.5.
|
|
18
|
-
imsciences-0.9.5.
|
|
19
|
-
imsciences-0.9.5.
|
|
20
|
-
imsciences-0.9.5.
|
|
21
|
-
imsciences-0.9.5.
|
|
22
|
-
imsciences-0.9.5.
|
|
17
|
+
imsciences-0.9.5.5.dist-info/LICENSE.txt,sha256=lVq2QwcExPX4Kl2DHeEkRrikuItcDB1Pr7yF7FQ8_z8,1108
|
|
18
|
+
imsciences-0.9.5.5.dist-info/METADATA,sha256=Vkj32g_Kv3Gfd7O6HJ_wr-Dbq51F7oIH7uBYs5h8lN8,17937
|
|
19
|
+
imsciences-0.9.5.5.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=yqZbigwHjnYoqyI81PGz_AeofRFfOrwH_Vyawyef-mg,854
|
|
20
|
+
imsciences-0.9.5.5.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
|
|
21
|
+
imsciences-0.9.5.5.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
|
|
22
|
+
imsciences-0.9.5.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|