Moving Prediction Models to the Web Server

In this step, you manually move the models to the Web server.

However, this process can be automated by using SQL Server Agent or by creating a script that uses the PredictorClient objectSaveModelToFile method to save the models. Following is a sample script:

sDWConn = "Provider=SQLOLEDB.1;Persist Security Info=False;Integrated Security='SSPI';Initial Catalog=PredictorDemo_dw;Data Source=CSSERVER1"
sModelName = "PreDemo_tran"
sSitename = "PredictorDemo"
sFilename = "c:\predictor_models.pmf"
call SaveModelToFile( sSitename, sDWConn, sModelName,sFilename)
'Load the model from the Data Warehouse and save it to a local file
sub SaveModelToFile(strSitename, strDWConn, strModelName, strFileName)
    Set oPredictor = CreateObject("Commerce.PredictorClient")
    oPredictor.sSiteName = strSitename
    oPredictor.LoadModelFromDB strModelName, strDWConn
    oPredictor.saveModeltofile strFileName
    Set oPredictor = Nothing
end sub

To move Prediction models to the Web server

  1. On the Data Warehouse computer, expand Commerce Server Manager, and then expand Predictor on <server_name>.
  2. Right-click each model, click Save, and then save the model to a file.
  3. Using Windows Explorer, copy the model file(s) from the Data Warehouse to disk, and then copy the files to each Web server.

Copyright © 2005 Microsoft Corporation.
All rights reserved.