How to: Query the Parameters Used to Create a Mining Model
Because the behavior of a mining model is affected not only by the composition of the training cases, but also by the parameters that were set when the model was created, you might find it useful to retrieve parameters and values for an existing model to better understand the behavior of the model. Retrieving parameters might also be useful for documenting a particular version of that model.
To find the parameters that were used to create a particular model, you create a query against one of the mining model schema rowsets. In SQL Server 2008 Analysis Services (SSAS), these schema rowsets were exposed as a set of system views that you can query easily by using Transact-SQL syntax. This procedure describes how to create a query that returns the parameters that were used to create the specified mining model.
To open a Query window for a schema rowset query
In SQL Server Management Studio, open the instance of Analysis Services that contains the model you want to query.
Right-click the instance name, select New Query, and then select DMX.
You can also create a query against a data mining model by using the MDX template.
If the instance contains multiple databases, select the database that contains the model you want to query from the Available Databases list in the toolbar.
To return model parameters for an existing mining model
In the DMX query pane, type or paste the following text:
SELECT MINING_PARAMETERS FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = ''
In Object Explorer, select the mining model you want, and then drag it into the DMX Query pane, between the single quotation marks.
Press F5, or click Execute.
The following code returns a list of the parameters that were used to create the mining model that you build in the Basic Data Mining Tutorial. These parameters include the explicit values for any defaults used by the mining services available from providers on the server.
SELECT MINING_PARAMETERS FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = 'TM Clustering'
The code example returns the following parameters for the clustering model: