- 博客(21)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
原创 MySQL常用语句
文章目录增删根据一个或多个字段删除表中重复行改查增删根据一个或多个字段删除表中重复行表table_name中字段col1、col2、col3都相同则视为重复行。只留下表中字段col4最大的那行,删除其他重复行DELETE `a` FROM `table_name` AS `a`, `table_name` AS `b` WHERE `a`.`col4` < `b`.`c...
2019-05-21 12:39:21 147
转载 Python——BeautifulSoup
# coding=utf-8from bs4 import BeautifulSoupimport bs4import rehtml = """<html><head><title>THe Dormouse's story</title></head><body><p class="title" name="dromouse"><b> The Dormouse's story</b></
2016-08-03 20:20:09 402
转载 Python——requests库
# coding=utf-8import requests# 1 基本请求r1 = requests.post('http://httpbin.org/post')r2 = requests.get('http://httpbin.org/put')r3 = requests.delete('http://httpbin.org/delete')r4 = requests.head('h
2016-08-03 20:17:44 357
转载 Python——urllib库
一urllib库的基本使用1读取静态网页读取动态网页动态传送参数数据1 post方式2 get方式二urllib库的高级使用设置Headers代理设置超时设置一、urllib库的基本使用1读取静态网页import urllibimport urllib2url = 'http://cuiqingcai.com/947.html'print urllib2.urlopen(ur
2016-08-03 20:16:51 417
转载 Python——urllib库的高级使用
# coding=utf-8import urllibimport urllib2import reimport StringIOimport gzip# 1 提取动态的lt和executionurl = 'https://passport.csdn.net/account/login?from=http://my.csdn.net/my/mycsdn'string = urllib
2016-08-03 20:15:14 300
转载 Python——urllib库的基本使用
# coding=utf-8# Urllib库的基本使用import urllibimport urllib2# 1 读取网页内容:先使用urllib2.urlopen打开网址,再read读取html = 'http://cuiqingcai.com/947.html'response = urllib2.urlopen(html, )# print response.read()"
2016-08-03 20:01:36 295
转载 Python——pdb调试
# coding=utf-8import pdb"""1.从命令行使用python debugger调试脚本python -m pdb my_script.py2.从脚本内部设置断点import pdb: pdb.set_trace() c:继续执行 w:显示正在执行的代码的上下文信息 a:打印当前函数的参数列表 s:执行当前代码行,并停留在第一个能
2016-08-03 19:55:09 261
转载 Python——生成器
# coding=utf-8import time"""生成器(Generators):要理解生成器,得知道以下几个概念: 1.可迭代对象iterable: python中任意的对象,只要他定义了可以返回一个迭代器的__iter__方法, 或者定义了可以支持下标索引的__getitem__方法,那它就是一个可迭代对象. 简单地说,可迭代对象
2016-08-03 19:52:56 273
转载 Python——更新所有包
# coding=utf-8import pipfrom subprocess import callfor dist in pip.get_installed_distributions(): call("pip install --upgrade " + dist.project_name, shell=True)
2016-08-03 19:51:35 2777
转载 Python——**kwargs
# coding=utf-8# **kwargs允许不定长度的键值对作为参数传给函数# greet 问候def greet_me(**kwargs): for key, value in kwargs.items(): print(key, value) print(type(kwargs))greet_me(name1="Michael Jack", name2
2016-08-03 19:50:29 268
转载 Python——*args的用法
# coding=utf-8# *args主要用于函数定义,预先不知道会传递多少个参数,*args传递一个参数数量可变的元组类型给函数def test_var_args(f_arg, *args): print("第一个参数为", f_arg) print(args) print(type(args)) for arg in args: print(
2016-08-03 19:49:28 3082
转载 Python——itertools
import itertoolsnaturals = itertools.count(10) # 自然数序列,从10开始print(type(naturals))# for n in naturals:# print(n)cd = itertools.cycle('ABCDEFGHIJKLMNOPQRSTUVWXYZ') # 无限循环# for c in cd:# pr
2016-08-03 19:47:32 243
转载 Python——装饰器
# coding=utf-8def a_new_decorator(a_func): def wrapthefunction(): print("I'm doing some boring work before executing a_func()") a_func() print("I'm doing some boring work afte
2016-08-03 19:46:03 383
转载 数据挖掘——线性神经网络的Matlab实现
% 线性神经网络% 感知器的传输函数只能输出两种可能的值,而线性神经网络的输出可以是任意值% 线性神经网络采用widow-hoff学习规则,即lms(least mean square)来更新权值和偏置%% 1.newlind--设计一个线性层%{语法格式: net=newlind(P,T,Pi)P: R×Q矩阵,包含Q个训练输入向量T: S×Q矩
2016-08-03 19:35:17 1368
转载 数据挖掘——数据分析挖掘体系
数据分析挖掘体系分析工具数据探索1 数据质量分析11 缺失值分析12 异常值分析13 一致性分析2 数据特征分析21 分布分析22 对比分析23 统计量分析24 周期性分析25 贡献度分析26 相关性分析数据预处理1 数据清洗11 缺失值处理12 异常值处理2 数据集成21 实体识别22 冗余性识别3 数据变换31 函数变换32 规范化33 连续属性离
2016-08-03 17:53:29 1458 1
转载 数据挖掘——多层感知器手写体识别的Python实现
# coding=utf-8from sklearn.datasets import load_digitsfrom sklearn.cross_validation import train_test_split, cross_val_scorefrom sklearn.pipeline import Pipelinefrom sklearn.preprocessing import Sta
2016-08-03 17:47:48 751
转载 数据挖掘——多层感知器的Python实现
# coding=utf-8from sklearn.cross_validation import train_test_splitfrom sklearn.neural_network import MultilayerPerceptronClassifierimport numpy as np"""让我们训练一个多层感知器来近似XOR函数。目前,scikit-learn的0.16.1
2016-08-03 17:44:04 3973
转载 数据挖掘——多层感知器算法简介
XOR(抑或)是一种非线性函数,不能被线性可分人工神经网络简介人工神经网络由三部分组成: - 架构:描述神经元的层次与连接神经元的结构 - 激励函数 - 找出最优权重值的学习算法人工神经网络主要类型: 1. 前馈神经网络:最常用的神经网络类型,一般定义为有向无环图,信号只能沿着最终出入的那个方向传播 2. 反馈神经网络:网络图中有环.反馈环表示网络的一种内部状态多层感知器多层感知器(mu
2016-08-03 17:35:17 3139
转载 数据挖掘——单层感知器的Matlab实现
% 单层感知器%% 1.newp--创建一个感知器%{具体用法:net=newp(P,T,TF,LF);P: P是一个R×2的矩阵,R为感知器中输入向量的维度,每一行表示输入向量每个分量的取值 范围如P=[-1,1;0,1]表示输入向量是二维向量[x1,x2],且x1∈[-1,1],x2∈[0,1]T: T表示输出节点的个数,标量TF: 传输函数,可选hardlim和hardli
2016-08-03 17:31:18 9184
转载 数据挖掘——单层感知器的Python实现
Python——scikit-learn实现单层感知器scikit-learn 提供了感知器功能。和我们用过的其他功能类似,Perceptron类的构造器接受超参数设置。Perceptron类有fit_transform()和predict()方法。Perceptron类还提供了partial_fit()方法,允许分类器训练流式数据(streaming data)并做出预测。# coding=utf
2016-08-03 17:25:27 3449
转载 数据挖掘——单层感知器算法简介
神经网络的学习机理和机构感知器学习算法神经网络的学习机理和机构 在神经网络中,对外部环境提供的模式样本进行学习训练,并能存储这种模式,则称为感知器;对外部环境有适应能力,能自动提取外部环境变化特征,则称为认知器。 神经网络在学习中,一般分为有教师和无教师学习两种。感知器采用有教师信号进行学习,而认知器则采用无教师信号学习的。在主要神经网络如BP网 络,Hopfield网络,ART网络和
2016-08-03 17:09:01 1414
python 利用sklearn库做了线性回归,怎么得出线性表达式的各个参数
2016-03-12
TA创建的收藏夹 TA关注的收藏夹
TA关注的人