i read the book "Machine Learning Algorithms" from Packt and there is a code sample which i tried to reproduce. I have some problems with the color of the markers inside this scatter plot.
The code is the following:
from sklearn.datasets import make_circles
nb_samples = 500
X, Y = make_circles(n_samples=nb_samples, noise=0.1)
This produces a circle with data. The picture in the book looks like that:
I tried to reproduce this with:
from sklearn.datasets import make_circles
import matplotlib.pyplot as plt
nb_samples = 500
X, Y = make_circles(n_samples=nb_samples, noise=0.1)
plt.scatter(X[:, 0], X[:, 1])
plt.show()
And the output is the following:
I want to know how to set a different color and markers for the data points. Maybe my code is wrong and i shouldn't plot X[:, 0], X[:, 1]. I hope someone can help me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.