text string |
|---|
<gh_stars>0
# import the necessary packages
import json
import os
import random
import cv2 as cv
import keras.backend as K
import numpy as np
import scipy.io
import pandas as pd
from utils import load_model
import glob
import os
from tqdm import trange
if __name__ == '__main__':
img_width, img_height = 224, 224
... |
<reponame>kclamar/ebnmpy
from abc import abstractmethod
import numpy as np
from scipy.optimize import minimize
from ..opt_control_defaults import lbfgsb_control_defaults
from ..output import (
add_g_to_retlist,
add_llik_to_retlist,
add_posterior_to_retlist,
df_ret_str,
g_in_output,
g_ret_str,
... |
<reponame>SPOClab-ca/COVFEFE
import subprocess
import collections
import csv
import os
import re
import logging
import statistics
import wordfreq
import nltk.tree
from nodes.helper import FileOutputNode
from utils import file_utils
import config
SENTENCE_TOKENS = '.。!?!?'
POS_TAGS = [
"AD","AS","BA","CC","CD","... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 6 15:05:01 2017
@author: wangronin
@email: <EMAIL>
"""
from __future__ import division
from __future__ import print_function
#import pdb
import dill, functools, itertools, copyreg, logging
import numpy as np
import queue
import threading
import time
import ... |
import unittest
from math import sqrt
from random import randint
import numpy as np
import scipy.stats
from pydes.core.metrics.accumulator import WelfordAccumulator
SAMPLE_SIZE = 1000000
PRECISION = 10
ERROR = 0.000015
CONFIDENCE = 0.95
class AccumulatorTest(unittest.TestCase):
def setUp(self):
self.ac... |
# -*- coding: utf-8 -*-
"""
Classes used to define linear dynamic systems
@author: rihy
"""
from __init__ import __version__ as currentVersion
# Std library imports
import numpy as npy
import pandas as pd
import matplotlib.pyplot as plt
import scipy
from pkg_resources import parse_version
import scipy.sparse as spa... |
"""Tests for tools for manipulation of expressions using paths. """
from sympy.simplify.epathtools import epath, EPath
from sympy.testing.pytest import raises
from sympy import sin, cos, E
from sympy.abc import x, y, z, t
def test_epath_select():
expr = [((x, 1, t), 2), ((3, y, 4), z)]
assert epath("/*", e... |
<reponame>lelugom/wgs_classifier
"""
Process FASTA files for automatic labelling of sequences. Load training,
validation, and test datasets.
[1] http://scikit-learn.org/stable/modules/preprocessing.html
[2] https://pymotw.com/2/multiprocessing/communication.html
[3] https://stackoverflow.com/questions/10415028/
how-ca... |
#!/usr/bin/python
import scipy as sp
import numpy as np
import string
import timeit
import os,sys
# Set other analysis parameters
overlap_length = 15
primer_length = 40
# Get input files
r1_file = sys.argv[1]
r2_file = sys.argv[2]
regions_file = sys.argv[3]
output_file = sys.argv[4]
stats_file = sys.argv[5]
# Make s... |
<gh_stars>10-100
import datetime
import sys
import yaml
import random
import numpy as np
import statistics
import torch
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
from copy import deepcopy
from agents.TD3 import TD3
from envs.env_factory import EnvFactory
from automl.bohb_optim import run_bohb_p... |
#!/usr/bin/env python
# Copyright (C) 2017 Electric Movement Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: <NAME>
# import modules
import rospy
import tf
from kuka_arm.srv import *
from trajectory_msgs.msg import JointT... |
<reponame>jarethholt/teospy<gh_stars>0
"""Seawater Gibbs free energy and related properties.
This module provides the Gibbs free energy of seawater (liquid water and
salt) and its derivatives with respect to salinity, temperature, and
pressure. It also provides properties (e.g. heat capacity) derived from
the Gibbs en... |
"""
Define project-wide parameters in this 'configuration' file
"""
# Import packages for all files
import os
import pickle
import random
import threading
import time
from os import listdir
import cv2
import keras
import keras.backend as K
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
fro... |
<reponame>ravih18/AD-DL
# coding: utf8
import abc
from logging import getLogger
from os import path
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
import torch
import torchvision.transforms as transforms
from clinica.utils.exceptions import ClinicaCAPSError... |
<gh_stars>10-100
"""
Clustergram - visualization and diagnostics for cluster analysis in Python
Copyright (C) 2020-2021 <NAME>
Original idea is by <NAME> - http://www.schonlau.net/clustergram.html.
"""
from time import time
import pandas as pd
import numpy as np
class Clustergram:
"""
Clustergram class m... |
from hutch_python.utils import safe_load
import subprocess
import sys
from ophyd import Device, Component as Cpt, EpicsSignal, EpicsSignalRO, AreaDetector
from pcdsdevices.device_types import PulsePicker
import matplotlib.pyplot as plt
from time import sleep
import statistics as stat
from pcdsdevices.device_types im... |
<reponame>Dheer08/Algorithms<gh_stars>0
import scipy
import numpy
import pandas
print(scipy.__version__)
print(numpy.__version__)
print(pandas.__version__) |
from numpy import *
# import loadargs
import Hasofer
import Dist
from scipy.stats import norm
from mvncdf import mvstdnormcdf
from model_calls import run_list
def UP_MPP(problem, driver):
# Uses the MPP method for UP
# This routine has been updated as part of refactoring code before the por... |
<gh_stars>1-10
import GPy
import os, sys
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.abspath(os.path.join(THIS_DIR, os.pardir))
GP_prob_folder = os.path.join(ROOT_DIR, 'GP_prob')
sys.path.append(GP_prob_folder)
import numpy as np
from numpy.linalg import inv
from numpy import matmul
import ... |
"""Primary tests."""
import copy
import functools
import pickle
from typing import Any, Callable, Dict, List, Optional, Tuple
import warnings
import numpy as np
import pytest
import scipy.optimize
from pyblp import (
Agents, CustomMoment, DemographicCovarianceMoment, Formulation, Integration, Iteration, Optimiza... |
<filename>wtdepth_bins_distinland_21Nov19.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 21 09:08:30 2019
@author: kbefus
"""
import sys,os
import numpy as np
import glob
import pandas as pd
import geopandas as gpd
#import dask.array as da
import rasterio
from rasterio import mask
from raste... |
<filename>rsHRF/unit_tests/test_spm.py
import pytest
from unittest import mock
import os
import math
import numpy as np
import nibabel as nib
from scipy.special import gammaln
from ..spm_dep import spm
SHAPE = (10, 10, 10, 10)
def get_data(image_type):
data = np.array(np.random.random(SHAPE), dtype=np.float32)
... |
from math import *
from sympy import *
def func( x ):
return x*e**x - 2
def derivFunc( x ):
return e**x + x*e**x
# Function to find the root
def newtonRaphson( x ):
h = func(x) / derivFunc(x)
while abs(h) >= 0.01:
try:
h = func(x)/derivFunc(x)
except ZeroDivi... |
import cmath as mth
import numpy as np
import scipy as sc
import time
np.seterr(all='print')
# Angle functions in degrees
nptypes = np.float64
angle_a = lambda _b, _c: 180 - _c - _b
angle_b = lambda _a,_c: 180 - _a - _c
angle_c = lambda _a,_b: 180 - _a - _b
# degrees from segment + opposite angles
angle_a_deg = lamb... |
<reponame>salah608/OPENPILOT
import numpy as np
import sympy
from laika.constants import EARTH_ROTATION_RATE, SPEED_OF_LIGHT
from laika.helpers import ConstellationId
def calc_pos_fix_gauss_newton(measurements, posfix_functions, x0=None, signal='C1C', min_measurements=6):
'''
Calculates gps fix using gauss newto... |
<filename>Chapter04/run.py
import glob
import io
import math
import time
import keras.backend as K
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from PIL import Image
from keras import Sequential, Input, Model
from keras.applications.inception_resnet_... |
import tensorflow as tf
from tensorflow import keras
import random
import numpy as np
from statistics import mean, median
from collections import Counter
from main import Game as game
def initial_population():
training_data = []
scores = []
accepted_scores = []
for i in range(initial_games):
... |
from scipy import signal
from scipy.interpolate import CubicSpline
from devito import Dimension
from devito.function import SparseTimeFunction
from cached_property import cached_property
import numpy as np
try:
import matplotlib.pyplot as plt
except:
plt = None
__all__ = ['PointSource', 'Receiver', 'Shot', '... |
<reponame>atlas-forward-calorimeter/noise
"""Fourier analysis of experimental noise data."""
import os
import sys
import numpy as np
from matplotlib import pyplot as plt
from scipy import fftpack
import read
import utils
# The voltage range spanned by the 2^14 possible counts from the
# digitizer. Can be 1/2 or 2 V... |
#!python
"""Unittesting for the pystokes module. Run as python -m unittest pystokes.test."""
import sys
import pystokes
import unittest
import inspect
import numpy as np
import scipy as sp
class UnboundedTest(unittest.TestCase):
def test_translation(self):
r = np.array([0,0,0.])
F = np.array([... |
"""
Functions dealing with passive task
"""
import numpy as np
from brainbox.processing import bincount2D
from scipy.linalg import svd
def get_on_off_times_and_positions(rf_map):
"""
Prepares passive receptive field mapping into format for analysis
Parameters
----------
rf_map: outp... |
"""
.. module:: west_coast_random
:platform: Windows
:synopsis: Example code making a scenario in west_coast_usa and having a
car drive around randomly.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import mmap
import random, math
import sys, time
from time import sleep
import numpy as np
import os
fr... |
<reponame>kkleidal/running<filename>krunning/reports/race_pace.py
import argparse
from typing import List
import numpy as np
import scipy
import scipy.stats
import matplotlib.pyplot as plt
import seaborn as sns
from ..constants import KG_PER_LB
from ..data_provider import SpeedPowerFitFilesDataProvider
from ..reports_... |
import numpy as np
import pandas as pd
import scipy
def compute_optimal_tau(PV_number, pv_projections, principal_angles, n_interpolation=100):
"""
Compute the optimal interpolation step for each PV (Grassmann interpolation).
"""
ks_statistics = {}
for tau_step in np.linspace(0,1,n_interpolation+1... |
<filename>sandbox/legacy_plot_code/outlier_montage.py
import img_scale
import pyfits as pyf
import pylab as pyl
from mpl_toolkits.axes_grid1 import axes_grid
from scipy.stats import scoreatpercentile
F = pyl.figure(1, figsize=(6,4))
grid = axes_grid.ImageGrid(F, 111, nrows_ncols=(3,4), axes_pad=0.05,
add_all=T... |
<reponame>renyiryry/natural-gradients<gh_stars>1-10
"""Functions for downloading and reading MNIST data."""
import gzip
import os
# import urllib
import urllib.request
import numpy as np
import sys
def maybe_download(SOURCE_URL, filename, work_directory):
"""Download the data from Yann's website, unless it's al... |
# Copyright 2019 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
<filename>step2_segm_vote_gmm.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import cv2
import os
import gco
import argparse
import numpy as np
import cPickle as pkl
from glob import glob
from scipy import signal
from util.labels import LABELS_REDUCED, LABEL_COMP, LABELS_MIXTURES, read_segmentation
from sklearn.m... |
import argparse
import csv
from scipy import signal
import matplotlib.pyplot as plt
from scipy.signal import find_peaks
import pandas as pd
from sklearn.model_selection import train_test_split
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--split_mode", help='Peak to Peak: pp / Fix... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 29 20:55:53 2018
Image dataset loader for a .txt file with a sample per line in the format
'path of image start_frame verb_id noun_id'
@author: Γιώργος
"""
import os
import pickle
import cv2
import numpy as np
from scipy.spatial.distance import pdist, squareform
from t... |
<reponame>jdammers/mne-python<gh_stars>0
import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
from nose.tools import assert_equal
from scipy.signal import lfilter
from mne import io
from mne.time_frequency.ar import _yule_walker, fit_iir_model_raw
from mne.utils... |
<reponame>31337mbf/MLAlgorithms<filename>mla/gaussian_mixture.py
# coding:utf-8
import random
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import multivariate_normal
from mla.base import BaseEstimator
from mla.kmeans import KMeans
class GaussianMixture(BaseEstimator):
"""Gaussian Mixture... |
<filename>src/fusion/covariance.py
"""
===============
=== Purpose ===
===============
Maximum likelihood covariance estimation that is robust to insufficient and
missing values.
"""
# standard library
import abc
# third party
import numpy as np
import scipy.linalg
import scipy.stats
# first party
from delphi.nowca... |
# libraries
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import simps
import scipy.constants as cte
from scipy.sparse import diags
from scipy.linalg import inv
from scipy.fftpack import fft, ifft, fftfreq
import scipy.special as sp
from scipy.signal import gaussian
# matplotlib defaults setu... |
<reponame>HansBlackCat/Python<gh_stars>0
import numpy as np
from scipy import special
L= np.random.random(1000000)
print(np.sum(L))
print(np.min(L))
print(np.max(L))
print('-----------------------------------------')
M=np.random.random((3,4))
print(M)
print(M.sum())
print(M.min())
print(M.min(axis=0))
print(M.min(ax... |
'''Module for training BGAN on Billion Word
'''
import argparse
import cPickle as pickle
import datetime
import logging
import os
from os import path
import sys
import time
from collections import OrderedDict
from fuel.datasets.hdf5 import H5PYDataset
from fuel.schemes import ShuffledScheme, SequentialScheme
from fu... |
<gh_stars>0
"""Definitions of problems currently solved by probabilistic numerical methods."""
import dataclasses
import typing
import numpy as np
import scipy.sparse
import probnum.filtsmooth as pnfs
import probnum.linops as pnlo
import probnum.random_variables as pnrv
import probnum.type as pntp
@dataclasses.dat... |
<reponame>lars4/Machine-Learning<filename>assignment3/assignment3/em_mog.py
import numpy as np
from scipy.stats import multivariate_normal
from sklearn.cluster import KMeans
import time
def em_mog(X, k, max_iter=20):
"""
Learn a Mixture of Gaussians model using the EM-algorithm.
Args:
X: The data... |
<reponame>nalindas9/bidirectional-spline-RRTstar<filename>adrurlbot_ws/src/turtlebot3_astar/scripts/utils.py
#!/usr/bin/env python3
"""
Utility Functions
Reference: Spline module taken from Author: <NAME>(@Atsushi_twi)
(https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathPlanning/CubicSpline/cubic_spline_pl... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 2
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Multiple real-time digital signals with GLSL-based clipping.
"""
from vispy import gloo, app, visuals
import nump... |
<filename>rt_model_opencovid_final.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 11 13:38:33 2020
@author: vicxon586
"""
import pandas as pd
import numpy as np
import os
from matplotlib import pyplot as plt
from matplotlib.dates import date2num, num2date
from matplotlib import dates as mda... |
import sys,os
qspin_path = os.path.join(os.getcwd(),"../")
sys.path.insert(0,qspin_path)
from quspin.operators import hamiltonian
from quspin.tools.measurements import _ent_entropy, _reshape_as_subsys
import numpy as np
import scipy.sparse as sp
import scipy.linalg as spla
np.set_printoptions(linewidth=10000000,preci... |
#!/usr/bin/python
import os
import getopt
import sys
import bz2
import subprocess
import numpy as np
import develop as d
import coding_theory as code
from walker_updated import isNumber, parseDir
from coding_theory import make_prototyped_random_codes #make_prototyped_random_codes
import scipy.io as sio
#############... |
# -*- coding: utf-8 -*-
'''
这个文件用于提供心率计算的算法:将实时得到的视频信息(4维的 frames)进行欧拉放大,并存储在内存当中
'''
import cv2
import numpy as np
import dlib
import time
from scipy import signal
import Queue
# from cv2 import pyrUp, pyrDown
class heartRateComputation(object):
'''
该类只提供计算方法,工具类,实验完成后应该改名为 tools系列的工具类
'''
def __i... |
<filename>utils.py
import torch
import numpy as np
import sys
import scipy.spatial
import scipy.io as sio
import os
from sklearn.neighbors import KNeighborsClassifier
import scipy
def getOrthW(num_classes, output_shape):
file_name = 'Orth_Ws/Orth_W_C%d_O%d.mat' % (num_classes, output_shape)
W = torch.Tensor(ou... |
<filename>polyxsim/make_imagestack.py
from __future__ import absolute_import
from __future__ import print_function
import numpy as n
from xfab import tools
from xfab import detector
from fabio import edfimage,tifimage
import gzip
from scipy import ndimage
from . import variables,check_input
from . import generate_grai... |
from datetime import datetime
from statistics import mean
import requests
from openheat.config import config
from openheat.exceptions import ConfigError
from openheat.logger import log
from openheat.utils import clamp
OPENWEATHER_BASIC_API_URL = 'https://api.openweathermap.org/data/2.5/weather'
OPENWEATHER_ONECALL_A... |
import pyqtgraph as pg
import numpy as np
from pprint import pprint
from scipy import signal
from statistics import mean
from libs.indicators_widget import Indicator
class Support_Resistances(Indicator):
def __init__(self):
super(Support_Resistances, self).__init__()
self.name = "Support & Resis... |
<gh_stars>1-10
import numpy as np
import visualisation as rob_vis
from model import Rod, RodState, Cable, TensegrityRobot
from simulation import run_simulation
from copy import deepcopy
from scipy.spatial.transform import Rotation
LENGTH = 5.0
OFFSET = LENGTH / 8.0
UNSTRETCHED_LENGTH = 0.1
STIFFNESS = ... |
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
def setup():
""" Simple 3 Mode Controlled Setup """
## Observations (t = 1 to 8)
x_obs = np.tile(np.linspace(1, 8, num=8, endpoint=True), (3, 1))
y_obs = np.zeros((3, 8))
## Real Predictions (t = 9 to 16... |
from ._util import *
def expectatedCapacityFactorFromWeibull( powerCurve, meanWindspeed=5, weibullShape=2 ):
"""Computes the expected capacity factor of a wind turbine based on an assumed Weibull distribution of observed wind speeds
"""
from scipy.special import gamma
from scipy.stats import exponweib
... |
"""
Test Code for tfcochleagram
Usage:
To test changes to the code, run the following:
python tests_tfcochleagram.py
If new tests are added, make sure that the old ones are satisfied and then create a new test function using make_test_file_tfcochleagram.py and push the new test file with the git commit. If changes ... |
<filename>sigproc.py
# set encoding=utf8
############################################################################
# Signal Processing Module
#
# FEATURES
# - Load/save signal in wav format
# - Manipulate signals in both time and frequency domains
# - Visualize signal in both time and frequency domains
#
# AUTHOR
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Computes broadband power, offset and slope of power spectrum
Based on selected epochs (e.g. ASCIIS) in the list of files a power spectrum
is computed. Based on this power spectrum the broadband power is calculated,
followed by the offset and slope using the FOOOF algo... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
<filename>wavepytools/diag/coherence/fit_singleGratingCoherence_z_scan.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
# #########################################################################
# Copyright (c) 2015, UChicago Argonne, LLC. All rights reserved. #
# ... |
from scipy.sparse import coo_matrix, csr_matrix
import re
import pprint
import sys
import numpy as np
import pickle
pp = pprint.PrettyPrinter(indent=4)
TRIGRAM_SIZE = 27000
def get_char_index(c):
if c == '#':
return 27
if c == '$':
return 28
if str.isalpha(c):
return (1 + ord(c) - ... |
<gh_stars>0
#mv.py
import itertools
import copy
import numbers
import operator
from compiler.ast import flatten
from operator import itemgetter, mul, add
from itertools import combinations
#from numpy.linalg import matrix_rank
from sympy import Symbol, Function, S, expand, Add, Mul, Pow, Basic, \
sin, cos, sinh, c... |
#!/usr/bin/env python -W ignore::DeprecationWarning
import warnings
warnings.filterwarnings("ignore")
import os
os.environ['ETS_TOOLKIT'] = 'wx'
import matplotlib
matplotlib.use('wx')
from mayavi import mlab
import numpy
class FIGURE:
def __init__(self, figure='SFEAL VIEW | VERSION 0.1.0', bgcolor=(1., 1., 1.), ... |
import numpy as np
from scanorama import *
from scipy.sparse import vstack, csr_matrix
from sklearn.preprocessing import normalize, LabelEncoder
import sys
from benchmark import write_table
from process import load_names
NAMESPACE = 'simulate_nonoverlap'
data_names = [
'data/simulation/simulate_nonoverlap/simula... |
import cv2
import scipy.io as sio
import numpy as np
from os import listdir
for mode in ['train', 'test']:
vid_path = './datasets/PennAction/frames/'
ann_path = './datasets/PennAction/labels/'
pad = 5
f = open('./datasets/PennAction/'+mode+'_list.txt','r')
lines = f.readlines()
f.close()
numvids=len(line... |
import os
import sys
import random
import numpy as np
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
protein_list_file = sys.argv[3]
protein_list = []
with open(protein_list_file) as f:
protein_list.extend([l.strip() for l in f])
indices = list(range(len(protein_list)))
random.seed(42)
random.sh... |
<reponame>quantum-booty/random_forest
import scipy.io as sp
from sklearn import ensemble
from sklearn import tree
import numpy as np
def class_probs(Y):
"""
Calculate the class probabilities by counting the unique classes.
Args:
Y: Class labels of the dataset.
Returns:
classes: uniqu... |
import cv2
import numpy as np
from scipy.ndimage import filters, measurements
from scipy.ndimage.morphology import (
binary_dilation,
binary_fill_holes,
distance_transform_cdt,
distance_transform_edt,
)
from skimage.morphology import remove_small_objects, watershed
####
def proc_np_hv(pred, marker_mode... |
<filename>model_1.py
# -*- coding: utf-8 -*-
"""
Case 1
@author: <NAME>
"""
import numpy as np
import scipy.linalg as lng
import matplotlib.pyplot as plt
import data_clean as dc
import pandas as pd
from sklearn import preprocessing
from sklearn.svm import SVR
from sklearn.decomposition import PCA
from sklearn.kernel... |
import time
import numpy as np
from scipy.sparse import issparse, csr_matrix
try:
import igraph
except ImportError:
print("Need python-igraph!")
import logging
logger = logging.getLogger(__name__)
from pegasusio import timer
@timer(logger=logger)
def construct_graph(
W: csr_matrix, directed: bool = Fals... |
import logging
import anndata as ad
import scipy.spatial
import scipy.sparse
import numpy as np
from sklearn.decomposition import TruncatedSVD
from sklearn.neighbors import NearestNeighbors
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import normalize
## VIASH START
# Anything within t... |
<filename>sampy/normal_half.py
import numpy as np
import scipy.special as sc
from sampy.distributions import Continuous
from sampy.interval import Interval
from sampy.utils import check_array, cache_property
from sampy.math import _handle_zeros_in_scale, logn
class HalfNormal(Continuous):
def __init__(self, scale=1... |
<filename>astromodels/core/model.py
from builtins import zip
__author__ = "giacomov"
import collections
import os
import warnings
import numpy as np
import pandas as pd
import scipy.integrate
from astromodels.core.memoization import use_astromodels_memoization
from astromodels.core.my_yaml import my_yaml
from astro... |
<reponame>amonelders/project
import ghat
import kernel
import numpy as np
import gamma_r
from scipy import linalg
def training_NDCG_rbf(train_r,K,l,k=10):
"""dont forget kernel
:param train:
:param train_r:
:param l:
:param k:
:return:
"""
n = train_r.shape[0]
K_inv = linalg.inv((K ... |
"""Content cluster
MIT License (MIT)
Copyright (c) 2015 <NAME> <<EMAIL>>
"""
import networkx as nx
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import re
import datetime
import redis
import string
import numpy as np
import math
import Image
import comm... |
<gh_stars>0
'''
Copyright: 2019-present <NAME>
Licence: GNU GPLv3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program... |
#!/usr/bin/env python
# LICENSE
# Copyright (c) 2014, South African Astronomical Observatory (SAAO)
# All rights reserved. See License file for more details
"""
SALTMOSAIC is a task to apply the CCD geometric corrections to MEF style SALT
data.
Author Version Date
------------------------------... |
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
from scipy.stats import entropy
def to_byte_dict(data):
byte_dict = {}
for i in range(0, 256): byte_dict.update({i:0})
for i in list(data): byte_dict[i]+= 1
return byte_dict
def count_ascii(byte_dict):
num_ascii... |
<reponame>shirtsgroup/LLC_Membranes<gh_stars>1-10
#!/usr/bin/env python
import argparse
import numpy as np
import matplotlib.pyplot as plt
import mdtraj as md
from scipy.spatial import distance, ConvexHull
from scipy.linalg import lstsq
from LLC_Membranes.llclib import topology
import tqdm
import sqlite3 as sql
import... |
#Author : <NAME> <EMAIL>
#Supervisor : Dr. A. Bender
#All rights reserved 2016
#Protein Target Prediction Tool trained on SARs from PubChem (Mined 21/06/16) and ChEMBL21
#Molecular Descriptors : 2048bit Morgan Binary Fingerprints (Rdkit) - ECFP4
#Dependencies : rdkit, sklearn, numpy
#libraries
from rdkit import Chem
f... |
<reponame>jziemer1996/BanDiTS
def stdev_time(arr1d, stdev):
"""
detects breakpoints through multiple standard deviations and divides breakpoints into timely separated sections
(wanted_parts)
- if sigma = 1 -> 68.3%
- if sigma = 2 -> 95.5%
- if sigma = 2.5 -> 99.0%
... |
import sys
import os
import io
import base64
import dash
from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash_html_components as html
from dash.exceptions import PreventUpdate
import gdown
import traceback
from scipy.io import wavfile
import numpy as np
import torch
sys.path.append("Diff... |
<reponame>single-cell-data/TileDB-SingleCell<filename>apis/python/src/tiledbsc/uns_array.py
from typing import Optional
import numpy as np
import pandas as pd
import scipy.sparse
import tiledb
import tiledbsc.util as util
from .logging import logger
from .tiledb_array import TileDBArray
from .tiledb_group import Til... |
<reponame>CharlesLoo/stockPrediction_CNN
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D, Conv2D
from keras.optimizers import SGD
from keras.utils import np_utils
from scipy import misc
import gl... |
from sklearn.pipeline import Pipeline
from sklearn.pipeline import FeatureUnion
from sklearn.utils._joblib import Parallel, delayed
import pandas as pd
import numpy as np
from scipy import sparse
class TSPipeline(Pipeline):
"""Pipeline of transforms with a final estimator.
Sequentially apply a list of transf... |
<gh_stars>10-100
from Classes.Config import Config
from Classes.Helper import Tools
from Classes.Image import AnnotatedImage,AnnotatedObjectSet, ArtificialAnnotatedImage
from matplotlib import pyplot as plt
import scipy.misc
import random
import numpy as np
from tifffile import tifffile
import argparse
import glob
from... |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# ## A Neural Net lab bench
# `nnbench_v2`
from matplotlib.widgets import Slider, Button, RadioButtons
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, LogLocator, For... |
<gh_stars>0
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of pyunicorn.
# Copyright (C) 2008--2017 <NAME> and pyunicorn authors
# URL: <http://www.pik-potsdam.de/members/donges/software>
# License: BSD (3-clause)
"""
Provides classes for analyzing spatially embedded complex networks, handling
multiva... |
import scipy.stats
from .utils import *
from scipy.stats import mannwhitneyu, ttest_ind, betabinom
def calc_wilcoxon_fn(M, N, m, s, alpha = 0.05, n_sim = 10_000):
"""
:param M: number of patients, as a list
:param N: number of cells, as a list
:param m: mean for both groups, as a list
:param s... |
"""Grid interpolation using scipy splines."""
from __future__ import division, print_function, absolute_import
from six.moves import range
from scipy import __version__ as scipy_version
try:
from scipy.interpolate._bsplines import make_interp_spline as _make_interp_spline
except ImportError:
def _make_interp_... |
# for this to work download the dataset from the provided link.
# then cd in the Images_Processed directory.
import os
import numpy as np
import cv2
from scipy.io import savemat
C = np.ones((349,))
N = np.zeros((397,))
labels = np.concatenate((C, N), axis=0)
covid = os.listdir('CT_COVID')
n_covid = os.listdir('CT_Non... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2021, Sandflow Consulting LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, ... |
<reponame>Omekaago101/Intracranial-Hemorrhage-Classification<gh_stars>0
# Created by moritz (<EMAIL>)
import torch
import numpy as np
from scipy.linalg import hadamard
def matmul_wht(x, h_mat=None, inverse=False):
"""
Welsh-Hadamard transform by matrix multiplication.
@ param x: The sequence to be transfo... |
<filename>GLADalertTRASE/update_data/functions.py
from new_alerts import *
from PIL import Image # $ pip install pillow
from scipy import sparse
import numpy as np
import re
Image.MAX_IMAGE_PIXELS = None
def download(keep,tempdir):
#print keep
#class rt:pass
name = keep.split('/')[-1]
area = re.finda... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.