Skip to content

Commit

Permalink
ready to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
shenyangHuang committed Jan 21, 2024
1 parent 7703ae6 commit c027b86
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 1,165 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/Features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"outputs": [],
"source": [
"node_engagement = get_avg_node_engagement(data)\n",
"plot_for_snapshots(node_engagement, filename=f\"{dataset.name}_avg_node_engagement_per_ts\", y_title=\"node engagement\")"
"plot_for_snapshots(node_engagement, y_title=\"node engagement\", filename=\"./\" + f\"{dataset.name}_avg_node_engagement_per_ts\")"
]
},
{
Expand All @@ -447,7 +447,7 @@
"outputs": [],
"source": [
"node_activity = get_avg_node_activity(data)\n",
"plot_for_snapshots(node_activity, filename=f\"{dataset.name}_avg_node_activity_per_ts\", y_title=\"node activity\")"
"plot_for_snapshots(node_activity, y_title=\"node activity\", filename=\"./\" + f\"{dataset.name}_avg_node_activity_per_ts\")"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/data_loader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
}
],
"source": [
"from tgx.utils.graph_stat import get_avg_node_engagement\n",
"from tgx.utils.stat import get_avg_node_engagement\n",
"\n",
"node_engagement = get_avg_node_engagement(data)\n",
"filename = f\"{dataset.name}_ave_node_engagement_per_ts\"\n",
Expand Down
13 changes: 6 additions & 7 deletions examples/data_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
dtdg = ctdg.discretize(time_scale=time_scale)[0]


#! plotting the statistics, works
#* plotting the statistics
tgx.degree_over_time(dtdg, network_name=dataset.name)
tgx.nodes_over_time(dtdg, network_name=dataset.name)
tgx.edges_over_time(dtdg, network_name=dataset.name)
Expand All @@ -36,27 +36,26 @@



#! compute statistics
#* compute statistics
test_ratio = 0.15
tgx.get_reoccurrence(ctdg, test_ratio=test_ratio)
tgx.get_surprise(ctdg, test_ratio=test_ratio)
tgx.get_avg_node_activity(dtdg)
tgx.get_novelty(dtdg)


# Number of Connected Components
tgx.connected_components_per_ts(dtdg, network_name=dataset.name, plot_path = plot_path)
tgx.connected_components_per_ts(dtdg, network_name=dataset.name)

# Size of Largest Connected Component
component_sizes = tgx.size_connected_components(dtdg)
largest_component_sizes = [max(inner_list) if inner_list else 0 for inner_list in component_sizes]
filename = f"{dataset.name}_largest_connected_component_size"
plot_for_snapshots(largest_component_sizes, filename, "Size of Largest Connected Component", plot_path = plot_path)
plot_for_snapshots(largest_component_sizes, y_title="Size of Largest Connected Component", filename="./"+filename)

# Average Node Engagement
engagements = tgx.get_avg_node_engagement(dtdg)
filename = f"{dataset.name}_average_node_engagement"
plot_for_snapshots(engagements, filename, "Average Engagement", plot_path = plot_path)
plot_for_snapshots(engagements, y_title="Average Engagement", filename="./"+filename)

# Degree Density
tgx.degree_density(dtdg, k=3, network_name=dataset.name, plot_path = plot_path)
tgx.degree_density(dtdg, k=3, network_name=dataset.name)
27 changes: 0 additions & 27 deletions examples/newtest.py

This file was deleted.

20 changes: 0 additions & 20 deletions examples/test_package2.py

This file was deleted.

Loading

0 comments on commit c027b86

Please sign in to comment.