Preview data frame analytics API
Previews the features used by a data frame analytics config.
Request
GET _ml/data_frame/analytics/_preview
POST _ml/data_frame/analytics/_preview
GET _ml/data_frame/analytics/<data_frame_analytics_id>/_preview
POST _ml/data_frame/analytics/<data_frame_analytics_id>/_preview
Prerequisites
Requires the monitor_ml cluster privilege. This privilege is included in the machine_learning_user built-in role.
Description
This API provides preview of the extracted features for a data frame analytics config that either exists already or one that has not been created yet.
Path parameters
-
<data_frame_analytics_id> - (Optional, string) Identifier for the data frame analytics job.
Request body
-
config - (Optional, object) A data frame analytics config as described in Create data frame analytics jobs. Note that
idanddestdon’t need to be provided in the context of this API.
Response body
The API returns a response that contains the following:
-
feature_values - (array) An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.
Examples
resp = client.ml.preview_data_frame_analytics(
config={
"source": {
"index": "houses_sold_last_10_yrs"
},
"analysis": {
"regression": {
"dependent_variable": "price"
}
}
},
)
print(resp) const response = await client.ml.previewDataFrameAnalytics({
config: {
source: {
index: "houses_sold_last_10_yrs",
},
analysis: {
regression: {
dependent_variable: "price",
},
},
},
});
console.log(response); POST _ml/data_frame/analytics/_preview
{
"config": {
"source": {
"index": "houses_sold_last_10_yrs"
},
"analysis": {
"regression": {
"dependent_variable": "price"
}
}
}
} The API returns the following results:
{
"feature_values": [
{
"number_of_bedrooms": "1",
"postcode": "29655",
"price": "140.4"
},
...
]
}
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/preview-dfanalytics.html