def T1(ds1_path, ds2_path, year, k):
    year_graph = gr.YearGraph(ds1_path, ds2_path, year)
    year_graph.read()
    year_graph.weights_fraction_cocitations()
    year_graph.build_ds1_graph()

    metrics = me.Metrics(year_graph)
    metrics.metrics_preprocessing()
    metrics.pagerank(k)

    models = sp.SpreadOfInfluenceModels(year_graph, metrics.get_top_k_nodes())
    models.spread_preprocessing()
    models.threshold_deg()
    models.tipping_model()

    ov_top = ov.OverlapTopics(year_graph, models.get_influenced_nodes(), k)
    ov_top.overlap_preprocessing()
    ov_top.clique_percolation_method()
    ov_top.check_number_topics()
    ov_top.check_spread_topics()

    return ov_top.get_topics()
Esempio n. 2
0
    if results.ds2_path:
        ds2_path = results.ds2_path

    if results.out and not results.s:
        raise parser.error(
            "Must to specify the save flag with the output path: -s.")

    if results.out:
        output_sample_path = results.out

    #Save file flag
    if results.s:
        save_logs = True

    #Building graph, with weights calculation strategy or not
    year_graph = gr.YearGraph(ds1_path, ds2_path, y)
    year_graph.read()
    year_graph.weights_fraction_cocitations()
    year_graph.build_ds1_graph()

    metrics = me.Metrics(year_graph)
    metrics.metrics_preprocessing()
    metrics.pagerank(k)

    models = sp.SpreadOfInfluenceModels(year_graph, metrics.get_top_k_nodes())
    models.spread_preprocessing()

    if t == 0:
        models.threshold_deg()
        threshold = "degree"
Esempio n. 3
0
    if results.ds1_path:
        ds1_path = results.ds1_path

    if results.ds2_path:
        ds2_path = results.ds2_path

    if results.out:
        output_sample_path = results.out

    #weights histogram plotting control and setting
    if results.plot:
        plot_show_flag_histogram = False

    #Building and plotting of the histogram
    year_graph = gr.YearGraph(ds1_path, ds2_path, results.y)
    year_graph.read()

    if results.weights == 'frac':
        year_graph.weights_fraction_cocitations()

    elif results.weights == 'num':
        year_graph.weights_number_cocitations()

    elif results.weights == None:
        raise parser.error("The -w WEIGHT options must be specified.")

    else:
        raise arg.ArgumentTypeError("Option value not valid.")

    if plot_show_flag_histogram: