- 博客(82)
- 收藏
- 关注
原创 XGBoost介绍
XGBoost介绍文章目录XGBoost介绍一.决策树二.信息增益和信息增益比三.剪枝四.CART算法回归树分类树CART 剪枝五.前向分步算法提升树模型梯度提升树模型六.XGBoost算法一.决策树 If-Else规则的集合,将样本递归地划分到对应的子空间,实现样本的分类。二.信息增益和信息增益比熵:H(X)=−∑i=1npilogpiH(X)=-\sum_{i=1}^np...
2019-05-06 15:21:26
643
原创 nlp基础
from sklearn.feature_extraction.text import CountVectorizerIn [2]:vect = CountVectorizer()vectOut[2]:CountVectorizer(analyzer='word', binary=False, decode_error='strict', dtype=<class ...
2018-05-10 08:41:52
421
原创 数据分析基础(一)
# coding: utf-8# In[1]:import pandas as pd# In[4]:data = pd.read_csv('pokemon.csv')# In[6]:data.head()# In[12]:import numpy as np # linear algebraimport pandas as pd # data pro...
2018-05-09 17:15:20
527
原创 sql之查询,连接查询,更新操作
-- 1.1 Select the names of all the products in the store.select Name from Products;-- 1.2 Select the names and the prices of all the products in the store.select name, price from products;-- 1.3...
2018-04-02 16:07:51
811
原创 sql之建表,插入操作
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255) NOT NULL, PRIMARY KEY (Code) );CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255) NOT NULL , Price DECIMAL NOT NULL ,...
2018-04-02 11:42:34
832
原创 行人识别与流量统计
行人识别:使用现有深度学习模型比如yolo,rcnn等流量统计:主要是判断上下两个方向,所以要设两条线,并存下每帧的行人(根据box转化为中心)。每次当前点与上一帧比较,设定一定距离判断是否是同一个人,再判断是否在区域内以及是先经过的哪条线来判断行人方向。结果如下:...
2018-03-24 16:49:32
5436
4
原创 可视化基础
plt.plot(first_twelve['DATE'],first_twelve['VALUE'])plt.xticks(rotation = 90)plt.xlabel('Month')plt.ylabel('Unemployment Rate')plt.title('Monthly Unemployment Trends, 1948')plt.show()plt.plot(wom...
2018-03-22 14:26:13
288
原创 pandas基本操作
import pandasfood_info = pandas.read_csv("food_info.csv")print(type(food_info))print(food_info.columns)print(food_info.head(2))col_names = food_info.columns.tolist()gram_columns = []for c in co...
2018-03-21 09:21:28
240
原创 numpy练习
highest_value = 0highest_key = Nonefor country in totals: consumption = totals[country] if highest_value < consumption: highest_value = consumption highest_key = countryto...
2018-03-20 16:45:24
282
原创 numpy基本操作
>>matrix = np.array([ [5, 10, 15], [20, 25, 30], [35, 40, 45] ])>> matrix[:,1]array([10, 25, 40])>> ma...
2018-03-20 11:54:24
263
原创 finetune模型例子
from keras.applications.inception_v3 import InceptionV3from keras.preprocessing import imagefrom keras.models import Modelfrom keras.layers import Dense, GlobalAveragePooling2Dfrom keras import ba...
2018-03-19 09:34:48
967
原创 opencv 找出面板缺陷
通过使用opencv找出面板中的缺陷原图是这样的:很明显通过肉眼我们能看到有一条黑色的横线。通过openc操作:代码在https://github.com/Juary88/DL_Defect 欢迎star...
2018-03-09 16:04:38
3240
原创 jupyter 安装出现错误
jupyter pip出现错误:Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSCo
2018-02-06 10:50:47
2061
原创 defect检测以及attention map
通过深度学习的方法,自动判defect类型。并画出attention map。找到其中的defect位置,就可以不用Rcnn等方法去标记bbox。 github: https://github.com/Juary88/DL_Defect/
2018-01-22 10:50:31
2131
1
原创 天气爬虫实例
这次的例子性价比高啊,正则表达式,模拟登陆,验证码识别都会一步一步实现,教你怎么去爬取天气数据。 爬取网站为: http://data.cma.cn看到了登陆界面点击登陆发现弹出: 现在就模拟要高模拟登陆了,以及发现了没有,还有验证码。当然你牛的话可以搞深度学习识别验证码,cnn什么的,但是label起来或者找到验证码生成机制很麻烦啊。所以直接使用pytesseract,pytesser3验证
2017-12-28 17:05:21
1033
原创 python基础之(map, filter,reduce,lambda,global 变量)
map(square, range(5))Out[9]:[0, 1, 4, 9, 16]filter(f, sq) 函数的作用相当于,对于 sq 的每个元素 s,返回所有 f(s) 为 True 的 s 组成的列表,相当于:[s for s in sq if f(s)]In [10]:def is_even(x): return x % 2 == 0filter(is_even,
2017-12-22 11:16:54
360
原创 论文阅读《Network in Network》
这篇文章关注点两个: 1 全连接层用gap替换 2 使用con(1,1)进行feature map 的组合以及降维,升维 3 使用mlpcon代替con 链接 http://blog.youkuaiyun.com/mounty_fsc/article/details/51746111 http://blog.youkuaiyun.com/hjimce/article/details/50458190
2017-12-21 11:01:06
402
转载 论文阅读-《Learning Deep Features for Discriminative Localization》
最近想找一个不用label位置的目标检测算法,不像faster-rcnn,mask_rcnn,yolo等这篇文章的一个重要思想就是 1 关于全连接层不能保持spatial information的理解 相比全连接层,卷积层是一个spatial-operation,能够保持物体的空间信息(translation-variant)。比如一个物体原来在左上角,卷积之后的结果feature-map在左上
2017-12-19 08:23:59
361
原创 微信公众号机器人开发
假设有个场景,机器人帮助用户询问安装电视,对用户提出的安装预定进行自动记录和提取里面关键信息,比如姓名,电话,购买电视机型号,安装地址等。。这样可以节约许多的人力,使用机器人客服去自动提取这些信息。可以先看说明,再到github参考代码。 github链接如下:客服机器人链接 欢迎star,不了解可以提问哦 此机器人属于任务型目前仅仅对于电视安装预定部分,不像微软小冰等。 首先的以个人微信的
2017-12-14 17:29:11
1548
原创 微信公众号开发自动回复
不想把服务搞在sae上,也不想搞什么反向代理直接来快速简单的。首先需要的是: ngrok:穿透内网。首先想到的是花生壳,用于穿透内网,原理上是可行的,不过linux下使用极其麻烦 但是ngro,它是跨平台的 下载安装地址: https://ngrok.com/download 怎么使用讲解的很清楚了WeRobot:一个微信公众号开发框架import werobotrobot = werob
2017-12-08 15:17:42
980
原创 rasa_nlu配置过程
1 在centos上安装conda install libgccsudo apt-get install g++pip install git+https://github.com/mit-nlp/MITIE.git2 安装numpy,需要安装python-devel 再安装需要的库3 yum install lsof 查看端口号占用进程 lsof -i:50004 训练模型pytho
2017-11-29 16:59:50
3931
原创 python调用Hanlp进行命名实体识别
1 python与jdk版本位数一致 2 pip install jpype1(python3.5) 3 类库hanlp.jar包、模型data包、配置文件hanlp.properties放在一个新建目录 4 修改hanlp.properties中root根目录,找到data代码调用如下:#coding:utf-8'''Created on 2017-11-21@author: 刘帅''
2017-11-21 13:39:53
8381
3
原创 R-CNN原理
R-CNN讲得比较好的文章: http://blog.youkuaiyun.com/shenxiaolu1984/article/details/51066975 http://blog.youkuaiyun.com/WoPawn/article/details/52133338 http://blog.youkuaiyun.com/liumaolincycle/article/details/49787101这里突然产生对激活
2017-11-20 11:43:07
427
原创 jupyternotebook 解压文件
应需要很多测试集图片,copy .rar格式图片集 首先安装rar%%bashapt-get install rar unrar%%bashunrar x simpsons_dataset.rar注意x表示保留当前路径 e表示直接解压出来在根目录
2017-11-15 15:54:05
10117
原创 聊天机器人开发思路(样板式模型)
最近打算弄一个智能客服的东西,就是辅助客服讲述帮助用户如何安装电视机的流程。现在记录下吧: 一开始查了很多rnn,lstm,s2s等模型,发现都是那种生成式模型。 而且需要大量训练集,效果不是很理想。对于此任务应该是一个task-oriented。一般有三种方法:样板式模型 (Rule-based model)检索式模型 (Retrieval-based model)生成式模型 (Gener
2017-11-11 11:50:02
3809
原创 Sequence to Sequence 实现机器翻译(keras demo)
最近在研究对话机器人,刚好看了几篇论文,参考keras demo理解。 原理请参考:- Sequence to Sequence Learning with Neural Networks https://arxiv.org/abs/1409.3215- Learning Phrase Representations using RNN Encoder-Decoder for S
2017-11-06 17:48:56
3574
原创 tf.nn.conv2d
conv2d( input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None)padding: A string from: "SAME", "VALID". The type of padding algorithm to use.注意
2017-11-01 11:06:50
252
原创 numpy.expand_dims
numpy.expand_dims(a, axis)[source] Expand the shape of an array. Insert a new axis that will appear at the axis position in the expanded array shape. Note Previous to NumPy 1.13.0, neither
2017-10-30 10:27:04
4123
原创 tf.argmax()用法
tf.argmax(vector, 1):返回的是vector中的最大值的索引号,如果vector是一个向量,那就返回一个值,如果是一个矩阵,那就返回一个向量,这个向量的每一个维度都是相对应矩阵行的最大值元素的索引号。import tensorflow as tf import numpy as np A = [[1,3,4,5,6]] B = [[1,3,4], [2,4,1]] wi
2017-10-23 16:01:48
1004
原创 TF中的tf.Variable 和 tf.placehold 的区别
1 tf.placehold 占位符。 主要为真实输入数据和输出标签的输入, 用于在 feed_dict中的变量,不需要指定初始值,具体值在feed_dict中的变量给出。2 tf.Variable 主要用于定义weights bias等可训练会改变的变量,必须指定初始值。
2017-10-23 09:40:05
408
原创 人脸实时情绪与性别识别
最近弄一个情绪识别与性别识别的东东。 opencv + keras opencv用于人脸检测 keras用于训练出识别模型数据集用于kaggle的(FER2013)CNN进行训练。代码如下:import cv2import sysimport jsonimport timeimport numpy as npfrom keras.models import model_from_js
2017-10-19 16:22:25
3628
3
原创 two_sum
#coding:utf-8'''Created on 2017-9-28@author: 刘帅'''"""Given an array of integers, return indices of the two numberssuch that they add up to a specific target.You may assume that each input would
2017-09-28 08:37:11
311
原创 Three_sum
#coding:utf-8'''Created on 2017-9-27@author: 刘帅'''"""Given an array S of n integers, are there elements a, b, c in Ssuch that a + b + c = 0?Find all unique triplets in the array which gives the
2017-09-27 08:52:19
328
原创 summary_ranges
#coding:utf-8'''Created on 2017-9-25'''def summary_ranges(nums): res = [] if len(nums) == 1: return [str(nums[0])] i = 0 while i < len(nums): num = nums[i] whi
2017-09-25 08:31:11
425
原创 subsets
#coding:utf-8'''Created on 2017-9-24@author: 刘帅'''def subsets(nums): res = [] backtrack2(res,nums,[],0) return resdef backtrack(res,nums,stack,pos): if pos == len(nums): res
2017-09-24 13:05:57
301
原创 rotate_array
#coding:utf-8'''Created on 2017-9-24@author: 刘帅'''def rotate_new_list(nums,k):#新开一个数组 t = [] for i in range(len(nums)): #print i #print (i + k)%7 t.insert((i + k)%7,
2017-09-24 11:19:41
223
原创 one_plus
#coding:utf-8'''Created on 2017-9-22@author: 刘帅'''def plus_1(num_arr): #print enumerate(num_arr) #print list(enumerate(num_arr)) #print reversed(list(enumerate(num_arr))) for idx, d
2017-09-22 14:02:38
282
原创 missing_range
#coding:utf-8'''Created on 2017-9-21@author: 刘帅'''## find missing ranges between low and high in the given array.# ex) [3, 5] lo=1 hi=10 => answer: [1->2, 4, 6->10]def missing_ranges(nums,lo,hi):
2017-09-21 09:22:33
289
原创 merge_intervals
#coding:utf-8'''Created on 2017-9-20"""Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]."""'''class Int
2017-09-20 08:59:12
434
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人