Module org.elasticsearch.xcore
Class Classification
java.lang.Object
org.elasticsearch.xpack.core.ml.dataframe.analyses.Classification
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,DataFrameAnalysis
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.xpack.core.ml.dataframe.analyses.DataFrameAnalysis
DataFrameAnalysis.FieldInfoNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final intThe max number of classes classification supportsstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionClassification(String dependentVariable) Classification(String dependentVariable, BoostedTreeParams boostedTreeParams, String predictionFieldName, Classification.ClassAssignmentObjective classAssignmentObjective, Integer numTopClasses, Double trainingPercent, Long randomizeSeed, List<PreProcessor> featureProcessors, Boolean earlyStoppingEnabled) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic StringextractJobIdFromStateDoc(String stateDocId) static ClassificationfromXContent(org.elasticsearch.xcontent.XContentParser parser, boolean ignoreUnknownFields) getAllowedCategoricalTypes(String fieldName) intgetParams(DataFrameAnalysis.FieldInfo fieldInfo) static PredictionFieldTypegetPredictionFieldType(Set<String> dependentVariableTypes) Returns the progress phases the analysis goes through in orderlonggetResultMappings(String resultsFieldName, FieldCapabilitiesResponse fieldCapabilitiesResponse) Returns fields for which the mappings should be either predefined or copied from source index to destination index.getStateDocIdPrefix(String jobId) Returns the document id prefix for the analysis statedoubleinthashCode()inferenceConfig(DataFrameAnalysis.FieldInfo fieldInfo) booleanbooleanbooleanbooleanorg.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
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 -
CLASS_ASSIGNMENT_OBJECTIVE
public static final org.elasticsearch.xcontent.ParseField CLASS_ASSIGNMENT_OBJECTIVE -
NUM_TOP_CLASSES
public static final org.elasticsearch.xcontent.ParseField NUM_TOP_CLASSES -
TRAINING_PERCENT
public static final org.elasticsearch.xcontent.ParseField TRAINING_PERCENT -
RANDOMIZE_SEED
public static final org.elasticsearch.xcontent.ParseField RANDOMIZE_SEED -
FEATURE_PROCESSORS
public static final org.elasticsearch.xcontent.ParseField FEATURE_PROCESSORS -
EARLY_STOPPING_ENABLED
public static final org.elasticsearch.xcontent.ParseField EARLY_STOPPING_ENABLED -
MAX_DEPENDENT_VARIABLE_CARDINALITY
public static final int MAX_DEPENDENT_VARIABLE_CARDINALITYThe max number of classes classification supports- See Also:
-
-
Constructor Details
-
Classification
public Classification(String dependentVariable, BoostedTreeParams boostedTreeParams, @Nullable String predictionFieldName, @Nullable Classification.ClassAssignmentObjective classAssignmentObjective, @Nullable Integer numTopClasses, @Nullable Double trainingPercent, @Nullable Long randomizeSeed, @Nullable List<PreProcessor> featureProcessors, @Nullable Boolean earlyStoppingEnabled) -
Classification
-
Classification
- Throws:
IOException
-
-
Method Details
-
fromXContent
public static Classification fromXContent(org.elasticsearch.xcontent.XContentParser parser, boolean ignoreUnknownFields) -
getDependentVariable
-
getBoostedTreeParams
-
getPredictionFieldName
-
getClassAssignmentObjective
-
getNumTopClasses
public int getNumTopClasses() -
getTrainingPercent
public double getTrainingPercent()- Specified by:
getTrainingPercentin interfaceDataFrameAnalysis- Returns:
- the percentage of data to use for training
-
getRandomizeSeed
public long getRandomizeSeed() -
getFeatureProcessors
-
getEarlyStoppingEnabled
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
getParams
- Specified by:
getParamsin interfaceDataFrameAnalysis- Parameters:
fieldInfo- Information about the fields like types and cardinalities- Returns:
- The analysis parameters as a map
-
getPredictionFieldType
-
supportsCategoricalFields
public boolean supportsCategoricalFields()- Specified by:
supportsCategoricalFieldsin interfaceDataFrameAnalysis- Returns:
trueif this analysis supports fields with categorical values (i.e. text, keyword, ip)
-
getAllowedCategoricalTypes
- Specified by:
getAllowedCategoricalTypesin interfaceDataFrameAnalysis- Parameters:
fieldName- field for which the allowed categorical types should be returned- Returns:
- The types treated as categorical for the given field
-
getRequiredFields
- Specified by:
getRequiredFieldsin interfaceDataFrameAnalysis- Returns:
- The names and types of the fields that analyzed documents must have for the analysis to operate
-
getFieldCardinalityConstraints
- Specified by:
getFieldCardinalityConstraintsin interfaceDataFrameAnalysis- Returns:
Listcontaining cardinality constraints for the selected (analysis-specific) fields
-
getResultMappings
public Map<String,Object> getResultMappings(String resultsFieldName, FieldCapabilitiesResponse fieldCapabilitiesResponse) Description copied from interface:DataFrameAnalysisReturns fields for which the mappings should be either predefined or copied from source index to destination index.- Specified by:
getResultMappingsin interfaceDataFrameAnalysis- Parameters:
resultsFieldName- name of the results field under which all the results are storedfieldCapabilitiesResponse- field capabilities fetched for this analysis' required fields- Returns:
Mapcontaining fields for which the mappings should be handled explicitly
-
supportsMissingValues
public boolean supportsMissingValues()- Specified by:
supportsMissingValuesin interfaceDataFrameAnalysis- Returns:
trueif this analysis supports data frame rows with missing values
-
persistsState
public boolean persistsState()- Specified by:
persistsStatein interfaceDataFrameAnalysis- Returns:
trueif this analysis persists state that can later be used to restore from a given point
-
getStateDocIdPrefix
Description copied from interface:DataFrameAnalysisReturns the document id prefix for the analysis state- Specified by:
getStateDocIdPrefixin interfaceDataFrameAnalysis
-
getProgressPhases
Description copied from interface:DataFrameAnalysisReturns the progress phases the analysis goes through in order- Specified by:
getProgressPhasesin interfaceDataFrameAnalysis
-
inferenceConfig
- Specified by:
inferenceConfigin interfaceDataFrameAnalysis- Returns:
- the analysis inference config or
nullif inference is not supported
-
supportsInference
public boolean supportsInference()- Specified by:
supportsInferencein interfaceDataFrameAnalysis- Returns:
trueif this analysis trains a model that can be used for inference
-
extractJobIdFromStateDoc
-
equals
-
hashCode
public int hashCode()
-