摘要: 三、数据预处理 作者:Chris Albon 译者:飞龙 协议:CC BY-NC-SA 4.0 为 Scikit-Learn 转换 Pandas 类别数据 # 导入所需的库 from sklearn import preprocessing import pandas as pd raw_data 阅读全文
posted @ 2018-11-09 21:00 绝不原创的飞龙 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 二、数据准备 作者:Chris Albon 译者:飞龙 协议:CC BY-NC-SA 4.0 从字典加载特征 from sklearn.feature_extraction import DictVectorizer staff = [{'name': 'Steve Miller', 'age': 阅读全文
posted @ 2018-11-09 20:59 绝不原创的飞龙 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 一、向量、矩阵和数组 作者:Chris Albon 译者:飞龙 协议:CC BY-NC-SA 4.0 转置矩阵或向量 # 加载库 import numpy as np # 创建向量 vector = np.array([1, 2, 3, 4, 5, 6]) # 创建矩阵 matrix = np.ar 阅读全文
posted @ 2018-11-09 20:58 绝不原创的飞龙 阅读(4) 评论(0) 推荐(0) 编辑