资源简介

模式识别作业,这个做出来之后效果很炫,所以和大家分享一下,共同学习!使用说明详见我的博客--模式识别专栏 内容包含谱聚类所有代码,以及一个月亮形的数据集!

资源截图

代码片段和文件信息

import numpy as np

# Create Data Set
mean1 = [1 -1]
cov1 = [[1 0] [0 1]]
x1 = np.random.multivariate_normal(mean1 cov1 200)

mean2 = [5.5 -4.5]
x2 = np.random.multivariate_normal(mean2 cov1 200)

mean3 = [1 4]
x3 = np.random.multivariate_normal(mean3 cov1200)

mean4 = [6 4.5]
x4 = np.random.multivariate_normal(mean4 cov1 200)

mean5 = [9 0.0]
x5 = np.random.multivariate_normal(mean5 cov1200)

X = np.vstack((x1 x2 x3 x4 x5))


f1 = open(“data_moon.csv“ “rb“)
case_train = np.loadtxt(f1 delimiter=‘‘ skiprows=0)
f1.close()

X = np.array(case_train)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-06-24 11:25  python_spectral_clustering\
     文件        3824  2019-12-01 01:56  python_spectral_clustering\K_Means.py
     文件         316  2019-12-01 01:56  __MACOSX\python_spectral_clustering\._K_Means.py
     文件        1676  2019-12-01 01:54  python_spectral_clustering\main_kmeans.py
     文件         264  2019-12-01 01:54  __MACOSX\python_spectral_clustering\._main_kmeans.py
     文件        7931  2019-11-28 03:28  python_spectral_clustering\spectral_acc.py
     文件         316  2019-11-28 03:28  __MACOSX\python_spectral_clustering\._spectral_acc.py
     文件        2953  2019-11-25 11:47  python_spectral_clustering\data_moon.csv
     文件         320  2019-11-25 11:47  __MACOSX\python_spectral_clustering\._data_moon.csv
     文件        1387  2019-11-28 01:03  python_spectral_clustering\knn_alg.py
     文件         264  2019-11-28 01:03  __MACOSX\python_spectral_clustering\._knn_alg.py
     目录           0  2020-06-24 11:25  python_spectral_clustering\__pycache__\
     文件       14787  2019-11-25 11:47  python_spectral_clustering\data.csv
     文件         320  2019-11-25 11:47  __MACOSX\python_spectral_clustering\._data.csv
     文件        5494  2019-11-28 07:44  python_spectral_clustering\spectral.py
     文件         316  2019-11-28 07:44  __MACOSX\python_spectral_clustering\._spectral.py
     文件        1685  2019-11-28 07:46  python_spectral_clustering\spectral_moon_data.py
     文件         316  2019-11-28 07:46  __MACOSX\python_spectral_clustering\._spectral_moon_data.py
     文件         577  2019-11-26 13:03  python_spectral_clustering\create_data.py
     文件         264  2019-11-26 13:03  __MACOSX\python_spectral_clustering\._create_data.py
     文件         997  2019-11-28 09:04  python_spectral_clustering\test_kmeans.py
     文件         264  2019-11-28 09:04  __MACOSX\python_spectral_clustering\._test_kmeans.py
     文件        3454  2020-06-24 11:25  python_spectral_clustering\__pycache__\spectral.cpython-37.pyc
     文件        2545  2020-06-24 11:25  python_spectral_clustering\__pycache__\K_Means.cpython-37.pyc

评论

共有 条评论