logistic regression的一些问题,不平衡数据,时间序列,求解惑
2014-04-03 22:52
239 查看
Logistic Regression
1、在有时间序列的特征数据中,怎么运用LR?
不光是LR,其他的模型也是。
有很多基本的模型变形之后,变成带时序的模型。但,个人觉得,这类模型大多不靠谱。
我觉得还是要从业务出发,同时探测分析数据,得出比较合理的假设,然后提取特征,这些特征可以含有时间信息,但不一定是时序的。比如,前N天其他特征的统计组合等。
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 正反例极不平衡的数据集的采样
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 正反例极不平衡的数据集的采样
相关文章推荐
- 大数据面试题求解:给定n个实数 ,求着n个实数在实轴上向量2个数之间的最大差值,要求线性的时间算法(最大间隙问题)
- 求解最大子序列和问题的线性时间算法
- 时间序列数据库——索引用ES、聚合分析时加载数据用什么?docvalues的列存储貌似更优优势一些
- 二分法查找和快速排序 二分法是分治算法的一种特殊形式,利用分治策略求解时,所需时间取决于分解后子问题的个数、子问题的规模大小等因素,而二分法,由于其划分的简单和均匀的特点,是查找数据时经常采用的一种有
- 最大子序列和问题的求解(时间复杂度为O(N))
- 时间序列数据库——索引用ES、聚合分析时加载数据用什么?docvalues的列存储貌似更优优势一些。那分布式计算呢?ES做
- 【数据结构与算法】最大子序列和问题的求解
- SQL查询获取最后一笔时间数据问题
- 小象数据分析和数据挖掘(豆瓣数据案例,时间序列分析和金融数据,金融数据分析案例)
- 如何解决机器学习中数据不平衡问题
- 关于unsigned属性涉及数据减法时引发的bug问题和时间用bigint的说明
- OpenStack/Gnocchi简介——时间序列数据聚合操作提前计算并存储起来,先算后取的理念
- 通过DIH工具增量将MySQL表中的数据导入Solr时,last_index_time小于当前时间8小时的问题
- [C++]四种方式求解最大子序列求和问题
- javascript执行顺序和执行时间的一些相关问题
- 设计算法,在O(n)时间内求解分数背包问题
- 机器学习中的数据不平衡问题----通过随机采样比例大的类别使得训练集中大类的个数与小类相当,或者模型中加入惩罚项
- 关于骨骼动画max数据导出到dx中一些问题总结
- 时间序列数据的存储和计算 - 开源时序数据库解析(三)
- 分类中数据不平衡问题的解决经验(转)