- 博客(7)
- 收藏
- 关注
原创 为什么我用遗传算法处理这个函数,去寻找他的最大/最小值的时候,结果是这样呢
@遗传算法gaot箱的问题 #如题,为什么我用遗传算法处理这个函数,去寻找他的最大/最小值的时候,结果是这样呢?应该不是陷入局部最小值把? y = -4:0.2:4; x = -4:0.1:4; [x,y]=meshgrid(x,y); % meshgrid函数的作用就在于把行向量变成矩阵,从而能够在后面计算中把z变成矩阵 z = y.*exp(-x.^2-y.^2); figure mesh...
2020-03-20 13:08:13
424
原创 Andrew NG 的ML3 作业纪律
很早之前就完成了,然后突然有个东西感觉没搞懂,上来重新弄了弄。记录一下 多元逻辑回归: lrCostFunction: m = length(y); % number of training examples J = 0; grad = zeros(size(theta)); temp=[0;theta(2:end)]; % theta(1)不参与正则化 J= -1 * sum( y .*...
2019-04-28 12:12:11
272
原创 爬虫将文件保存到制定路径
爬虫将文件保存到制定路径 利用os库的方式 def mkdir(path): # os.path.exists(name)判断是否存在路径 # os.path.join(path, name)连接目录与文件名 isExists = os.path.exists(os.path.join("E:\爬虫\weibo",path)) if not isExists: print(...
2019-04-18 23:39:26
3899
原创 小白爬虫3,爬取图片
今天来爬一爬图片 学习链接来自于 https://www.jqhtml.com/13393.html 爬的图片 http://i.jandan.net/ooxx 中的1-33页 现在看1-33页的表达方式 http://jandan.net/ooxx/ page-32 仅仅只是page-32 这一块变了,所以目的很明确,for循环一下就好了 但是不可能每次爬虫都看一下有几页,所以要他自动抓取 对...
2019-04-18 17:06:45
310
原创 Couldn't find a tree builder with the features you requested: lxml.解决方案
我的情况如下: 我在pip install lxml的时候,系统告诉我已经装好了,但是在.py文件调试跟cmd 的python调试的时候,lxml又不能使用, 会报错bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a par...
2019-04-18 10:12:42
6733
2
原创 巨小白爬虫2
豆瓣爬虫纪律 关于find()和find_all() import requests from bs4 import BeautifulSoup resp = requests.get('https://book.douban.com/top250?start=0') soup = BeautifulSoup(resp.text,'html.parser') alldiv = soup.fin...
2019-04-18 10:12:23
199
原创 # 巨小白 爬虫记录
爬虫记录 从下面的连接学习的 https://www.jqhtml.com/13264.html 一.Request 用法 import requests response = requests.get('http://www.baidu.com/') 上式response得到了baidu的html 再利用 print(response.text) 就可以输出baidu的HTML了 带输出参...
2019-04-18 10:12:07
131
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅