Skip to main content

Powerful data structures for data analysis, time series for information diffusion analysis

Project description

The proposed package is designed to facilitate comprehensive work on information diffusion analysis. It provides a versatile set of tools and functionalities that empower users to explore, model, and analyze the intricate dynamics of information spread within a given system.

Following is a sample scenario.

def measure_information_diffusion(posts, threshold): # Sort the set of posts . This should using timestamps posts = sorted(posts, key=lambda x: x.timestamp)

# Initialize empty set of trees
trees = set()

# Iterate over each post in the sorted set
for i, p_i in enumerate(posts):
    # Initialize a new tree with a single node representing (p_i)
    T_i = {p_i}

    # For each post with a timestamp later than p_i
    for j in range(i + 1, len(posts)):
        p_j = posts[j]

        # Compute the similarity between the tags of p_i and p_j
        similarity = compute_similarity(p_i, p_j)

        # If similarity is above the threshold, add a directed edge from p_i to p_j in T_i
        if similarity > threshold:
            T_i.add(p_j)

        # If p_j has already been added to a diffusion tree in trees, merge T_i with that tree
        for T_j in trees:
            if p_j in T_j:
                T_j.update(T_i)
                break
        else:
            # If p_j hasn't been added to any diffusion tree, add T_i to trees
            trees.add(T_i)

# Return the set of diffusion trees
return trees

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SMAdiffz-1.1.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

SMAdiffz-1.1.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page