现在我们在kaggle上的数据集上做一次实验,这个数据集有训练集和测试集,训练集便于我们训练模型,测试集用来校验我们模型的正确性,这是最简单的。
需要导入的库
import pandas as pd # load csv's (pd.read_csv)
import numpy as np # math (lin. algebra)
import sklearn as skl # machine learning
from sklearn.ensemble import RandomForestClassifier
#from plotnine import *
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn_pandas import DataFrameMapper
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import classification_report