Skip to content

Commit

Permalink
[Example] Fix ACM data JSON content inconsistency (#1106)
Browse files Browse the repository at this point in the history
*Issue #, if available:*

*Description of changes:*
This PR fixes the inconsistency of ACM data's config.json for using a
dummy categorical edge feature on the paper-citing-paper edge type. And
update the corresponding tutorial contents.

Preview page of the updated tutorial:
https://james4graphstorm.readthedocs.io/en/james_acm_fix_json/tutorials/own-data.html

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
zhjwy9343 and Ubuntu authored Dec 4, 2024
1 parent 618c3fc commit 933f6e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/source/tutorials/own-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ The above command automatically creates the examplary ACM `config.json` file, so
],
"source_id_col": "source_id",
"dest_id_col": "dest_id",
"features": [
{
"feature_col": "cate_feat",
"feature_name": "cate_feat",
"transform": {
"name": "to_categorical"
}
}
],
"labels": [
{
"task_type": "link_prediction",
Expand Down
6 changes: 5 additions & 1 deletion examples/acm_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,14 @@ def create_acm_raw_data(graph,
# The split pct values are just for
# demonstration purpose.
labels_list.append(label_dict)
elif col.startswith('cate_'): # Dummy categorical features that ask
feat_dict['feature_col'] = col # for a "to_categorical" tranformation
feat_dict['feature_name'] = col # operation
feat_dict['transform'] = {"name": "to_categorical"}
feats_list.append(feat_dict)
else:
feat_dict['feature_col'] = col
feat_dict['feature_name'] = col
# for this example, we do not have transform for features
feats_list.append(feat_dict)
# set up the rest fileds of this node type
if feats_list:
Expand Down
Binary file modified tutorial/ACM_raw_parquet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 933f6e4

Please sign in to comment.