Share via


PredictorClient.LoadModelFromFile Method (PIA)

Use this method to load a model stored in a file.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Sub LoadModelFromFile(sFilePath As String)

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public void LoadModelFromFile (
stringsFilePath,
);

Parameters

[Visual Basic .NET]

  • sFilePath
    A String that contains the file name, extension, and path.

[C#]

  • sFilePath
    A string that contains the file name, extension, and path.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Remarks

A valid model must be loaded before calling the other methods of the PredictorClient object. A model is originally stored in a database and must be loaded by using the LoadModelFromDB method. After it is loaded, the model may be saved to a file by using the SaveModelToFile method.

The file path is relative to the current working directory of the calling process.

[Visual Basic .NET]

Example

' PredictionModel2.mdl is stored in the working directory of the
'  calling process
oPredictorClient.LoadModelFromFile("PredictionModel2.mdl")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: PredictorClient (in PredictorClient.dll)

See Also

PredictorClient Class

PredictorClient.Predict

PredictorClient.LoadModelFromDB

Copyright © 2005 Microsoft Corporation.
All rights reserved.