我正在学习Microsoft的SQL Server 2012 Analysis Services。使用VisualStudio 2012插件完成了基本的AdventureWorks教程后,我现在正尝试使用DMX查询语言执行这些相同的过程。 / p>
我所指的教程可以在这里找到:
http://msdn.microsoft.com/en-us/library/4b634cc1-86dc-42ec-9804-a19292fe8448(v=sql.110)
我在Analysis Server中使用的数据库项目是BasicDataMining项目的项目,可以在完成BasicDataMining教程时找到:
http://msdn.microsoft.com/en-us/library/ms167167(v=sql.110).aspx
DMX教程的第一课很好地使用了以下查询来创建挖掘结构:
CREATE MINING STRUCTURE [Bike Buyer]
(
[Customer Key] LONG KEY,
[Age]LONG DISCRETIZED(Automatic,10),
[Bike Buyer] LONG DISCRETE,
[Commute Distance] TEXT DISCRETE,
[Education] TEXT DISCRETE,
[Gender] TEXT DISCRETE,
[House Owner Flag] TEXT DISCRETE,
[Marital Status] TEXT DISCRETE,
[Number Cars Owned]LONG DISCRETE,
[Number Children At Home]LONG DISCRETE,
[Occupation] TEXT DISCRETE,
[Region] TEXT DISCRETE,
[Total Children]LONG DISCRETE,
[Yearly Income] DOUBLE CONTINUOUS
)
WITH HOLDOUT (30 PERCENT or 1000 CASES)
当我到达第二课时,建议的查询不起作用:
ALTER MINING STRUCTURE [Bike Buyer]
ADD MINING MODEL [Decision Tree]
(
CustomerKey,
[Age],
[Bike Buyer] PREDICT,
[Commute Distance],
[Education],
[Gender],
[House Owner Flag],
[Marital Status],
[Number Cars Owned],
[Number Children At Home],
[Occupation],
[Region],
[Total Children],
[Yearly Income]
) USING Microsoft_Decision_Trees
WITH DRILLTHROUGH
提供以下错误:
Error (Data mining): The 'CustomerKey' source structure column for the 'CustomerKey' mining model column was not found.
我很困惑如何解决这个问题,以及为什么微软自己的教程中的文字查询似乎不起作用。
我非常感谢能够帮助我解决此问题的任何见解并继续本教程。
答案 0 :(得分:0)
ALTER MINING STRUCTURE [Bike Buyer]
ADD MINING MODEL [Decision Tree]
(
**[Customer Key]**, <-- Missing space was the issue
[Age],
[Bike Buyer] PREDICT,
[Commute Distance],
[Education],
[Gender],
[House Owner Flag],
[Marital Status],
[Number Cars Owned],
[Number Children At Home],
[Occupation],
[Region],
[Total Children],
[Yearly Income]
) USING Microsoft_Decision_Trees
WITH DRILLTHROUGH