Class WekaRegressionModel

    • Field Detail

      • m_Model

        protected weka.classifiers.Classifier m_Model
        the underlying model.
      • m_DatasetInfo

        protected DatasetInfo m_DatasetInfo
        the dataset info.
      • m_InstancesHeader

        protected weka.core.Instances m_InstancesHeader
        the instances used.
    • Constructor Detail

      • WekaRegressionModel

        public WekaRegressionModel​(weka.classifiers.Classifier model,
                                   Dataset data,
                                   weka.core.Instances inst)
        Initializes the model.
        Parameters:
        model - the built Weka classifier
        data - the training data
        inst - the Weka training data
    • Method Detail

      • classify

        public double classify​(Row row)
                        throws Exception
        Returns the regression for the given row.
        Specified by:
        classify in interface RegressionModel
        Parameters:
        row - the row to make predictions for
        Returns:
        the prediction
        Throws:
        Exception - if prediction fails
      • getDatasetInfo

        public DatasetInfo getDatasetInfo()
        Returns information about the dataset used for building the model.
        Specified by:
        getDatasetInfo in interface Model
        Returns:
        the information
      • getInstancesHeader

        public weka.core.Instances getInstancesHeader()
        Returns the Instances header used for building the model.
        Returns:
        the header
      • getModelDescription

        public String getModelDescription()
        Gets a short string description of the model.
        Specified by:
        getModelDescription in interface Model
        Returns:
        the description, null if none available
      • isCompatible

        public String isCompatible​(Dataset data)
        Checks whether the dataset is compatible with the model.
        Specified by:
        isCompatible in interface Model
        Parameters:
        data - the dataset to check
        Returns:
        null if compatible, otherwise error message why not