text
string
import face_recognition import cv2 import os import argparse import face_recognition import numpy as np import demo_texture import tensorflow as tf from face_detection import select_face from face_swap import face_swap from api import PRN from utils.render import render_texture import numpy as np import os from glob...
# 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 applicable law or agreed to in writing, software # distribu...
"""Abstract tensor product.""" from __future__ import print_function, division from sympy import Expr, Add, Mul, Matrix, Pow, sympify from sympy.core.compatibility import u from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.qexpr import QuantumError fro...
from abc import ABC from abc import abstractmethod from pathlib import Path from typing import Collection from typing import Dict from typing import Iterable from typing import Union import numpy as np import scipy.signal import soundfile from typeguard import check_argument_types from typeguard import check_return_ty...
<reponame>nlpsoc/STEL<gh_stars>1-10 """ STYLE similarity is at 1 if the same style (also for cosine-sim) at 0 or -1 if distinct style """ from abc import ABC import nltk from typing import Tuple, List import numpy import logging # from sentence_transformers import SentenceTransformer, models from to_add_...
<filename>dataloader.py<gh_stars>1-10 import numpy as np from abc import abstractmethod from torch.utils.data import DataLoader import torch from torchvision import datasets, transforms import networkx as nx import typing import scipy import scipy.io as spio import numpy as np import os def loadmat(filename): '''...
<reponame>201518015029022/zzzzzz ''' load and preprocess data ''' import numpy as np import scipy.io as sio from keras import backend as K from keras.models import model_from_json from core import util from core import pairs def get_data(params): ''' load data data_list contains the multi-view data for...
<reponame>FutureYu/ButingButing<gh_stars>1-10 import matplotlib.pyplot as plt import numpy as np import scipy.misc import os import csv import pandas as pd import random from skimage import io from rpi_define import * import shutil npy_dir = BUTING_PATH + r"\data_npy" # npy文件夹路径 dest_dir = BUTING_PATH + r"\data" # 训...
""" Copyright 2017 <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 applicable law or agreed to in writing, software distrib...
from simulator.simulatorBases.CrownstoneCore import CrownstoneCore from simulator.simulatorBases.GuiCrownstoneCore import GuiCrownstoneCore import math import operator import string import numpy as np from scipy.stats import norm import numpy as np import numpy class SimulatorCrownstone(GuiCrownstoneCore): ""...
<reponame>jarvisqi/machine_learning from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import Binarizer from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import scale from sklearn.preprocessing import StandardScaler from sklearn import preprocessing import numpy as np im...
<gh_stars>10-100 __author__ = 'jules' import deepThought.ORM.ORM as ORM import pymc import gamma_model import numpy as np from numpy import mean from scipy.stats import gamma import matplotlib.pylab as plt def main(): model=pymc.MCMC(gamma_model) model.sample(iter=1000, burn=500, thin=2) alpha = mean(...
# coding: utf-8 # # Photometry # @author: <NAME> # From astropy and [Photutils](http://photutils.readthedocs.io/en/stable/). from astropy import units as u from astropy.table import Table from astropy.table import Column from astropy.coordinates import SkyCoord from astropy.coordinates import EarthLocation from ph...
<filename>Chapter 6-7/fn_PSHA_given_M_lambda.py<gh_stars>0 # Note: The codes were originally created by Prof. <NAME> in the MATLAB import numpy as np from scipy.stats import norm from scipy.interpolate import interp1d from gmpe_eval import gmpe_eval # Compute PSHA, with rupture rates for each M precomputed #########...
<gh_stars>0 """ BSD 3-Clause License Copyright (c) 2020, <NAME>, <NAME>, <NAME> All rights reserved. """ import logging import sys from functools import lru_cache import numpy as np from scipy.special import binom logging.basicConfig( stream=sys.stdout, level=logging.INFO, format='%(asctime)s - %(levelna...
<gh_stars>1-10 from scipy.ndimage import binary_erosion, binary_dilation from scipy.io import savemat from nibabel import processing import nibabel as nib import numpy as np import glob import os tag = "mri_4688" nii_list = glob.glob("../data/"+tag+"/*.nii.gz") nii_list.sort() for nii_path in nii_list: print(nii_p...
import numpy as np import time from .constants import log from . import util from . import convex from . import nsphere from . import grouping from . import triangles from . import transformations try: from scipy import spatial from scipy import optimize except ImportError: log.warning('Scipy import fail...
<gh_stars>0 import numpy as np from scipy.stats import ttest_rel, ttest_ind X = [0.1, 0.2, 0.6, 0.7, 0.9] Y = [0.05, 0.1, 0.3, 0.4, 0.8] print("X: ", X, "mean is", np.mean(X), "\nY: ", Y, "mean is", np.mean(Y)) print("\nPair: ", round(ttest_rel(X, Y).pvalue, 3)) print("Unpair: ", round(ttest_ind(X, Y).pvalue, 3)) s...
# # # littletable.py # # littletable is a simple in-memory database for ad-hoc or user-defined objects, # supporting simple query and join operations - useful for ORM-like access # to a collection of data objects, without dealing with SQL # # # Copyright (c) 2010-2021 <NAME> # # Permission is hereby granted, free of c...
# -------------- # Importing header files import numpy as np import pandas as pd from scipy.stats import mode import warnings warnings.filterwarnings('ignore') #Reading file bank_data = pd.read_csv(path) #Code starts here bank=pd.DataFrame(bank_data) categorical_var=bank.select_dtypes(include='obj...
r"""Y-Path Factory :mod:`abelfunctions.ypath_factory` ================================================= This module defines the y-skeleton of the Riemann surface. That is, a means of not only computing the a- and b-cycles of the first homology group of the Riemann surface but also mechanisms for travelling from one sh...
<reponame>simone-mastrogiovanni/gdr_gwcosmo_tutorial_2020<gh_stars>1-10 """ Module with Schechter magnitude function: (C) <NAME> (2014) """ from numpy import * from scipy.integrate import quad import numpy as np class SchechterMagFunctionInternal(object): def __init__(self, Mstar, alpha, phistar): self.Ms...
import scipy as sp from scipy import interpolate def estimate(pv, m=None, verbose=False, lowmem=False, pi0=None): """ Estimates q-values from p-values Args ===== m: number of tests. If not specified m = pv.size verbose: print verbose messages? (default False) lowmem: use memory-efficient...
from __future__ import print_function from __future__ import absolute_import from __future__ import division from numpy import asarray from numpy import hstack from numpy import ones from numpy import vectorize from numpy import tile from scipy.linalg import solve from compas.geometry import cross_vectors __all__ ...
import logging import math import numpy as np import scipy.stats from datetime import datetime, timedelta from django.utils import timezone from django.db.models import QuerySet from src.apps.runs.models import Run logger = logging.getLogger(__name__) def random_weighted_choice(networks): probability_to_be_pic...
<reponame>habichta/ETHZDeepReinforcementLearning ''' Contains functions to simplify transofrmation of the input data. This can be illuminance data or cloud images Author: <NAME> <EMAIL> ''' import os import re from .abb_clouddrl_constants import ABB_Solarstation as abb_st from .abb_clouddrl_constants import abb_filepa...
<reponame>Ditskih/Project # -*- coding: utf-8 -*- """ Created on Thu May 2 19:42:57 2019 @author: Ditskih """ import numpy as np import pandas as pd import re import matplotlib.pyplot as plt from scipy.sparse import csr_matrix from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.de...
<reponame>BjoernBiltzinger/astromodels import collections import astropy.units as u import numpy as np import os import pandas as pd from pandas.api.types import infer_dtype import re import scipy.interpolate import warnings from pandas import HDFStore from astromodels.core.parameter import Parameter from astromodels...
# -*- coding: utf-8 -*- """ Created on Fri Feb 25 15:28:21 2022 @author: NeoChen [note] 1. score check ok 2. IOread and plot check ok 3. denoise ok 4. model tran ? """ #import pytest import numpy as np import scipy.io.wavfile import soundfile as sf from scipy import signal from pathlib import Path from pesq...
<gh_stars>1-10 from __future__ import division import datetime import os import numpy as np from scipy import linalg, stats import sympy import matplotlib if os.environ.get('DISPLAY') is None: matplotlib.use('Agg') else: matplotlib.use('Qt5Agg') from matplotlib import rcParams import matplotlib.pyplot as plt fr...
from scipy.optimize import fmin_cobyla import openopt from openopt.kernel.setDefaultIterFuncs import * from openopt.kernel.ooMisc import WholeRepr2LinConst, xBounds2Matrix from openopt.kernel.baseSolver import baseSolver from numpy import inf, array, copy #from openopt.kernel.setDefaultIterFuncs import SMALL_DELTA_X, ...
#! /usr/bin/env python """ Functions involving masked arrays Some functions are general array operations, others involve geospatial information """ import sys import os import glob import numpy as np from osgeo import gdal from pygeotools.lib import iolib #Notes on geoma #Note: Need better init overloading #http:...
""" FILE: convolveRadiallySymmetricFunctions.py Module implementing 2D convolution of two radially symmetric functions based on two differnt approaches to compute Fourier-Bessel functions as explained in Refs. [2] and [3]. Refs: [1] Operational and convolution properties of two-dimensional Fourier tran...
<filename>tests/printing/test_inifile.py<gh_stars>1-10 from os.path import join import pytest from sympy import atan, sqrt, symbols from sympy.printing.printer import Printer from sympy.printing.str import StrPrinter from qalgebra.core.operator_algebra import LocalSigma from qalgebra.core.state_algebra import BasisKe...
# Author: <NAME> # ENF estimation from video recordings using Rolling Shutter Mechanism # Import required packages import numpy as np import cv2 import pickle import pyenf #from scipy import signal, io import scipy.io.wavfile import math from scipy.fftpack import fftshift import matplotlib.pyplot as plt i...
<reponame>fact-project/DrsTemperatureCalibration<filename>drs4Calibration/other_studys/photon_reconstruction/plot.py<gh_stars>0 import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.interpolate import griddata # Define a class that forces representation of float to look a certain way # Th...
<reponame>jorisvandenbossche/scipy-lecture-notes import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from sklearn.mixture import GMM np.random.seed(1) n = 10 l = 256 im = np.zeros((l, l)) points = l*np.random.random((2, n**2)) im[(points[0]).astype(np.int), (points[1]).astype(np.int)] = 1 im =...
import numpy as np from scipy import signal def diagonal_potential(d_1: int, d_2: int, rng: np.random.RandomState) -> np.ndarray: factor_potential = rng.randint(4, 6, size=(d_1, d_2)) * 1.0 dim = np.min([d_1, d_2]) identity = np.eye(dim) if rng.normal(size=1) > 1: identi...
<reponame>okfang/ssd_tf_master # Copyright 2018 <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 applicable law or...
from scipy.stats import beta from typing import List, Optional class IncrementalFsum: """ Incremental version of https://en.wikipedia.org/wiki/Kahan_summation_algorithm """ def __init__(self): self.partials = [] def __iadd__(self, x): i = 0 for y in self.partials: if a...
from scipy.spatial import distance import numpy as np import utils4knets import APKnet import CSKnet from sklearn.metrics import pairwise_distances ''' Brief K-nets description. K-networks: Exemplar based clustering algorithm. It can be operated as a deterministic or stochastic process. The basic K-nets parameter is...
<gh_stars>1-10 import os import numpy as np from numpy.lib.type_check import imag from sklearn import cluster from scipy.sparse.linalg import svds from sklearn.preprocessing import normalize from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score, adjusted_mutual_info_score import torch import...
from sympy import symbols, lambdify, diff, sqrt, I from sympy import besselj, hankel1, atan2, exp, pi, tanh import scipy.special as scp import numpy as np from scipy.sparse.linalg import gmres # gmres iteration counter # https://stackoverflow.com/questions/33512081/getting-the-number-of-iterations-of-scipys-gmres-ite...
############################################################################### # Imports import argparse # Argument parser import logging # DEBUG, INFO, WARNING, ERROR, CRITICAL import Utility import YawlToMetagraph import TriplesToMetagraph import PolicyAnalysisHelper from mgtoolkit.library import * from ortools...
<gh_stars>10-100 # Authors: <NAME> <<EMAIL>> # # License: BSD 3 clause """ Non-stationary kernels that can be used with sklearn's GP module. """ import numpy as np from scipy.special import gamma, kv from sklearn.cluster import KMeans from sklearn.metrics.pairwise import pairwise_kernels from sklearn.gaussian_proce...
<reponame>josephmje/niworkflows<gh_stars>10-100 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in ...
<filename>0_Test_Device/Python/test_Models.py import tclab import numpy as np import time import matplotlib.pyplot as plt from scipy.integrate import odeint # FOPDT model Kp = 0.5 # degC/% tauP = 120.0 # seconds thetaP = 10 # seconds (integer) Tss = 23 # degC (ambient temperature) Qss = 0 ...
<gh_stars>100-1000 import pickle import gzip from sparse_gp import SparseGP import scipy.stats as sps import numpy as np import os.path import rdkit from rdkit.Chem import MolFromSmiles, MolToSmiles from rdkit.Chem import Descriptors import torch import torch.nn as nn from jtnn import create_var, JTNNVAE, Vocab from...
<reponame>tfrere/music-to-led-server<filename>visualizations/visualizer.py import numpy as np from copy import deepcopy from scipy.ndimage.filters import gaussian_filter1d from visualizations.pixelReshaper import PixelReshaper from helpers.audio.expFilter import ExpFilter from visualizations.functions.sound.scroll...
<filename>xcs_soxs/spectra.py from __future__ import division import numpy as np import subprocess import tempfile import shutil import os from xcs_soxs.utils import soxs_files_path, mylog, \ parse_prng, parse_value, soxs_cfg, line_width_equiv, \ DummyPbar from xcs_soxs.lib.broaden_lines import broaden_lines f...
# -*- coding: utf-8 -*- """ Created on Sat Jul 05 09:54:39 2014 @author: rlabbe """ from __future__ import division, print_function import matplotlib.pyplot as plt from scipy.integrate import ode import math import numpy as np from numpy import random, radians, cos, sin class BallTrajectory2D(object)...
<gh_stars>0 import matplotlib.pyplot as plt import numpy as np from scipy import ndimage as ndi import scipy import cv2 import os from skimage import data from skimage.util import img_as_float from skimage.filters import gabor_kernel import utility_functions from sklearn.svm import SVC, LinearSVC from sklearn.model_sel...
"""Wald distribution.""" import numpy from scipy import special from ..baseclass import Dist from ..operators.addition import Add class wald(Dist): """Wald distribution.""" def __init__(self, mu): Dist.__init__(self, mu=mu) def _pdf(self, x, mu): out = numpy.zeros(x.shape) indic...
<filename>replay/models/admm_slim.py from typing import Optional, Tuple import numba as nb import numpy as np import pandas as pd from pyspark.sql import DataFrame from scipy.sparse import coo_matrix, csr_matrix from replay.models.base_rec import NeighbourRec from replay.session_handler import State # pylint: disab...
<reponame>Air-Factories-2-0/af2-hyperledger # coding: utf-8 """Common tools to optical flow algorithms. """ import numpy as np from scipy import ndimage as ndi from ..transform import pyramid_reduce from ..util.dtype import _convert def get_warp_points(grid, flow): """Compute warp point coordinates. Param...
<filename>models.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import torch import torch.nn as nn from torch import Tensor import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable import torch.utils.data as data_utils import num...
<reponame>duangsuse-valid-projects/extract-subtitles<filename>deprecated/extract_subtitles_old.py #!/bin/env python3 # -*- coding: utf-8 -*- from typing import Tuple from argparse import ArgumentParser, FileType from re import findall from pathlib import Path from os import remove from progressbar import ProgressBar ...
<gh_stars>10-100 import functools import numpy as np from scipy.stats import norm as ndist import regreg.api as rr from selection.tests.instance import gaussian_instance from selection.learning.Rutils import lasso_glmnet from selection.learning.utils import (full_model_inference, ...
# -*- coding: utf-8 -*- #!/usr/bin/env python #compatible chiner 1.5 import os import chainer import argparse import os import numpy as np from chainer import cuda import chainer.functions as F from chainer import cuda, Function, FunctionSet, gradient_check, Variable, optimizers from chainer import serializers from...
import scipy.sparse as sp import scipy.sparse.linalg as slinalg from numpy import linalg import scipy.misc from sklearn.preprocessing import normalize from gcn.utils import Test21, absorption_probability, smooth, load_data, taubin_smoothing import gcn.utils from config import configuration import matplotlib.pyplot as p...
<reponame>lucasmaystre/kickscore import numpy as np from kickscore.item import Item from kickscore.kernel import Constant from kickscore.observation.observation import Observation from math import log, pi, sqrt from scipy.stats import norm class DummyObservation(Observation): def match_moments(self, mean_cav, ...
<reponame>shilpiprd/sympy<gh_stars>1000+ from sympy import Rational, I, expand_mul, S, simplify, sqrt from sympy.matrices.matrices import NonSquareMatrixError from sympy.matrices import Matrix, zeros, eye, SparseMatrix from sympy.abc import x, y, z from sympy.testing.pytest import raises, slow from sympy.testing.matric...
#!/usr/bin/env python3 ''' Rank which offensive statistics by how well they correlated from 2017 to 2018 ''' import re from scipy import stats import pandas as pd # Contains various per-season stats and limited descriptive info for # all hitters with at least 200 PAs in either 2017 or 2018. # Obtained via exporting ...
# Copyright 2018 The Cornac Authors. All Rights Reserved. # # 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 applicable ...
#!/usr/bin/env python3 # Copyright (c) 2020 Leedehai. All rights reserved. # Use of this source code is governed under the MIT LICENSE.txt file. # ----- # Generate a static site to show the test results, read from the # result log file. # This is the second iteration; formerly score_view.py. import argparse import dat...
import numpy as np from scipy import stats import matplotlib matplotlib.use('tkagg') import matplotlib.pyplot as plt import matplotlib.colors as colors from scipy.stats import kde def print_stats(labels_test, labels_predict): '''' Calculate the following statistics from machine learning tests. RMSE, Bias,...
import numpy from scipy.fftpack import fft import sys eps = 0.00000001 def mtFeatureExtraction(signal,Fs, mtWin, mtStep, stWin, stStep): """ Mid-term feature extraction """ mtWinRatio = int(round(mtWin / stStep)) mtStepRatio = int(round(mtStep / stStep)) stFeatures = stFeatureExtraction2(s...
import tensorflow as tf import numpy as np np.set_printoptions(precision=2, linewidth=200) import cv2 import os import time import sys import tf_nndistance import argparse import glob import PIL import scipy.ndimage as ndimage sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from utils impo...
<gh_stars>1-10 #!/usr/bin/env python #-*- coding:utf-8 -*- import scipy import pylab import scipy.linalg as sl import random from collections import defaultdict import h5py def normalize(x): n = scipy.sqrt(scipy.inner(x,x)) #n = sl.norm(x, scipy.inf) if n > 0: return x/n else: return x ...
import logging import multiprocessing from multiprocessing import Lock, Pool multiprocessing.set_start_method("spawn", True) # ! must be at top for VScode debugging import argparse import glob import json import math import multiprocessing as mp import os import pathlib import pickle import re import sys import warni...
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt import numpy as np def Pn3m(x, y, z): """ :param x: a vector of coordinates (x1, x2, x3) :return: An approximation of the Schwarz D "Diamond" infinite periodic minimal surface """ a = np.sin(x)*np.sin(y)*np.sin(z) b = np....
#!/usr/bin/env python ############################################# # Title: Satellite utilities # # Project: TLE Match # # Date: Jan 2018 # # Author: <NAME>, KJ4QLP # ############################################# import sys import os import...
<reponame>MasterMilkX/codenames_autobots # WEIGHTED TRANSFORMER CODEMASTER # CODE BY <NAME> import nltk from nltk.stem import WordNetLemmatizer from nltk.stem.lancaster import LancasterStemmer from nltk.corpus import gutenberg from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from players.c...
""" Solve Biharmonic equation on the unit disc Using polar coordinates and numerical method from: "Efficient spectral-Galerkin methods III: Polar and cylindrical geometries", <NAME>, SIAM J. Sci Comput. 18, 6, 1583-1604 """ import matplotlib.pyplot as plt from shenfun import * from shenfun.la import SolverGeneric2N...
<gh_stars>0 """Base class used to define the interface for derivative approximation schemes.""" from __future__ import print_function, division from six import iteritems from collections import defaultdict from scipy.sparse import coo_matrix import numpy as np from openmdao.utils.array_utils import sub2full_indices, g...
<reponame>googlearchive/rgc-models # Copyright 2018 Google LLC # # 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 applic...
from sympy.polys.domains import ZZ from sympy.polys.domains import GF from sympy.polys.galoistools import gf_rem, gf_quo, gf_mul, gf_add from sympy.polys.galoistools import gf_sub, gf_degree, gf_irreducible_p from sympy.ntheory.modular import solve_congruence import time import math import numpy as np import logging im...
'''extra statistical function and helper functions contains: * goodness-of-fit tests - powerdiscrepancy - gof_chisquare_discrete - gof_binning_discrete Author: <NAME> License : BSD-3 changes ------- 2013-02-25 : add chisquare_power, effectsize and "value" ''' from statsmodels.compat.python import lrange im...
<filename>bin/bin_onePT/extra/mvir-3b-fitS01-zTrend.py<gh_stars>1-10 from os.path import join import numpy as n import astropy.io.fits as fits import sys import os import lib_functions_1pt as lib import cPickle import astropy.cosmology as co cosmo = co.Planck13 import astropy.units as uu import matplotlib #matplotlib...
"""Module for querying SymPy objects about assumptions.""" from __future__ import print_function, division from sympy.core import sympify from sympy.core.cache import cacheit from sympy.logic.boolalg import (to_cnf, And, Not, Or, Implies, Equivalent, BooleanFunction, BooleanAtom) from sympy.logic.inference import ...
import pyParz as parallelize import sys # Dictionary of sncosmo CCSN model names and their corresponding SN sub-type SubClassDict_SNANA = { 'ii':{ 'snana-2007ms':'IIP', # sdss017458 (Ic in SNANA) 'snana-2004hx':'IIP', # sdss000018 PSNID 'sn...
<reponame>lruthotto/DeepGenerativeModelingIntro import torch import torchvision import argparse import numpy as np import matplotlib.pyplot as plt device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") parser = argparse.ArgumentParser('DCGAN') parser.add_argument("--batch_size" , type=int, default...
<reponame>DarkDisasters/winglets_python import math; import numpy as np; from scipy import stats; from skimage import measure; from sklearn.cluster import KMeans from .geoOperation import getGeoInfo; from shapely.geometry import Point; from shapely.geometry import Polygon; import seaborn as sns import numpy as np imp...
import pickle, glob, sys, csv, warnings from sklearn.preprocessing import PolynomialFeatures, StandardScaler from sklearn.metrics import accuracy_score, confusion_matrix, auc, roc_curve from feature_extraction_utils import _load_file, _save_file, _get_node_info from scipy.stats import multivariate_normal from ...
#!/usr/bin/env python3 import json import statistics import sys if __name__ == '__main__': if len(sys.argv) != 2: sys.stderr.write('Usage: {} <file.json>\n'.format(sys.argv[0])) sys.exit(1) file_name = sys.argv[1] with open(file_name, 'r') as fd: content = fd.read() process_...
import math import numpy as np import matplotlib.pyplot as plt from scipy.misc import comb def ensemble_error(n_classifier, error): k_start = math.ceil(n_classifier / 2.0) probs = [comb(n_classifier, k) * error ** k * (1 - error) ** (n_classifier - k) for k in range(k_start, n_classifier + 1)] ...
<reponame>hanzy1110/ProbabilisticFatigue #%% import pymc3 as pm import arviz as az import pandas as pd import numpy as np from pymc3.gp.util import plot_gp_dist from scipy import stats from typing import Dict import theano.tensor as tt import matplotlib.pyplot as plt def basquin_rel(N, B,b): return B*(N**b) B ...
<filename>test.py<gh_stars>0 import pandas as pd import numpy as np from scipy.special import comb import getparameter from keras import backend as K celllinename=pd.read_excel("cell-line-name.xlsx",header=None) drugname=pd.read_excel("drug-name.xlsx",header=None) drug = pd.read_csv("drugfeature.csv",header=No...
<reponame>mzy2240/GridCal #!/usr/local/bin/python import sys, math from math import sin, cos, atan2, sqrt, exp, log, pi import cmath Euler = 0.577215664901532860606512 gamma = exp(Euler) ln2g = log(2.0/gamma) lng = Euler tpi = 2.0*pi tworoot = sqrt(2.0) Nmax = 150 F = [ 0.0 ]*Nmax # Generate table of factorials, no...
<reponame>moritzblum/pytorch_geometric<gh_stars>1-10 import torch import scipy.sparse import networkx as nx from torch_geometric.data import Data from torch_geometric.utils import (to_scipy_sparse_matrix, from_scipy_sparse_matrix) from torch_geometric.utils import to_networkx, from_n...
<gh_stars>0 import inspect import math import sys from abc import ABC, abstractmethod from typing import Union, Tuple import numpy as np from scipy import stats from scipy.special import erfcinv from autoconf import conf from autofit import exc from autofit.mapper.model_object import ModelObject from aut...
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[1]: import sklearn import matplotlib.pyplot as plt import pandas as pd import numpy as np import seaborn as sns import scipy.stats as ss import os data_dir ='data' # # Question 2.1 - Load Data # Download prostate data from https://web.stanford.edu/~hastie/El...
<gh_stars>1-10 import os import time import pickle import cv2 import hashlib import numpy as np import nibabel as nib import statsmodels.api as sm from scipy.signal import argrelextrema def hash_file(filename): """"This function returns the SHA-1 hash of the file passed into it""" # make a hash object ...
# coding: utf-8 # In[ ]: from keras.layers import Input, Dense, Flatten, Dropout from keras.layers.core import Reshape from keras.models import Model from keras.callbacks import ModelCheckpoint from keras.layers.convolutional import MaxPooling2D,UpSampling2D,Conv2DTranspose from keras.layers.convolutional import Co...
<gh_stars>0 """This module defines parameters and parameter declaration for usage in pulse modelling. Classes: - Parameter: A base class representing a single pulse parameter. - ConstantParameter: A single parameter with a constant value. - MappedParameter: A parameter whose value is mathematically compute...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 29 13:21:27 2021 @author: christiansaintlouis """ import pandas as pd from scipy.stats import shapiro import scipy.stats as stats from matplotlib import pyplot from scipy.stats import ttest_ind # dataframe diabetes = pd.read_csv('https://raw.gith...
__author__ = 'Prateek' from sympy import primerange def phi(n): value = n for i in primerange(1, n): if n % i == 0: value = value * (1 - i ** -1) return int(value) if __author__ == 'Prateek': print phi(666)
# -*- coding: utf-8 -*- """ Created on Sat Dec 28 20:06:03 2019 @author: <NAME> Email: <EMAIL> """ from scipy import stats from statsmodels.formula.api import ols from statsmodels.stats.anova import anova_lm from statsmodels.stats.multicomp import pairwise_tukeyhsd import warnings import pandas as pd warnings.filter...
#(c) Coded by <NAME> 2014 #Functions related with the XTCAV pulse retrieval import logging logger = logging.getLogger(__name__) import numpy as np import scipy.interpolate import time import cv2 import scipy.io import math import psana.xtcav.Constants as cons import collections import psana.xtcav.Spli...
import matplotlib.patches as mpatches import numpy as np from sympy import Symbol, latex class Pool(): def __init__( self, x, y, size, pool_color, pool_alpha, pipe_alpha, connectionstyle, arrowstyle, ...