Class BaseScikitLearnContentLoader<ObjectType>

    • Constructor Detail

      • BaseScikitLearnContentLoader

        protected BaseScikitLearnContentLoader​(String typeName)
        Instantiate a BaseScikitLearnContentLoader object.
        Parameters:
        typeName - The type name of the loader.
    • Method Detail

      • createResultObject

        protected abstract ObjectType createResultObject()
        An abstract method to initialize a new instance of the scikit-learn object supported by the loader.
        Returns:
        The unloaded scikit-learn object supported by the loader.
      • registerSetters

        protected abstract void registerSetters()
        An abstract method implemented by the derived classes that loads the layout of the binary format. BaseScikitLearnContentLoader uses this layout to load the object.
      • getTypeName

        public String getTypeName()
        Name of the loader. The name is stored in the header of the binary package file to be used during deserialization.
        Specified by:
        getTypeName in interface IScikitLearnContentLoader
        Returns:
        The name/id of the loader type.
      • loadContent

        public Object loadContent​(BinaryModelPackage buffer)
        Loads the scikit-learn object with the provided layout in registerSetters.
        Specified by:
        loadContent in interface IScikitLearnContentLoader
        Parameters:
        buffer - The buffer to load the object from.
        Returns:
        The fully initialized scikit-learn object.
      • registerDoubleField

        protected void registerDoubleField​(String name,
                                           IScikitLearnLoaderDoubleFieldSetter<ObjectType> setter)
        Registers a double field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerLongField

        protected void registerLongField​(String name,
                                         IScikitLearnLoaderLongFieldSetter<ObjectType> setter)
        Registers a long integer field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerStringField

        protected void registerStringField​(String name,
                                           IScikitLearnLoaderStringFieldSetter<ObjectType> setter)
        Registers a string field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerNumpyArrayField

        protected void registerNumpyArrayField​(String name,
                                               IScikitLearnLoaderNumpyArrayFieldSetter<ObjectType> setter)
        Registers a numpy array field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerStringArrayField

        protected void registerStringArrayField​(String name,
                                                IScikitLearnLoaderStringArrayFieldSetter<ObjectType> setter)
        Registers a String array field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerListOfNumpyArrayField

        protected <ArrayType> void registerListOfNumpyArrayField​(String name,
                                                                 IScikitLearnLoaderListOfNumpyArrayFieldSetter<ObjectType,​ArrayType> setter)
        Registers a list of numpy array field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerListField

        protected void registerListField​(String name,
                                         IScikitLearnLoaderListFieldSetter<ObjectType> setter)
        Registers a list field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.
      • registerDictionaryField

        protected void registerDictionaryField​(String name,
                                               IScikitLearnLoaderDictionaryFieldSetter<ObjectType> setter)
        Registers a dictionary field for the scikit-learn serialized layout.
        Parameters:
        name - Name of the field.
        setter - The setter callback to load the value of the scikit-learn object.