FritzMLModel

@objc(FritzMLModel)
public final class FritzMLModel : MLModel
  • Declaration

    Swift

    @objc
    public private(set) var activeModelConfig: FritzModelConfiguration
  • id

    Declaration

    Swift

    public var id: String { get }
  • Declaration

    Swift

    public var version: Int { get }
  • Model manager for api requests

    Declaration

    Swift

    unowned public let sessionManager: SessionManager
  • Model to use for predictions

    Declaration

    Swift

    public private(set) var model: MLModel
  • Initialize model with an model type.

    Listens for active model updates and reloads model if active version different than existing.

    Declaration

    Swift

    @objc(initWithIdentifiedModel:config:sessionManager:)
    public init(
      model: MLModel,
      activeModelConfig: FritzModelConfiguration,
      sessionManager: SessionManager
    )
  • Proxy model description

    Declaration

    Swift

    public override var modelDescription: MLModelDescription { get }
  • Override prediction method and pass input/output to analytics

    Declaration

    Swift

    @objc(predictionFromFeatures:error:)
    public override func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider
  • Override prediction method and pass input/output to analytics

    Declaration

    Swift

    @objc(predictionFromFeatures:options:error:)
    public override func prediction(from input: MLFeatureProvider, options: MLPredictionOptions)
      throws -> MLFeatureProvider