《BI那点儿事》Microsoft 逻辑回归算法——预测股票的涨跌

数据准备:
一组股票历史成交数据(股票代码:601106 中国一重),起止日期:2011-01-04至今,其中变量有“开盘”、“最高”、“最低”、“收盘”、“总手”、“金额”、“涨跌”等

UPDATE  FactStock
SET     [涨跌] = N''
WHERE   [涨幅] > 0

UPDATE  FactStock
SET     [涨跌] = N''
WHERE   [涨幅] < 0

UPDATE  FactStock
SET     [涨跌] = N'持平'
WHERE   [涨幅] = 0

SELECT  [涨跌] ,
        COUNT(*) AS Cnt
FROM    FactStock
GROUP BY [涨跌]

SELECT  *
FROM    FactStock
WHERE   [涨跌] = N'持平'

SELECT  MAX(收盘) ,
        MIN(收盘) ,
        AVG(收盘)
FROM    FactStock

UPDATE  FactStock
SET     序列 = CAST(REPLACE(CONVERT(CHAR(10), SUBSTRING([时间], 1, 10), 120), '-',
                          '') AS INT)

SELECT  *
FROM    FactStock

 

分析过程:










posted @ 2014-11-19 21:14  Bobby0322  阅读(3618)  评论(4编辑  收藏  举报