text
string
<reponame>anze-gn/CBLBs<filename>cblb/run_ode_model_clb.py import os from scipy.integrate import ode import matplotlib.pyplot as plt from models import * from parameters import * """ [[(S1, I1)], []] """ """ states = [([0,0], [0,0,0,0]), ([0,0], [1,0,0,0]), ([1,0], [0,0,0,0]), ([1,0], [0,1,0,0]), ...
<reponame>Yomguithereal/twembeddings # -*- coding: utf-8 -*- import argparse import logging import pandas as pd from .embeddings import TfIdf, W2V, BERT, SBERT, Elmo, ResNetLayer, DenseNetLayer, USE from scipy.sparse import issparse, save_npz, load_npz import numpy as np import os import re import csv from unidecode im...
# # Measure Diversity # # <NAME>, August 9, 2020 # # Diversity is the number of different types of ash observed. # # (1) For each of the four layers, for each generation, calculate # the diversity of the elite sample as a whole, averaging over # the 12 runs. Sample size is num_runs = 12. This is a kind # of p...
<gh_stars>1-10 #!/usr/bin/env python # coding: utf-8 # # notebook: interactive analysis with jupyter notebook, napari, scikit-image, and scipy # # ## Overview # In this activity, we will perform spot detection on some in situ sequencing data ([Feldman and Singh et al., Cell, 2019](https://www.cell.com/cell/fulltext/S...
<reponame>kpessa/matplotlib-challenge<filename>Pymaceuticals/src.py # Dependencies and Setup import matplotlib.pyplot as plt import pandas as pd import scipy.stats as st import numpy as np import seaborn as sns from matplotlib import cm import ipywidgets as widgets import importlib import ipywidgets as widgets import ...
# Code for soft DTW is by <NAME> under Simplified BSD license import numpy from scipy.optimize import minimize from tslearn.utils import to_time_series_dataset, check_equal_size, \ to_time_series from tslearn.preprocessing import TimeSeriesResampler from tslearn.metrics import SquaredEuclidean, SoftDTW from .uti...
import os from pathlib import Path import pyrefinebio import statistics import pandas as pd import numpy as np import seaborn as sns; sns.set_theme(color_codes=True) import IPython df1=pd.read_csv('a/file/path/only/I/have/SRP070849.tsv', sep='\t') mdf=pd.read_csv('a/file/path/only/I/have/SRP070849_metadata.tsv', sep='\...
import scipy import numpy as np import statsmodels.api as sm import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import EngFormatter class FrequencyPlot: def __init__( self, sample_rate = 48000, num_fft = 8192, smoothing_amount = 0.002, ...
<gh_stars>10-100 # SIR model example for python 2.7 # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) -7-9-17 #### Import all the packages #### import scipy.optimize as optimize import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats import sir_ode import sir_cost import minifim import proflike from scipy....
<filename>pyiron_contrib/protocol/compound/tild.py<gh_stars>0 # coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from __future__ import print_function from pyiron_contrib...
<gh_stars>1-10 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri May 18 15:04:43 2018 Code to represent the Private Flux Region @author: max """ from __future__ import division import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata, UnivariateSpline from scipy.constan...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from datetime import date from pydap.client import open_url import numpy import numpy as N def explore(): d = open_url('http://ourocean.jpl.nasa.gov:8080/thredds/dodsC/g1sst/sst_20130526.nc') ##v = d["SST"] ## ##v["lon"] ## ##v["SST"].shape ## ##s = v["SST"] ## ##print ##...
from __future__ import absolute_import, division, print_function, unicode_literals from shutil import copyfile import numpy as np from scipy.signal import lfilter, bessel, butter, lfiltic from datutils.utils import read_metadata, write_metadata, BUFFER_SIZE def datfilt(dat, channels, out, order, highpass, lowpass, fi...
from itertools import chain from sympy import * from sympy.logic.boolalg import conjuncts, to_cnf from utils import * class PropositionalKB: def __init__(self, sentence=None): self.game_map = None self.map_objects = None self.clauses = [] if sentence: self.tell(sent...
import sys sys.path.insert(0, '../') import numpy as np from jax.experimental import optimizers import matplotlib.pyplot as plt from matplotlib.colors import hsv_to_rgb, rgb_to_hsv, ListedColormap from scipy.interpolate import interp1d import time from sde_gp import SDEGP import approximate_inference as approx_inf impo...
<reponame>zblanks/water_pumps from jax import random, vmap from jax.example_libraries.optimizers import adam import jax.numpy as jnp import numpy as np import numpy.typing as npt import numpyro import numpyro.distributions as dist from numpyro.infer import SVI, Trace_ELBO from numpyro.infer.autoguide import AutoNormal ...
<filename>TDSS_VarStar_Vi.py # %load_ext autoreload # %autoreload 2 import matplotlib import matplotlib.style as mplstyle matplotlib.use('TkAGG') mplstyle.use('fast') matplotlib.rcParams['path.simplify'] = True matplotlib.rcParams['path.simplify_threshold'] = 1.0 matplotlib.rcParams['agg.path.chunksize'] = 10000 imp...
#ipython --pylab import scipy from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab import pandas import pylab Folder = 'results' species1 = ['Thunnus_obesus', 'Thunnus_albacares', 'Katsuwonus_pelamis...
<filename>qumquat/measure.py from .qvars import * import cmath, math from random import random # measure.py # - dist # - measure # - postselect # - print, print_amp class Measure: ######################################## Measurement and printing def dist(self, *exprs, branches=False): def cast(ex...
"""Create the hash table. This program is mainly for the insert function. """ import base64 import hashlib import json import math import os import random try: import sympy except ImportError: raise ImportError("Dependency sympy is missing. Use 'pip install sympy' to install it.") import zlib from typing impor...
<reponame>wgurecky/bipymc<gh_stars>1-10 from __future__ import print_function, division from six import iteritems import h5py import numpy as np import scipy.stats as stats from bipymc.util import var_ball class McmcChain(object): """! @brief A simple mcmc chain with some helper functions. """ def __i...
<reponame>kilianFatras/unbisad_minibatch_sinkhorn_GAN<gh_stars>1-10 import numpy as np import matplotlib.pylab as pl import ot import ot.plot from itertools import combinations, chain from scipy.special import comb ############################################################## # Update transportation matrix #########...
<reponame>Vinomo4/Cryptography # **BLOCKCHAIN** # LIBRARIES import sympy import math import random import hashlib import pickle import time import numpy as np from prettytable import PrettyTable import csv #------------------------------------------------------------------------------- # Filepaths generated_path = "./...
<reponame>hash2430/pitchtron<gh_stars>100-1000 ''' This inference code normalizes f0 by 1. Subtracting reference f0 mean from reference pitch contour 2. Divide reference pitch contour with reference speaker f0 variance obtained by 'max-min'. 3. Multiply reference pitch contour with target speaker f0 variance 4. Ad...
<gh_stars>0 """ povm.py Class for the POVM object Basic Principles: ----------------- 1. Indexing is by input state 2. Mean of the generating distribution is the "central state" 3. """ import numpy as np from scipy.stats import binom NUM_DIMS = 5 # Number of dimensions class POVM(object): de...
<gh_stars>0 def rotationSum(a_z1, a_z2, a_x, b_z1, b_z2, b_x): from pytom.angles.angleFnc import zxzToMat, matToZXZ m1 = zxzToMat(a_z1, a_z2, a_x) m2 = zxzToMat(b_z1, b_z2, b_x) ms = m2*m1 if ms[2,2] > 1: ms[2,2] = 1.0 elif ms[2,2] < -1: ms[2,2] = -1.0 ...
<gh_stars>0 import nmrpy.data_objects import logging, traceback import numpy import scipy from matplotlib import pyplot as plt import numbers from datetime import datetime from matplotlib.figure import Figure from mpl_toolkits.mplot3d import Axes3D from matplotlib.collections import PolyCollection import copy from mat...
import json import math import os import random import sys import time import warnings from functools import reduce from itertools import combinations, product from operator import add from typing import List, Sequence, Union import matplotlib.pyplot as plt import numpy as np import pandas as pd import pretty_errors i...
<filename>rlmbm.py #simulation of Riemann-Liouville Multi-fractional Brownian Motion (RLMBM) from #'Modelling of locally self-similar processes using multifractional Brownian motion of Riemann-Liouville type' by <NAME> and <NAME> (2001), Phys. Rev. E 63, 046104 #<NAME> 3.5.2020 import numpy as np from scipy.special i...
import scipy import scipy.io as spio import numpy as np def loadmat(filename): ''' this function should be called instead of direct spio.loadmat as it cures the problem of not properly recovering python dictionaries from mat files. It calls the function check keys to cure all entries which are sti...
import unittest from functools import partial from scipy import stats import numpy as np from pyapprox.mixture_model import \ get_leja_univariate_quadrature_rules_of_beta_mixture, sample_mixture, \ get_mixture_sparse_grid_quadrature_rule, \ get_mixture_tensor_product_gauss_quadrature, \ compute_grammia...
import numpy as np import torch from sklearn.metrics import confusion_matrix, f1_score from scipy.stats import pearsonr from thop import profile def convert2class(out): if out < 0: return -1 elif out > 0: return 1 else: return 0 def convert7class(out): return np.clip(np.rint(...
############################################################################### # WaterTAP Copyright (c) 2021, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National # Laboratory, National Renewable Energy Laboratory, and National Energy # Technology Laboratory ...
""" This file will contain the class for tracking metrics of the system """ import os import torch import numpy as np import scipy.io as sio class MonitoringMultiAgentPerformance: def __init__(self, config): ''' Init a new performance tracker Args: config: global config ...
import statistics def calculate_everything(arg): average = statistics.mean(arg) minimum = min(arg) maximum = max(arg) standard_deviation = statistics.pstdev(arg) return [average, minimum, maximum, standard_deviation] def make_list(messages): n_list = [] while True: input_number ...
<filename>TAD_Calling_By_Ratio.py # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import os import sys import numpy as np import pandas as pd #import seaborn as sns from scipy.signal import find_peaks #from scipy.signal import argrelextrema directory = str(sys.argv[1]) ou...
<filename>utils/speedtest.py import math import statistics import time import requests CF_DOWNLOAD_ENDPOINT = "https://speed.cloudflare.com/__down?measId=0&bytes={}" CF_UPLOAD_ENDPOINT = "https://speed.cloudflare.com/__up?measId=0" REQ_SESSION = requests.Session() def get_server_timing(server_timing: str) -> float:...
#!/usr/bin/env python3 import numpy as np from scipy import sparse from scipy.sparse import issparse from sklearn.compose import ColumnTransformer from joblib import Parallel from sklearn.utils.fixes import np_version, parse_version, delayed from sklearn.base import clone from sklearn.utils.validation import check_a...
<filename>hyperion/transforms/cent_whiten_up.py """ Copyright 2018 Johns Hopkins University (Author: <NAME>) Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ import numpy as np import h5py import scipy.linalg as la from ..hyp_model import HypModel from ..pdfs import Normal from .cent_whiten import Cen...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The modelgen module provides classes for specifying designs for individual subject analysis of task-based fMRI experiments. In particular it also includes algorithms for generating regressors for sparse...
""" PySurf Module: Validation and Training of Interpolators Provide infrastructure for the training of interpolators and test them against a validation set """ import numpy as np from scipy.optimize import minimize import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from pysurf.database import...
<reponame>n3011/deepchem<gh_stars>1-10 """ Computes putative binding pockets on protein. """ from __future__ import division from __future__ import unicode_literals __author__ = "<NAME>" __copyright__ = "Copyright 2017, Stanford University" __license__ = "MIT" import os import logging import tempfile import numpy as ...
from __future__ import division, print_function, absolute_import from numpy.testing import run_module_suite, assert_equal import scipy.constants as sc def test_fahrenheit_to_celcius(): assert_equal(sc.F2C(32), 0) assert_equal(sc.F2C([32, 32]), [0, 0]) def test_celcius_to_kelvin(): assert_equal(sc.C2K([...
<filename>Jupyter_notebook/dvv_module.py import os import glob import copy import obspy import scipy import time import pycwt import pyasdf import datetime import numpy as np import pandas as pd from numba import jit from scipy.signal import hilbert from obspy.signal.util import _npts2nfft from obspy.signal.invsim impo...
<reponame>dearkafka/inferno<gh_stars>0 try: import tensorflow as tf except ImportError: tf = None try: import matplotlib.pyplot as plt except ImportError: plt = None import numpy as np from scipy.misc import toimage from .base import Logger from ....utils import torch_utils as tu from ....utils import...
# Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause from sklearn.base import BaseEstimator from scipy.sparse.csr import csr_matrix from sklearn.neighbors import NearestCentroid, nearest_centroid from sklearn.metrics.pairwise import pairwise_distances import numpy as np from scipy import spa...
<reponame>ygCoconut/MRIreconUNET<gh_stars>1-10 # Train with MRI Cine Data with 20 Channels # Date: 2nd April 2019 # Contact <NAME> at <EMAIL> import os import time import numpy as np import keras from keras import backend as K import pylab import matplotlib.cm as cm import keras.layers import tensorflow as tf from k...
<reponame>tejas-9er/SVM-vs-LSSVM<filename>Iris Benchmarks/LSSVM.py<gh_stars>1-10 import numpy as np import scipy from scipy.sparse import linalg from sklearn.metrics import accuracy_score class LSSVM: def __init__(self, kernel = 'linear', C = 1.0,gamma = 1.0, d = 2.0): kernels = { 'rbf':self.rb...
<reponame>aahmadian-liu/ood-likefree-invertible<filename>Codes/Resflow_Procs/preprocessing/create_imagenet_benchmark_datasets.py """ Run the following commands in ~ before running this file wget http://image-net.org/small/train_64x64.tar wget http://image-net.org/small/valid_64x64.tar tar -xvf train_64x64.tar tar -xvf ...
<reponame>cristobaltapia/sajou #!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import scipy.sparse as sparse class CoordSys(object): """Class implementing coordinating systems Parameters ---------- type: str type of the coordinate system - 'cartesian' - 'cyl...
#!/usr/bin/env python import sys import re import math import numpy as np import io from JMLUtils import eprint import scipy.stats DEFAULT_RADIUS = 2.5 def main(): if not sys.argv or len(sys.argv) < 3: # TODO: Restore effective scriptiness (i.e. all arguments). eprint("Must have two arguments (p...
<filename>preprocess_msra/preprocess.py import os import numpy as np import matplotlib.pyplot as plt import time import numba as nb from transform import transform import pcl import scipy.io as sio dataset_dir='../../Hand-Pointnet/data/cvpr15_MSRAHandGestureDB/' save_dir = '../data/MSRA/msra_process_fullsubvplenpy/' ...
from os.path import join, isfile, isdir import os, sys import datetime, json import scanpy as sc def dim_name(mapName, dim): return mapName + '_' + str(dim+1) def buildsjson_scRNA_geneExp(output, cohort, label = None, metaPara = None): fout = open(output +'.json', 'w') J = {} J['type'] ='genomicMatrix...
<reponame>ivan-severin/peaks<gh_stars>0 from __future__ import print_function import numpy as np import peakutils import pylab from scipy.signal import savgol_filter class Spetrumn(object): x = np.array y = np.array # Additional data smooth_y = np.array baseline = np.array indexes = np.arr...
<reponame>iorodeo/water_channel_calcs """ inertial_sled_sim.py Purpose: provides a simulation of the inertial sled system with the goal of determining the required bandwith for the short range laser distance sensor, the the required update frequency of the realtime loop and the required motor performance. """ import ...
<reponame>bmcmenamin/model_wrangler<gh_stars>0 """End to end testing on autoencoders """ # pylint: disable=C0103 # pylint: disable=C0325 # pylint: disable=E1101 import numpy as np from scipy.stats import zscore from model_wrangler.model_wrangler import ModelWrangler from model_wrangler.dataset_managers import Datase...
<reponame>RichardScottOZ/geoapps<filename>geoapps/simpegPF/PF/GravAnalytics.py from scipy.constants import G from ..Utils import mkvc import numpy as np def GravSphereFreeSpace(x, y, z, R, xc, yc, zc, rho): """ Computing the induced response of magnetic sphere in free-space. >> Input x, y,...
# -*- coding: utf-8 -*- # Author: <NAME> # Date: 09-10-2018 """TopicRank keyphrase extraction model. Graph-based ranking approach to keyphrase extraction described in: * <NAME>, <NAME> and <NAME>. TopicRank: Graph-Based Topic Ranking for Keyphrase Extraction. *In proceedings of IJCNLP*, pages 543-551, 2013. """...
from __future__ import division, print_function import time from abc import ABCMeta,abstractmethod import numpy as np from numpy.lib.stride_tricks import sliding_window_view from scipy.fftpack import fft, fftfreq, ifft, next_fast_len from scipy.signal import hilbert from scipy.interpolate import RectBivariateSpline ...
from scipy.spatial.distance import cdist import matplotlib.pyplot as plt from PIL import Image import numpy as np from glob import glob import argparse import time import os parser = argparse.ArgumentParser() parser.add_argument("--clusters", type=int, default=4, help="Number of clusters") parser.add_argument("--gam...
<filename>models/GloVe/glove_clean_tfidf.py<gh_stars>0 import os import string import json import requests import pandas as pd import numpy as np from scipy import spatial import nltk nltk.download('punkt') nltk.download('stopwords') nltk.download('wordnet') from nltk.tokenize import word_tokenize from ...
#!/usr/bin/env python3 ''' Author: <NAME> Email: <EMAIL> ''' from typing import List, Tuple import numpy as np from scipy.optimize import linear_sum_assignment from .agent import Agent # 这个文件两个函数的作用一致,就是为不同的车指派不同的终点。一种是用匈牙利算法进行指派,一种则是贪心搜索最近终点。 # Hungarian algorithm for global minimal cost 匈牙利算法 def min_cost(starts...
<reponame>LBJ-Wade/SPT_SZ_cluster_likelihood from __future__ import division import numpy as np import os import imp from multiprocessing import Pool import scipy.ndimage from scipy.stats import norm from scipy.interpolate import RectBivariateSpline from astropy.table import Table from cosmosis.datablock import option...
from PIL import Image import glob import numpy as np import scipy.stats import matplotlib.pyplot as plt d = glob.glob('/Users/vignavramesh/Documents/CT2Xray/tests/ground_truth_masks/*') for i in d: im = Image.open(i) im = im.resize((1024,1024)) im.save(i)
import numpy as np import pandas as pd from inspect import getmembers, isfunction from sklearn.utils import check_X_y from scipy.stats import rankdata from . import sbfl_formula class NoFailingTestError(Exception): """Raised when there is no failing test (0 not in y)""" pass class NotSupportedFormulaError(Exc...
<reponame>xhulianoThe1/PySpike """ regression benchmark Copyright 2015, <NAME> <<EMAIL>> Distributed under the BSD License """ from __future__ import print_function import numpy as np from scipy.io import loadmat import pyspike as spk from numpy.testing import assert_almost_equal spk.disable_backend_warning = True...
<filename>tests/external/plot_conics.py # Plot conic sections using the below code # Plots implicit equations in a graph import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import numpy as np import scipy as sp mpl.rcParams['lines.color'] = 'k' mpl.rcParams['axes.prop_cycle'] = mpl.cycler('col...
<reponame>taekyulee/flip import numpy as np from scipy.stats import pareto import matplotlib as mpl import matplotlib.pyplot as plt import preprocessing as prep import pdfplot as pdfplt import kldplot as kldplt name = "basic-pareto" dir = "../../../flip-bench/experiments/basic-pareto/" def data_loc(i): return dir...
<reponame>pygae/galgebra import sys import pytest from sympy import symbols, sin, cos, Rational, expand, collect, simplify, Symbol, Add, S, eye from galgebra.printer import Format, Eprint, latex, GaPrinter from galgebra.ga import Ga from galgebra.mv import Mv, Nga # for backward compatibility from galgebra import ga, m...
<reponame>benjaminleroy/smooth_rf<filename>smooth_rf/smooth_level.py import pandas as pd import numpy as np from sklearn.manifold import TSNE import sklearn import sys, os import matplotlib.pyplot as plt import scipy import progressbar import sparse import scipy.sparse from collections import Counter import sklearn imp...
<gh_stars>1-10 import sympy as sp import numpy as np import pylab as plt from model import ArmModel from simulation import Simulation from projection import TaskSpace, MuscleSpace from controller import JointSpaceController, TaskSpaceController,\ MuscleSpaceControllerJS, PosturalMuscleSpaceController from analysis ...
<reponame>Anthony102899/Lego-ImageGenerator from bricks_modeling.file_IO.model_reader import read_bricks_from_file from bricks_modeling.file_IO.model_writer import write_bricks_to_file from bricks_modeling.connectivity_graph import ConnectivityGraph from util.debugger import MyDebugger from bricks_modeling.connections....
<filename>control/matlab/wrappers.py """ Wrappers for the MATLAB compatibility module """ import numpy as np from ..statesp import ss from ..xferfcn import tf from ..ctrlutil import issys from ..exception import ControlArgument from scipy.signal import zpk2tf from warnings import warn __all__ = ['bode', 'nyquist', 'n...
from typing import Any, Callable, Dict, List, Tuple import argparse from itertools import repeat import json from pathlib import Path from pprint import pprint import numpy as np import pandas as pd from scipy.special import expit from sklearn import metrics from sklearn.model_selection import RepeatedStratifiedKFold ...
import pyasdf import numpy as np import scipy.fftpack import matplotlib.pyplot as plt ''' this script takes a chunk of noise spectrum for a station pair and compare their cross-correlation functions computed using two schemes: one is averaging the frequency domain and the other is in the time domain ''' def cross...
import wx import numpy as np from imagepy.core.engine import Tool, Filter import scipy.ndimage as nimg class ScaleTool(Tool): def __init__(self, plg): self.plg = plg self.para = plg.para self.moving = False def snap(self, x, y, lim): plg = self.plg if abs(x-plg....
<filename>mgt2001/hyp/non.py from matplotlib import pyplot as plt import pandas as pd import numpy as np import math import scipy.stats as stats def inter_p_value(p_value): # interpretation if p_value >= 0 and p_value < 0.01: inter_p = 'Overwhelming Evidence' elif p_value >= 0.01 and p_value < 0.0...
import bpy, math, os, gpu, bgl import numpy as np from . import utility from fractions import Fraction from gpu_extras.batch import batch_for_shader def encodeLogLuvGPU(image, outDir, quality): input_image = bpy.data.images[image.name] image_name = input_image.name offscreen = gpu.types.GPUOffScreen(input...
import aesara import aesara.tensor as at import numpy as np import pytest import scipy.stats.distributions as sp from aesara.graph.basic import Apply, ancestors, equal_computations from aesara.graph.op import Op from aesara.tensor.subtensor import ( AdvancedIncSubtensor, AdvancedIncSubtensor1, AdvancedSubte...
<reponame>qcgm1978/formula<filename>py/getting_started.py import unittest,math from datatype import DataTypes import numpy as np from scipy import stats class TDD_GETTING_STARTED(unittest.TestCase): def test_mse(self): a=[1,2,3] b=[4,5,6] self.assertRaises(TypeError,DataTypes({'a':a}).getMSE...
#!/usr/bin/env python # coding: utf-8 import sys import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import norm from scipy.io import loadmat, savemat from nbs_class import Ppi, Patient from subprocess import call # import h5py import os import glob import time import datetime # NOTE mutationProfileD...
import astral import csv import datetime import math import os import random import re import statistics def load_historical_data_headers(): """Load the headers for historical weather data.""" with open(os.path.dirname(os.path.realpath(__file__)) + '/../data/1711054.csv') as f: reader = csv.reader(f) ...
import unittest import numpy as np import scipy import random import bayesian_bootstrap.bootstrap as bb from bayesian_bootstrap.bootstrap import ( mean, var, bayesian_bootstrap, central_credible_interval, highest_density_interval, BayesianBootstrapBagging, covar, ) from sklearn.linear_model ...
<gh_stars>1-10 #!/usr/bin/env python3 ############################################################################### # Program: EPI-ClusT.py # Type: Python Script # Version: 1.0 # Author: <NAME> # Description: Empiral Phylogeny Informed Cluster Tool for identifying # distance thresholds and defining clus...
#!/usr/bin/python # -*- coding: utf-8 -*- # =========================================================== # File Name: MatchingScoreBench.py # Author: <NAME>, Columbia University # Creation Date: 01-25-2019 # Last Modified: Mon Apr 15 15:19:28 2019 # # Description: Matching score benchmark # # Copyright (C) 2018 <N...
<filename>multiclass_classification/cost.py<gh_stars>0 import numpy as np from scipy.special import expit def log_cost(theta, x, y_i, hyper_p): """ Logistic regression cost function with regularization. Parameters ---------- theta : array_like Shape (n+1,). Parameter v...
from __future__ import division import os from collections import OrderedDict from future.utils import iteritems import numpy as np import scipy.stats from scipy.integrate import cumtrapz from scipy.interpolate import interp1d from scipy.special import erf, erfinv # Keep import bilby statement, it is necessary for s...
<reponame>BAMresearch/ctsimu-toolbox # -*- coding: UTF-8 -*- """ This module provides classes for the virtual processing of images. * `Image` reads, stores, writes and handles image data. * `ImageFile` gathers information about an image file: file name, data type, byte order. It is used to instruct the `Image....
from mnist import MNIST import matplotlib.pyplot as plt import numpy as np import time import datetime as dt import sys #Import datasets, classifiers and performance metrics from sklearn import datasets, svm, metrics from scipy.io import loadmat from sklearn.datasets import fetch_mldata # import custom module from Cl...
"""Imagniary time analytic continuation kernel routines.""" """ Copyright 2021 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by ...
import cairo import numpy as np import primitives as pm import geometry as gm import matplotlib.pyplot as plt from matplotlib import animation from collections import deque import scipy.misc as scm tmpDir = '/data1/pulkitag/tmp/projPhysics/' imName = tmpDir + 'im%d.jpg' ## #Try to paste a ball at a certain location d...
<reponame>vdods/vorpy import itertools import numpy as np import os from .hamiltons_equations import deviation_form from .kepler_nd import KeplerNd from .pendulum_nd import PendulumNd from .results import Results import scipy.integrate import vorpy import vorpy.symplectic_integration TEST_ARTIFACTS_DIR = 'test_artifac...
# Starting from ONS dropout data, try to make model predicting proportions of dropouts of ORF1ab (abbreviated to OR), N, S. # Following on from <NAME>'s analysis at https://theo.io/post/2021-01-22-ons-data/. # Data from tabs 1a, 1b of spreadsheet here https://www.ons.gov.uk/peoplepopulationandcommunity/healthandsocialc...
import pandas as pd import numpy as np from scipy import sparse import scipy as sp import matplotlib.pylab as plt # read the interaction matrix #interaction_sparse_stage = sparse.load_npz('data/interaction_v3.npz') # interaction_sparse.data = np.nan_to_num(interaction_sparse.data, copy=False) interactio...
<reponame>wathen/PhD<filename>MHD/FEniCS/MHD/Stabilised/Precond/MHDstabPrecond.py import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np from dolfin import tic, toc import HiptmairSetup import scipy.sparse as sp class BaseMyPC(object): def setup(self, pc): pass ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Feb 4 20:44:25 2018 @author: hendrawahyu """ import cv2 import numpy as np from scipy.ndimage.filters import convolve, correlate # ============================================================================= # demosaicking / debayering image using s...
<filename>spectral_cluster_algo.py from contextlib import contextmanager import os, sys from sklearn.neighbors import NearestNeighbors import numpy as np from scipy.stats import norm import sklearn.metrics from keras import backend as K from keras.callbacks import Callback import tensorflow as tf from core import co...
from cvxpy.expressions.variable import Variable from cvxpy.atoms.suppfunc import SuppFuncAtom from cvxpy.reductions.cvx_attr2constr import CONVEX_ATTRIBUTES import numpy as np from scipy import sparse def scs_coniclift(x, constraints): """ Return (A, b, K) so that {x : x satisfies constraints} can...
<filename>tests/framework/test_randomness_index_map.py from itertools import chain, combinations, product import pytest import numpy as np import pandas as pd from scipy.stats import chisquare from vivarium.framework.randomness import IndexMap, RandomnessError def almost_powerset(iterable): """almost_powerset([...