Explain data frame analytics API

Explains a data frame analytics config.

This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Request

GET _ml/data_frame/analytics/_explain

POST _ml/data_frame/analytics/_explain

GET _ml/data_frame/analytics/<data_frame_analytics_id>/_explain

POST _ml/data_frame/analytics/<data_frame_analytics_id>/_explain

Prerequisites

If the Elasticsearch security features are enabled, you must have the following privileges:

  • cluster: monitor_ml

For more information, see Security privileges and Machine learning security privileges.

Description

This API provides explanations for a data frame analytics config that either exists already or one that has not been created yet. The following explanations are provided:

  • which fields are included or not in the analysis and why,
  • how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.

If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.

Path parameters

<data_frame_analytics_id>

(Optional, string) Identifier for the data frame analytics job.

Request body

A data frame analytics config as described in Create data frame analytics jobs. Note that id and dest don’t need to be provided in the context of this API.

Response body

The API returns a response that contains the following:

field_selection

(array) An array of objects that explain selection for each field, sorted by the field names.

Properties of field_selection objects

  • is_included

    (boolean) Whether the field is selected to be included in the analysis.

    is_required

    (boolean) Whether the field is required.

    feature_type

    (string) The feature type of this field for the analysis. May be categorical or numerical.

    mapping_types

    (string) The mapping types of the field.

    name

    (string) The field name.

    reason

    (string) The reason a field is not selected to be included in the analysis.

memory_estimation

(object) An object containing the memory estimates.

Properties of memory_estimation

  • expected_memory_with_disk

    (string) Estimated memory usage under the assumption that overflowing to disk is allowed during data frame analytics. expected_memory_with_disk is usually smaller than expected_memory_without_disk as using disk allows to limit the main memory needed to perform data frame analytics.

    expected_memory_without_disk

    (string) Estimated memory usage under the assumption that the whole data frame analytics should happen in memory (i.e. without overflowing to disk).

Examples

  1. POST _ml/data_frame/analytics/_explain
  2. {
  3. "source": {
  4. "index": "houses_sold_last_10_yrs"
  5. },
  6. "analysis": {
  7. "regression": {
  8. "dependent_variable": "price"
  9. }
  10. }
  11. }

The API returns the following results:

  1. {
  2. "field_selection": [
  3. {
  4. "field": "number_of_bedrooms",
  5. "mappings_types": ["integer"],
  6. "is_included": true,
  7. "is_required": false,
  8. "feature_type": "numerical"
  9. },
  10. {
  11. "field": "postcode",
  12. "mappings_types": ["text"],
  13. "is_included": false,
  14. "is_required": false,
  15. "reason": "[postcode.keyword] is preferred because it is aggregatable"
  16. },
  17. {
  18. "field": "postcode.keyword",
  19. "mappings_types": ["keyword"],
  20. "is_included": true,
  21. "is_required": false,
  22. "feature_type": "categorical"
  23. },
  24. {
  25. "field": "price",
  26. "mappings_types": ["float"],
  27. "is_included": true,
  28. "is_required": true,
  29. "feature_type": "numerical"
  30. }
  31. ],
  32. "memory_estimation": {
  33. "expected_memory_without_disk": "128MB",
  34. "expected_memory_with_disk": "32MB"
  35. }
  36. }