Upload
shaoli-lu
View
321
Download
0
Embed Size (px)
Citation preview
Data Mining By Example – Forecasting and Cross Prediction Using Microsoft Time Series
by Shaoli Lu
Microsoft Time Series
• Microsoft Time Series algorithm provides a unique approach to time series forecasting that is both intuitive and accurate. It is used to forecast future series points based on past history
Goal
• To forecast and cross-predict based on past sales history
Prerequisite
• An SQL Server instance created (2005 or above)• SQL Server Analysis Service (SSAS) –
Multidimensional Feature Installed(this is used to host and browse the mining structures; cube is not required for data mining!)
• AdventureWorksDW database attached(download from CodePlex - tailor to the SQL Server version you have)
• Visual Studio 2010 or above with SQL Server Data Tools (SSDT) installed
My Demo Setup
• Visual Studio 2010 • SQL Server 2012
Create Data Mining Project
• Name the project as DM Forecasting (DM = Data Mining)
Create Data Source and Impersonation
Create Data Source View
Create Mining Structure
• Use relational data source• Choose Microsoft Time Series model• Select Data Source View• Select key, input and predict• Name the mining structure and model• Add Amount to the mining structure and
change it to Predict• Tune Algorithm Parameters
Deploy the mining structure and model
Process the mining model
• This is also called “training the model”
Mining Model Viewer
• Forecast trend• Select items to predict• View standard deviation• View forecasting mode in a tree graph• View regression formula• Use Generic Content Tree View to inspect
stats details
Mining Model Prediction
• Convert to DMX query• Adjust the DMX query by adding FLATTENED
clause• Add filters to the DMX query• View query results
Adding Additional Data
• DMX EXTEND_MODEL_CASES clause will add additional data to the existing data
Cross Prediction
• Create new named query AllRegions for cross-prediction
• Create a query for a specific region and model• Create a new mining structure for cross-
prediction• Deploy and process the cross-prediction mining
structure and model• Use REPLACE_MODEL_CASES in the DMX query
for cross-prediction
Browse mining model on SQL Server
• Time Series Chart View• Model Tree Graph• Prediction Query Window• DMX• Query result
Summary
• Microsoft Time Series is a powerful data mining model, yet it is intuitive to build, train and use
• It is useful in forecasting future event points • Algorithm Parameters can be tuned• DMX EXTEND_MODEL_CASES clause will add additional
data to the existing data• Use REPLACE_MODEL_CASES in the DMX query for
cross-prediction• Relational database can be used for data mining; cube is
not required
The End