Repository navigation
Faster normalizeSimilarity() and networkPlot(), OpenAlex ids in cocMatrix(), normalized Co-citation in Biblioshiny - #701
Merged
Merged
Conversation
The filter that drops CR entries of 10 characters or fewer discarded the ids of older OpenAlex works (W + 6-9 digits): 911 of 53,078 references (1.7%) on a 585-document OpenAlex API collection. Such ids are now kept. Matrices for WoS and Scopus collections compare identical() before and after.
…only outer() on the diagonal built dense n x n matrices (4.85 GB peak on a 9,999-node co-citation network) and inclusion called min() per cell via mapply(). The indices are now computed on the sparse triplets: 0.03 s instead of 2.9 s on the same network. Values and class compare identical() with the old implementation for all five indices; an unknown type or a non-square matrix is refused by name.
…twork The option was left out because normalizeSimilarity() built dense matrices. Default Association, as in the Co-occurrence and Collaboration networks; the normalized similarity drives the layout.
…the whole edge list An apply() over the edges re-read the vertex attribute for every edge, and the community.repulsion weights looked up both end points with which() in a loop: about three quarters of the time on a 120,836-edge co-citation network. Now vectorised: 23 s become 6 s there, 14 s become 1-2 s on coupling and author co-citation. Graph, layout, cluster table, modularity and Pajek graph compare identical() in 20 configurations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
cocMatrix()keeps short OpenAlex work ids inCR(d089214). The filter that drops CR entries of 10 characters or fewer was discarding the ids of older OpenAlex works (W+ 6-9 digits). On a 585-document OpenAlex API collection, 911 of the 53,078 references (1.7%) were lost. For WoS and Scopus collections, the matrices compareidentical()before and after.normalizeSimilarity()works on the non-zero cells only (01c98ad).outer()built dense n x n matrices. On a 9,999-node co-citation network, time drops from 2.9 s to 0.03 s and the memory peak from 4.85 GB to about 335 MB. For all five indices, values and class compareidentical(). An unknowntype, or a non-square matrix, is now refused with a message that names it.03d03d3). It matches the Co-occurrence and Collaboration networks, with Association as the default. The normalized similarity drives the layout.networkPlot()is 4-16 times faster on dense networks (454344b). Edge colouring and thecommunity.repulsionweights are now computed on the whole edge list, not edge by edge. On a 120,836-edge co-citation network, 23 s become 6 s. In 20 configurations, the graph, layout, cluster table, modularity and Pajek graph compareidentical().Tests
The full suite passes locally (610 passed, 0 failed). New tests cover the OpenAlex ids,
normalizeSimilarity()against the dense formula, edge colours, and repulsion weights. Each change has an entry in NEWS and NEWS.md.