Skip to content

Commit

Permalink
Add ml inference processor and APIs to console (#53618)
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 authored Dec 20, 2019
1 parent fc999e5 commit ec4fca6
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 ec4fca6

Please sign in to comment.