Python:导入KMeans库失败;Kmeans报错及解决方法;NameError: name ‘KMeans‘ is not defined

Python:导入KMeans库失败;Kmeans报错及解决方法;NameError: name 'KMeans' is not defined

当我们在python中使用KMeans包进行聚类时报错:

NameError: name 'KMeans' is not defined

原因是没有导入包:

from sklearn.cluster import KMeans

同时在sertting中加载sklearn包即可。切记不是加载KMeans包!


 

  • 15
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
Create and run a real-time, highly-available, and high-redundancy version of the world's most popular open-source database, MySQL. You will understand the advantages and disadvantages of the MySQL NDB Cluster solution, and when MySQL NDB Cluster is the right choice. Pro MySQL NDB Cluster walks you through the full lifecycle of a MySQL Cluster installation: starting with the installation and initial configuration, moving through online configuration and schema changes, and completing with online upgrades. Along the way, you will learn to monitor your cluster, make decisions about schema design, implement geographic replication, troubleshoot and optimize performance, and much more. This book covers the many programming APIs that are supported by MySQL NDB Cluster. There's also robust coverage of connecting to MySQL NDB Cluster from Java, SQL, memcached, and even from C++. From any of these languages, you'll be able to connect and store and retrieve data as your applications demand. The book: Covers MySQL NDB Cluster concepts and architecture Takes you through the MySQL NDB Cluster lifecycle from installation to upgrades Guides you through DBA and Developer decisions when working with MySQL NDB Cluster What You'll Learn Understand the shared-nothing architecture behind MySQL NDB Cluster Plan, install, and configure a MySQL NDB Cluster environment Perform everyday tasks such as backing up, restoring, and upgrading Develop applications from Java, memcached, C++, and SQL Troubleshoot and resolve application performance problems Master enterprise-level features such the MySQL NDB Cluster Manager Who This Book Is For Database administrators and developers who are looking into deploying MySQL NDB Cluster, or who already have a cluster in production and want to increase their knowledge and ability to handle routine administrative tasks and troubleshooting. The book also is for those developers wanting to employ MySQL NDB Cluster as their chosen storage engine from Java, memcached, and C++ applications. Table of Contents Part I: The Basics Chapter 1: Architecture and Core Concepts Chapter 2: The Data Nodes Part II: Installation and Configuration Chapter 3: System Planning Chapter 4: Configuration Chapter 5: Installation Chapter 6: Replication Part III: Daily Tasks and Maintenance Chapter 7: The NDB Management Client and Other NDB Utilities Chapter 8: Backups and Restores Chapter 9: Table Maintenance Chapter 10: Restarts Chapter 11: Upgrades and Downgrades Chapter 12: Security Considerations Chapter 13: MySQL Cluster Manager Part IV: Monitoring and Troubleshooting Chapter 14: Monitoring Solutions and the Operating System Chapter 15: Sources for Monitoring Data Chapter 16: Monitoring MySQL NDB Cluster Chapter 17: Typical Troubles and Solutions Part V: Development and Performance Tuning Chapter 18: Developing Applications Using SQL with MySQL NDB Cluster Chapter 19: MySQL NDB Cluster as a NoSQL Database Chapter 20: MySQL NDB Cluster and Application Performance Tuning

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值