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

Which model support "multiclass" task #77

Open
astrung opened this issue Aug 3, 2022 · 3 comments
Open

Which model support "multiclass" task #77

astrung opened this issue Aug 3, 2022 · 3 comments
Assignees

Comments

@astrung
Copy link

astrung commented Aug 3, 2022

Please make sure that this is a feature request.

System information

  • DeepTables version: 0.2.3.1
  • Are you willing to contribute it: No

Describe the feature and the current behavior/state.
When i test with various models in ModelConfig by change nets=['fibi_nets'], I see some model only support for binary classification, and when I tried to use with multi classification, I always get this error: ValueError: Unexpected logit output.{}

So how can I know which model support for multi classification, and which model is only for binary ?
Please help

@oaksharks oaksharks self-assigned this Aug 4, 2022
@oaksharks
Copy link
Collaborator

Hi @astrung,
Is there any categorical features in your dataset?
If not, you can set auto_discrete=True to discretize continuous features into categorical.
I think the network needs categorical features rather than does not support multi-classification.

References:

def fibi_nets(embeddings, flatten_emb_layer, dense_layer, concat_emb_dense, config, model_desc):
"""
The SENET layer can convert an embedding layer into the SENET-Like embedding fea�tures, which helps
to boost feature discriminability. The following Bilinear-Interaction layer models second order
feature interactions on the original embedding and the SENET-Like embedding respec�tively. Subsequently,
these cross features are concatenated by a combination layer which merges the outputs of
Bilinear-Interaction layer.
"""
senet_index = counter.next_num('senet_layer')
senet_emb_concat = _concat_embeddings(embeddings, f'concat_senet_embedding_{senet_index}')
if senet_emb_concat is None:
model_desc.add_net('fibi', (None), (None))
return None

@astrung
Copy link
Author

astrung commented Aug 4, 2022

@oaksharks
thank you for your fast response.
Yes after setting auto_discrete=True, my code works, but I get too many below warnings:

/opt/conda/lib/python3.7/site-packages/sklearn/preprocessing/_discretization.py:233: UserWarning: Bins whose width are 
too small (i.e., <= 1e-8) in feature 0 are removed. Consider decreasing the number of bins. 
"decreasing the number of bins." % jj

How can I fix it ? Do I have problem in my features ?

@oaksharks
Copy link
Collaborator

Maybe the value of your features is too small, here is how DT calculates the number of the bins:
https://github.com/DataCanvasIO/Hypernets/blob/7b486d0a9206181d4f08f502160f8d6ba3a4994b/hypernets/tabular/sklearn_ex.py#L727-L737

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

2 participants