java.lang.Object
org.elasticsearch.xpack.core.ml.dataframe.analyses.Regression
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject, DataFrameAnalysis

public class Regression extends Object implements DataFrameAnalysis
  • Field Details

    • NAME

      public static final org.elasticsearch.xcontent.ParseField NAME
    • DEPENDENT_VARIABLE

      public static final org.elasticsearch.xcontent.ParseField DEPENDENT_VARIABLE
    • PREDICTION_FIELD_NAME

      public static final org.elasticsearch.xcontent.ParseField PREDICTION_FIELD_NAME
    • TRAINING_PERCENT

      public static final org.elasticsearch.xcontent.ParseField TRAINING_PERCENT
    • RANDOMIZE_SEED

      public static final org.elasticsearch.xcontent.ParseField RANDOMIZE_SEED
    • LOSS_FUNCTION

      public static final org.elasticsearch.xcontent.ParseField LOSS_FUNCTION
    • LOSS_FUNCTION_PARAMETER

      public static final org.elasticsearch.xcontent.ParseField LOSS_FUNCTION_PARAMETER
    • FEATURE_PROCESSORS

      public static final org.elasticsearch.xcontent.ParseField FEATURE_PROCESSORS
    • EARLY_STOPPING_ENABLED

      public static final org.elasticsearch.xcontent.ParseField EARLY_STOPPING_ENABLED
  • Constructor Details

  • Method Details

    • fromXContent

      public static Regression fromXContent(org.elasticsearch.xcontent.XContentParser parser, boolean ignoreUnknownFields)
    • getDependentVariable

      public String getDependentVariable()
    • getBoostedTreeParams

      public BoostedTreeParams getBoostedTreeParams()
    • getPredictionFieldName

      public String getPredictionFieldName()
    • getTrainingPercent

      public double getTrainingPercent()
      Specified by:
      getTrainingPercent in interface DataFrameAnalysis
      Returns:
      the percentage of data to use for training
    • getRandomizeSeed

      public long getRandomizeSeed()
    • getLossFunction

      public Regression.LossFunction getLossFunction()
    • getLossFunctionParameter

      public Double getLossFunctionParameter()
    • getFeatureProcessors

      public List<PreProcessor> getFeatureProcessors()
    • getEarlyStoppingEnabled

      public Boolean getEarlyStoppingEnabled()
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface NamedWriteable
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • getParams

      public Map<String,Object> getParams(DataFrameAnalysis.FieldInfo fieldInfo)
      Specified by:
      getParams in interface DataFrameAnalysis
      Parameters:
      fieldInfo - Information about the fields like types and cardinalities
      Returns:
      The analysis parameters as a map
    • supportsCategoricalFields

      public boolean supportsCategoricalFields()
      Specified by:
      supportsCategoricalFields in interface DataFrameAnalysis
      Returns:
      true if this analysis supports fields with categorical values (i.e. text, keyword, ip)
    • getAllowedCategoricalTypes

      public Set<String> getAllowedCategoricalTypes(String fieldName)
      Specified by:
      getAllowedCategoricalTypes in interface DataFrameAnalysis
      Parameters:
      fieldName - field for which the allowed categorical types should be returned
      Returns:
      The types treated as categorical for the given field
    • getRequiredFields

      public List<RequiredField> getRequiredFields()
      Specified by:
      getRequiredFields in interface DataFrameAnalysis
      Returns:
      The names and types of the fields that analyzed documents must have for the analysis to operate
    • getFieldCardinalityConstraints

      public List<FieldCardinalityConstraint> getFieldCardinalityConstraints()
      Specified by:
      getFieldCardinalityConstraints in interface DataFrameAnalysis
      Returns:
      List containing cardinality constraints for the selected (analysis-specific) fields
    • getResultMappings

      public Map<String,Object> getResultMappings(String resultsFieldName, FieldCapabilitiesResponse fieldCapabilitiesResponse)
      Description copied from interface: DataFrameAnalysis
      Returns fields for which the mappings should be either predefined or copied from source index to destination index.
      Specified by:
      getResultMappings in interface DataFrameAnalysis
      Parameters:
      resultsFieldName - name of the results field under which all the results are stored
      fieldCapabilitiesResponse - field capabilities fetched for this analysis' required fields
      Returns:
      Map containing fields for which the mappings should be handled explicitly
    • supportsMissingValues

      public boolean supportsMissingValues()
      Specified by:
      supportsMissingValues in interface DataFrameAnalysis
      Returns:
      true if this analysis supports data frame rows with missing values
    • persistsState

      public boolean persistsState()
      Specified by:
      persistsState in interface DataFrameAnalysis
      Returns:
      true if this analysis persists state that can later be used to restore from a given point
    • getStateDocIdPrefix

      public String getStateDocIdPrefix(String jobId)
      Description copied from interface: DataFrameAnalysis
      Returns the document id prefix for the analysis state
      Specified by:
      getStateDocIdPrefix in interface DataFrameAnalysis
    • getProgressPhases

      public List<String> getProgressPhases()
      Description copied from interface: DataFrameAnalysis
      Returns the progress phases the analysis goes through in order
      Specified by:
      getProgressPhases in interface DataFrameAnalysis
    • inferenceConfig

      public InferenceConfig inferenceConfig(DataFrameAnalysis.FieldInfo fieldInfo)
      Specified by:
      inferenceConfig in interface DataFrameAnalysis
      Returns:
      the analysis inference config or null if inference is not supported
    • supportsInference

      public boolean supportsInference()
      Specified by:
      supportsInference in interface DataFrameAnalysis
      Returns:
      true if this analysis trains a model that can be used for inference
    • extractJobIdFromStateDoc

      public static String extractJobIdFromStateDoc(String stateDocId)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object