![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习实战
Sany 何灿
这个作者很懒,什么都没留下…
展开
-
构建函数 - 画学习曲线learning curves | Python
from sklearn.metrics import mean_square_errorfrom sklearn.model_selection import train_test_splitimport numpy as npimport matplotlib.pyplot as pltdef plot_learning_curves(model, X, y): """ 画学习曲线 parameters ---------- model: 模型原创 2020-07-01 22:58:22 · 994 阅读 · 0 评论 -
垃圾邮件辨别 | 实战(四)
1. 获取和加载数据import osimport tarfilefrom six.moves import urllibDOWNLOAD_ROOT = "http://spamassassin.apache.org/old/publiccorpus/"HAM_URL = DOWNLOAD_ROOT + "20030228_easy_ham.tar.bz2"SPAM_URL = DOWNLOAD_ROOT + "20030228_spam.tar.bz2"SPAM_PATH = os.pat原创 2020-05-26 17:26:31 · 885 阅读 · 0 评论 -
Titanic | 实战(三)
1. 获取和加载数据import osimport pandas as pdTITANIC_PATH = os.path.join("datasets", "titanic")def load_titanic_data(filename, titanic_path=TITANIC_PATH):# 加载数据 csv_path = os.path.join(titanic_path, filename) return pd.read_csv(csv_path)train_data = lo原创 2020-05-25 14:08:29 · 359 阅读 · 0 评论 -
数字识别 | 实战(二)
1. 设定# To support both python 2 and python 3from __future__ import division, print_function, unicode_literals# Common importsimport numpy as npimport osnp.random.seed(42)%matplotlib inlineimport matplotlib as mplimport matplotlib.pyplot as plt原创 2020-05-24 17:15:55 · 415 阅读 · 0 评论 -
预测房价 | 实战(一)
1.设置确保matplotlib工作和写函数来保存图片保证python2和python3的可以使用from __future__ import division, print_function, unicode_literalsimport numpy as npimport os# 确保notebook运行时结果稳定np.random.seed(42)# 修改默认属性%matplotlib inlineimport matplotlib as mplimport matplot原创 2020-05-16 17:43:34 · 684 阅读 · 0 评论