Skip to content

Commit

Permalink
Merge branch 'whylabs:mainline' into prof-viz-nb-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeAdachi committed Mar 23, 2022
2 parents 26c925a + 90a1dab commit 726c9b0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 24 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
<a href="https://github.com/python/black" target="_blank">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black">
</a>
<a href="https://bestpractices.coreinfrastructure.org/projects/4490" target="_blank">
<img src="https://bestpractices.coreinfrastructure.org/projects/4490/badge" alt="CI Best Practices">
</a>
<a href="https://pepy.tech/project/whylogs" target="_blank">
<img src="https://pepy.tech/badge/whylogs" alt="PyPi Downloads">
</a>
Expand Down
58 changes: 37 additions & 21 deletions examples/performance-metrics/Performance Metrics-Regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -235,7 +235,7 @@
"8155 33.335 79 12.9980 0 4 4 "
]
},
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -260,7 +260,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -318,7 +318,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -350,14 +350,14 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.33426422991287585\n"
"0.33934000785461543\n"
]
}
],
Expand Down Expand Up @@ -406,7 +406,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -465,7 +465,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -489,13 +489,14 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter your Dataset ID\n",
"logging input/output features for day 0....\n",
"logging input/output features for day 1....\n",
"logging input/output features for day 2....\n",
Expand All @@ -504,6 +505,13 @@
"logging input/output features for day 5....\n",
"logging input/output features for day 6....\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using API key ID: xxtIbfnVKB\n"
]
}
],
"source": [
Expand All @@ -518,9 +526,9 @@
"now = datetime.datetime.now()\n",
"for day in range(0, 7):\n",
" timestamp = now - timedelta(days=6) + timedelta(days=day)\n",
" #First day to log was 11 Feb, but we're logging as if it were 7 days ago. Adding 11 as offset\n",
" original_date = 11 + day\n",
" cond = (features_df['date'].dt.day==original_date) & (features_df['date'].dt.month==2)\n",
" #First day to log was 1 July, but we're logging as if it were 7 days ago. Adding 1 as offset\n",
" original_date = 1 + day\n",
" cond = (features_df['date'].dt.day==original_date) & (features_df['date'].dt.month==7)\n",
" daily_features = features_df.loc[cond]\n",
" # We don't need date anymore\n",
" daily_features = daily_features.drop(['date'],axis=1)\n",
Expand Down Expand Up @@ -556,7 +564,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -568,17 +576,17 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"cond = (df_metrics['date'].dt.day>=11) & (df_metrics['date'].dt.month==2) & (df_metrics['date'].dt.day<18)\n",
"cond = (df_metrics['date'].dt.day>=1) & (df_metrics['date'].dt.month==7) & (df_metrics['date'].dt.day<8)\n",
"df_metrics = df_metrics.loc[cond]\n"
]
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -588,9 +596,17 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 11,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter your Dataset ID\n"
]
}
],
"source": [
"# Run whylogs on historical data and upload to WhyLabs.\n",
"# Stick to data from the prior seven days for now.\n",
Expand All @@ -601,8 +617,8 @@
"\n",
"for day in range(0, 7):\n",
" timestamp = now - timedelta(days=6) + timedelta(days=day)\n",
" original_date = 11 + day\n",
" cond = (df_metrics['date'].dt.day==original_date) & (df_metrics['date'].dt.month==2)\n",
" original_date = 1 + day\n",
" cond = (df_metrics['date'].dt.day==original_date) & (df_metrics['date'].dt.month==7)\n",
" daily_metrics = df_metrics.loc[cond]\n",
" # We don't need date anymore\n",
" daily_metrics = daily_metrics.drop(['date'],axis=1)\n",
Expand All @@ -619,7 +635,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 726c9b0

Please sign in to comment.