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

swh:1:snp:71e207e31ede7e57452dd15820b4e990811094a3
  • Code
  • Branches (1)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • 634604c
  • /
  • 1.Parameter-scans & Seletivity Prior Shapes
  • /
  • param_scans.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.

  • content
  • directory
  • revision
  • snapshot
content badge Iframe embedding
swh:1:cnt:28a2dfe21a9f8930ce79c67eac1e949a2a0e49f3
directory badge Iframe embedding
swh:1:dir:141a4dd2e34def6f938b865e3eb40155ec95b35b
revision badge
swh:1:rev:14f721936016ccc712c83fb14b24ce07353de31c
snapshot badge
swh:1:snp:71e207e31ede7e57452dd15820b4e990811094a3
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.

  • content
  • directory
  • revision
  • snapshot
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 ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 14f721936016ccc712c83fb14b24ce07353de31c authored by Ian Outhwaite on 04 December 2023, 14:50:22 UTC
Update citation
Tip revision: 14f7219
param_scans.py
#!/bin/python3.9.4
#Ian Outhwaite, 2021
#082521
#param_scans.py
#runs tests for the JS distance protocol using the PKIS2 dataset

import JS_distance_drugpotency_111821 as JS
import pandas as pd
import numpy as np
import sys
import openpyxl

if __name__ == "__main__":

    dataset=pd.read_excel("./PKIS2_dataset_no_promks.xlsx", engine='openpyxl', nrows=645)

    print(dataset)

    prior_type = 1
    bdist_alpha = 3
    bdist_beta = 1
    mu = 400
    size = 10000
    prior_settings = (prior_type, (bdist_alpha, bdist_beta, mu, size))
    noise_variance = 5
    max_combination_iter = 3
    influence = 0.0
    output_name = ''
    num_p = 5

    if len(sys.argv) > 1:
        print('Number of processes to use: ' + str(sys.argv[1]))
        num_p = int(sys.argv[1])


    ##################### Variable Scanning Tests: Repeat each test 5x 
    
    ##################### TEST 1: Vary Prior Settings 

    for x in range(0,5):
    
        excel_prefix = '111921_PKIS2_nopromks_90thresh_NoInfluence_x'+str(x)+'_vary_prior_'
        
        for new_bdist_alpha in np.arange(2,8,0.5):
            output_name = excel_prefix + 'beta_' + str(new_bdist_alpha)+'_1'
            prior_type = 1
            new_prior_settings = (prior_type, (new_bdist_alpha, bdist_beta, mu, size))
            JS.main_function(dataset,new_prior_settings,noise_variance,max_combination_iter,influence,output_name,num_p)

        for new_mu in np.arange(100,1300,100):
            output_name = excel_prefix + 'poisson_' + str(new_mu)
            new_prior_type = 2
            new_prior_settings = (new_prior_type, (bdist_alpha, bdist_beta, new_mu, size))
            JS.main_function(dataset,new_prior_settings,noise_variance,max_combination_iter,influence,output_name,num_p)

    

    ##################### TEST 2: Vary Gaussian Noise Added to Measurments

    for x in range(0,5):

        excel_prefix = '111921_PKIS2_nopromks_90thresh_NoInfluence_x'+str(x)+'_vary_noise_'

        for new_noise in np.arange(0,6,1):
            output_name = excel_prefix+str(new_noise)
            JS.main_function(dataset,prior_settings,new_noise,max_combination_iter,influence,output_name,num_p)
    
    ##################### TEST 3: Vary the weight of the on-target measurment versus the on-target prior 

    for x in range(0,5):

        excel_prefix = '111921_PKIS2_nopromks_90thresh_NoInfluence_x'+str(x)+'_vary_influence_'

        for new_influence in np.arange(0, 0.6, 0.1):
            output_name = excel_prefix+str(new_influence)
            JS.main_function(dataset,prior_settings,noise_variance,max_combination_iter,new_influence,output_name,num_p)
    
    ##################### END VARIABLE SCANNING TESTS


    

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

back to top