电影评论分类:二分类问题
摘要:恢复内容开始 1.IMDB数据集 该数据集包含来自互联网电影数据库(IMDB)的 50 000 条严重两极分化的评论。数据集被分为用于训练的 25 000 条评论与用于测试的 25 000 条评论,训练集和测试集都包含 50% 的正面评论和 50% 的负面评论 1.1加载数据集 from tenso
阅读全文
posted @
2022-01-17 17:53
张家口体校毕业班学渣
阅读(111)
推荐(0) 编辑
新闻分类--多分类问题
摘要:1.加载路透社数据集 from tensorflow.keras.datasets import reuters (train_data,train_lables),(test_data,test_lables) = reuters.load_data(num_words=10000) 首次运行会自
阅读全文
posted @
2022-01-17 17:52
张家口体校毕业班学渣
阅读(62)
推荐(0) 编辑
Matplotlib
摘要:1.绘制图像,点和线 Matplotlib可以用来绘制条形图,饼状图,散点图等 例:用点和线绘制一些图像 点击查看代码 from array import array from PIL import Image from pylab import * im = array(Image.open('v
阅读全文
posted @
2022-01-15 11:39
张家口体校毕业班学渣
阅读(131)
推荐(0) 编辑
基本图像操作和处理
摘要:恢复内容开始 1.1PIL:Python图像处理类库 读取一幅图像 1 from PIL import Image 2 pil_img = Image.open('imagepath') 3 pil_img.show() 如图: 颜色转换,比如转换为灰度图 1 from PIL import Ima
阅读全文
posted @
2022-01-15 10:46
张家口体校毕业班学渣
阅读(33)
推荐(0) 编辑