app.tests module¶
-
app.tests.
eval_and_sum
(munger, weighting_keys, k_depth, discount, write_graph=False)[source]¶ Evaluates all metrics and summarize using the graph output from a munger. :param munger: the munger to analyze :param write_graph: whether or not to write the network to a graph ml file :param weighting_keys: the weighting key to use for knowledge calculation :param k_depth: the maximum depth to evaluate k :type k_depth: int :param discount: the discount rate :type discount: float
-
app.tests.
feature_test
(query_json_file, limit, weighting_keys, discount, k_depth)[source]¶ The feature endpoint constructs descendant trees for a series of roots from a single query, but does not conduct time series analysis. It also collects additional observable features for use as controls in multiple regression.
Parameters: - query_json_file (str) – path to a JSON file containing the query to be queried
- limit (int) – the maximum number of docs to munge
- k_depth (int) – the maximum depth to evaluate k
- discount (float) – the discount rate
- weighting_keys (list) – the weighting key to use for knowledge calculation
-
app.tests.
get_query_munger
(query_file, limit=None, cache=True)[source]¶ Construct a query munger for a given query, stored in a JSON file. :param query_file: the path to the query file :param limit: the maximum number of docs to query :return: a QueryMunger with this configuration
-
app.tests.
query_test
(query_json_file, limit, weighting_keys, k_depth, discount, write_graph=False)[source]¶ The query endpoint collects patents for a query, constructs a citation network, and conducts metric calculations breadth-wise.
Parameters: - query_json_file (str) – path to a JSON file containing the query to be queried
- limit (int) – the maximum number of docs to munge
- k_depth (int) – the maximum depth to evaluate k
- discount (float) – the discount rate
- write_graph (bool) – whether or not to write the network to a graph ml file
- weighting_keys (list) – the weighting key to use for knowledge calculation
-
app.tests.
root_test_multiple
(query_json_file, limit, weighting_keys, k_depth, discount, bin_size=20, prefix='TIME-DATA')[source]¶ The root endpoint constructs a descendant citation tree for one or more patents and calculates metrics for the root.
Parameters: - query_json_file (str) – path to a JSON file containing the query to be queried
- limit (int) – the maximum number of docs to munge
- k_depth (int) – the maximum depth to evaluate k
- discount (float) – the discount rate
- bin_size (Integer) – bin size in weeks
- weighting_keys (list) – the weighting key to use for knowledge calculation
- prefix (str) – prefix for final storage file name
-
app.tests.
root_test_single
(patent, depth, weighting_keys, bin_size=20)[source]¶ The root endpoint constructs a descendant citation tree for one or more patents and calculates metrics for the root.
Parameters: - patent (str) – the patent number
- depth (int) – the graph search depth
- bin_size (int) – the bin size in weeks
- weighting_keys (list) – the weighting key to use for knowledge calculation