Skip to content

Commit

Permalink
Add ml inference processor and APIs to console (#53618) (#53708)
Browse files Browse the repository at this point in the history
Adds new Machine Learning Inference processor to Kibana Console.

Also adds new Inference APIs generated from ES specs.
  • Loading branch information
benwtrent committed Dec 20, 2019
1 parent ded308c commit 41d7236
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
@@ -0,0 +1,11 @@
{
"ml.delete_trained_model": {
"methods": [
"DELETE"
],
"patterns": [
"_ml/inference/{model_id}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html"
}
}
@@ -0,0 +1,19 @@
{
"ml.get_trained_models": {
"url_params": {
"allow_no_match": "__flag__",
"include_model_definition": "__flag__",
"decompress_definition": "__flag__",
"from": 0,
"size": 0
},
"methods": [
"GET"
],
"patterns": [
"_ml/inference/{model_id}",
"_ml/inference"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html"
}
}
@@ -0,0 +1,17 @@
{
"ml.get_trained_models_stats": {
"url_params": {
"allow_no_match": "__flag__",
"from": 0,
"size": 0
},
"methods": [
"GET"
],
"patterns": [
"_ml/inference/{model_id}/_stats",
"_ml/inference/_stats"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html"
}
}
31 changes: 30 additions & 1 deletion x-pack/legacy/plugins/console_extensions/spec/ingest/index.js
Expand Up @@ -37,4 +37,33 @@ const enrichProcessorDefinition = {
},
};

export const processors = [enrichProcessorDefinition];
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/inference-processor.html
const inferenceProcessorDefinition = {
inference: {
__template: {
model_id: '',
inference_config: {},
field_mappings: {},
},
target_field: '',
model_id: '',
field_mappings: {
__template: {},
},
inference_config: {
regression: {
__template: {},
results_field: '',
},
classification: {
__template: {},
results_field: '',
num_top_classes: 2,
top_classes_results_field: '',
},
},
...commonPipelineParams,
},
};

export const processors = [enrichProcessorDefinition, inferenceProcessorDefinition];

0 comments on commit 41d7236

Please sign in to comment.