python3 学习使用api 支持向量机的两种核函数模型进行预测 git: https://github.com/linyi0604/MachineLearning from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.svm impor…
使用python3 学习了决策树分类器的api 涉及到 特征的提取,数据类型保留,分类类型抽取出来新的类型 需要网上下载数据集,我把他们下载到了本地, 可以到我的git下载代码和数据集: https://github.com/linyi0604/MachineLearning import pandas as pd from sklearn.cross_validation import train_test_split from sklearn.feature_extraction impor…
python3 学习api的使用 git: https://github.com/linyi0604/MachineLearning 代码: from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.tree import DecisionTr…
python3学习使用api 线性回归,和 随机参数回归 git: https://github.com/linyi0604/MachineLearning from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.linear_model i…
使用python语言 学习k近邻分类器的api 欢迎来到我的git查看源代码: https://github.com/linyi0604/MachineLearning from sklearn.datasets import load_iris from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.neighbors…
常用数据结构 1.list 列表 有序集合 classmates = ['Michael', 'Bob', 'Tracy'] len(classmates) classmates[0] len(classmates) - 1 classmates[-1] classmates[-2] classmates.append('Adam') classmates.insert(1, 'Jack') classmates.pop() classmates.pop(1) s = ['python', 'j…
python3 学习机器学习api 使用了三种集成回归模型 git: https://github.com/linyi0604/MachineLearning 代码: from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.ensemble…
python3 学习机器学习api 使用两种k近邻回归模型 分别是 平均k近邻回归 和 距离加权k近邻回归 进行预测 git: https://github.com/linyi0604/MachineLearning 代码: from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.preprocessing import Standard…
import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model,svm from sklearn.model_selection import train_test_split def load_data_regression(): ''' 加载用于回归问题的数据集 ''' diabetes = datasets.load_diabetes() #使用 scikit-lea…
import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model,svm from sklearn.model_selection import train_test_split def load_data_regression(): ''' 加载用于回归问题的数据集 ''' diabetes = datasets.load_diabetes() #使用 scikit-lea…