z-score算法原理参考网址
https://blog.youkuaiyun.com/m0_59596937/article/details/128378641
具体实现代码如下:
import numpy as np
class ZScoreOutlierDetector:
def __init__(self, threshold=3):
"""构造函数"""
self.threshold = threshold # Z-score阈值,默认为3
self.x_mean = None # X坐标的均值
self.x_std = None # X坐标的标准差
self.y_mean = None # Y坐标的均值
self.y_std = None # Y坐标的标准差
def fit(self, points):