层次聚类和最邻近

文章目录

  • 层次聚类
  • 最邻近距离法分类

层次聚类

# -*- coding:utf-8 -*-
# /usr/bin/python
'''
-------------------------------------------------
   File Name   :  hierarchical_clustering
   Description :  AIM: 层次聚类
                  Functions: 1. 
                             2. 
   Envs        :  python == 
                  pip install  -i https://pypi.douban.com/simple 
   Author      :  errol
   Date        :  2020/8/5  14:28
   CodeStyle   :  规范,简洁,易懂,可阅读,可维护,可移植!
-------------------------------------------------
   Change Activity:
          2020/8/5 : 新建
-------------------------------------------------
'''

import numpy as np

from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram
from sklearn.datasets import load_iris
from sklearn.cluster import AgglomerativeClustering


def plot_dendrogram(model, **kwar

你可能感兴趣的:(机器学习原理讲解与代码实现,机器学习,深度学习实战讲解与分析)