evaluate-data-frame.asciidoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --
  2. :api: evaluate-data-frame
  3. :request: EvaluateDataFrameRequest
  4. :response: EvaluateDataFrameResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Evaluate Data Frame API
  8. The Evaluate Data Frame API is used to evaluate an ML algorithm that ran on a {dataframe}.
  9. The API accepts an +{request}+ object and returns an +{response}+.
  10. [id="{upid}-{api}-request"]
  11. ==== Evaluate Data Frame Request
  12. ["source","java",subs="attributes,callouts,macros"]
  13. --------------------------------------------------
  14. include-tagged::{doc-tests-file}[{api}-request]
  15. --------------------------------------------------
  16. <1> Constructing a new evaluation request
  17. <2> Reference to an existing index
  18. <3> The query with which to select data from indices
  19. <4> Kind of evaluation to perform
  20. <5> Name of the field in the index. Its value denotes the actual (i.e. ground truth) label for an example. Must be either true or false
  21. <6> Name of the field in the index. Its value denotes the probability (as per some ML algorithm) of the example being classified as positive
  22. <7> The remaining parameters are the metrics to be calculated based on the two fields described above.
  23. <8> https://en.wikipedia.org/wiki/Precision_and_recall[Precision] calculated at thresholds: 0.4, 0.5 and 0.6
  24. <9> https://en.wikipedia.org/wiki/Precision_and_recall[Recall] calculated at thresholds: 0.5 and 0.7
  25. <10> https://en.wikipedia.org/wiki/Confusion_matrix[Confusion matrix] calculated at threshold 0.5
  26. <11> https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_the_curve[AuC ROC] calculated and the curve points returned
  27. include::../execution.asciidoc[]
  28. [id="{upid}-{api}-response"]
  29. ==== Response
  30. The returned +{response}+ contains the requested evaluation metrics.
  31. ["source","java",subs="attributes,callouts,macros"]
  32. --------------------------------------------------
  33. include-tagged::{doc-tests-file}[{api}-response]
  34. --------------------------------------------------
  35. <1> Fetching all the calculated metrics results
  36. <2> Fetching precision metric by name
  37. <3> Fetching precision at a given (0.4) threshold
  38. <4> Fetching confusion matrix metric by name
  39. <5> Fetching confusion matrix at a given (0.5) threshold