Skip to content

Commit

Permalink
chore: fix style on image classification notebook (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy authored Apr 3, 2023
1 parent e91b33f commit a7bef92
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tutorials/image_classification_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@
"metadata": {},
"outputs": [],
"source": [
"train_df = pd.read_parquet(\"https://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/cv/human-actions/human_actions_training.parquet\")\n",
"prod_df = pd.read_parquet(\"https://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/cv/human-actions/human_actions_production.parquet\")"
"train_df = pd.read_parquet(\n",
" \"https://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/cv/human-actions/human_actions_training.parquet\"\n",
")\n",
"prod_df = pd.read_parquet(\n",
" \"https://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/cv/human-actions/human_actions_production.parquet\"\n",
")"
]
},
{
Expand Down Expand Up @@ -143,9 +147,12 @@
" Displays each image alongside the actual and predicted classes.\n",
" \"\"\"\n",
" sample_df = df[[\"actual_action\", \"predicted_action\", \"url\"]].rename(columns={\"url\": \"image\"})\n",
" html = sample_df.to_html(escape=False, index=False, formatters={\"image\": lambda url: f'<img src=\"{url}\">'})\n",
" html = sample_df.to_html(\n",
" escape=False, index=False, formatters={\"image\": lambda url: f'<img src=\"{url}\">'}\n",
" )\n",
" display(HTML(html))\n",
" \n",
"\n",
"\n",
"display_examples(train_df.head())"
]
},
Expand All @@ -168,12 +175,12 @@
},
"outputs": [],
"source": [
"latest_timestamp = max(prod_df['prediction_ts'])\n",
"latest_timestamp = max(prod_df[\"prediction_ts\"])\n",
"current_timestamp = datetime.timestamp(datetime.now())\n",
"delta = current_timestamp - latest_timestamp\n",
"\n",
"train_df['prediction_ts'] = (train_df['prediction_ts'] + delta).astype(float)\n",
"prod_df['prediction_ts'] = (prod_df['prediction_ts'] + delta).astype(float)"
"train_df[\"prediction_ts\"] = (train_df[\"prediction_ts\"] + delta).astype(float)\n",
"prod_df[\"prediction_ts\"] = (prod_df[\"prediction_ts\"] + delta).astype(float)"
]
},
{
Expand Down

0 comments on commit a7bef92

Please sign in to comment.