知识点
机器学习-【8】异常检测(高斯分布模型)【手抄笔记】
运行效果

程序代码+数据下载
异常检测(高斯分布模型)+测试数据
程序
from tools import TXTtoNumpy
import numpy as np
import random
import matplotlib.pyplot as plt
def GaussianParamEstimation(npArr, GaussianType = 'Normal'):
'''
:param npArr: shape=(n_examples, n_features)
:param GaussianType: 'Normal' or 'Multi'
:return:
'''
n_features = npArr.shape[1]
# mean = np.zeros(n_features)
mean = np.average(npArr, axis=0)
if GaussianType == 'Normal':
# std = np.zeros(n_features)
std = np.std(npArr, axis=0)
return mean, std
elif GaussianType == 'Multi