Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 3a5e3f0b76c87d564dc34aaf0446700a91ebdfbb authored by Wesley Tansey on 01 December 2016, 14:00:04 UTC, committed by Wesley Tansey on 01 December 2016, 14:00:04 UTC
Merge branch 'master' of github.com:tansey/smoothfdr
2 parent s 0b3d4a8 + 6baa8dc
  • Files
  • Changes
  • 8d923da
  • /
  • test
  • /
  • fdrl_run.py
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:3a5e3f0b76c87d564dc34aaf0446700a91ebdfbb
directory badge Iframe embedding
swh:1:dir:892f10df507d1f9e5b4f08f94035d8aa1fa69841
content badge Iframe embedding
swh:1:cnt:e2c25191c3684d9435275889fa058ac93d927d06
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
fdrl_run.py
import numpy as np
import sys
import csv
from collections import defaultdict
from smoothfdr.utils import local_agg_fdr, p_value

def load_edges(filename):
    with open(filename, 'rb') as f:
        reader = csv.reader(f)
        edges = defaultdict(list)
        for line in reader:
            nodes = [int(x) for x in line]
            for n1,n2 in zip(nodes[:-1], nodes[1:]):
                edges[n1].append(n2)
                edges[n2].append(n1)
    return edges

edges = load_edges(sys.argv[1] + 'edges.csv')
data = np.loadtxt(sys.argv[1] + 'data.csv', delimiter=',').flatten()
pvals = p_value(data)
fdr_level = 0.1


discoveries = local_agg_fdr(pvals, edges, fdr_level, lmbda = 0.2)
results = np.zeros(data.shape)
results[discoveries] = 1
np.savetxt(sys.argv[1] + 'fdrl_discoveries.csv', results, delimiter=',', fmt='%d')
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API