I'm having some trouble generating the proper SQL/DMX in order to do prediction in SQL Server 2008 Business Intelligence Development Studio. I've got the following table setup with training data.
Transactions
ID (int)(primary key)
Code (string)
Items
ID (int)(foreign key that points to ID in Transactions table)
Item (string)
I'm using the Naive Bayes classifier and what I want to do is train it so that whenever I see a specific collection of items, they allow me to predict what the "Code" field is in the Transactions table. Since I'm using a nested table, I'm sure that my SQL below is screwed up.
select predict([code]) from <miningModel>
natural prediction join
(select 'ethernet' as Item union
select 'panel' as Item) as foo
Any suggestions are appreciated.
I got it. I wasn't naming my aliases exactly like they were in reality, the nested portion was messed up, and a couple other things. It should've been like the following.
select predict([TransactionsMiningModel].[Code]) from [TransactionsMiningModel]
natural prediction join
(select (
select 'foobar' as [Item]
) as [Item Decomposition] ) as t