Class Model

java.lang.Object
mindsdb.models.Model
Direct Known Subclasses:
ModelVersion

public class Model extends Object
Model class for handling model.
  • Constructor Details

    • Model

      public Model(Project project, Map<String,Object> data)
      Constructor for Model
      Parameters:
      project - Project object
      data - Data for the model
  • Method Details

    • getIdentifier

      public String getIdentifier()
      Get identifier of the model
      Returns:
      identifier of the model
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • predict

      public tech.tablesaw.api.Table predict(tech.tablesaw.api.Table data, Map<String,String> params)
      Make prediction with the model
      Parameters:
      data - input data
      params - prediction parameters
      Returns:
      prediction result in Tablesaw Table
    • predict

      public tech.tablesaw.api.Table predict(tech.tablesaw.api.Table data)
      Make prediction with the model
      Parameters:
      data - input data
      Returns:
      prediction result in Tablesaw Table
    • predict

      public tech.tablesaw.api.Table predict(MDBTable data)
      Make prediction with the model using MDBTable
      Parameters:
      data - MDBTable input data
      Returns:
      prediction result in Tablesaw Table
    • predict

      public tech.tablesaw.api.Table predict(Map<String,String> data, Map<String,String> params)
      Make prediction with the model
      Parameters:
      data - input data
      params - prediction parameters
      Returns:
      prediction result in Tablesaw Table
    • predict

      public tech.tablesaw.api.Table predict(Map<String,String> data)
      Make prediction with the model
      Parameters:
      data - input data
      Returns:
      prediction result in Tablesaw Table
    • waitComplete

      public void waitComplete() throws InterruptedException
      Wait for training to complete
      Throws:
      InterruptedException - if the thread is interrupted
    • getStatus

      public String getStatus()
      Get status of the model
      Returns:
      status of the model
    • refresh

      public Map<String,Object> refresh()
      Refresh the model
      Returns:
      data of the model
    • describe

      public tech.tablesaw.api.Table describe(String type)
      Return description of the model
      Parameters:
      type - describe type (for lightwood is models, ensemble, features), optional
      Returns:
      dataframe with result of description
    • describe

      public tech.tablesaw.api.Table describe()
      Return description of the model
      Returns:
      dataframe with result of description
    • listVersions

      public List<ModelVersion> listVersions()
      List all versions of the model
      Returns:
      list of ModelVersion objects
    • getVersion

      public ModelVersion getVersion(Integer num)
      Get version of the model
      Parameters:
      num - version number
      Returns:
      ModelVersion object
    • dropVersion

      public void dropVersion(int num)
      Drop version of the model
      Parameters:
      num - version number
    • setActive

      public void setActive(int version)
      Set active version of the model
      Parameters:
      version - version number
    • retrain

      public Model retrain(String query, String database, Map<String,String> options, String engine)
      Call retrain of the model
      Parameters:
      query - SQL string to get data for retraining, optional
      database - Database to get data for retraining, optional
      options - Parameters for retraining model, optional
      engine - ML engine, optional
      Returns:
      Model object
    • finetune

      public Model finetune(String query, String database, Map<String,String> options, String engine)
      Call finetune of the model
      Parameters:
      query - SQL string to get data for fine-tuning, optional
      database - Database to get data for fine-tuning, optional
      options - Parameters for fine-tuning model, optional
      engine - ML engine, optional
      Returns:
      Model object