INNER CODE UNIT · Python

overlap

tuangauss/DataScienceProjects · Python/lincoln_estimate.py:19

        overlap = np.sum(like_post_1 & like_post_2)
        
        naive_estimates.append(like_post1_count + like_post2_count - overlap)
        if overlap > 0:
            lincoln_estimates.append(like_post1_count*like_post2_count / float(overlap))
    
    return naive_estimates, lincoln_estimates

def calc_stats(arr):
    return (
            np.mean(arr),
            np.std(arr, ddof=1),
            np.mean(arr) - 1.96*np.std(arr, ddof=1),
            np.mean(arr) + 1.96*np.std(arr, ddof=1)
           )

sims = [[0.3, 0.5], [0.6, 0.4], [0.7, 0.8], [0.9, 0.9]]
# create 2 lists, 1 of data frame of values, 1 of titles

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…