> 目  录 <  k-armed bandit problem Incremental Implementation Tracking a Nonstationary Problem Initial Values (*) Upper-Confidence-Bound Action Selection(UCB) (*) Gradient Bandit Algorithms (*) Associative Search (Contextual Bandits)  > 笔  记 < …
 > 目  录 <  Agent–Environment Interface Goals and Rewards Returns and Episodes Policies and Value Functions Optimal Policies and Optimal Value Functions  > 笔  记 <  Agent–Environment Interface MDPs are meant to be a straightforward framing of th…
  > 目  录 <   learning & intelligence 的基本思想 RL的定义.特点.四要素 与其他learning methods.evolutionary methods的比较 例子(井字棋 tic-tac-toe)及早期发展史    > 笔  记 <  learning & intelligence 的基本思想:learning from interaction RL的定义: RL is learning what to do--how to…
 > 目  录 <  Dynamic programming Policy Evaluation (Prediction) Policy Improvement Policy Iteration Value Iteration Asynchronous Dynamic Programming Generalized Policy Iteration  > 笔  记 <  Dynamic programming(DP) 定义:a collection of algorithms th…
# 强化学习读书笔记 - 02 - 多臂老O虎O机问题 学习笔记: [Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016](https://webdocs.cs.ualberta.ca/~sutton/book/) ## 数学符号的含义 * 通用 $a$ - 行动(action). $A_t$ - 第t次的行动(select action).通常指求解的…
——深度学习的建模.调参思路整合. 写在前面 最近偶尔从师兄那里获取到了吴恩达教授的新书<Machine Learning Yearing>(手稿),该书主要分享了神经网络建模.训练.调节参数时所需要的一些技巧和经验.我在之前的一些深度学习项目中也遇到过模型优化,参数调节之类的问题,由于当时缺少系统化的解决方案,仅仅依靠感觉瞎蒙乱碰.虽然有时也能获得效果不错的网络模型,但对于该模型是否已到达最佳性能.该模型是否能适配更泛化的数据等问题心理没底.通过阅读这本教材,对于数据集的获取.划分:训练模型…
data<-'F:\\learning\\ML_for_Hackers\\ML_for_Hackers-master\\06-Regularization\\data\\' ranks <- read.csv(file.path(data, 'oreilly.csv'),stringsAsFactors = FALSE) library('tm') documents <- data.frame(Text = ranks$Long.Desc.)row.names(documents) &…
#定义函数,打开每一个文件,找到空行,将空行后的文本返回为一个字符串向量,该向量只有一个元素,就是空行之后的所有文本拼接之后的字符串 #很多邮件都包含了非ASCII字符,因此设为latin1就可以读取非ASCII字符 #readLines,读取每一行作为一个元素 #异常捕获是自己加的,书上没有,不加会出错,因为有些邮件没有空行 get.msg <- function(path){con <- file(path, open = "rt",encoding='latin1')…
为了培养一个机器学习领域专家那样的直觉,最好的办法就是,对你遇到的每一个机器学习问题,把所有的算法试个遍,直到有一天,你凭直觉就知道某些算法行不通.…
library('ggplot2')df <- read.csv('G:\\dataguru\\ML_for_Hackers\\ML_for_Hackers-master\\12-Model_Comparison\\data\\df.csv') #用glm logit.fit <- glm(Label ~ X + Y,family = binomial(link = 'logit'),data = df) logit.predictions <- ifelse(predict(logit…
#一,自己写KNN df<-read.csv('G:\\dataguru\\ML_for_Hackers\\ML_for_Hackers-master\\10-Recommendations\\data\\example_data.csv')head(df) #得出距离矩阵distance.matrix <- function(df){ #生成一万个NA,并转成100*100的矩阵 distance <- matrix(rep(NA, nrow(df) ^ 2), nrow = nrow…
library('foreign') library('ggplot2') data.dir <- file.path('G:\\dataguru\\ML_for_Hackers\\ML_for_Hackers-master\\09-MDS\\data\\roll_call') data.files <- list.files(data.dir) rollcall.data <- lapply(data.files,function(f) {  read.dta(file.path(da…
library('ggplot2') prices <- read.csv('G:\\dataguru\\ML_for_Hackers\\ML_for_Hackers-master\\08-PCA\\data\\stock_prices.csv',stringsAsFactors = FALSE) library('lubridate') #把日期列转成日期对象 prices <- transform(prices, Date = ymd(Date)) #prices中的数据只有三列,日期,股…
#凯撒密码:将每一个字母替换为字母表中下一位字母,比如a变成b. english.letters <- c('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z') caesar.cipher <- list() inverse.caesar.cipher <- list() #加密LIS…
线性回归函数 model<-lm(Weight~Height,data=?) coef(model):得到回归直线的截距 predict(model):预测 residuals(model):残差 cor:相关性 MSE:均方误差 RMSE:均方误差的平方根,为0最好.缺点是可以取无限的值,这很难知识模型效果是否合理 线性回归中解决上述问题的方法是R2,它的值总是介于0~1之间,完美预测则R2为1,如果不比均值好,那么它的值是0.…
#数据集来源http://spamassassin.apache.org/publiccorpus/ #加载数据 library(tm)library(ggplot2)data.path<-'F:\\dataguru\\ML_for_Hackers\\ML_for_Hackers-master\\03-Classification\\data\\'easyham.path<-paste(data.path,'easy_ham\\',sep='') #读取文件的函数msg.full,返回一个向量…
#均值:总和/长度 mean() #中位数:将数列排序,若个数为奇数,取排好序数列中间的值.若个数为偶数,取排好序数列中间两个数的平均值 median() #R语言中没有众数函数 #分位数 quantile(data):列出0%,25%,50%,75%,100%位置处的数据 #可自己设置百分比 quantile(data,probs=0.975) #方差:衡量数据集里面任意数值与均值的平均偏离程度 var() #标准差: sd() #直方图,binwidth表示区间宽度为1 ggplot(hei…
#使用数据:UFO数据 #读入数据,该文件以制表符分隔,因此使用read.delim,参数sep设置分隔符为\t #所有的read函数都把string读成factor类型,这个类型用于表示分类变量,因此将stringsAsFactors设置为False #header=F表示文件中并没有表头 #na.string='',表示把空元素设置为R中的特殊值NA,即将所有空元素读成NA ufo<-read.delim('ufo_awesome.tsv',sep='\t',stringsAsFactors…
我在机器学习读书会的分享slides,关于DP.MC.TD方法: https://mp.weixin.qq.com/s/r8wZw4iZwFCz0nnakutY3Q 内容如下:…
强化学习读书笔记 - 06~07 - 时序差分学习(Temporal-Difference Learning) 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 数学符号看不懂的,先看看这里: 强化学习读书笔记 - 00 - 术语和数学符号 时序差分学习简话 时序差分学习结合了动态规划和蒙特卡洛方法,是强化学习的核心思想. 时序差分这个词不…
强化学习入门最经典的数据估计就是那个大名鼎鼎的  reinforcement learning: An Introduction 了,  最近在看这本书,第一章中给出了一个例子用来说明什么是强化学习,那就是tic-and-toc游戏, 感觉这个名很不Chinese,感觉要是用中文来说应该叫三子棋啥的才形象. 这个例子就是下面,在一个3*3的格子里面双方轮流各执一色棋进行对弈,哪一方先把自方的棋子连成一条线则算赢,包括横竖一线,两个对角线斜连一条线. 上图,则是  X 方赢,即: reinforc…
Dictum:  To spark, often burst in hard stone. -- William Liebknecht 强化学习(Reinforcement Learning)是模仿人类的学习方式(比如,学习一种新的技能,从入门到掌握总是不断地去寻错,改正,直至完全掌握),强化学习的主要思想就是智能体在与环境的交互过程中不断调整,以达到理想结果. 强化学习的框架 Reinforcement learning is learning what to do--how to map s…
强化学习读书笔记 - 05 - 蒙特卡洛方法(Monte Carlo Methods) 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 数学符号看不懂的,先看看这里: 强化学习读书笔记 - 00 - 数学符号说明 蒙特卡洛方法简话 蒙特卡洛是一个赌城的名字.冯·诺依曼给这方法起了这个名字,增加其神秘性. 蒙特卡洛方法是一个计算方法,被广泛…
强化学习读书笔记 - 13 - 策略梯度方法(Policy Gradient Methods) 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 参照 Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 20…
强化学习读书笔记 - 12 - 资格痕迹(Eligibility Traces) 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 参照 Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 强化学习…
强化学习读书笔记 - 11 - off-policy的近似方法 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 参照 Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 强化学习读书笔记 - 00…
强化学习读书笔记 - 10 - on-policy控制的近似方法 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 参照 Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 强化学习读书笔记 - 0…
强化学习读书笔记 - 09 - on-policy预测的近似方法 参照 Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016 强化学习读书笔记 - 00 - 术语和数学符号 强化学习读书笔记 - 01 - 强化学习的问题 强化学习读书笔记 - 02 - 多臂老O虎O机问题 强化学习读书笔记 - 03 - 有限马尔科夫决策过程 强化学习读书笔记 - 04 -…
Awesome Reinforcement Learning A curated list of resources dedicated to reinforcement learning. We have pages for other topics: awesome-rnn, awesome-deep-vision, awesome-random-forest Maintainers: Hyunsoo Kim, Jiwon Kim We are looking for more contri…
在机器学习中,我们经常会分类为有监督学习和无监督学习,但是尝尝会忽略一个重要的分支,强化学习.有监督学习和无监督学习非常好去区分,学习的目标,有无标签等都是区分标准.如果说监督学习的目标是预测,那么强化学习就是决策,它通过对周围的环境不断的更新状态,给出奖励或者惩罚的措施,来不断调整并给出新的策略.简单来说,就像小时候你在不该吃零食的时间偷吃了零食,你妈妈知道了会对你做出惩罚,那么下一次就不会犯同样的错误,如果遵守规则,那你妈妈兴许会给你一些奖励,最终的目标都是希望你在该吃饭的时候吃饭,该吃零食…