<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Create a classifier to predict the wine color from wine quality attributes using this dataset
Step1:  Query for the data and create a numpy array
Step2:  Split the data into features (x) and target (y, the last column in the table)
Remember you can cast the results into an numpy array and then slice out what you want
Step3:  Create a decision tree with the data
Step4:  Run 10-fold cross validation on the model
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
%matplotlib inline
from sklearn import datasets
from sklearn import tree
from sklearn import metrics
from sklearn.tree import DecisionTreeClassifier
from sklearn.cross_validation import cross_val_score
import matplotlib.pyplot as plt
import numpy as np
from numpy import array
Explanation: Create a classifier to predict the wine color from wine quality attributes using this dataset: http://archive.ics.uci.edu/ml/datasets/Wine+Quality
The data is in the database we've been using
host='training.c1erymiua9dx.us-east-1.rds.amazonaws.com'
database='training'
port=5432
user='dot_student'
password='qgis'
table name = 'winequality'
End of explanation
import pg8000
conn = pg8000.connect(host='training.c1erymiua9dx.us-east-1.rds.amazonaws.com', port= 5432, database= 'training', user= 'dot_student', password= 'qgis')
cursor = conn.cursor()
cursor.execute("select column_name from information_schema.columns where table_name='winequality'")
column_name=[]
for item in cursor.fetchall():
    column_name.append(item)
    print(item)
cursor.execute("select * from winequality")
data=[]
for item in cursor.fetchall():
    #print(item)
    data.append(item)
type(data)
my_array= array(data)
type(my_array)
Explanation: Query for the data and create a numpy array
End of explanation
x = my_array[:,:11]
y = my_array[:,11:] #two dimensional y array
y2= my_array[:,11] #one dimensional y array THIS IS THE ONE WE NEED
Explanation: Split the data into features (x) and target (y, the last column in the table)
Remember you can cast the results into an numpy array and then slice out what you want
End of explanation
dt= DecisionTreeClassifier()
dt= dt.fit(x,y)
Explanation: Create a decision tree with the data
End of explanation
scores = cross_val_score(dt, x, y2, cv=10)
scores
Explanation: Run 10-fold cross validation on the model
End of explanation
<END_TASK>