()
return dataSet,labels
创建数据集
创建数据集
创建数据集
def createDataSet():
    '''
    创建数据集
    '''

    dataSet = [[1, 1, 0, 'y'],
               [1, 1, 0, 'y'],
               [1, 0, 0, 'n'],
               [0, 1, 0, 'n'],
               [0, 0, 1, 'n'],
               [1, 0, 1, 'n'],
               [1, 1, 1, 'n']]
    labels = ['Salary', 'Time', 'Bank flow']
    return dataSet,labels
def createDataSet ( ) : dataSet = [ [ 1 , 1 , 0 , 'y' ] , [ 1 , 1 , 0 , 'y' ] , [ 1 , 0 , 0 , 'n' ] , [ 0 , 1 , 0 , 'n' ] , [ 0 , 0 , 1 , 'n' ] , [ 1 , 0 , 1 , 'n' ] , [ 1 , 1 , 1 , 'n' ] ] labels = [ 'Salary' , 'Time' , 'Bank flow' ] return dataSet , labels