<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Guided Project 3
Learning Objective
Step1:  Step 1. Environment setup
Envirnonment Variables
Setup the your Kubeflow pipelines endopoint below the same way you did in guided project 1 & 2.
Step2:  You may need to restart the kernel at this point.
skaffold tool setup
Step3:  Modify the PATH environment variable so that skaffold is available
Step4:  Step 2. Copy the predefined template to your project directory.
In this step, we will create a working pipeline project directory and 
files by copying additional files from a predefined template.
You may give your pipeline a different name by changing the PIPELINE_NAME below. 
This will also become the name of the project directory where your files will be put.
Step5:  TFX includes the taxi template with the TFX python package. 
If you are planning to solve a point-wise prediction problem,
including classification and regresssion, this template could be used as a starting point.
The tfx template copy CLI command copies predefined template files into your project directory.
Step6:  Step 3. Browse your copied source files
The TFX template provides basic scaffold files to build a pipeline, including Python source code,
sample data, and Jupyter Notebooks to analyse the output of the pipeline. 
The taxi template uses the same Chicago Taxi dataset and ML model as 
the Airflow Tutorial.
Here is brief introduction to each of the Python files
Step7:  Step 4. Create the artifact store bucket
Note
<ASSISTANT_TASK:>
Python Code:
import os
Explanation: Guided Project 3
Learning Objective:
Learn how to customize the tfx template to your own dataset
Learn how to modify the Keras model scaffold provided by tfx template
In this guided project, we will use the tfx template tool to create a TFX pipeline for the covertype project, but this time, instead of re-using an already implemented model as we did in guided project 2, we will adapt the model scaffold generated by tfx template so that it can train on the covertype dataset
Note: The covertype dataset is loacated at
gs://workshop-datasets/covertype/small/dataset.csv
End of explanation
ENDPOINT = '' # Enter your ENDPOINT here.
PATH=%env PATH
%env PATH={PATH}:/home/jupyter/.local/bin
shell_output=!gcloud config list --format 'value(core.project)' 2>/dev/null
GOOGLE_CLOUD_PROJECT=shell_output[0]
%env GOOGLE_CLOUD_PROJECT={GOOGLE_CLOUD_PROJECT}
# Docker image name for the pipeline image.
CUSTOM_TFX_IMAGE = 'gcr.io/' + GOOGLE_CLOUD_PROJECT + '/tfx-pipeline'
CUSTOM_TFX_IMAGE
Explanation: Step 1. Environment setup
Envirnonment Variables
Setup the your Kubeflow pipelines endopoint below the same way you did in guided project 1 & 2.
End of explanation
%%bash
LOCAL_BIN="/home/jupyter/.local/bin"
SKAFFOLD_URI="https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64"
test -d $LOCAL_BIN || mkdir -p $LOCAL_BIN
which skaffold || (
    curl -Lo skaffold $SKAFFOLD_URI &&
    chmod +x skaffold               &&
    mv skaffold $LOCAL_BIN
)
Explanation: You may need to restart the kernel at this point.
skaffold tool setup
End of explanation
!which skaffold
Explanation: Modify the PATH environment variable so that skaffold is available:
At this point, you shoud see the skaffold tool with the command which:
End of explanation
PIPELINE_NAME = 'guided_project_3' # Your pipeline name
PROJECT_DIR = os.path.join(os.path.expanduser("."), PIPELINE_NAME)
PROJECT_DIR
Explanation: Step 2. Copy the predefined template to your project directory.
In this step, we will create a working pipeline project directory and 
files by copying additional files from a predefined template.
You may give your pipeline a different name by changing the PIPELINE_NAME below. 
This will also become the name of the project directory where your files will be put.
End of explanation
!tfx template copy \
  --pipeline-name={PIPELINE_NAME} \
  --destination-path={PROJECT_DIR} \
  --model=taxi
%cd {PROJECT_DIR}
Explanation: TFX includes the taxi template with the TFX python package. 
If you are planning to solve a point-wise prediction problem,
including classification and regresssion, this template could be used as a starting point.
The tfx template copy CLI command copies predefined template files into your project directory.
End of explanation
!python -m models.features_test
!python -m models.keras.model_test
Explanation: Step 3. Browse your copied source files
The TFX template provides basic scaffold files to build a pipeline, including Python source code,
sample data, and Jupyter Notebooks to analyse the output of the pipeline. 
The taxi template uses the same Chicago Taxi dataset and ML model as 
the Airflow Tutorial.
Here is brief introduction to each of the Python files:
pipeline - This directory contains the definition of the pipeline
* configs.py — defines common constants for pipeline runners
* pipeline.py — defines TFX components and a pipeline
models - This directory contains ML model definitions.
* features.py, features_test.py — defines features for the model
* preprocessing.py, preprocessing_test.py — defines preprocessing jobs using tf::Transform
models/estimator - This directory contains an Estimator based model.
* constants.py — defines constants of the model
* model.py, model_test.py — defines DNN model using TF estimator
models/keras - This directory contains a Keras based model.
* constants.py — defines constants of the model
* model.py, model_test.py — defines DNN model using Keras
beam_dag_runner.py, kubeflow_dag_runner.py — define runners for each orchestration engine
Running the tests:
You might notice that there are some files with _test.py in their name. 
These are unit tests of the pipeline and it is recommended to add more unit 
tests as you implement your own pipelines. 
You can run unit tests by supplying the module name of test files with -m flag. 
You can usually get a module name by deleting .py extension and replacing / with ..
For example:
End of explanation
GCS_BUCKET_NAME = GOOGLE_CLOUD_PROJECT + '-kubeflowpipelines-default'
GCS_BUCKET_NAME
!gsutil ls gs://{GCS_BUCKET_NAME} | grep {GCS_BUCKET_NAME} || gsutil mb gs://{GCS_BUCKET_NAME}
Explanation: Step 4. Create the artifact store bucket
Note: You probably already have completed this step in guided project 1, so you may
may skip it if this is the case.
Components in the TFX pipeline will generate outputs for each run as
ML Metadata Artifacts, and they need to be stored somewhere.
You can use any storage which the KFP cluster can access, and for this example we
will use Google Cloud Storage (GCS).
Let us create this bucket if you haven't created it in guided project 1.
Its name will be &lt;YOUR_PROJECT&gt;-kubeflowpipelines-default.
End of explanation
<END_TASK>