DetectOutliers

POST api.scientificmicroservices.com/detectoutliers

Detect unusual values in a list

DetectOutliers runs the three most common algorithms used to find unusual values in a list. Values that trigger at least one algorithm are reported in the response.

If the column posted is numeric, outliers are the values that are unusually high or unusually low. If the column is strings, outliers are values that are unusually rare or unusually common.

Graph of data highlighting a datapoint that is an outlier.
Example usage in terminal

  curl --request POST \
  --url 'https://api.scientificmicroservices.com/detectoutliers' \
  --header 'Content-Type: application/json' \
  --header 'email:YOUR_EMAIL' \
  --header 'key:YOUR_KEY' \
  --data '[10.1727,11.9026,7.9209,9.0841,9.8298,11.345,9.6483,8.9257,8.9788,958.9969,11.1933,12.1186,9.5798,10.0861,10.1675,10.2935,11.2547,10.4636,9.6607,9.7316]'
  
> [{"position":9,"value":958.9969}]

Use the DetectOutliers endpoint at api.scientificmicroservices.com/detectoutliers to find unusual values in this list:

[10.1727,11.9026,7.9209,9.0841,9.8298,11.345,9.6483,8.9257,8.9788,958.9969,11.1933,12.1186,9.5798,10.0861,10.1675,10.2935,11.2547,10.4636,9.6607,9.7316]

My key is [YOUR KEY], and the email to use is [YOUR_EMAIL]



import json
import requests

headers = {
    'email': YOUR_EMAIL,
    'key': YOUR_KEY,
    'Content-Type': 'application/json'
}

url_outliers = "https://api.scientificmicroservices.com/detectoutliers"

sample_data_outliers = [
    10.1727, 11.9026, 7.9209, 9.0841, 9.8298, 11.345, 9.6483, 8.9257, 
    8.9788, 958.9969, 11.1933, 12.1186, 9.5798, 10.0861, 10.1675, 
    10.2935, 11.2547, 10.4636, 9.6607, 9.7316
]

response = requests.post(url_outliers, headers=headers, json=sample_data_outliers)

outliers = response.json()
print("--- Outliers ---")
print(outliers)



library(jsonlite)
library(httr)

url <- "https://api.scientificmicroservices.com/detectoutliers"

sample_data <- toJSON(c(10.1727,11.9026,7.9209,9.0841,9.8298,11.345,9.6483,8.9257,8.9788,958.9969,11.1933,12.1186,9.5798,10.0861,10.1675,10.2935,11.2547,10.4636,9.6607,9.7316))

response <- POST(
  url = url,
  add_headers(  'email'= YOUR_EMAIL,
                'key' = YOUR_KEY,
                'Content-Type' = 'application/json'
  ),
  body = sample_data,
  encode = "json"
)

outliers <- fromJSON(content(response, as = 'text'))
print(outliers)

Input types allowed
Graphic showing that input types allowed are strings, numbers, single list only
Response fields
position The zero-based position in the list of the outlier
value The value of the list item indicated in the position field