clusterSimilarSSIDSets.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:directed-probe-matching 作者: rc1035 项目源码 文件源码
def write_results_at_various_thresholds(token_to_probes, check_fingerprints, increment_threshold_by=0.01):
    """Output to CSV results at various thresholds. Used to draw ROC curve.
    :param token_to_probes: Dictionary of token to list of probe dictionary
    :param check_fingerprints: Optional step to remove false positives.
    """
    def drange(x, y, jump):
        """Because python doesn't support decimal steps..."""
        while x <= y:
            yield float(x)
            x += decimal.Decimal(jump)

    with open("jaccard_threshold_results.csv", "w") as f:
        writer = csv.DictWriter(f, fieldnames=["tp", "fp", "tn", "fn", "tpr", "fpr", "accuracy", "clusters", "macs", "median"])
        writer.writeheader()
        for threshold in drange(0, 1.01, increment_threshold_by):
            writer.writerow(cluster_with_threshold(token_to_probes, threshold, check_fingerprints))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号