Demo entry 6640470

py

   

Submitted by p on Sep 12, 2017 at 04:41
Language: Python 3. Code size: 457 Bytes.

# -*- coding: UTF-8 -*-
import numpy as np

"""
函数说明:创建数据集

Parameters:

Returns:
    group - 数据集
    labels - 分类标签
Modify:
    2017-07-13
"""
def createDataSet():
    #四组二维特征
    group = np.array([[1,101],[5,89],[108,5],[115,8]])
    #四组特征的标签
    labels = ['爱情片','爱情片','动作片','动作片']
    return group, labels
if __name__ == '__main__':
    #创建数据集
    group, labels = createDataSet()
    #打印数据集
    print(group)
    print(labels)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).