1
0

preview-dfanalytics.asciidoc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. [role="xpack"]
  2. [[preview-dfanalytics]]
  3. = Preview {dfanalytics} API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Preview {dfanalytics}</titleabbrev>
  7. ++++
  8. Previews the features used by a {dataframe-analytics-config}.
  9. [[ml-preview-dfanalytics-request]]
  10. == {api-request-title}
  11. `GET _ml/data_frame/analytics/_preview` +
  12. `POST _ml/data_frame/analytics/_preview` +
  13. `GET _ml/data_frame/analytics/<data_frame_analytics_id>/_preview` +
  14. `POST _ml/data_frame/analytics/<data_frame_analytics_id>/_preview`
  15. [[ml-preview-dfanalytics-prereq]]
  16. == {api-prereq-title}
  17. Requires the `monitor_ml` cluster privilege. This privilege is included in the
  18. `machine_learning_user` built-in role.
  19. [[ml-preview-dfanalytics-desc]]
  20. == {api-description-title}
  21. This API provides preview of the extracted features for a {dataframe-analytics-config}
  22. that either exists already or one that has not been created yet.
  23. [[ml-preview-dfanalytics-path-params]]
  24. == {api-path-parms-title}
  25. `<data_frame_analytics_id>`::
  26. (Optional, string)
  27. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics]
  28. [[ml-preview-dfanalytics-request-body]]
  29. == {api-request-body-title}
  30. `config`::
  31. (Optional, object)
  32. A {dataframe-analytics-config} as described in <<put-dfanalytics>>.
  33. Note that `id` and `dest` don't need to be provided in the context of this API.
  34. [role="child_attributes"]
  35. [[ml-preview-dfanalytics-results]]
  36. == {api-response-body-title}
  37. The API returns a response that contains the following:
  38. `feature_values`::
  39. (array)
  40. An array of objects that contain feature name and value pairs. The features have
  41. been processed and indicate what will be sent to the model for training.
  42. [[ml-preview-dfanalytics-example]]
  43. == {api-examples-title}
  44. [source,console]
  45. --------------------------------------------------
  46. POST _ml/data_frame/analytics/_preview
  47. {
  48. "config": {
  49. "source": {
  50. "index": "houses_sold_last_10_yrs"
  51. },
  52. "analysis": {
  53. "regression": {
  54. "dependent_variable": "price"
  55. }
  56. }
  57. }
  58. }
  59. --------------------------------------------------
  60. // TEST[skip:TBD]
  61. The API returns the following results:
  62. [source,console-result]
  63. ----
  64. {
  65. "feature_values": [
  66. {
  67. "number_of_bedrooms": "1",
  68. "postcode": "29655",
  69. "price": "140.4"
  70. },
  71. ...
  72. ]
  73. }
  74. ----