This article provides step‑by‑step guidance for deploying a data mining model from a development environment to a production Analysis Services instance.
Ensure that the mining model is fully trained and validated in your development instance.
- Review model performance metrics.
- Document the input columns, processing options, and algorithm settings.
- Export the model to a
.bim file using SQL Server Data Tools (SSDT).
In the target Analysis Services database, create a mining structure that matches the model definition.
CREATE MINING STRUCTURE [AdventureWorks_MiningStructure]
(
[CustomerAge] FLOAT,
[AnnualIncome] FLOAT,
[PurchaseHistory] LONG,
...
)
USING [Microsoft.Mining.Cluster];
Deploy the model using either SQL Server Management Studio (SSMS) or a PowerShell script.
Import-Module SqlServer
$server = "myprodserver"
$database = "AdventureWorksDW"
$modelPath = "C:\Models\CustomerChurnModel.bim"
Invoke-ASCmd -ServerInstance $server -Database $database -InputFile $modelPath
Confirm that the model is available and functional.
SELECT *
FROM $system.mining_models
WHERE model_name = 'CustomerChurnModel';
Run a test prediction to ensure correct results.