Open edmundarmin opened 1 year ago
I have got the same Problem. I followed the demo version and I am getting: Found input variables with inconsistent numbers of samples: [100, 1900] in the explain_instance method. Any ideas?
`def lime(): df_new = pd.DataFrame(df.iloc[:40000]) signal_names = df_new.columns.names X = dfnew.values y = np.array([np.random.randint(0,2) for in range(760000)])
steps = [
("concatenate", ColumnConcatenator()),
("classify", HistGradientBoostingClassifier())
]
clf = Pipeline(steps)
clf.fit(X, y)
class_names=[y[0]]
num_slices=20
num_features=17
explainer = lime_ts.LimeTimeSeriesExplainer(
class_names=class_names,
signal_names=signal_names)
labelid = 0
exp = explainer.explain_instance(
X[0], clf.predict_proba,
num_features=num_features,
num_samples=100,
num_slices=num_slices,
labels=[labelid],
replacement_method='total_mean')
exp.as_pyplot_figure(labelid)
plt.savefig("lime.png")`
Hellow, i have data time series of multiple sensor, and i dont know how to use it in your code, can you give me an example ?