机器学习
qingliangdexiar
这个作者很懒,什么都没留下…
展开
-
R语言环境篇
1.简介R是一门数据分析语言,现在貌似比Python还流行,Spark中既提供了Python也提供了R接口。但是其学习难度也往往比较大。2.R的环境认识 下载R官网上提供的软件,最后成这个样子(R还有一个好的集成开发工具RStudio):、 3.R常用说明1)R和其他语言都需要安装相关包,才能具备相关函数功能安装方式分为离线和在线①离线...原创 2018-08-08 17:33:28 · 1158 阅读 · 0 评论 -
Python快速学习第五课
#coding=utf-8'''Created on 2018��9��8��顺序结构 if,elif,else循环结构:while,foreach @author: Administrator'''a=3b=4if a<1: print a-1elif a<2: print a-2else: print aprint "\n"#f...原创 2018-09-08 23:55:15 · 211 阅读 · 0 评论 -
python快速学习第六课
#coding=utf-8'''Created on 2018年9月8日@author: Administrator自定义函数,不需要返回类型。Python不管干什么都不需要定义类型,当然也没有返回值。lambda:匿名函数和Scala很像。'''def add(x,y): print x+ydef sub(): print "111"def isPrime...原创 2018-09-09 13:22:10 · 95 阅读 · 0 评论 -
Python快速学习第七课
#coding=utf-8'''Created on 2018年9月8日@author: Administrator文件读写操作'''#写文件fr=open(r"E:\abc.txt",'w')fr.write("author is wangpeng!!!!!!!\n")fr.write("author is zhangsan!!!!!!!\n")fr.write("a...原创 2018-09-09 13:22:41 · 110 阅读 · 0 评论 -
python快速学习第八课
#coding=utf-8'''Created on 2018��9��9��@author: Administrator序列(字符串,列表和元祖),以及序列中常见的通用函数字符串其实是一个对象。标注类型运算符序列运算操作序列类型转换操作'''from audioop import reverse#标注类型运算符print 'apple' <"banana" ...原创 2018-09-09 13:23:30 · 294 阅读 · 0 评论 -
Python快速学习第九课
#coding=utf-8'''Created on 2018��9��9��@author: Administrator'''#排序Jscores=[9,8,5,6,7,2,0,1]ascore=11Jscores.sort(cmp=None, key=None, reverse=False)print Jscores#列表popJscores.pop()print ...原创 2018-09-09 13:24:24 · 395 阅读 · 0 评论 -
Python快速学习第十课
#coding=utf-8'''Created on 2018��9��9��@author: Administrator'''str1='adcde\"This is a Text"'#拆分方法s=str1.split('\"')[1]print sprint str1.index('\"')#title方法if str1.istitle(): print s...原创 2018-09-09 13:24:57 · 389 阅读 · 0 评论 -
Python快速学习第十一课
#coding=utf-8'''Created on 2018年9月9日创建字典方式很多,只要中间有个逗号即可。访问字典字典的基本操作@author: Administrator'''from __builtin__ import dict, zipfrom pickle import DICT#字典创建infoa=[(2,3),(4,6)]a=dict(infoa)...原创 2018-09-09 13:25:31 · 155 阅读 · 0 评论 -
Python与机器学习快速入门第一篇
#coding=utf-8'''数组的结构认识和理解numpy就是一个矩阵数据库scipy:线性代数数据库两个相结合矩阵结构理解:[[ 1. 1. 1. 1.] [ 1. 1. 1. 1.] [ 1. 1. 1. 1.]] 由于 [ 1. 1. 1. 1.] [ 1. 1. 1. 1.] [ 1. 1. 1. 1.], 这三...原创 2018-09-09 16:17:51 · 215 阅读 · 0 评论 -
Python快速学习第四课
#coding=utf-8'''#coding=utf-8Created on 2018��9��8��@author: Administrator内置函数:直接调用模块:导入函数,需要引入模块 from module import function.库:相关模块的集合包:包里面可以包含模块和子包,和库。帮助函数;help'''from __builtin__ imp...原创 2018-09-08 23:54:00 · 99 阅读 · 0 评论 -
Python快速学习第四课
#coding=utf-8'''#coding=utf-8Created on 2018��9��8��@author: Administrator内置函数:直接调用模块:导入函数,需要引入模块 from module import function.库:相关模块的集合包:包里面可以包含模块和子包,和库。帮助函数;help'''from __builtin__ imp...原创 2018-09-08 23:00:11 · 343 阅读 · 0 评论 -
Python快速学习第三课
#coding=utf-8'''Created on 2018��9��8��@author: Administrator本章内容: Python和数学表达式。 逻辑运算符 and or not 转义字符 r'''a= 3.3/2print a #和数学一样。b=3.3//2print b #和程序中的除号一样c=3.3...原创 2018-09-08 22:02:14 · 214 阅读 · 0 评论 -
R语言数据类型与数据对象
1.前言每种语言都有一定的数据类型,也必有其提供的数据对象(常用数据结构)2.数据类型a <- TRUE //逻辑类型,即编程语言中的boolean类型。print(mode(a)) //logical,逻辑类型b <- 23.5print(mode(b))//numeric,数字类型c <- 15Lclass(c)//返回的是inte...原创 2018-08-08 18:12:37 · 525 阅读 · 0 评论 -
R语言加载包和装载数据集
(1)编写程序离开不了调用函数,那么就有可能需要引包。 包操作: ①引包 引包,必须数据库已经安装了该包。 引包语句:library(discoverR) ②可以查询包的安装位置 查询语句:.libPaths() ③可以查询目前自己的库里安装了哪些包 查询语句: library()(2)编写程序离开不了了数据集,那么就有可能需要加载...原创 2018-08-30 20:46:01 · 13966 阅读 · 0 评论 -
R语言frame操作
1.为什么要介绍frame?之所以介绍frame,是因为frame就是sql中的表,数据分析其实都是围绕着表来的。2.frame有哪些操作既然围绕着表来操作,那么想想sql中怎么玩的,都有哪些函数①创建frameemp.data <- data.frame(emp_id <- c(1,2,3,4,5),+ emp_n...原创 2018-08-30 21:19:56 · 3232 阅读 · 0 评论 -
R语言图表操作
图表有很多,重点介绍几种图表①直方图:直方图不同于条形图,因其是连续的(条形的:条条框框的,直方的,直线式) v <- c(9,13,21,8,36,22,12,41,31,33,19)hist(x = v,main = "histogram",col = "red",border = "yellow")②箱线图:箱线图是数据集中的数据分布良好的度量。 它将数据集分...原创 2018-08-30 23:06:46 · 742 阅读 · 0 评论 -
R语言机器学习篇
机器学习算法有很多,主要围绕着线性和非线性。非线性的学习也是围绕着线性来解读的。线性回归:> x <- c(1,2,3,4)> y <- c(4,6,7,11)> lm(formula = y~x) ...原创 2018-08-31 00:14:11 · 3629 阅读 · 0 评论 -
分布式dplyr
分布式dplyr提供了对R中的dataframe和分布式dataframe提供了一致的操作接口原创 2018-08-31 00:17:24 · 111 阅读 · 0 评论 -
python快速入门第一课
#coding=utf-8 '''本章知识点:基本的输入和输出。换行键 \{} 表示: () 表示缩进''' '''段落注释'''#行注释# raw_input 返回的是char类型。'''s= raw_input("请输入数字")print s+1 #报错,char类型'''# input 返回的是 int类型n= input("...原创 2018-09-08 21:27:03 · 136 阅读 · 0 评论 -
Python快速学习第二课
#coding=utf-8'''Created on 2018年9月8日@author: Administrator本章知识点:基本数据类型 复数类型 bool类型存储基本的数据结构基本的函数使用'''from scipy.special._ufuncs import it2j0y0n1 = 3print type(n1) #数据类型函数<type...原创 2018-09-08 21:46:53 · 152 阅读 · 0 评论 -
python与机器学习快速入门第二章
#coding=utf-8'''数组的结构认识和理解numpy就是一个矩阵数据库scipy:线性代数数据库两个相结合矩阵结构理解:[[ 1. 1. 1. 1.] [ 1. 1. 1. 1.] [ 1. 1. 1. 1.]] 由于 [ 1. 1. 1. 1.] [ 1. 1. 1. 1.] [ 1. 1. 1. 1.], 这三...原创 2018-09-09 16:25:27 · 143 阅读 · 0 评论