regression

目标检测 | RetinaNet:Focal Loss for Dense Object Detection

拜拜、爱过 提交于 2020-03-26 18:43:20
3 月,跳不动了?>>> > 论文分析了one-stage网络训练存在的类别不平衡问题,提出能根据loss大小自动调节权重的focal loss,使得模型的训练更专注于困难样本。同时,基于FPN设计了RetinaNet,在精度和速度上都有不俗的表现 论文:Focal Loss for Dense Object Detection 论文地址: https://arxiv.org/abs/1708.02002 论文代码: https://github.com/facebookresearch/Detectron Introduction   目前state-of-the-art的目标检测算法大都是two-stage、proposal-driven的网络,如R-CNN架构。而one-stage检测器一直以速度为特色,在精度上始终不及two-stage检测器。因此,论文希望研究出一个精度能与two-stage检测器媲美的one-stage检测器 通过分析, 论文认为阻碍one-stage精度主要障碍是类别不平衡问题(class imbalance) : 在R-CNN架构检测器中,通过two-stage级联和抽样探索法(sampling heuristics)来解决类别不平衡问题。proposal阶段能迅速地将bndbox的数量缩小到很小的范围(1-2k),过滤了大部分背景。而第二阶段

Word Embedding 稳定性研究

白昼怎懂夜的黑 提交于 2020-03-23 21:48:42
3 月,跳不动了?>>> 我们在production的系统里面会遇到一个问题,模型如何处理新进来的数据。重新训练的话下游的prediction可能会非常不一样,但是我们不知道到底怎么不一样。之前在MLSys 2020 看到了这个关于稳定心的文章,所以跟大家分享一下。这个paper尝试总结retraining对embedding的影响到底有多大,原文在这里 https://proceedings.mlsys.org/static/paper_files/mlsys/2020/104-Paper.pdf ​ proceedings.mlsys.org 既然我们要讨论稳定性,我们得先给一个稳定性的定义 这个定义的逻辑本身是根据下游的task来定义上游够不够稳定,如果完全稳定的话下游的模型就不用retrain了。这里文章讲用zero one可能是因为讨论的是NLP的问题,假设是ctr的话这种zero one loss就不合理。 对于word embedding的算法,文中用了三种 Matrix Completion GloVE word2vec quantization用的是uniform quantization,原文在这里 https://arxiv.org/pdf/1909.01264.pdf ​ arxiv.org Embedding distance 的算法文中也用了几个来做比较

机器学习算法(四)—— 线性回归算法

大憨熊 提交于 2020-03-22 09:52:29
3 月,跳不动了?>>> 在以前的内容中,我们学习到了KNN分类算法。其中: 分类(Classification)指 Y变量为类别型(categorical variable),如:颜色类别,电脑品牌,有无信誉。 今天学习的线性回归算法,其中: 回归(regression) 指 Y变量为连续数值型(continuous numerical variable),如:房价,人数,降雨量。 一、简单线性回归 1-1、简单线性回归 很多做决定过程通常是根据两个或者多个变量之间的关系 回归分析 (regression analysis) 用来建立方程模拟两个或者多个变量之间如何关联 被预测的变量叫做:因变量(dependent variable), y, 输出(output) 被用来进行预测的变量叫做: 自变量(independent variable), x, 输入(input) 1-2、 简单线性回归介绍 简单线性回归包含一个自变量(x)和一个因变量(y) 以上两个变量的关系用一条直线来模拟 如果包含两个以上的自变量,则称作多元回归分析(multiple regression) 1-3. 简单线性回归模型 被用来描述因变量(y)和自变量(X)以及偏差(error)之间关系的方程叫做回归模型 简单线性回归的模型是: y: 样本的预测值,即回归模型中的应变量 x: 样本的特征数值

Why are there discrepancies in xgboost regression prediction from individual trees?

主宰稳场 提交于 2020-03-19 06:22:31
问题 First I run a very simple xgb regression model which contains only 2 trees with 1 leaf each. Data available here. (I understand this is a classification dataset but I just force the regression to demonstrate the question here): import numpy as np from numpy import loadtxt from xgboost import XGBClassifier,XGBRegressor from xgboost import plot_tree import matplotlib.pyplot as plt plt.rc('figure', figsize=[10,7]) # load data dataset = loadtxt('pima-indians-diabetes.csv', delimiter=",") # split

Loop function to add large numbers of predictors in regression function

会有一股神秘感。 提交于 2020-03-05 07:27:05
问题 I want to improve the way to insert predictors in a regression function: fm <- lm(formula= df$dependent_variable ~ df[,2] + df[,3]+ df[,4], data = df) df = data.frame In this example I put only 4 predictors and 1 dependent_variable. Actually I have 191 predictors. I think I need to a loop script to put all these predictors. Suggestions? 回答1: Here is one possible solution: yname<-"DVnamehere" xnames<-colnames(dat) xnames<-xnames[-which(xnames==yname)] formula<-as.formula(paste(yname,"~",paste

custom made regression using average absolute deviation

久未见 提交于 2020-03-04 16:41:49
问题 Following this post, I now have serious doubts if R-squared or F-test are good indications of a good linear fit into some data with random noise. Hence, I want to develop a custom made regression function so I can both learn how it works and maybe improve upon the existing tools. Consider these randomly generated ndarrays x and y : import numpy as np np.random.seed(42) x = np.random.rand(30) * 10 y = 1.5 * x + 0.3 + (np.random.rand(30) - 0.5) * 3.5 now I can define the average/mean absolute

《Knowledge Base Completion By Learning...》阅读笔记

陌路散爱 提交于 2020-03-02 02:17:53
Knowledge Base Completion by Learning to Rank Model 基于模型排序学习的知识库推理 摘要 1. 知识库推理(Knowledge Base Completion)就是从KB中已有的事实预测新的事实; 2. 目前的方法是 PRA (Path Ranking Algorithm) ,基于连接实体的路径类型预测事实,并将预测当做分类问题(使用逻辑回归); 3. 本文的方法是将关系预测视作一个排序问题,并基于YAGO进行试验,最终成绩优于各种分类模型。 介绍 尽管知识库在不断壮大,但是知识库仍然不完整,缺失大量的事实,知识库推理就是通过已有事实来预测未知的事实从而来填补缺失的事实。 符号方法使用规则或者关系路径来推理新的知识,比如PRA算法;嵌入方法将推理问题看做一个 矩阵完备 (matrix completion) 问题,学习KB中的实体和关系在低维空间的表示形式;当然也有人试着将两个方法结合在一起,比如基于路径的TransE(Modeling relation paths for representation learning of knowledge bases, Lin, EMNLP2015)。 本文主要研究PRA算法和它的扩展。 PRA算法 PRA使用随机行走(random walk)来遍历有限长度的连接着实体对的路径

机器学习“判定模型”和“生成模型”有什么区别?

故事扮演 提交于 2020-02-29 09:45:21
维基百科上Generative条目里面有个经典的案例: 假设有四个samples: 生成式模型的世界是这个样子: 而判定式模型的世界是这个样子: 也就是说:生成模型是联合概率分布,判别模型是条件概率分布。 简单地说,对于监督学习,预测时,一般都是在求 生成模型: 从数据中学习联合概率分布 ,然后利用贝叶斯公式求: ; 这类典型的模型包括:朴素贝叶斯、LDA、HMM 判别模型:直接学习 , 它直观输入什么特征X,就直接预测出最可能的 ; 典型的模型包括:LR, SVM,CRF,Boosting,Decision tree.... 其实机器学习的任务是从属性X预测标记Y,即求概率P(Y|X); 对于判别式模型来说求得P(Y|X),对未见示例X,根据P(Y|X)可以求得标记Y,即可以直接判别出来,如上图的左边所示,实际是就是直接得到了判别边界,所以传统的、耳熟能详的机器学习算法如线性回归模型、支持向量机SVM等都是判别式模型,这些模型的特点都是输入属性X可以直接得到Y(对于二分类任务来说,实际得到一个score,当score大于threshold时则为正类,否则为反类)~(根本原因个人认为是对于某示例X_1,对正例和反例的标记的条件概率之和等于1,即P(Y_1|X_1)+P(Y_2|X_1)=1) 而生成式模型求得P(Y,X),对于未见示例X,你要求出X与不同标记之间的联合概率分布

Maximize nonlinear regression function in R

与世无争的帅哥 提交于 2020-02-29 00:12:29
问题 Given a linear model obtained from the function call reg = lm(...) , how can you find the coefficients that maximize the obtained regression function? I'm aware of the function optim(...) , but it requires a function as an input. I haven't figured out how to extract this from the regression model. It should be noted that I'm using non-linear terms in my regression analysis (squared variables, to be precise). In other words, by regression function looks like y_hat = kx_11*x_1+kx_12*x_1^2 + kx

Maximize nonlinear regression function in R

一世执手 提交于 2020-02-29 00:09:24
问题 Given a linear model obtained from the function call reg = lm(...) , how can you find the coefficients that maximize the obtained regression function? I'm aware of the function optim(...) , but it requires a function as an input. I haven't figured out how to extract this from the regression model. It should be noted that I'm using non-linear terms in my regression analysis (squared variables, to be precise). In other words, by regression function looks like y_hat = kx_11*x_1+kx_12*x_1^2 + kx