dbscan.py 文件源码

python
阅读 43 收藏 0 点赞 0 评论 0

项目:ML-From-Scratch 作者: eriklindernoren 项目源码 文件源码
def main():
    # Load the dataset
    X, y = datasets.make_moons(n_samples=300, noise=0.08, shuffle=False)

    # Cluster the data using DBSCAN
    clf = DBSCAN(eps=0.17, min_samples=5)
    y_pred = clf.predict(X)

    # Project the data onto the 2 primary principal components
    p = Plot()
    p.plot_in_2d(X, y_pred, title="DBSCAN")
    p.plot_in_2d(X, y, title="Actual Clustering")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号