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的一些问题,不平衡数据,时间序列,求解惑的更多相关文章

  1. Logistic Regression逻辑回归

    参考自: http://blog.sina.com.cn/s/blog_74cf26810100ypzf.html http://blog.sina.com.cn/s/blog_64ecfc2f010 ...

  2. 学习Logistic Regression的笔记与理解(转)

    学习Logistic Regression的笔记与理解 1.首先从结果往前来看下how logistic regression make predictions. 设我们某个测试数据为X(x0,x1, ...

  3. 机器学习理论基础学习3.3--- Linear classification 线性分类之logistic regression(基于经验风险最小化)

    一.逻辑回归是什么? 1.逻辑回归 逻辑回归假设数据服从伯努利分布,通过极大化似然函数的方法,运用梯度下降来求解参数,来达到将数据二分类的目的. logistic回归也称为逻辑回归,与线性回归这样输出 ...

  4. 通俗地说逻辑回归【Logistic regression】算法(二)sklearn逻辑回归实战

    前情提要: 通俗地说逻辑回归[Logistic regression]算法(一) 逻辑回归模型原理介绍 上一篇主要介绍了逻辑回归中,相对理论化的知识,这次主要是对上篇做一点点补充,以及介绍sklear ...

  5. 机器学习---逻辑回归(二)(Machine Learning Logistic Regression II)

    在<机器学习---逻辑回归(一)(Machine Learning Logistic Regression I)>一文中,我们讨论了如何用逻辑回归解决二分类问题以及逻辑回归算法的本质.现在 ...

  6. sklearn逻辑回归(Logistic Regression,LR)调参指南

    python信用评分卡建模(附代码,博主录制) https://study.163.com/course/introduction.htm?courseId=1005214003&utm_ca ...

  7. 机器学习——逻辑回归(Logistic Regression)

    1 前言 虽然该机器学习算法名字里面有"回归",但是它其实是个分类算法.取名逻辑回归主要是因为是从线性回归转变而来的. logistic回归,又叫对数几率回归. 2 回归模型 2. ...

  8. 逻辑回归 Logistic Regression

    逻辑回归(Logistic Regression)是广义线性回归的一种.逻辑回归是用来做分类任务的常用算法.分类任务的目标是找一个函数,把观测值匹配到相关的类和标签上.比如一个人有没有病,又因为噪声的 ...

  9. SparkMLlib之 logistic regression源码分析

    最近在研究机器学习,使用的工具是spark,本文是针对spar最新的源码Spark1.6.0的MLlib中的logistic regression, linear regression进行源码分析,其 ...

随机推荐

  1. Yii源码阅读笔记(十)

    控制器类,所有控制器的基类,用于调用模型和布局,输出到视图 namespace yii\base; use Yii; /** * Controller is the base class for cl ...

  2. MVC4发布到IIS7报404错误

    在MVC根目录的web.config中添加 <system.webServer> <modules runAllManagedModulesForAllRequests=" ...

  3. Solr高亮详解

    hl.fl: 用空格或逗号隔开的字段列表.要启用某个字段的highlight功能,就得保证该字段在schema中是stored.如果该参数未被给出,那么就会高亮默认字段 standard handle ...

  4. 基于LR的HTTP协议接口性能测试脚本实例

    背景介绍 XXX项目性能测试中新增业务场景:XX设备的在线激活,因为存在多用户同时在线激活,故需进行性能测试以确认后台服务器系统在多用并发时功能是否正常,性能指标是否满足规格要求.用户使用场景为用户通 ...

  5. laravle faker

    1.编辑 /database/factories/ModelFactory,添加新的类模型填充 $factory->define(App\Post::class, function (Faker ...

  6. 发现了一个很好的Pasical编程软件Lazarus

    下载地址:http://www.lazarus.freepascal.org/ 中文社区:http://www.fpccn.com/ 该软件有几点如下特征: 1.跨平台.体积小(只有100多M) 2. ...

  7. 蓝牙版本V4.2特征讲解说明

    2014年12月4日,最新的蓝牙4.2标准颁布,改善了数据传输速度和隐私保护程度,并接入了该设备将可直接通过IPv6和6LoWPAN接入互联网.在新的标准下蓝牙信号想要连接或者追踪用户设备必须经过用户 ...

  8. css+div盒模型研究笔记

    红色标记的为默认值 1.border(边框):border-top,border-bottom,border-left,border-right 1.border-color(边框颜色): 2.bor ...

  9. Ubuntu-1404 GDB 调试C++报错

    问题 Ubuntu1404下,当用GDB调试C++程序时,报错ImportError: No module named 'libstdcxx' 解决办法 vim ~/.gdbinit #~/.gdbi ...

  10. 根据IP查主机名和MAC地址

    根据IP查主机名: nbtstat -a XXX.XXX.XXX.XXX根据IP查MAC地址: arp -a XXX.XXX.XXX.XXXXXX.XXX.XXX.XXX指代要查的主机的IP