<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Movie Review Explanations
We will use an SKLearn classifier built on movie sentiment data which predicts positive or negative sentiment for review text. 
The Kfserving resource provdes
Step1:  Get Explanation for Negative Prediction
Step2:  Show precision. How likely predictions using the Anchor features would produce the same result.
Step3:  Get Explanation for Positive Example
Step4:  Show precision. How likely predictions using the Anchor features would produce the same result.
Step5:  Teardown
<ASSISTANT_TASK:>
Python Code:
!pygmentize moviesentiment.yaml
!kubectl apply -f moviesentiment.yaml
CLUSTER_IPS=!(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
CLUSTER_IP=CLUSTER_IPS[0]
print(CLUSTER_IP)
SERVICE_HOSTNAMES=!(kubectl get inferenceservice moviesentiment -o jsonpath='{.status.url}' | cut -d "/" -f 3)
SERVICE_HOSTNAME=SERVICE_HOSTNAMES[0]
print(SERVICE_HOSTNAME)
import sys
sys.path.append('../')
from alibi_helper import *
from alibi.datasets import fetch_movie_sentiment
movies = fetch_movie_sentiment()
idxNeg = 37
idxPos = 5227
for idx in [idxNeg,idxPos]:
    print(movies.data[idx])
    show_prediction(predict(movies.data[idx:idx+1],'moviesentiment',movies,SERVICE_HOSTNAME,CLUSTER_IP))
Explanation: Movie Review Explanations
We will use an SKLearn classifier built on movie sentiment data which predicts positive or negative sentiment for review text. 
The Kfserving resource provdes:
   * A pretrained sklearn model stored on a Google bucket
   * A Text Seldon Alibi Explainer. See the Alibi Docs for further details.
End of explanation
exp = explain(movies.data[idxNeg:idxNeg+1],"moviesentiment",SERVICE_HOSTNAME,CLUSTER_IP)
show_anchors(exp['data']['anchor'])
Explanation: Get Explanation for Negative Prediction
End of explanation
show_bar([exp['data']['precision']],[''],"Precision")
show_bar([exp['data']['coverage']],[''],"Coverage")
show_feature_coverage(exp['data'])
show_examples(exp['data'],0,movies)
show_examples(exp['data'],0,movies,False)
Explanation: Show precision. How likely predictions using the Anchor features would produce the same result.
End of explanation
exp = explain(movies.data[idxPos:idxPos+1],"moviesentiment",SERVICE_HOSTNAME,CLUSTER_IP)
show_anchors(exp['data']['anchor'])
Explanation: Get Explanation for Positive Example
End of explanation
show_bar([exp['data']['precision']],[''],"Precision")
show_bar([exp['data']['coverage']],[''],"Coverage")
show_feature_coverage(exp['data'])
show_examples(exp['data'],0,movies)
show_examples(exp['data'],0,movies,False)
Explanation: Show precision. How likely predictions using the Anchor features would produce the same result.
End of explanation
!kubectl delete -f moviesentiment.yaml
Explanation: Teardown
End of explanation
<END_TASK>