def initialize_timestamp_array(comment_number, cascade_source_timestamp): timestamp_column_names_list = ["timestamp_true", "timestamp"] timestamp_array = np.empty((comment_number, 2), dtype=np.float64) update_feature_value(timestamp_array, 0, 0, cascade_source_timestamp) update_feature_value(timestamp_array, 0, 1, cascade_source_timestamp) return timestamp_column_names_list, timestamp_array
def update_basic_max_depth_max_width_ratio(feature_array, i, j, intermediate_dict): # comment_depth = intermediate_dict["comment_depth"] # basic_max_depth_max_width_ratio = update_max_depth_max_width_ratio(intermediate_dict["depth_node_dict"], # comment_depth, # feature_to_list["basic_max_width"][-1]) basic_max_depth_max_width_ratio = update_max_depth_max_width_ratio(intermediate_dict["depth_node_dict"]) update_feature_value(feature_array, i, j, basic_max_depth_max_width_ratio)
def update_user_graph_hirsch_index(feature_array, i, j, intermediate_dict): commenter_id = intermediate_dict["commenter_id"] user_hirsch = update_user_hirsch_eponymous( intermediate_dict["contributor_comment_count"], feature_array[i - 1, j], intermediate_dict["contributor_comment_count"][commenter_id]) update_feature_value(feature_array, i, j, user_hirsch)
def update_basic_max_depth_max_width_ratio(feature_array, i, j, intermediate_dict): # comment_depth = intermediate_dict["comment_depth"] # basic_max_depth_max_width_ratio = update_max_depth_max_width_ratio(intermediate_dict["depth_node_dict"], # comment_depth, # feature_to_list["basic_max_width"][-1]) basic_max_depth_max_width_ratio = update_max_depth_max_width_ratio( intermediate_dict["depth_node_dict"]) update_feature_value(feature_array, i, j, basic_max_depth_max_width_ratio)
def update_user_graph_indegree_normalized_entropy(feature_array, i, j, intermediate_dict): within_discussion_anonymous_coward = intermediate_dict[ "within_discussion_anonymous_coward"] user_graph_indegree_normalized_entropy = update_normalized_graph_indegree_entropy( intermediate_dict["contributor_replied_to_count"], intermediate_dict["set_of_contributors"], within_discussion_anonymous_coward) update_feature_value(feature_array, i, j, user_graph_indegree_normalized_entropy)
def update_user_graph_user_count_estimated(feature_array, i, j, intermediate_dict): user_count_estimated = update_user_count_estimated( intermediate_dict["set_of_contributors"], intermediate_dict["anonymous_coward_comments_counter"]) update_feature_value(feature_array, i, j, user_count_estimated)
def update_user_graph_randic_index(feature_array, i, j, intermediate_dict): user_randic = update_randic_index( intermediate_dict["user_randic_graph"].tocoo()) update_feature_value(feature_array, i, j, user_randic)
def update_user_graph_indegree_normalized_entropy(feature_array, i, j, intermediate_dict): within_discussion_anonymous_coward = intermediate_dict["within_discussion_anonymous_coward"] user_graph_indegree_normalized_entropy = update_normalized_graph_indegree_entropy(intermediate_dict["contributor_replied_to_count"], intermediate_dict["set_of_contributors"], within_discussion_anonymous_coward) update_feature_value(feature_array, i, j, user_graph_indegree_normalized_entropy)
def update_branching_randic_index(feature_array, i, j, intermediate_dict): branching_randic_index = update_randic_index(intermediate_dict["branching_randic_graph"].tocoo()) update_feature_value(feature_array, i, j, branching_randic_index)
def update_user_graph_hirsch_index(feature_array, i, j, intermediate_dict): commenter_id = intermediate_dict["commenter_id"] user_hirsch = update_user_hirsch_eponymous(intermediate_dict["contributor_comment_count"], feature_array[i-1, j], intermediate_dict["contributor_comment_count"][commenter_id]) update_feature_value(feature_array, i, j, user_hirsch)
def update_user_graph_outdegree_entropy(feature_array, i, j, intermediate_dict): user_graph_outdegree_entropy = update_graph_outdegree_entropy(intermediate_dict["contributor_comment_count"]) update_feature_value(feature_array, i, j, user_graph_outdegree_entropy)
def initialize_handcrafted_features(comment_number, handcrafted_feature_names_set, op_is_anonymous): """ Initialize dictionary that maps a feature name to a score. Output: - feature_to_list: Dictionary that maps feature names to scores. """ handcrafted_feature_names_list = list() replicate_feature_if_anonymous_set = list() handcrafted_function_list = list() handcrafted_feature_array = np.empty((comment_number, len(handcrafted_feature_names_set)), dtype=np.float64) #################################################################################################################### # Discussion tree basic features. #################################################################################################################### if "basic_comment_count" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_comment_count") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_comment_count")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_max_depth" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_max_depth") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_max_depth")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_ave_depth" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_ave_depth") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_ave_depth")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_max_width" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_max_width") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_max_width")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "basic_ave_width" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_ave_width") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_ave_width")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "basic_max_depth_max_width_ratio" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_max_depth_max_width_ratio") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_max_depth_max_width_ratio")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_depth_width_ratio_ave" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_depth_width_ratio_ave") handcrafted_function_list.append(getattr(basic_wrappers, "update_" + "basic_depth_width_ratio_ave")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) #################################################################################################################### # Discussion tree branching indices. #################################################################################################################### if "branching_hirsch_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("branching_hirsch_index") handcrafted_function_list.append(getattr(branching_wrappers, "update_" + "branching_hirsch_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "branching_wiener_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("branching_wiener_index") handcrafted_function_list.append(getattr(branching_wrappers, "update_" + "branching_wiener_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "branching_randic_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("branching_randic_index") handcrafted_function_list.append(getattr(branching_wrappers, "update_" + "branching_randic_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) #################################################################################################################### # User graph features #################################################################################################################### if "user_graph_user_count" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_user_count") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_user_count")) if op_is_anonymous: update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) else: update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "user_graph_user_count_estimated" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_user_count_estimated") handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_user_count_estimated")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "user_graph_hirsch_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_hirsch_index") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_hirsch_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_randic_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_randic_index") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_randic_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_outdegree_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_outdegree_entropy") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_outdegree_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_outdegree_normalized_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_outdegree_normalized_entropy") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_outdegree_normalized_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "user_graph_indegree_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_indegree_entropy") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_indegree_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_indegree_normalized_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_indegree_normalized_entropy") replicate_feature_if_anonymous_set.append(len(handcrafted_function_list) - 1) handcrafted_function_list.append(getattr(user_graph_wrappers, "update_" + "user_graph_indegree_normalized_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) #################################################################################################################### # Temporal features. #################################################################################################################### if "temporal_first_half_mean_time" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_first_half_mean_time") handcrafted_function_list.append(getattr(temporal_wrappers, "update_" + "temporal_first_half_mean_time")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "temporal_last_half_mean_time" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_last_half_mean_time") handcrafted_function_list.append(getattr(temporal_wrappers, "update_" + "temporal_last_half_mean_time")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "temporal_std_time" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_std_time") handcrafted_function_list.append(getattr(temporal_wrappers, "update_" + "temporal_std_time")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "temporal_timestamp_range" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_timestamp_range") handcrafted_function_list.append(getattr(temporal_wrappers, "update_" + "temporal_timestamp_range")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) return handcrafted_feature_names_list,\ replicate_feature_if_anonymous_set,\ handcrafted_function_list,\ handcrafted_feature_array
def update_branching_hirsch_index(feature_array, i, j, intermediate_dict): comment_depth = intermediate_dict["comment_depth"] branching_hirsch_index = update_hirsch_index( intermediate_dict["depth_node_dict"], feature_array[i - 1, j], comment_depth) update_feature_value(feature_array, i, j, branching_hirsch_index)
def update_basic_comment_count(feature_array, i, j, intermediate_dict): basic_comment_count = update_comment_count(feature_array[i-1, j] + 1) update_feature_value(feature_array, i, j, basic_comment_count)
def initialize_handcrafted_features(comment_number, handcrafted_feature_names_set, op_is_anonymous): """ Initialize dictionary that maps a feature name to a score. Output: - feature_to_list: Dictionary that maps feature names to scores. """ handcrafted_feature_names_list = list() replicate_feature_if_anonymous_set = list() handcrafted_function_list = list() handcrafted_feature_array = np.empty( (comment_number, len(handcrafted_feature_names_set)), dtype=np.float64) #################################################################################################################### # Discussion tree basic features. #################################################################################################################### if "basic_comment_count" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_comment_count") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_comment_count")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_max_depth" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_max_depth") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_max_depth")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_ave_depth" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_ave_depth") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_ave_depth")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_max_width" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_max_width") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_max_width")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "basic_ave_width" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_ave_width") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_ave_width")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "basic_max_depth_max_width_ratio" in handcrafted_feature_names_set: handcrafted_feature_names_list.append( "basic_max_depth_max_width_ratio") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_max_depth_max_width_ratio")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "basic_depth_width_ratio_ave" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("basic_depth_width_ratio_ave") handcrafted_function_list.append( getattr(basic_wrappers, "update_" + "basic_depth_width_ratio_ave")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) #################################################################################################################### # Discussion tree branching indices. #################################################################################################################### if "branching_hirsch_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("branching_hirsch_index") handcrafted_function_list.append( getattr(branching_wrappers, "update_" + "branching_hirsch_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "branching_wiener_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("branching_wiener_index") handcrafted_function_list.append( getattr(branching_wrappers, "update_" + "branching_wiener_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "branching_randic_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("branching_randic_index") handcrafted_function_list.append( getattr(branching_wrappers, "update_" + "branching_randic_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) #################################################################################################################### # User graph features #################################################################################################################### if "user_graph_user_count" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_user_count") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_user_count")) if op_is_anonymous: update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) else: update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "user_graph_user_count_estimated" in handcrafted_feature_names_set: handcrafted_feature_names_list.append( "user_graph_user_count_estimated") handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_user_count_estimated")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "user_graph_hirsch_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_hirsch_index") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_hirsch_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_randic_index" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_randic_index") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_randic_index")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_outdegree_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_outdegree_entropy") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_outdegree_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_outdegree_normalized_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append( "user_graph_outdegree_normalized_entropy") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_outdegree_normalized_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 1) if "user_graph_indegree_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("user_graph_indegree_entropy") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_indegree_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "user_graph_indegree_normalized_entropy" in handcrafted_feature_names_set: handcrafted_feature_names_list.append( "user_graph_indegree_normalized_entropy") replicate_feature_if_anonymous_set.append( len(handcrafted_function_list) - 1) handcrafted_function_list.append( getattr(user_graph_wrappers, "update_" + "user_graph_indegree_normalized_entropy")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) #################################################################################################################### # Temporal features. #################################################################################################################### if "temporal_first_half_mean_time" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_first_half_mean_time") handcrafted_function_list.append( getattr(temporal_wrappers, "update_" + "temporal_first_half_mean_time")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "temporal_last_half_mean_time" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_last_half_mean_time") handcrafted_function_list.append( getattr(temporal_wrappers, "update_" + "temporal_last_half_mean_time")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "temporal_std_time" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_std_time") handcrafted_function_list.append( getattr(temporal_wrappers, "update_" + "temporal_std_time")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) if "temporal_timestamp_range" in handcrafted_feature_names_set: handcrafted_feature_names_list.append("temporal_timestamp_range") handcrafted_function_list.append( getattr(temporal_wrappers, "update_" + "temporal_timestamp_range")) update_feature_value(handcrafted_feature_array, 0, len(handcrafted_function_list) - 1, 0) return handcrafted_feature_names_list,\ replicate_feature_if_anonymous_set,\ handcrafted_function_list,\ handcrafted_feature_array
def update_basic_depth_width_ratio_ave(feature_array, i, j, intermediate_dict): basic_depth_width_ratio_ave = update_depth_width_ratio_ave(intermediate_dict["depth_width_ratio_sum"], intermediate_dict["depth_node_dict"]) update_feature_value(feature_array, i, j, basic_depth_width_ratio_ave)
def update_basic_max_depth(feature_array, i, j, intermediate_dict): basic_max_depth = update_max_depth(intermediate_dict["depth_node_dict"]) update_feature_value(feature_array, i, j, basic_max_depth)
def update_basic_ave_width(feature_array, i, j, intermediate_dict): basic_ave_width = update_ave_width(intermediate_dict["width_sum"], intermediate_dict["depth_node_dict"]) update_feature_value(feature_array, i, j, basic_ave_width)
def update_basic_max_width(feature_array, i, j, intermediate_dict): comment_depth = intermediate_dict["comment_depth"] basic_max_width = update_max_width(intermediate_dict["depth_node_dict"], comment_depth, feature_array[i-1, j]) update_feature_value(feature_array, i, j, basic_max_width)
def update_branching_randic_index(feature_array, i, j, intermediate_dict): branching_randic_index = update_randic_index( intermediate_dict["branching_randic_graph"].tocoo()) update_feature_value(feature_array, i, j, branching_randic_index)
def update_basic_ave_depth(feature_array, i, j, intermediate_dict): basic_ave_depth = update_ave_depth(intermediate_dict["leaf_depth_sum"], intermediate_dict["set_of_leaves"]) update_feature_value(feature_array, i, j, basic_ave_depth)
def update_user_graph_user_count_estimated(feature_array, i, j, intermediate_dict): user_count_estimated = update_user_count_estimated(intermediate_dict["set_of_contributors"], intermediate_dict["anonymous_coward_comments_counter"]) update_feature_value(feature_array, i, j, user_count_estimated)
def update_basic_max_width(feature_array, i, j, intermediate_dict): comment_depth = intermediate_dict["comment_depth"] basic_max_width = update_max_width(intermediate_dict["depth_node_dict"], comment_depth, feature_array[i - 1, j]) update_feature_value(feature_array, i, j, basic_max_width)
def update_user_graph_randic_index(feature_array, i, j, intermediate_dict): user_randic = update_randic_index(intermediate_dict["user_randic_graph"].tocoo()) update_feature_value(feature_array, i, j, user_randic)
def update_user_graph_indegree_entropy(feature_array, i, j, intermediate_dict): user_graph_indegree_entropy = update_graph_indegree_entropy(intermediate_dict["contributor_replied_to_count"]) update_feature_value(feature_array, i, j, user_graph_indegree_entropy)
def update_user_graph_indegree_entropy(feature_array, i, j, intermediate_dict): user_graph_indegree_entropy = update_graph_indegree_entropy( intermediate_dict["contributor_replied_to_count"]) update_feature_value(feature_array, i, j, user_graph_indegree_entropy)
def update_branching_wiener_index(feature_array, i, j, intermediate_dict): branching_wiener_index = update_wiener_index(intermediate_dict["subtree_size_vector"], intermediate_dict["subtree_cum_size_vector"], intermediate_dict["subtree_cum_size_sqrt_vector"]) update_feature_value(feature_array, i, j, branching_wiener_index)
def update_temporal_timestamp_range(feature_array, i, j, intermediate_dict): timestamp_range = update_timestamp_range(intermediate_dict["initial_timestamp"], intermediate_dict["latest_timestamp"]) update_feature_value(feature_array, i, j, timestamp_range)
def update_branching_hirsch_index(feature_array, i, j, intermediate_dict): comment_depth = intermediate_dict["comment_depth"] branching_hirsch_index = update_hirsch_index(intermediate_dict["depth_node_dict"], feature_array[i-1, j], comment_depth) update_feature_value(feature_array, i, j, branching_hirsch_index)
def update_basic_comment_count(feature_array, i, j, intermediate_dict): basic_comment_count = update_comment_count(feature_array[i - 1, j] + 1) update_feature_value(feature_array, i, j, basic_comment_count)
def update_temporal_first_half_mean_time(feature_array, i, j, intermediate_dict): temporal_first_half_mean_time = update_first_half_time_difference_mean(intermediate_dict["timestamp_differences"]) update_feature_value(feature_array, i, j, temporal_first_half_mean_time)
def update_branching_wiener_index(feature_array, i, j, intermediate_dict): branching_wiener_index = update_wiener_index( intermediate_dict["subtree_size_vector"], intermediate_dict["subtree_cum_size_vector"], intermediate_dict["subtree_cum_size_sqrt_vector"]) update_feature_value(feature_array, i, j, branching_wiener_index)
def update_user_graph_outdegree_entropy(feature_array, i, j, intermediate_dict): user_graph_outdegree_entropy = update_graph_outdegree_entropy( intermediate_dict["contributor_comment_count"]) update_feature_value(feature_array, i, j, user_graph_outdegree_entropy)
def update_basic_depth_width_ratio_ave(feature_array, i, j, intermediate_dict): basic_depth_width_ratio_ave = update_depth_width_ratio_ave( intermediate_dict["depth_width_ratio_sum"], intermediate_dict["depth_node_dict"]) update_feature_value(feature_array, i, j, basic_depth_width_ratio_ave)
def update_temporal_std_time(feature_array, i, j, intermediate_dict): time_difference_std = update_time_difference_std(intermediate_dict["timestamp_differences"]) update_feature_value(feature_array, i, j, time_difference_std)