Refining a parallel coordinates plot
After viewing your parallel coordinates plot, the founder concludes that her decision to step away from a Batman-centered streaming platform may have been premature. Indeed, the parallel coordinates plot seems to suggest that many popular movies are strongly associated with The Dark Knight. She decides instead to pitch the idea to her staff in a meeting, but has asked you to make some refinements to the plot to make it more visually appealing for the presentation.
Note that the rules have been generated and are available for you as rules
. Additionally, pandas
is available as pd
and the function rules_to_coordinates()
has been defined and is available.
Cet exercice fait partie du cours
Market Basket Analysis in Python
Instructions
- Import the parallel coordinates function from the
plotting
submodule ofpandas
. - Convert the DataFrame of rules into coordinates.
- Complete the statement to generate a parallel coordinates plot, using
ocean
as the colormap.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Import the parallel coordinates plot submodule
from pandas.____ import parallel_coordinates
# Convert rules into coordinates suitable for use in a parallel coordinates plot
coords = ____
# Generate parallel coordinates plot
____(____, 'rule', colormap = '____')
plt.legend([])
plt.show()