如何解决具有高斯分布的 K-近邻模型
假设我有 3 个不同的类,它们遵循以下方式生成的高斯分布:
x1 = np.random.random((100,7))
x2 = np.random.random((200,7))
x3 = np.random.random((300,7))
mean_x1 = np.mean(x1,axis = 0)
mean_x2 = np.mean(x2,axis = 0)
mean_x3 = np.mean(x3,axis = 0)
cov_x1 = np.cov(x1.T)
cov_x2 = np.cov(x2.T)
cov_x3 = np.cov(x3.T)
Class_1 = np.random.multivariate_normal(mean_x1,cov_x1,100)
Class_2 = np.random.multivariate_normal(mean_x2,cov_x2,200)
Class_3 = np.random.multivariate_normal(mean_x3,cov_x3,300)
并且我想执行基于 KNN 模型的分类任务来预测测试样本的类别,该类别也遵循高斯分布,即根据它们的平均值是 Class_1、Class_2 或 Class_3。
>有人可以向我解释如何操作吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。