Jan-18-2023, 03:37 PM
The following program was written by me. I wanted to plot feature importance against sensor number on a two-dimensional plot. The X axis has the sensor number, and the Y axis has feature importances.
I am not sure how.
Any help appreciated.
R,
Led Zeppelin
import pandas as pd import matplotlib.pyplot as plt # Load the data data = pd.read_csv("sensor_data.csv", header=None) # Extract the feature names and importance values feature_names = range(0,51) importances = data[0] # Plot the data plt.figure(figsize=(10, 5)) plt.title("Feature Importance") plt.bar(feature_names, importances) plt.xlabel("Sensor Index") plt.ylabel("Importance Value") plt.show()Now I want to add this python code to the python program in the attachment, so I have a plot of the data instead of just a vector.
I am not sure how.
Any help appreciated.
R,
Led Zeppelin