![](https://img-blog.csdnimg.cn/20190927151117521.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
机器学习
机器学习
Xiaoweidumpb
这个作者很懒,什么都没留下…
展开
-
泰坦尼克号预测
import pandas as pd# 1、获取数据path = "http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic.txt"titanic = pd.read_csv(path)titanic.head() row.names pclass survived name age embarked原创 2020-12-05 11:33:08 · 403 阅读 · 0 评论 -
肿瘤预测
import pandas as pdimport numpy as np#1.读取数据path="https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data"column_name = ['Sample code number', 'Clump Thickness', 'Uniformity of Cell Size', 'Unifo原创 2020-12-05 11:34:24 · 443 阅读 · 0 评论 -
python-数据处理
import pandas as pd# 读取整个csv文件path='C:/Users/18578/Desktop/testCF.csv'orgin_data = pd.read_csv(path,header=None)items=orgin_data.iloc[:,1].drop_duplicates().sort_values()user=orgin_data.iloc[:,0].drop_duplicates().sort_values()print(items)print(u原创 2020-12-05 11:27:32 · 128 阅读 · 0 评论 -
波士顿房价
'''正规方程的优化方法对波士顿房价进行预测'''from sklearn.datasets import load_bostonfrom sklearn.model_selection import train_test_splitfrom sklearn.preprocessing import StandardScalerfrom sklearn.linear_model import LinearRegressionfrom sklearn.metrics import mean_sq原创 2020-12-05 11:25:54 · 293 阅读 · 0 评论 -
facebook登录预测
import pandas as pddata=pd.read_csv('D:/BaiduNetdiskDownload/Python3天快速入门机器学习项目资料/机器学习day2资料/02-代码/FBlocation/train.csv')data.head() row_id x y accuracy time place_id 0原创 2020-12-05 11:28:39 · 224 阅读 · 0 评论 -
python-数据处理-合并表
# 1读取数据#.2.合并表#3.找到user_id和aisle_之间的关系import pandas as pd#1.获取数据order_products=pd.read_csv("C:/Users/18578/Desktop/instacart/order_products__prior.csv")products=pd.read_csv('C:/Users/18578/Desktop/instacart/products.csv')orders=pd.read_csv('C:/User原创 2020-12-05 11:32:00 · 332 阅读 · 0 评论 -
机器学习实战第三章KNN学习笔记1
监督学习使用两种类型的目标变量 标称型:真假,动物分类集合{爬行类,鱼类} 数值型:0.100,4200,100.43# -*- coding: UTF-8 -*-import numpy as npimport operatordef createDataSet(): #四组二维特征 group = np.array([[1,101],[5,89],[108,5],[115,8]]) #四组特征的标签 labels = ['爱情片','爱情片','原创 2021-03-30 20:25:10 · 218 阅读 · 0 评论 -
K-means 小麦数据集
import numpy as npimport matplotlib.pyplot as pltfrom sklearn import preprocessingfrom sklearn.decomposition import PCA#加载数据data = np.loadtxt("C:/Users/18578/Desktop/Anaconda/seeds_dataset.txt")x = data[:,1:7]print(x)dataset= preprocessing.scale(x原创 2021-07-06 08:19:01 · 2967 阅读 · 5 评论