class GML [source]
The main process of progressive machine learning, which runs through Essential Support, Approximate Probability Estimation, select topm, select topk, construct subgraph, inference subgraph process
This class currently provides the following methods:
-
evidential_support(variable_set,update_feature_set) [source]
Function: calculate essential support
parameter:
· variable_set - the set of target variables
· update_feature_set - the set of target features
Return: none
Return type:none -
approximate_probability_estimation(variable_set) [source]
Function: Calculate approximate probability
parameter:
· variable_set - the set of target variables
Return: none
Return type:none -
select_top_m_by_es(m) [source]
Function: Select the first m latent variables according to the calculated Evidential Support (large to small) parameter:
· m - The number of latent variables to be selected
Return: a list containing m variable ids
Return type:list -
select_top_k_by_entropy(var_id_list, k) [source]
Function: calculate entropy, select top_k latent variables with small entropy
parameter:
· mvar_id_list - Choose range
· k - The number of latent variables to be selected
Return: a list containing k ids
Return type:list -
select_evidence(var_id) [source]
Function: Select the edges, variables and features which needed for subsequent subgraph construction
parameter:
· var_id - The id of the target variable
Return: Edges, variables and features needed for subsequent subgraph construction
Return type:set -
construct_subgraph(var_id) [source]
Function: Select topk latnet variables and create subgraph
parameter:
· var_id - The id of the target variable
Return: According to the factor graph requirement of numbskull,return weight, variable, factor, fmap, domain_mask, edges
Return type: multiple types -
inference_subgraph(var_id) [source]
Function: inference subgraph
parameter:
· var_id - For entity recognition, var_id is a variable id, and var_id is a set of k variables for sentiment analysis
Return: none
Return type:none -
label(var_id_list) [source]
Function: Compare the entropy of k latent variables, select the one with the smallest entropy and label it, and write the parameters learned from this graph back to self.features parameter:
· var_id_list - A list of k ids, the probability corresponding to each variable is taken from variables
Return: No output, directly update the label and entropy in vairables, by the way, you can update observed_variables_id and potential_variables_id
Return type:dict -
inference() [source]
Function: Main flow
parameter:
· none
Return: none
Return type:none -
score() [source]
Function: Calculate the accuracy rate, precision rate, recall rate, f1 value of inference results, etc.
parameter:
· none
Return: none
Return type:none -
save_results() [source]
Function: Save the variable and feature information after inference.
parameter:
· none
Return: none
Return type:none