Question: in pyton please image Credit: Towards Data Science Anomaly detection, or outlier detection is an important activity in data science. Outliers are data values that
image Credit: Towards Data Science Anomaly detection, or outlier detection is an important activity in data science. Outliers are data values that lie outside some predefined domain in which data is expected to lie. If a stream of data values are numeric, one common outler detection method involves identifying the data values are more than a certain number of standard deviations distant from the mean value, For this assignment, you will implement an outlier detection function that uses this method. Your function will be provided a list of numerical values of an undetermined length and your function will return the indices of the data values in that lint that are considered outliers. Suppose a represents a list of N numerical values, X. X. X, ... XN1. The mean value of this list of values is (as you know) 1 H . and the standard deviation o is: N1 (, ) 10 N 1 The program template given below, my_anomaly_detector.py, partially defines the function, detect_anomalies () with two arguments. The first, X, is a list of numerical values. The second, k, is the number of standard deviations that define the anomalous datum criterion. If the absolute value of x, is more than u + ko, then x; is a designated an outlier. The detect_anomalies() function must return a list of integer indices named anomalous_indices that enumerate the elements of x that are designated outliers. The _main_block in the program is provided to allow you to test this program on your own computer It does not matter what is in your main block when you submit your assignment is only graded on the performance of your detect_anomalies() function, 28912 1763056
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
