#-*- coding: utf-8 -*-
# pylint: disable=E1101
from random import shuffle
import matplotlib.pyplot as plt
import pandas as pd
from keras.layers.core import Activation, Dense
from keras.models import Sequential
from scipy.interpolate import lagrange
from sklearn.externals import joblib
from sklearn.metrics import confusion_matrix, roc_curve
from sklearn.tree import DecisionTreeClassifier
"""
cm_plot-->自定義混淆矩陣可視化
programmer_1-->使用拉格朗日插值法進行插值
programmer_2-->構建CART決策樹模型,進行預測給出訓練結果,並且繪制ROC曲線
programmer_3-->使用神經網絡模型,進行預測給出訓練結果,並且繪制ROC曲線
"""
def cm_plot(y, yp):
cm = confusion_matrix(y, yp)
plt.matshow(cm, cmap=plt.cm.Greens)
plt.colorbar()
for x in range(len(cm)):
for y in range(len(cm)):
plt.annotate(
cm[x, y],
xy=(x, y),
horizontalalignment='center',
verticalalig