mossnet package¶
MossNet is a Python library for performing network analyses on MOSS results
Module contents¶
-
mossnet.
build
(moss_results_links, verbose=False)[source]¶ Download MOSS results into a
MossNet
object- Args:
moss_results_links
(list
): A list of MOSS result URLsverbose
(bool
):True
to show verbose messages, otherwiseFalse
- Returns:
MossNet
: AMossNet
object
-
mossnet.
load
(mossnet_file)[source]¶ Load a
MossNet
object from file- Args:
mossnet_file
(str
): The desired input file- Returns:
MossNet
: The resultingMossNet
object
-
class
mossnet.
MossNet
(moss_results_dict)[source]¶ Bases:
object
-
export
(outpath, style='html', gte=0, verbose=False)[source]¶ Export the links in this
MossNet
in the specified style- Args:
outpath
(str
): Path to desired output folder/filestyle
(str
): Desired output stylegte
(int
): The minimum number of links for an edge to be exported"dot"
to export as a GraphViz DOT file"gexf"
to export as a Graph Exchange XML Format (GEXF) file"html"
to export one HTML file per pair
verbose
(bool
):True
to show verbose messages, otherwiseFalse
-
get_networkx
()[source]¶ Return a NetworkX
MultiDiGraph
equivalent to thisMossNet
object- Returns:
MultiDiGraph
: A NetworkXDiGraph
equivalent to thisMossNet
object
-
get_nodes
()[source]¶ Returns a
set
of node labels in thisMossNet
object- Returns:
set
: The node labels in thisMossNet
object
-
get_pair
(u, v, style='tuples')[source]¶ Returns the links between nodes
u
andv
- Args:
u
(str
): A node labelv
(str
): A node label not equal tou
style
(str
): The representation of a given link"tuples"
: Links are((u_percent, u_html), (v_percent, v_html))
tuples"html"
: Links are HTML representation (one HTML for all links)"htmls"
: Links are HTML representations (one HTML per link)
- Returns:
dict
: The links betweenu
andv
(keys are filenames)
-
num_edges
()[source]¶ Returns the number of (undirected) edges in this
MossNet
object (including parallel edges)- Returns:
int
: The number of (undirected) edges in thisMossNet
object (including parallel edges)
-
num_links
(u, v)[source]¶ Returns the number of links between
u
andv
- Args:
u
(str
):v
(str
):- Returns:
int
: The number of links betweenu
andv
-
num_nodes
()[source]¶ Returns the number of nodes in this
MossNet
object- Returns:
int
: The number of nodes in thisMossNet
object
-
outlier_pairs
()[source]¶ Predict which student pairs are outliers (i.e., too many problem similarities). The distribution of number of links between student pairs (i.e., histogram) is modeled as y = A/(B^x), where x = a number of links, and y = the number of student pairs with that many links
- Returns:
list
oftuple
: The student pairs expected to be outliers (in decreasing order of significance)
-