<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Prediction of diabetes with scikit-learn
Only the essential bits of code
Imports
Step1:  Load data and have initial look
Step2:  Look at class distribution
Step3:  Data in the table is organized the following way
Step4:  Split the data in training and test set
Step5:  Train the model
Step6:  Predict y (class) on test set and probabilities that sample belongs to each of two classes.
Step7:  Calculate confusion matrix
|          | Predicted Positive | Predicted Negative|
|----------|-----------|----------|
| Positive |     TP    |    FN    | 
| Negative |     FP    |    TN    |
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import numpy as np
from sklearn.metrics import roc_curve, roc_auc_score, auc, recall_score, accuracy_score, confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
Explanation: Prediction of diabetes with scikit-learn
Only the essential bits of code
Imports
End of explanation
df = pd.read_csv('../data/pima-indians-diabetes-data.csv', index_col=[0])
df.head()
df.describe()
Explanation: Load data and have initial look
End of explanation
len(df[df['class'] == 1]), len(df[df['class'] == 0])
Explanation: Look at class distribution
End of explanation
X = df.drop('class', axis=1).values
y = df['class'].values
Explanation: Data in the table is organized the following way: 
| Samples  | Feature 1 | Feature 2 | ... | Class |
|----------|-----------|-----------|-----|-------|
| Sample 1 |     12    |    600    | ... |   1   |
| Sample 2 |      9    |    932    | ... |   0   |
Extract values for the machine learning.
X - are features
y - class, target value
End of explanation
X_train, X_test, y_train, y_test = train_test_split(X, y)
Explanation: Split the data in training and test set
End of explanation
clf = RandomForestClassifier(n_estimators=100)
clf.fit(X_train, y_train)
Explanation: Train the model
End of explanation
y_pred = clf.predict(X_test)
y_pred_proba = clf.predict_proba(X_test)
print("AUC: %.3f" % roc_auc_score(y_test, y_pred_proba.T[1]))
Explanation: Predict y (class) on test set and probabilities that sample belongs to each of two classes.
End of explanation
confusion_matrix(y_test, y_pred, labels=[1,0])
recall_score(y_test, y_pred, pos_label=1) # Low-moderate sensitivity
recall_score(y_test, y_pred, pos_label=0) # High specificity 
Explanation: Calculate confusion matrix
|          | Predicted Positive | Predicted Negative|
|----------|-----------|----------|
| Positive |     TP    |    FN    | 
| Negative |     FP    |    TN    |
End of explanation
<END_TASK>