Creating and Training the Mining Model - Data Mining

The ExcelTimeSeriesMining class handles the interactions with the data mining engine. To create and train a mining model, you have to perform three steps. First, connect to the data mining engine, then create and execute a CREATE MINING MODEL statement, and finally create and execute an INSERT INTO statement.

Connecting to the Data Mining Engine
You connect to the Analysis Services server using the standard ADO methodology. The client machine must have the Analysis Services OLE DB provider (MSOLAP90.DLL) installed As mentioned before, this server must be configured to accept session mining models, and the user must have permissions on at least one database on the server. The simple VBA code using ADO to connect to a server looks like this:


Creation and Training
The ExcelTimeSeriesMining class performs model creation and training in a single step. The model created here has one column for every column (or row) in the data selection. This model will indicate the date column as the KEY TIME and every other column will have the content type CONTINUOUS and usage PREDICT. A sample creation statement would look like this:


INSERT INTO is simplified as there is no input query. Instead, you simply need to list the columns and specify the named parameter for the input XMLA rowset.

INSERT INTO ExcelTimeSeriesModel
([Date],[Retail Food Total],[Retail Food])
@InputRowset

ExcelTimeSeriesMining.CreateModel Implementation

The implementation of ExcelTimeSeriesMining.CreateModel takes advantage of the selecting preprocessing performed by XMLARowsetGen .FillRowset Using FillRowset as a starting point allows you to ignore issues relating to series orientation, because the XMLARowsetGen object is always Series as Rows. The code in Listing demonstrates how to create the creation and insertion commands, add a XMLA named parameter to a command, and execute those commands. Note the string generation uses helper functions to ensure column name correctness and to convert from Excel data types to OLE DB for Data Mining data types.

Listing : CreateModel code listing


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Data Mining Topics