當前位置: 首頁>>代碼示例>>Python>>正文


Python Plotter.plotLabledData方法代碼示例

本文整理匯總了Python中Plotter.Plotter.plotLabledData方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.plotLabledData方法的具體用法?Python Plotter.plotLabledData怎麽用?Python Plotter.plotLabledData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Plotter.Plotter的用法示例。


在下文中一共展示了Plotter.plotLabledData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: raw_input

# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import plotLabledData [as 別名]
	plotter.plotCentroids(centroids)
	print "Init complete..."
	raw_input('Press enter to continue and to start the algorithm.')

	# Run the algorith 10 times
	# TODO So right now we are running the algorithm 10 times. Maybe we should come up with some better meassurement?
	for x in xrange(1,10):
		# Get lables
		print "Create the lables, this should take some time...."
		# The interesting part is what is going on in the classify method.
		labels = kmeans.classify(trainingX, trainingY, centroids)
		# Plot the labled data
		print "Plot the labled data."
		plotter.clear()
		plotter.plotCentroids(centroids)
		plotter.plotLabledData(trainingX, trainingY, labels, centroids)
		raw_input('Press enter to continue')

		# Recalculated the centroids and unlable the data so to say...
		print "Plot the new centroids."
		plotter.clear()
		plotter.plotUnlabledData(trainingX, trainingY)
		centroids = kmeans.reCalculateCentroids(trainingX, trainingY, labels, centroids)
		plotter.plotCentroids(centroids)
		raw_input('Press enter to continue')



	raw_input("Trying out the clusters with some new data... press enter to continue")
	# Here we just look as some different data.
	rawDataX, rawDataY = loadData('largeDataSet.txt')
開發者ID:r2m,項目名稱:machine-learning,代碼行數:33,代碼來源:main.py


注:本文中的Plotter.Plotter.plotLabledData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。