How is the indexing and slicing used inside the for loop to produce the Scatterplot with three classifications shown below.

icon
Related questions
Question

How is the indexing and slicing used inside the for loop to produce the Scatterplot with three classifications shown below.

 

Principal component 2
15
10
0.5
0.0
-0.5
-1.0
setosa
versicolor
virginica
-3
-2
-7
0
1
Principal component 1
2
3
Transcribed Image Text:Principal component 2 15 10 0.5 0.0 -0.5 -1.0 setosa versicolor virginica -3 -2 -7 0 1 Principal component 1 2 3
for i, species in enumerate(iris['target_names']):
plt.scatter (iris_transformed [:,0][iris['target'] == i], iris_transformed [:,1][iris['target']
plt.legend (iris['target_names'])
plt.show()
==
i])
Transcribed Image Text:for i, species in enumerate(iris['target_names']): plt.scatter (iris_transformed [:,0][iris['target'] == i], iris_transformed [:,1][iris['target'] plt.legend (iris['target_names']) plt.show() == i])
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer