Incorporate final technical feedback

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>
This commit is contained in:
Naarcha-AWS 2022-03-21 15:20:31 -05:00
parent 228dd73a60
commit bbbcdc32ef
3 changed files with 67 additions and 38 deletions

View File

@ -16,11 +16,11 @@ nav_order: 99
---
The Machine Learning (ML) commons API lets you train ML algorithms synchronously and asynchronously, and then store that model in an ML model index.
The Machine Learning (ML) commons API lets you train ML algorithms synchronously and asynchronously, make predictions with that trained model, train and predict with the same data set, and then store that model in an ML model index.
In order to train tasks through the API, three inputs are required.
- Algorithm name: Usually `FunctionaName`. This determines what algorithm the ML Engine runs.
- Algorithm name: Must be one of a [FunctionaName](https://github.com/opensearch-project/ml-commons/blob/1.3/common/src/main/java/org/opensearch/ml/common/parameter/FunctionName.java). This determines what algorithm the ML Engine runs.
- Model hyper parameters: Adjust these parameters to make the model train better.
- Input data: The data input that trains the ML model, or applies the ML models to predictions. To input data, query against your index or use data frame.
@ -385,7 +385,7 @@ POST /_plugins/_ml/_train_predict/kmeans
"values" : [
{
"column_type" : "INTEGER",
"value" : 0
"value" : 1
}
]
},
@ -393,7 +393,7 @@ POST /_plugins/_ml/_train_predict/kmeans
"values" : [
{
"column_type" : "INTEGER",
"value" : 0
"value" : 1
}
]
},
@ -401,7 +401,7 @@ POST /_plugins/_ml/_train_predict/kmeans
"values" : [
{
"column_type" : "INTEGER",
"value" : 0
"value" : 1
}
]
},
@ -526,33 +526,6 @@ POST /_plugins/_ml/models/_search
}
```
## Delete task
Delete a task based on the task_id.
```json
DELETE /_plugins/_ml/tasks/{task_id}
```
### Response
```json
{
"_index" : ".plugins-ml-task",
"_type" : "_doc",
"_id" : "xQRYLX8BydmmU1x6nuD3",
"_version" : 4,
"result" : "deleted",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"_seq_no" : 42,
"_primary_term" : 7
}
```
## Search task
Search tasks based on parameters indicated in the request body.
@ -707,6 +680,62 @@ GET /_plugins/_ml/stats
}
```
## Delete task
Delete a task based on the task_id.
```json
DELETE /_plugins/_ml/tasks/{task_id}
```
The API returns the following:
```json
{
"_index" : ".plugins-ml-task",
"_type" : "_doc",
"_id" : "xQRYLX8BydmmU1x6nuD3",
"_version" : 4,
"result" : "deleted",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"_seq_no" : 42,
"_primary_term" : 7
}
```
## Delete model
Deletes a model based on the model_id
```json
DELETE /_plugins/_ml/models/<model_id>
```
The API returns the following:
```json
{
"_index" : ".plugins-ml-model",
"_type" : "_doc",
"_id" : "MzcIJX8BA7mbufL6DOwl",
"_version" : 2,
"result" : "deleted",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"_seq_no" : 27,
"_primary_term" : 18
}
```

View File

@ -10,7 +10,7 @@ has_toc: false
ML Commons for OpenSearch eases the development of machine learning features by providing a set of common machine learning (ML) algorithms through transport and REST API calls. Those calls choose the right nodes and resources for each ML request and monitors ML tasks to ensure uptime. This allows you to leverage existing open-source ML algorithms and reduce the effort required to develop new ML features.
Models trained through the ML Commons plugin support model-based algorithms such as kmeans or Linear Regression. To get the best results, make sure you train your model first, then use the model to apply predictions. Linear Regression is only supported for synchronous models.
Models trained through the ML Commons plugin support model-based algorithms such as kmeans or Linear Regression. To get the best results, make sure you train your model first, then use the model to apply predictions.
Interaction with the ML commons plugin occurs through either the [REST API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api) or [AD]({{site.url}}{{site.baseurl}}/ppl/commands#ad) and [kmeans]({{site.url}}{{site.baseurl}}/observability-plugin/ppl/commands#kmeans) PPL commands.
@ -18,8 +18,8 @@ Interaction with the ML commons plugin occurs through either the [REST API]({{si
There are two reserved user roles that can use of the ML commons plugin.
- `ml_full_access`: Full access to all ML features, including starting new jobs and reading or deleting models.
- `ml_readonly_access`: Can only read trained models and statistics relevant to the model's cluster. Cannot start jobs or delete models.
- `ml_full_access`: Full access to all ML features, including starting new ML tasks and reading or deleting models.
- `ml_readonly_access`: Can only read ML tasks, trained models and statistics relevant to the model's cluster. Cannot start nor delete ML tasks or models.

View File

@ -846,7 +846,7 @@ Field | Description | Required
:--- | :--- |:---
`shingle_size` | A consecutive sequence of the most recent records. The default value is 8. | No
`time_decay` | Specifies how much of the recent past to consider when computing an anomaly score. The default value is 0.001. | No
`time_field` | Specifies the time filed for RCF to use as time-series data. Must be either a long value, such as the timestamp in miliseconds, or a string value in yyyy-MM-dd HH:mm:ss.| Yes
`time_field` | Specifies the time filed for RCF to use as time-series data. Must be either a long value, such as the timestamp in miliseconds, or a string value in "yyyy-MM-dd HH:mm:ss".| Yes
### Batch RCF for Non-time-series Data Command Syntax
@ -866,7 +866,7 @@ The example trains a RCF model and use the model to detect anomalies in the time
PPL query:
```sql
os> source=nyc_taxi | fields value, timestamp | AD time_field='timestamp' | where value=10844.0'
os> source=nyc_taxi | fields value, timestamp | AD time_field='timestamp' | where value=10844.0
```
value | timestamp | score | anomaly_grade
@ -878,7 +878,7 @@ value | timestamp | score | anomaly_grade
PPL query:
```sql
os> source=nyc_taxi | fields value | AD | where value=10844.0'
os> source=nyc_taxi | fields value | AD | where value=10844.0
```
value | score | anomalous