Skip to content

Commit d54b66e

Browse files
committed
update guide messages
1 parent 6d8a0b8 commit d54b66e

File tree

5 files changed

+175
-140
lines changed

5 files changed

+175
-140
lines changed

notebooks/feature_engineering.ipynb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@
188188
"id": "7bfd56a7",
189189
"metadata": {},
190190
"outputs": [
191+
{
192+
"name": "stderr",
193+
"output_type": "stream",
194+
"text": [
195+
"[GUIDE] Successfully performed generate_entityset.\n",
196+
"\tYou can perform the next step by calling generate_label_times.\n"
197+
]
198+
},
191199
{
192200
"data": {
193201
"text/plain": [
@@ -290,6 +298,14 @@
290298
"id": "e0ee16eb",
291299
"metadata": {},
292300
"outputs": [
301+
{
302+
"name": "stderr",
303+
"output_type": "stream",
304+
"text": [
305+
"[GUIDE] Successfully performed generate_label_times.\n",
306+
"\tYou can perform the next step by calling generate_feature_matrix.\n"
307+
]
308+
},
293309
{
294310
"data": {
295311
"text/html": [
@@ -458,7 +474,9 @@
458474
"/Users/raymondpan/zephyr/Zephyr-repo/venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3464: RuntimeWarning: Mean of empty slice.\n",
459475
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
460476
"/Users/raymondpan/zephyr/Zephyr-repo/venv/lib/python3.8/site-packages/numpy/core/_methods.py:192: RuntimeWarning: invalid value encountered in scalar divide\n",
461-
" ret = ret.dtype.type(ret / rcount)\n"
477+
" ret = ret.dtype.type(ret / rcount)\n",
478+
"[GUIDE] Successfully performed generate_feature_matrix.\n",
479+
"\tYou can perform the next step by calling generate_train_test_split.\n"
462480
]
463481
}
464482
],
@@ -627,10 +645,10 @@
627645
" <Feature: MAX(pidata_processed.fft.mean.mean_value)>,\n",
628646
" <Feature: MIN(pidata_processed.fft.mean.mean_value)>,\n",
629647
" <Feature: SUM(pidata_processed.fft.mean.mean_value)>,\n",
630-
" <Feature: COUNT(alarms WHERE DES_NAME = Alarm2)>,\n",
631648
" <Feature: COUNT(alarms WHERE DES_NAME = Alarm1)>,\n",
632-
" <Feature: SUM(alarms.IND_DURATION WHERE DES_NAME = Alarm2)>,\n",
649+
" <Feature: COUNT(alarms WHERE DES_NAME = Alarm2)>,\n",
633650
" <Feature: SUM(alarms.IND_DURATION WHERE DES_NAME = Alarm1)>,\n",
651+
" <Feature: SUM(alarms.IND_DURATION WHERE DES_NAME = Alarm2)>,\n",
634652
" <Feature: MAX(stoppages.NUM_WORDS(DES_COMMENTS))>,\n",
635653
" <Feature: MAX(stoppages.NUM_WORDS(DES_DESCRIPTION))>,\n",
636654
" <Feature: MAX(stoppages.NUM_WORDS(DES_WO_NAME))>,\n",

notebooks/modeling.ipynb

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,15 @@
545545
"text": [
546546
"/Users/raymondpan/zephyr/Zephyr-repo/venv/lib/python3.8/site-packages/sklearn/impute/_base.py:555: UserWarning: Skipping features without any observed values: [ 1 2 6 7 9 10 15 16 17 18]. At least one non-missing value is needed for imputation with strategy='mean'.\n",
547547
" warnings.warn(\n",
548-
"Performing set_feature_matrix. You are skipping the following steps:\n",
549-
"0. generate_entityset or set_entityset\n",
550-
"1. generate_label_times or set_label_times\n"
548+
"[GUIDE] STALE WARNING: \n",
549+
"\tPerforming step 2 from step -1 with set_feature_matrix.\n",
550+
"\tThis is a forward step via a set method.\n",
551+
"\tThe current step is -1.\n",
552+
"\tAll previous steps will be considered stale.\n",
553+
"[GUIDE] Successfully performed set_feature_matrix.\n",
554+
"\tYou can perform the next step by calling generate_train_test_split.\n",
555+
"[GUIDE] Successfully performed generate_train_test_split.\n",
556+
"\tYou can perform the next step by calling fit_pipeline.\n"
551557
]
552558
},
553559
{
@@ -603,7 +609,16 @@
603609
"execution_count": 3,
604610
"id": "edffee03",
605611
"metadata": {},
606-
"outputs": [],
612+
"outputs": [
613+
{
614+
"name": "stderr",
615+
"output_type": "stream",
616+
"text": [
617+
"[GUIDE] Successfully performed fit_pipeline.\n",
618+
"\tYou can perform the next step by calling predict or evaluate.\n"
619+
]
620+
}
621+
],
607622
"source": [
608623
"hyperparameters = {\n",
609624
" \"xgboost.XGBClassifier#1\": {\n",
@@ -628,6 +643,15 @@
628643
"id": "78187756",
629644
"metadata": {},
630645
"outputs": [
646+
{
647+
"name": "stderr",
648+
"output_type": "stream",
649+
"text": [
650+
"[GUIDE] Successfully performed predict.\n",
651+
"\tYou have reached the end of the predictive engineering workflow.\n",
652+
"\tYou can call predict or evaluate again or re-perform previous steps based on results.\n"
653+
]
654+
},
631655
{
632656
"data": {
633657
"text/plain": [
@@ -656,7 +680,17 @@
656680
"execution_count": 5,
657681
"id": "cd097853",
658682
"metadata": {},
659-
"outputs": [],
683+
"outputs": [
684+
{
685+
"name": "stderr",
686+
"output_type": "stream",
687+
"text": [
688+
"[GUIDE] Successfully performed evaluate.\n",
689+
"\tYou have reached the end of the predictive engineering workflow.\n",
690+
"\tYou can call predict or evaluate again or re-perform previous steps based on results.\n"
691+
]
692+
}
693+
],
660694
"source": [
661695
"res = zephyr.evaluate()"
662696
]

notebooks/visualization.ipynb

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 10,
19+
"execution_count": 1,
2020
"id": "d6f954db",
2121
"metadata": {},
2222
"outputs": [],
@@ -38,7 +38,7 @@
3838
},
3939
{
4040
"cell_type": "code",
41-
"execution_count": 11,
41+
"execution_count": 2,
4242
"id": "23ec49dd",
4343
"metadata": {},
4444
"outputs": [
@@ -48,9 +48,15 @@
4848
"text": [
4949
"/Users/raymondpan/zephyr/Zephyr-repo/venv/lib/python3.8/site-packages/sklearn/impute/_base.py:555: UserWarning: Skipping features without any observed values: [ 1 2 6 7 9 10 15 16 17 18]. At least one non-missing value is needed for imputation with strategy='mean'.\n",
5050
" warnings.warn(\n",
51-
"Performing set_feature_matrix. You are skipping the following steps:\n",
52-
"0. generate_entityset or set_entityset\n",
53-
"1. generate_label_times or set_label_times\n"
51+
"[GUIDE] STALE WARNING: \n",
52+
"\tPerforming step 2 from step -1 with set_feature_matrix.\n",
53+
"\tThis is a forward step via a set method.\n",
54+
"\tThe current step is -1.\n",
55+
"\tAll previous steps will be considered stale.\n",
56+
"[GUIDE] Successfully performed set_feature_matrix.\n",
57+
"\tYou can perform the next step by calling generate_train_test_split.\n",
58+
"[GUIDE] Successfully performed generate_train_test_split.\n",
59+
"\tYou can perform the next step by calling fit_pipeline.\n"
5460
]
5561
},
5662
{
@@ -109,7 +115,7 @@
109115
" Name: label, dtype: bool)"
110116
]
111117
},
112-
"execution_count": 11,
118+
"execution_count": 2,
113119
"metadata": {},
114120
"output_type": "execute_result"
115121
}
@@ -177,17 +183,26 @@
177183
},
178184
{
179185
"cell_type": "code",
180-
"execution_count": 12,
186+
"execution_count": 3,
181187
"id": "683393df",
182188
"metadata": {},
183-
"outputs": [],
189+
"outputs": [
190+
{
191+
"name": "stderr",
192+
"output_type": "stream",
193+
"text": [
194+
"[GUIDE] Successfully performed fit_pipeline.\n",
195+
"\tYou can perform the next step by calling predict or evaluate.\n"
196+
]
197+
}
198+
],
184199
"source": [
185200
"output = zephyr.fit_pipeline(pipeline = \"xgb_classifier\", visual=True)"
186201
]
187202
},
188203
{
189204
"cell_type": "code",
190-
"execution_count": 13,
205+
"execution_count": 4,
191206
"id": "13221b40",
192207
"metadata": {},
193208
"outputs": [
@@ -197,7 +212,7 @@
197212
"dict_keys(['threshold', 'scores'])"
198213
]
199214
},
200-
"execution_count": 13,
215+
"execution_count": 4,
201216
"metadata": {},
202217
"output_type": "execute_result"
203218
}
@@ -216,7 +231,7 @@
216231
},
217232
{
218233
"cell_type": "code",
219-
"execution_count": 14,
234+
"execution_count": 5,
220235
"id": "c7a88d5b",
221236
"metadata": {},
222237
"outputs": [

tests/test_guide.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
class DummyObject:
55
def __init__(self):
66
producers_and_getters = [
7-
([self.step0_key, self.step0_set], [self.step0_getter]),
8-
([self.step1_key, self.step1_set], [self.step1_getter]),
9-
([self.step2_key, self.step2_set], [self.step2_getter])
7+
([self.step0_key], [self.step0_set], [self.step0_getter]),
8+
([self.step1_key], [self.step1_set], [self.step1_getter]),
9+
([self.step2_key], [self.step2_set], [self.step2_getter])
1010
]
11-
set_methods = {
12-
self.step0_set.__name__,
13-
self.step1_set.__name__,
14-
self.step2_set.__name__
15-
}
16-
self._guide_handler = GuideHandler(producers_and_getters, set_methods)
11+
self._guide_handler = GuideHandler(producers_and_getters)
1712

1813
@guide
1914
def step0_key(self):

0 commit comments

Comments
 (0)