Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while predicting on new dataset #8

Open
adityalahiri opened this issue May 15, 2020 · 0 comments
Open

Error while predicting on new dataset #8

adityalahiri opened this issue May 15, 2020 · 0 comments

Comments

@adityalahiri
Copy link

Hi,
I am trying to run this on a dataset of my own. I did the prepare dataset part for my dataset. But when it tries to predict the point, I get the following error-

in
4 continuous_function_estimation=False,
5 returns_infos=True,
----> 6 path=path_data, sep=';', log=False)

/LORE/lore.py in explain(idx_record2explain, X2E, dataset, blackbox, ng_function, discrete_use_probabilities, continuous_function_estimation, returns_infos, path, sep, log)
38
39 dfx = build_df2explain(blackbox, x.reshape(1, -1), dataset).to_dict('records')[0]
---> 40 cc_outcome, rule, tree_path = pyyadt.predict_rule(dt, dfx, class_name, features_type, discrete, continuous)
41
42 # Apply Black Box and Decision Tree on neighborhood

/LORE/pyyadt.py in predict_rule(dt, x, class_name, features_type, discrete, continuous)
138
139 y, tree_path = predict_single_record(dt, x, class_name, edge_labels, node_labels, node_isleaf,
--> 140 features_type, discrete, continuous)
141 if y is None:
142 return None, None, None

/LORE/pyyadt.py in predict_single_record(dt, x, class_name, edge_labels, node_labels, node_isleaf, features_type, discrete, continuous, n_iter)
95 while not node_isleaf[node]:
96 att = node_labels[node]
---> 97 val = x[att]
98 for child in dt.neighbors(node):
99 count += 1

KeyError: '22'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant