Knowledge-Graph-Hub/kg-covid-19

Classifier

Closed this issue · 4 comments

(Note: this template is for requesting new features in the software, not new datasets to ingest. Use the "Dataset request" for that.)

Describe the desired behavior

I read in the paper for the downstream tasks especially the classifiers, am I missing this part from the documentation, please advise?

Additional context

@shainaraza thanks for the ticket. What sort of classifier are you interested in using, and for what ML task? KG-COVID-19 is tightly integrated with Embiggen, so building a classifier is pretty painless these days. You could do something like this for example:

pip install embiggen
pip install ensmallen
python3
>>> from embiggen.node_prediction import GraphConvolutionalNeuralNetwork
>>> from ensmallen.datasets.kghub import KGCOVID19
>>> kg = KGCOVID19()
>>> train, test = kg.node_label_holdout(0.8, use_stratification=True)
>>> model = GraphConvolutionalNeuralNetwork(
    kg,
    node_features_number=50,
    num_split=2
)
>>> history = model.fit(
    train,
    validation_graph=test,
)
# now do some classification

Thanks @justaddcoffee
its very useful information, thanks for sharing a code snippet.
One question, does I need to work with elasticsearch only to have kg, I am running on Colab and do not have much resources for now.
I might be missing some part of documentation?

thanks

No problem @shainaraza

You shouldn't need elasticsearch at all for this project. To run the code above you might need access to a GPU. Colab may work, depending on the resources available when you run this

Closing this, but feel free to reopen if we can help