closest-git / QuantumForest

Fast Differentiable Forest lib with the advantages of both decision trees and neural networks
77 stars 19 forks source link

ValueError: INVALID self.config.attention_alg = eca_reponse #2

Closed abdalimran closed 3 years ago

abdalimran commented 4 years ago

I was trying to run QuantumForest over my own dataset. I defined my data using the following code:

data = quantum_forest.TabularDataset(dataset = "MYDATA",
                                     X_train = X_train, 
                                     y_train = y_train, 
                                     X_valid = X_val, 
                                     y_valid = y_val, 
                                     X_test = X_test,
                                     y_test = y_test,
                                     random_state=1337, 
                                     quantile_transform=True,
                                     quantile_noise=1e-3)

Everything went fine without any error. But when I tried to run the following code it generates the given error.

learner = quantum_forest.QuantumForest(config, 
                                       data, 
                                       feat_info=None, 
                                       visual=visual)

Here is the error log:

ValueError                                Traceback (most recent call last)
<ipython-input-22-2ac6f6f82a68> in <module>()
      1 learner = quantum_forest.QuantumForest(config, 
----> 2                                        data)

3 frames
/content/QuantumForest/python-package/quantum_forest/DifferentiableTree.py in __init__(self, in_features, num_trees, config, flatten_output, feat_info, initialize_response_, initialize_selection_logits_, threshold_init_beta, threshold_init_cutoff)
    234             print("!!! Empty attention_alg.Please try \"--attention=eca_response\" !!!\n")
    235         else:
--> 236             raise ValueError( f'INVALID self.config.attention_alg = {self.config.attention_alg}' )
    237 
    238 

ValueError: INVALID self.config.attention_alg = eca_reponse
closest-git commented 4 years ago

Than you! I will check it in this weekend.

closest-git commented 4 years ago

You are right. It's spelling error.
The value of config.attention_alg would actually be reset in the main_tabular_data.py. That is: config.attention_alg = args.attention, and the default value of args.attention is "eca_response". So this spelling error would not affect the testing results.

abdalimran commented 3 years ago

This issue is resolved. Thanks.