logistic regression的一些问题,不平衡数据,时间序列,求解惑
Logistic Regression
1、在有时间序列的特征数据中,怎么运用LR?
不光是LR,其他的模型也是。
有很多基本的模型变形之后,变成带时序的模型。但,个人觉得,这类模型大多不靠谱。
我觉得还是要从业务出发,同时探测分析数据,得出比较合理的假设,然后提取特征,这些特征可以含有时间信息,但不一定是时序的。比如,前N天其他特征的统计组合等。
可以参考:Logistic regression for time series
Q: I would like to use a binary logistic regression model in the context of streaming data (multidimensional time series) in order to predict the value of the dependent variable of the data (i.e. row) that just arrived, given the past observations. As far as I know, logistic regression is traditionally used for postmortem analysis, where each dependent variable has already been set (either by inspection, or by the nature of the study).
A: There are two methods to consider:
Only use the last N input samples. Assuming your input signal is of dimension D, then you have N*D samples per ground truth label. This way you can train using any classifier you like, including logistic regression. This way, each output is considered independent from all other outputs.
Use the last N input samples and the last N outputs you have generated. The problem is then similar to viterbi decoding. You could generate a non-binary score based on the input samples, and combine the score of multiple samples using a viterbi decoder. This is better than method 1. if you now something about the temporal relation between the outputs.
2、数据不平衡时怎么处理?
比如正负比例1:100,而要研究的是正例的1,这时候LR表现非常差。
一般有两种方案:
1)调整权重,比如正例*10。ps,个人实验还是不理想
2)sample,还没尝试
参考:http://www.alidata.org/archives/205 正反例极不平衡的数据集的采样
logistic regression的一些问题,不平衡数据,时间序列,求解惑的更多相关文章
- Logistic Regression逻辑回归
参考自: http://blog.sina.com.cn/s/blog_74cf26810100ypzf.html http://blog.sina.com.cn/s/blog_64ecfc2f010 ...
- 学习Logistic Regression的笔记与理解(转)
学习Logistic Regression的笔记与理解 1.首先从结果往前来看下how logistic regression make predictions. 设我们某个测试数据为X(x0,x1, ...
- 机器学习理论基础学习3.3--- Linear classification 线性分类之logistic regression(基于经验风险最小化)
一.逻辑回归是什么? 1.逻辑回归 逻辑回归假设数据服从伯努利分布,通过极大化似然函数的方法,运用梯度下降来求解参数,来达到将数据二分类的目的. logistic回归也称为逻辑回归,与线性回归这样输出 ...
- 通俗地说逻辑回归【Logistic regression】算法(二)sklearn逻辑回归实战
前情提要: 通俗地说逻辑回归[Logistic regression]算法(一) 逻辑回归模型原理介绍 上一篇主要介绍了逻辑回归中,相对理论化的知识,这次主要是对上篇做一点点补充,以及介绍sklear ...
- 机器学习---逻辑回归(二)(Machine Learning Logistic Regression II)
在<机器学习---逻辑回归(一)(Machine Learning Logistic Regression I)>一文中,我们讨论了如何用逻辑回归解决二分类问题以及逻辑回归算法的本质.现在 ...
- sklearn逻辑回归(Logistic Regression,LR)调参指南
python信用评分卡建模(附代码,博主录制) https://study.163.com/course/introduction.htm?courseId=1005214003&utm_ca ...
- 机器学习——逻辑回归(Logistic Regression)
1 前言 虽然该机器学习算法名字里面有"回归",但是它其实是个分类算法.取名逻辑回归主要是因为是从线性回归转变而来的. logistic回归,又叫对数几率回归. 2 回归模型 2. ...
- 逻辑回归 Logistic Regression
逻辑回归(Logistic Regression)是广义线性回归的一种.逻辑回归是用来做分类任务的常用算法.分类任务的目标是找一个函数,把观测值匹配到相关的类和标签上.比如一个人有没有病,又因为噪声的 ...
- SparkMLlib之 logistic regression源码分析
最近在研究机器学习,使用的工具是spark,本文是针对spar最新的源码Spark1.6.0的MLlib中的logistic regression, linear regression进行源码分析,其 ...
随机推荐
- 【翻译】Kinect v2程序设计(C++) Body 篇
Kinect SDK v2预览版的主要功能的使用介绍,基本上完成了.这次,是关于取得Body(人体姿势)方法的说明. 上一节,是使用Kinect SDK v2预览版从Kinect v2预览版取得B ...
- ThinkPhp 中Action控制器中动态改变自动完成规则(使用setProperty)
Common.php中定义的方法 在更新数据时动态规则中 "完成时间" 必须设定为2
- js里面的等于号--
一个是赋值等于号,二个是对比等于号,那么三个等于号是什么用的呢 有时候会看到在判断两个对象是否相等的时候使用了三个等号(===),它和两个等号(==)有什么区别呢?简单来说就是使用“==”时,如果 ...
- MyEclipse8.5 以debug模式启动tomcat6.0服务器 报错cannot connect to vm。
打开MyEclipse8.5 想以debug模式启动tomcat6.0服务器,报 a configuration error occurred during startup.please verif ...
- phpcms list页实现分页
{pc:content action="lists" catid="41" order="id ASC" num="1" ...
- 蓝牙BLE ATT剖析(二)-- PDU
一.Error Handling Error Response The Error Responseis used to state that a given request cannot be pe ...
- BLE GATT规范中关于UUID与属性的详细解析
1. 角色 除了GAP定义了角色之外,BLE还定义了另外2种角色:GATT服务器和GATT客户端,它们完全独立于GAP的角色.提供数据的设备称为GATT服务器,访问GATT服务器而获得数据的设备称为G ...
- nrf51822裸机教程-SPI(主)
关于SPI总线的介绍这里就不细说了,网上有很多介绍SPI总线时序的. SPI总线的本质就是一个环形总线结构,在时钟驱动下两个双向移位寄存器进行数据交换. 所以SPI总线的特色就是:传输一字节数据的同时 ...
- random and password 在Linux下生成crypt加密密码的方法,shell 生成指定范围随机数与随机字符串
openssl rand -hex n (n is number of characters) LANG=c < /dev/urandom tr -dc _A-Z-a-z-0-9 | head ...
- 关于HIVE的配置
一:安装配置hive 1.检测hadoop 2.解压hive 3.修改环境 sudo vi /etc/profile 4.source以下 5.复制hive-env.sh 6.编辑hive-env.s ...