使用嵌套表和DMX进行预测

时间:2012-01-31 17:46:52

标签: sql sql-server classification business-intelligence dmx-ssas

为了在SQL Server 2008 Business Intelligence Development Studio中进行预测,我在生成正确的SQL / DMX时遇到了一些麻烦。我已经通过训练数据设置了下表。

Transactions
    ID (int)(primary key)
    Code (string)
Items
    ID (int)(foreign key that points to ID in Transactions table)
    Item (string)

我正在使用Naive Bayes分类器,我想要做的就是训练它,这样每当我看到一个特定的项目集合时,它们就可以让我预测“交易”表中的“代码”字段。由于我使用的是嵌套表,因此我确信我的SQL下面已经搞砸了。

select predict([code]) from <miningModel>
    natural prediction join 
    (select 'ethernet' as Item union
     select 'panel' as Item) as foo

任何建议都表示赞赏。

1 个答案:

答案 0 :(得分:0)

我明白了。我没有像现实中那样命名我的别名,嵌套部分搞砸了,还有其他一些东西。它应该像以下一样。

select predict([TransactionsMiningModel].[Code]) from [TransactionsMiningModel]
    natural prediction join 
    (select (
             select 'foobar' as [Item]
            ) as [Item Decomposition] ) as t