def createDataSet(s=0):# {{{
    """
    生成测试数据
    """
    if s == 2:
        dataSet = [
                [1, 2, 'A'],
                [3, 4, 'B'],
                [1, 3, 'E'],
                [3, 6, 'C'],
                [5, 7, 'D'],
                [4, 9, 'B'],
                [4, 3, 'D'],
                [8, 1, 'A']]
        labels = ['first', 'second']
    elif s == 1:
        """
        第2特征:
        1 --> A
        2 --> B
        3 --> C
        """
        dataSet = [
                [1, 1, 'A'],
                [2, 2, 'B'],
                [0, 3, 'C'],
                [1, 3, 'C'],
                [0, 2, 'B'],
                [1, 1, 'A'],
                [2, 2, 'B'],
                [1, 1, 'A']]
        labels = ['first', 'second']
    else:
        dataSet = [
                [1, 1, 'yes'],
                [1, 1, 'yes'],
                [1, 0, 'no'],
                [0, 1, 'no'],
                [0, 1, 'no']]
        labels = ['no surfacing','flippers']

    return dataSet, labels