Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 'Introduction to generic pipelines' tutorial #114

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,010 changes: 61 additions & 949 deletions pipelines/introduction-to-generic-pipelines/Part 1 - Data Cleaning.ipynb

Large diffs are not rendered by default.

725 changes: 217 additions & 508 deletions pipelines/introduction-to-generic-pipelines/Part 2 - Data Analysis.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "702729a9-40d0-47a1-94e1-96ac60a96ce2",
"metadata": {},
"source": [
"## Copyright 2018-2022 Elyra Authors"
]
},
{
"cell_type": "markdown",
"id": "b02ab100-90c5-4364-9e13-2c5e2b15dd58",
"metadata": {},
"source": [
"Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"you may not use this file except in compliance with the License.\n",
"You may obtain a copy of the License at\n",
"\n",
"http://www.apache.org/licenses/LICENSE-2.0\n",
"\n",
"Unless required by applicable law or agreed to in writing, software\n",
"distributed under the License is distributed on an \"AS IS\" BASIS,\n",
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
"See the License for the specific language governing permissions and\n",
"limitations under the License."
]
},
{
"cell_type": "markdown",
"id": "cb48220c-fb29-4b50-9868-a27d75523d9d",
"metadata": {},
"source": [
"## Classify data"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c36d1686-5165-48ca-9906-a6bb99901b15",
"metadata": {},
"outputs": [],
"source": [
"# Uncomment this line to install scikit-learn\n",
"! pip install scikit-learn"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8ce06184-2db2-42c7-bc39-0d323c487981",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pandas as pd\n",
"from sklearn.model_selection import train_test_split"
]
},
{
"cell_type": "markdown",
"id": "6cb6e348-8297-41a5-b839-ba0c8db36109",
"metadata": {},
"source": [
"Load processed CSV file into Pandas DataFrame"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "39f922b3-3c3f-474a-b7f5-af42db0cff3c",
"metadata": {},
"outputs": [],
"source": [
"data_filename_in = os.getenv(\"DATASET_FILENAME\", \"iris.csv\")\n",
"iris_df = pd.read_csv(data_filename_in)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "540c6b4e-d0b1-4ea3-923a-f22fd19e31a7",
"metadata": {},
"outputs": [],
"source": [
"iris_df.shape"
]
},
{
"cell_type": "markdown",
"id": "535cc7df-fb5e-4e35-a965-feeb9ca93aa2",
"metadata": {},
"source": [
"Split the dataset into training set and testing set"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "371604d1-30e5-4035-944c-a6dbd8bf0426",
"metadata": {},
"outputs": [],
"source": [
"X = iris_df.drop([\"class\"], axis=1)\n",
"y = iris_df[\"class\"]\n",
"X_train, X_test, y_train, y_test = train_test_split(\n",
" X, y, test_size=0.35, random_state=5\n",
")\n",
"\n",
"print(f\"Training feature {X_train.shape}\")\n",
"print(f\"Training outcome {y_train.shape}\")\n",
"print(f\"Test feature {X_test.shape}\")\n",
"print(f\"Test outcome {y_test.shape}\")"
]
},
{
"cell_type": "markdown",
"id": "1c2b6027-3f9d-4de9-9447-0555b62d7ed5",
"metadata": {},
"source": [
"Lorem Ipsum"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "41590a00-68ff-4df2-8c90-b1819cfb7a20",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading