.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/04_similarity/plot_15_electric_car.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_04_similarity_plot_15_electric_car.py: HAT-VIS case study: developing an autonomous electric car ========================================================= The house of quality of the HAT-VIS case study relates eight customer requirements (CR) to eleven engineering specifications (ES). As in the HAT-VIS paper, the requirements are the vertices, the specifications the hyperedges, and the incidence values are relationship scores multiplied by the importance ratings. Line widths show the hyperedge centrality, vertex sizes the vertex centrality (here: the linear node–edge eigenvector centralities of Tudisco and Higham 2021). .. GENERATED FROM PYTHON SOURCE LINES 15-29 .. code-block:: Python import matplotlib.pyplot as plt import hatvis as hv from hatvis.plotting import draw_hatvis qfd = hv.datasets.load_electric_car_qfd() H = qfd.hypergraph # [snippet:centrality] x, y = hv.node_edge_eigenvector(H, "linear") print("vertex centrality:\n", x.sort_values(ascending=False).round(4).head(4).to_string()) print("hyperedge centrality:\n", y.sort_values(ascending=False).round(4).head(4).to_string()) # [/snippet:centrality] print({k: qfd.names[k] for k in ("CR1", "CR4", "ES5", "ES6", "ES10", "ES11")}) .. rst-class:: sphx-glr-script-out .. code-block:: none vertex centrality: CR1 0.2298 CR8 0.2057 CR7 0.1264 CR4 0.1248 hyperedge centrality: ES5 0.1580 ES6 0.1580 ES1 0.1339 ES7 0.1138 {'CR1': 'Autonomous Driving Quality and Reliability', 'CR4': 'Obstacle Avoidance', 'ES5': 'Sensors', 'ES6': 'Algorithms', 'ES10': 'Airbags', 'ES11': 'SRS'} .. GENERATED FROM PYTHON SOURCE LINES 30-31 [snippet:views] .. GENERATED FROM PYTHON SOURCE LINES 31-39 .. code-block:: Python fig, axes = plt.subplots(1, 3, figsize=(18, 5.6)) draw_hatvis(H, ax=axes[0], width_by=y, size_by=x, title="requirements (vertices) and specifications") draw_hatvis(H, ax=axes[1], ego="CR4", width_by=y, size_by=x, title="ego view of CR4 (obstacle avoidance)") draw_hatvis(H.dual(), ax=axes[2], title="dual: specifications as vertices") # [/snippet:views] plt.tight_layout() D = H.dual() print("ES10 and ES11 have identical profiles:", (D.to_dataframe().loc["ES10"] == D.to_dataframe().loc["ES11"]).all()) .. image-sg:: /auto_examples/04_similarity/images/sphx_glr_plot_15_electric_car_001.png :alt: requirements (vertices) and specifications, ego view of CR4 (obstacle avoidance), dual: specifications as vertices :srcset: /auto_examples/04_similarity/images/sphx_glr_plot_15_electric_car_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none ES10 and ES11 have identical profiles: True .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.359 seconds) .. _sphx_glr_download_auto_examples_04_similarity_plot_15_electric_car.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/hatvis/main?urlpath=lab/tree/notebooks/auto_examples/04_similarity/plot_15_electric_car.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_15_electric_car.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_15_electric_car.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_15_electric_car.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_