自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ZenG的博客

极客矩阵

  • 博客(75)
  • 收藏
  • 关注

原创 1.1 Introduction to HTML

Online HTML padDev API DocsWeb Archive MachineEmmet DocsAtom shortcut cheatsheet: Ctrl + `Heading1 to 6 onlysearch google to see more heading html mdnHTML templatehtml hit enterhtml:4t ...

2018-12-23 16:59:32 226

原创 CMU课程推荐

CMU课程简介和先修查询 17437: Web Application Development (Django) 17214: Principles of Software ConstructionKeynotes 15110: Principles of Computing 15112: Fundamentals of Programming and C...

2018-12-22 18:17:32 3200

原创 机器学习学习网站

CIML

2018-11-05 19:51:24 301

原创 云计算:核心概念

ScalabilityA distributed program is considered to be scalable if it remains effective when the quantities of users, data, and resources increase significantly.从线性编程到分布式编程倍速公式:Ts: sequential pro...

2018-11-03 09:47:28 1787

原创 Distributed Programming: Synchronous vs Asynchronous

SynchronousA distributed program is synchronous if and only if the component tasks operate in lockstep.Such mechanisms usually have an important effect on performance.AsynchronousAsynchronous p...

2018-11-03 07:57:29 225

原创 Distributed Programming: Two Traditional Communication Mechanism

shared memory vs message passing文章目录Shared MemoryKey Abstraction:FeatureSynchronisation Mechanism1. Semaphore2. Locks3. BarrierExampleThe Message-Passing Programming ModelKey Abstraction:FeatureExamp...

2018-11-03 07:41:08 196

原创 Database Manipulation in Java (Netbeans & Derby)

文章目录Set up Derby Database in Netbeans1. Create a new Database2. Get the Database URL3. Add library to Java4.Code SkeletonLoad the Database DriverConnect to DatabaseCreate TableInsert Records using Sta...

2018-11-02 08:08:29 516

原创 Leetcode: Valid Parentheses

问题描述思路:考虑特殊情况栈(stack)来存储未配对的符号指针移动,如果和栈顶匹配,则弹栈指针移动,如果和栈顶不匹配,且属于给定的符号,则压栈终止条件为,遍历结束,栈空class Solution { public boolean isValid(String s) { // corner case 1 if (s...

2018-11-02 06:25:04 160

原创 Spark之RDD操作

// 读取文件,压缩文件和路径都可以val lines = sc.textFile("hdfs://localhost:9000/...") // hdfsval textFile = sc.textFile("file:///usr/local/spark/mycode/wordcount/word.txt") // local// 从driver的内存中读取val array = Ar...

2018-11-01 08:00:10 237

原创 Spark实战(5) DataFrame基础之处理缺失值

Drop Missing Valuefrom pyspark.sql import SparkSessionspark = SparkSession.builder.appName('aggs').getOrCreate()df = spark.read.csv('sales_info.csv', inferSchema = True, header = True)df.printSche...

2018-10-31 21:37:51 8333

原创 Spark实战(5) DataFrame基础之GroupBy和Aggregate

文章目录groupBy()AggregationAggregation FunctiongroupBy()from pyspark.sql import SparkSessionspark = SparkSession.builder.appName('aggs').getOrCreate()df = spark.read.csv('sales_info.csv', inferSche...

2018-10-31 19:54:26 7858

原创 Spark实战(4) DataFrame基础之数据筛选

文章目录filter写法一filter写法二条件符号获取结果filter写法一from pyspark.sql import SparkSessionspark = SparkSession.builder.appName('ops').getOrCreate()df = spark.read.csv('appe_stock.csv',inferSchema = True, heade...

2018-10-31 19:09:39 10230

原创 Spark实战(3) DataFrame基础之行列操作和SQL

文章目录行列操作SQL操作行列操作df['age'] # I only get a column objectdf.select('age').show() # I get a datafram with a column that we could use with show() method# see the first two row elementsdf.head(2) # r...

2018-10-31 18:40:59 741

原创 云计算之分布式编程(1)

基本概念串行(sequential):cpu一次只执行一个程序,按照顺序执行所有程序并行(concurrent):多个任务交替使用cpu资源,在时间上共享单一cpu资源并发(parallel):多个任务在多个cpu上同时执行分布式(distributed program):并发任务在不同的,互联的机器上执行(不仅仅是cpu)多任务(multitasking):用户可以同时运行多个任务(...

2018-10-31 18:15:59 799

原创 Spark实战(2) DataFrame基础之创建DataFrame

之前,RDD语法占主导,但是比较难用难学.现在,有了DataFrame,更容易操作和使用spark.文章目录创建DataFrame创建DataFrame(指定Schema)创建DataFramefrom pyspark.sql import SparkSession# 新建一个sessionspark = SparkSession.builder.appName('Basics')...

2018-10-31 18:15:22 773

原创 Spark实战(1) 配置AWS EMR 和Zeppelin Notebook

SparkContext和SparkSession的区别,如何取用?SparkContext:在Spark 2.0.0之前使用通过资源管理器例如YARN来连接集群需要传入SparkConf来创建SparkContext对象如果要使用SQL,HIVE或者Streaming的API, 需要创建单独的Context val conf = new SparkConf() .setA...

2018-10-31 17:40:41 1245

转载 Linux如何定位JDK Path

Linux如何查看JDK的安装路径

2018-10-23 21:52:21 505

转载 Ubuntu 16.04安装Java JDK8

Ubuntu 16.04安装Java JDK8

2018-10-23 21:47:43 231

原创 Install spaCy

For mac OS pip install -U spacy python -m spacy download en

2018-10-23 20:29:02 1215

原创 Introduction to Scala

Introduction to ScalaScala is becoming popularTwitter and Linkedin is using scalaScala combines oop and functional programmingScala has good support of concurrencyInstall ScalaFor LinuxInst...

2018-10-23 13:46:58 174

原创 Install Scala SBT

# install stageecho "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.listsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF734...

2018-10-22 21:45:38 321

原创 Install Scala Shell

# download the install debwget https://downloads.lightbend.com/scala/2.12.7/scala-2.12.7.deb# install the deb pacakgesudo dpkg -i scala-2.12.7.deb# check the versionscala -version# enter the sca...

2018-10-22 20:56:23 171

转载 Auto-Scaling

AutoScaling 是 AWS 比较核心的一个服务,用到这个服务以后才真正有点云的感觉,它比较巧妙的实现了云的弹性。在应用忙时扩展计算能力,在应用闲时收缩计算能力,很好的体现了云计算按需供给、按量计费的宗旨。只有用好了这种弹性的云服务才能真正发挥出云的作用,才能以经济的价格实现优质的应用服务...

2018-08-28 08:02:59 2427

原创 Week One - 5. 代价函数

Square Error Function在线性回归中,如何选择参数以达到最好的效果呢?或者说我们如果定义最好呢?基本想法是让拟合的直线尽量靠近已知的数据点。 具体一点就是: 这里cost function就是,如图 这里其实是Square Error Function, 在回归问题中很普遍,其他问题中还会出现其他代价函数。这里我们发现代价函数其实关于...

2018-08-21 00:47:38 137

原创 Week One - 4.模型的表示

在Andrew Ng的课程中,有些表示符号是固定的:m : 训练集的大小-训练集中样本数量x’s: 特征y’s: 目标变量(x,y): 单个训练集样本 : 第i个训练集样本整个监督学习的过程如下图 h: 仅仅是映射函数,叫惯了叫成了Hypothesis,但是并非是假设的意思 Linear Regression Model 单变量线性回归 ...

2018-08-20 23:55:54 142

原创 Week One - 3. Andrew Ng - 非监督学习

在前面的监督学习中,已获取的数据集中包含正确答案,因此计算机可以通过学习来发现数据和正确答案之间的关系,进而进行预测。接下来,我们要计算机学习那些为赋予正确答案的数据。 在上图中,我们对于数据的类别一无所知,现在只有x1和x2两个特征,对于无监督算法,我们能做的就是聚类。 情景一:谷歌新闻每天都会收集成千上万的新闻,然后将他们聚合称为不同的类别,形成新闻专题。 情景二:...

2018-08-20 23:08:21 172

原创 Week One - 2. Andrew Ng - 监督学习

情景一假设你想预测房价, 你朋友的房子面积是750,你想知道这房子能卖多少钱,机器学习算法如何做到这一点呢?   横坐标:房子的面积   纵坐标:房子的价格,单位是1000$方法一: 拟合出一条直线,使其尽量匹配到所有数据,然后用这条直线的方程预测房价。 方法二: 拟合出一条曲线,使其尽量匹配到所有数据,然后用这条曲线的方程预测...

2018-08-20 22:10:53 147

原创 Week One - 1. Andrew Ng - 什么是机器学习?

Definition定义(1): 在不需要具体编程的情况下赋予计算机自我学习的能力。 - Arthur Samuel(1959)。例如: 程序的编写者可能是某个领域的菜鸟,例如围棋,但是通过机器学习,计算机获得了如果才能赢得策略,成为了围棋高手。定义(2): 存在经验E, 任务T, 性能P,使得计算机程序执行任务T,其表现由P来测量,并且其结果由经验E来改进。- Tom ...

2018-08-20 21:28:16 157

原创 python 判断文件还是文件夹

import osif os.path.isdir(path): print "it's a directory"elif os.path.isfile(path): print "it's a normal file"else: print "it's a special file(socket,FIFO,device file)"

2018-08-20 12:22:15 37564 1

原创 NLP常用英文数据集

https://machinelearningmastery.com/datasets-natural-language-processing/

2018-08-20 12:16:28 8138

原创 Anaconda下使用Pip安装包

首先在cmd中列出所有anaconda环境:conda info --envs然后,激活其中一个环境activate untitled最后,进入untitled环境使用pip或者pip3即可pip3 install jieba

2018-08-19 22:42:39 7680 1

原创 Python中read(), readline(), readlines()

read() 读取整个文本 readline() 一次读取一行,没有内容返回None readlines() 读取所有行,形成列表

2018-08-19 15:51:11 828

原创 自然语言处理 - 朴素贝叶斯

https://wizardforcel.gitbooks.io/dm-algo-top10/content/naive-bayes.html

2018-08-19 00:07:39 616

原创 python 正则表达式

python正则表达式

2018-08-18 13:24:35 198

原创 NLP - 统计频率

引入必要的包import refrom collections import Counter方法一:# Version Onedef get_max_value_v1(text): # 统一为小写字母 text = text.lower() # 返回所有的字母 result = re.findall('[a-zA-Z]',text) ...

2018-08-18 13:11:04 598

原创 NLP - 查找字符串

# 查找字符串s.find('bc')结果:1

2018-08-18 12:53:12 251

原创 NLP - 翻转字符串

s = 'abcdefg's[::-1]结果:'gfedcba'

2018-08-18 12:52:26 149

转载 python - BeautifulSoup教程

BeautifulSoupBeautifulSoup将网页元素的正则化查找简单化。from bs4 import BeautifulSouphtml_doc = """<html><head><title>The Dormouse's story</title>&

2018-08-15 23:24:42 2062

转载 python - requests用法

Python标准库中提供了:urllib、urllib2、httplib等模块以供Http请求,但是,它的 API 太渣了。它是为另一个时代、另一个互联网所创建的。它需要巨量的工作,甚至包括各种方法覆盖,来完成最简单的任务。Requests 是使用 Apache2 Licensed 许可证的 基于Python开发的HTTP 库,其在Python内置模块的基础上进行了高度的封装,从而使得Pyth...

2018-08-15 00:21:08 580

原创 python request+open 下载任意文件

实例源码 link = 'https://www.google.com.au/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwiaucyRvurcAhVaMt4KHbRMCOcQjRx6BAgBEAU&url=https%3A%2F%2Fimage.so.com%2F&psi...

2018-08-14 00:52:59 6719

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除