text string |
|---|
<filename>uncoverml/optimise/models.py<gh_stars>1-10
import logging
from functools import partial
import numpy as np
from scipy.integrate import fixed_quad
from scipy.stats import norm, gamma
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.gaussian_process import GaussianProcessRegressor
from sklear... |
<gh_stars>0
"""Three named_players simultaneously either contribute to a public good or don't.
It is only acceptable if at least two contribute."""
from ..__init__ import *
from sympy import symbols
global_players("i", "j", "k")
global_actions("dont", "contribute")
not_enough = Ou("not_enough", ac=False)
enough = ... |
<filename>skvalidation/chisquare.py
import unittest
import numpy as np
from typing import Optional
from scipy.stats import chisquare
class PearsonChiSquaredTest(unittest.TestCase):
def assertObservationByFrequencies(self, observation: np.ndarray, frequencies: np.ndarray,
p_... |
<reponame>slabbaki/discriminative-subtyping
"""Data utils."""
from concurrent import futures
from functools import partial
import numpy as np
import scipy as sp
def get_tokenizer(name="bert-base-uncased", max_workers=16):
import transformers
def tokenize(inputs, max_length=None):
# Build tokenizer... |
import os
import pickle
import numpy as np
import soundfile as sf
from scipy import signal
from scipy.signal import get_window
from librosa.filters import mel
from numpy.random import RandomState
import autovc_melsp
# audio file directory
rootDir = './wavs'
# spectrogram directory
targetDir = './spmel'
dirName, su... |
<reponame>abhayadevms/svm-model-for-simple-detection<gh_stars>0
import pandas as pd
import pylab as pl
import numpy as np
import scipy.optimize as opt
from sklearn import preprocessing
#3from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
data = pd.read_csv("f.csv")
data.h... |
import numpy as np
from statistics import mean
from sklearn.feature_selection import VarianceThreshold, SelectPercentile
from sklearn.model_selection import cross_val_score
from metalfi.src.data.meta.importance.shap import ShapImportance
class MetaFeatureSelection:
def __init__(self, meta_data, target_names):
... |
<gh_stars>0
#!/usr/bin/env python
'''
Author: <NAME>
Email: <EMAIL>
Description:
Simple utility to read in '.dat' files and measure the gaussian of the data
and sort the files based on the gaussian width
Dependencies:
docopt, statistics
Usage:
gausssort bact.a <read_file_path> [save [<write_file_path>]... |
<reponame>yupbank/sympy
"""
.. deprecated:: 1.7
cxxcode.py was deprecated and renamed to cxx.py. This is a shim file to
provide backwards compatibility.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning(
"""
The sympy.printing.cxxcode submodule is deprecate... |
<gh_stars>1-10
##
# Copyright 2018, <NAME>
# Licensed under MIT.
##
from scipy.spatial import distance
##
# Rectangle class
##
class Rectangle:
def __init__(self):
return None
##
# Static method centroid()
# Method to return centroid of given rectangle
#
# @param coordinates - recta... |
import sympy as sp
from rolldecayestimators.substitute_dynamic_symbols import lambdify
from rolldecayestimators import equations
from rolldecayestimators import symbols
|
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import mysql.connector
import math
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib import dates
from mpl_toolkits.basemap import Basemap
import calendar
from scipy.opti... |
<reponame>eljosephavila123/taugeomectic
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from taugeometric.poresSE import points_start
from taugeometric.poresSE import points_end
from taugeometric.astar import astar
from scipy.spatial import distance as ds
def metric_euclidian(points):
p_s=poin... |
<reponame>solomon-ma/PaMIR
import numpy as np
import os
import cv2 as cv
import glob
import math
import random
import pyexr
from tqdm import tqdm
import scipy.io as sio
import prt.sh_util as sh_util
from renderer.camera import Camera
from renderer.mesh import load_obj_mesh, compute_tangent, compute_normal, load_obj_me... |
<filename>dse_simulation/test/test_information_filter.py
#!/usr/bin/env python
from __future__ import print_function
import roslib
import os
import sys
import unittest
import rospy
import rostest
from optparse import OptionParser
import numpy as np
import datetime
import time
from dse_msgs.msg import PoseMarkers
from ... |
# JACSNET Evaluation
# Author: <NAME> 04.11.19
# get libraries
import sys
import numpy as np
import pandas as pd
import scipy
import csv
import matplotlib.pyplot as plt
import tensorflow as tf
import itertools
import librosa
import librosa.display
import keras
from keras.models import Model
from keras.layers import ... |
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import csv
import sys
import os, os.path
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import Delaunay
from wpca import WPCA
import matplotlib.image as mpimg
import PIL
PIL.Image.MAX_IMAGE_PIXELS = None
# HALF_CUBE_SIDE =... |
<reponame>matchms/old-iomega-spec2vec
#
# Spec2Vec
#
# Copyright 2019 Netherlands eScience Center
#
# 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/LICENS... |
#!/home/twixtrom/miniconda3/envs/analogue/bin/python
##############################################################################################
# run_wrf.py - Code for calculating the best member over a date range
#
#
# by <NAME>
# Texas Tech University
# 22 January 2019
#
##########################################... |
"""
Tools for doing kernel PCA on environmental similarity
e.g.
kNN = np.genfromtxt(prefix+".k",skip_header=1)
proj = KernelPCA(kpca_d).fit_transform(kNN)
KernelPCA with precomputed kernel for now only!!!!!!!!!!!!
"""
import numpy as np
import scipy.linalg as salg
class KernelPCA:
def __init__(self, n_component... |
import numpy as np
import scipy.io as scio
# 本地地址:D:\FluidSim\FluidSim\FEMNEW\Navier-stokes-Satsit14master
tmax = 100
celem = scio.loadmat('celem.mat')['celem'] - 1
node = scio.loadmat('node.mat')['node']
nmax = 341
u0 = np.ones((nmax))
v0 = np.zeros((nmax))
numOfElements = 100
for t in range(0,tmax):
... |
#import elevation
import numpy as np
import cmath as cm
#from osgeo import gdal
from scipy.interpolate import interp2d
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
import pyproj
#bounds = (-158.4, 21, -157.4, 22)
bounds = (29.636637, 60.112502, 31.288706, 60.699130)
west, south, east, north ... |
import os
import argparse
import re
import statistics
import matplotlib.pyplot as plt
from collections import defaultdict
def parse_tegrastats_file(file_path):
avg_gpu_power = None
avg_cpu_power = None
gpu_utils = []
cpu_utils = []
mem_utils = []
total_time = 0
with open(file_pa... |
<reponame>rohankadekodi/compilers_project<gh_stars>0
#!/usr/bin/env python
"""cholesky - Cholesky factorization as a graph algorithm."""
import networkx as nx # Graph library
import matplotlib.pyplot as plt # For plotting
import numpy as np # Does matrices and stuff
import scipy.io ... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>.
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft, Delft, Netherlands
"""
from objects.CSCG._3d.forms.base import _3dCSCG_FORM_BASE
from objects.CSCG._3d.forms.standard.base.numbering.main import _3dCSCG_Standard_Form_Numbering... |
"""
spectra.py is a Python routine that contains postprocessing routines for
spectral functions.
"""
import numpy as np
def compute_kpeak(k, E, tol=.01, quiet=False):
"""
Function that computes the maximum of the spectrum E and its spectral
peak.
Arguments:
k -- array of wave numbers
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Calculate cosmological quantities.
"""
from __future__ import print_function, division
import numpy as np
import scipy.interpolate
import scipy.integrate
import astropy.cosmology
import astropy.units as u
def create_cosmology(*args, **kwargs):
"... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
import h5py
import numpy as np
import geomdl
from scipy.special import... |
import numpy as np
from scipy.stats import norm
# Function generates choice data from lba
def rlba(v = np.array([1, 1]),
A = 1,
b = 1.5,
s = 0.1,
ndt = 0.0,
n_samples = 1000,
max_t = 20,
d_lower_lim = 0.01):
rts = np.zeros((n_samples, 1))
c... |
'''
[diagnostics_vars.py]
Handles data requirements specifications for visualization globAcc project simulation results. Note: spherical_polar coordinates only!
Author: <NAME>, <EMAIL>
'''
import numpy as np
exec(open("./diagnostics_header.py").read())
def identity (x):
return x
def SQR (x):
return x*x
# Acc... |
<reponame>herjy/scarlet<filename>scarlet/psf_match.py
import numpy as np
from .config import Config
from . import constraint as sc
from .component import Component
from .source import Source
from .blend import Blend
def moffat(coords, y0, x0, amplitude, alpha, beta=1.5):
"""Moffat Function
Symmetric 2D Moffa... |
from skimage import measure
import numpy.ma as ma
import skfmm
import numpy as np
import scipy.ndimage as nd
from .nd_tools import (filter_binary_array_by_min_size,
get_superpixel_area_as_features,
apply_func_to_superpixels,
get_array_from_features)
... |
<reponame>ayuguchi/gazed_object_identification_robot<filename>catkin_ws/py_ws/timeuse_test/scoredata_plot.py
#! c:/Python27/python.exe
# -*- coding: utf-8 -*-
#------------import modules
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.ticker import *
import csv
import scipy as ... |
<filename>plotter_wittman.py<gh_stars>0
"""Wittman style plot for the report"""
import numpy as np
import pandas as pd
import pickle
import matplotlib.pyplot as plt
from scipy.stats import norm as scipy_normal
# Make TeX labels work on plots
#plt.rc('font', **{'family': 'serif', 'serif': ['DejaVu Sans']})
#plt.rc('te... |
from astropy.table import Table
from astropy.units import Unit as u
from astropy.units import spectral
import glob
import numpy as np
from astropy.io import fits
import pylab as plt
from scipy import interpolate
data=Table.read('tau_finke_2010.fits')
nu=np.logspace(-1.5,3,30)
def get_tau_funtcion(data_table):
y =... |
r"""
Infinity Rings
The unsigned infinity "ring" is the set of two elements
1. infinity
2. A number less than infinity
The rules for arithmetic are that the unsigned infinity ring does
not canonically coerce to any other ring, and all other rings
canonically coerce to the unsigned infinity ring, sending all
element... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import scipy.constants as CONSTANTS
import math
import json
import os
class SingleAtomMD:
def __init__(self, length, number, dimension, sigma, mass, epsilon, v_max, h=10 ** -3, saving_period=10,
is_reduced... |
<filename>pysptools/eea/nfindr.py
#
#------------------------------------------------------------------------------
# Copyright (c) 2013-2014, <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 th... |
from typing import Optional
import histomicstk as htk
import numpy as np
import scipy as sp
import skimage.color
import skimage.io
import skimage.measure
from anndata import AnnData
from scipy import ndimage as ndi
from skimage.feature import peak_local_max
from skimage.segmentation import watershed
from tqdm import tq... |
from pykingas import KineticGas
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
from matplotlib.cm import get_cmap
from scipy.constants import Boltzmann
from scipy.integrate import dblquad
plt.style.use('default')
T = 300
kin = KineticGas('AR,C1', potential='mie')
sigma = kin... |
import pandas as pd
import numpy as np
from pathlib import Path
from sklearn.metrics import mean_squared_error, r2_score
from scipy.stats import pearsonr
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import KFold
from catboost import CatBoostRegressor
from sklearn.model_selection impor... |
from __future__ import print_function
import time
import scipy
import matplotlib.pyplot as plt
from autostep import Autostep
def get_period_and_amplitude(velocity, acceleration):
period = 2.0*scipy.pi*velocity/acceleration
amplitude = (velocity**2)/acceleration
return period, amplitude
min_velocity = 10... |
from typing import List, Tuple
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
from plotly.subplots import make_subplots
from scipy.io import loadmat
import os
import shutil
from urllib.request import urlopen
COLOR1 = 'steelblue'
def find_or_create_dir(dir_n... |
<gh_stars>1-10
import numpy as np
import pandas as pd
from scipy.stats import zscore
from sklearn.linear_model import LogisticRegression, LassoLars
from tqdm import tqdm
import matplotlib.pyplot as plt
import seaborn as sb
def createDataset(n, d=100, d_inf=5, is_classification=True, no_signal=False):
"""
n i... |
<gh_stars>10-100
import numpy as np
from collections import Counter
from scipy.sparse import dok_matrix, csr_matrix
import itertools
def cut_dataset(data, hoax_pages, min_post_like=10, min_user_like=30, print_results=False):
"""returns the dataset filtered with these parameters:
min_post_like: post with at le... |
<reponame>agflood/scatteringmatrix<filename>scatteringmatrix/units.py
# -*- coding: utf-8 -*-
"""Scattering Matrix Units
This contains useful units and conversions for scattering matrix calculations
Because all the scattering matrix code is written with m.g.s SI units, constants
have been included that can be used as... |
# Run in terminal or command prompt
# python3 -m spacy download en
import numpy as np
import pandas as pd
import re, nltk, spacy, gensim
# Sklearn
from sklearn.decomposition import LatentDirichletAllocation, TruncatedSVD
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.model_s... |
<filename>BasicModel/AUV.py
import numpy as np
# from sklearn import linear_model as lm
from scipy.optimize import fsolve
from BasicModel.Sensor import *
class AUV():
"""AUV model"""
def __init__(self, X0, V, delta):
self.X = np.array(X0)
self.V = V
self.t = 0.0
self.delta = de... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse as Spar
import scipy.sparse.linalg as SparLinalg
np.set_printoptions(linewidth = 500)
def NN_Arr(coor):
N = coor.shape[0]
NN = -1*np.ones((N,4), dtype = 'int')
xmax = max(coor[:,0])
ymax = max(coor[:,1])
Lx = xmax + 1
Ly = ... |
import pytest
from scipy.integrate import dblquad
from numpy import conj, sin, pi, array
from numpy.linalg import norm
from sphericalquadpy.tools.sphericalharmonics import ylm
from sphericalquadpy.tools.transformations import xyz2thetaphi
def test_integrate_to_unity():
i, j, m, n = 1, 2, 1, 2
def f(theta, ph... |
from scipy.io.wavfile import read
import numpy as np
import audio
import soundfile as sf
def _process_utterance(wav_path, hparams):
try:
# Load the audio as numpy array
sr, wav = read(wav_path)
wav = wav.astype(np.float32)
MAX_WAV_VALUE = 32768.0
wav = wav / MAX_WAV_VALUE
... |
<gh_stars>10-100
from __future__ import print_function
import sys
from setuptools import setup, find_packages
with open('requirements.txt') as f:
INSTALL_REQUIRES = [l.strip() for l in f.readlines() if l]
try:
import numpy
except ImportError:
print('numpy is required during installation')
sys.exit(1)... |
from timemachines.skatertools.data.synthetic import brownian_with_noise, brownian_with_exogenous
from timemachines.skating import prior, residuals, prior_with_sporadic_fit
from sklearn.metrics import mean_squared_error, mean_absolute_error
from scipy.stats import energy_distance
import numpy as np
from timemachines.ska... |
import numpy as np
from numpy.testing import assert_almost_equal
from scipy.stats import t as stats_t
from scipy.stats import ttest_ind
def make_t_test(na: int, nb: int):
"""
Returns a t-test that takes the sample mean and variance for a list of sample points from A,
and those for a list of sample points ... |
import os
import sys
import multiprocessing as mp
import multiprocessing.pool as pool
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import wilcoxon
basedir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
sys.path.append(basedir)
sys.path.append(os.path.dirname(o... |
import os
from os.path import join as jph
import nibabel as nib
import numpy as np
from scipy.optimize import minimize
class IcvEstimator(object):
"""
ICV estimation as in
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>: "Template-free estimation of
intracranial volume: a preterm birth animal ... |
import os
from scipy import misc
import RPi.GPIO as GPIO
from time import sleep
import spidev
MyARM_ResetPin = 19 # Pin 4 of connector = BCM19 = GPIO[1]
MySPI_FPGA = spidev.SpiDev()
MySPI_FPGA.open(0,0)
MySPI_FPGA.max_speed_hz = 5000000
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(MyARM_Re... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 7 14:37:39 2019
@authors: <NAME> and <NAME>
"""
"""
Testing the vrft on a SISO example
"""
#%% Header: importing python libraries
import numpy as np # important package for scientific computing
from scipy import signal # signal processing library
import matplotlib.pyplo... |
# --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
import sys
import ctypes
from pprint import pprint
from PIL import Image
import glutils.glcontext as glcontext
import OpenGL.GL as GL
import ... |
<gh_stars>1-10
"""hist.py: processing of PET list-mode data: histogramming and randoms estimation."""
import logging
import os
from collections.abc import Collection
from numbers import Integral
import nibabel as nib
import numpy as np
import scipy.ndimage as ndi
from niftypet import nimpa
from .. import mmraux
# C... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 7 11:38:29 2021
custom plots for data visualization
@author: Ashish
"""
def plot_bivariate(categorical_vars, data):
from matplotlib import pyplot as plt
import math
import seaborn as sns
'''A plot for bivariate analysis.'''
fig, axes = plt.s... |
<reponame>t-young31/thesis<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.collections import LineCollection
from matplotlib import colors as mcolors
from scipy import special
from scipy import integrate
plt.style.use('graph')
def morse_potential(x, d_e, m, nu_hz... |
<gh_stars>1-10
import ray
import numpy as np
import scipy
import scipy.sparse
# Code for sparse matrix vector products
def partition_matrix_rows(A, num_partitions):
n = A.shape[0]
partition_size = -(-n // num_partitions) # ceil division
partitions = [A[i:min(i+partition_size, n), :] for i in xrange(0, n, partit... |
import os
import random
import keras_vgg_buddy
import numpy as np
from keras import backend as K
from scipy.misc import imsave
def output_samples(model, args, input_generator):
'''Generate args.num_sample outputs drawn from the `input_generator`.'''
num_samples = args.num_samples
num_batches = max(num_sa... |
## attack.py -- generate audio adversarial examples
##
## Copyright (C) 2017, <NAME> <<EMAIL>>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in the LICENCE file in this directory.
import numpy as np
import tensorflow as tf
from shutil import copyfile
import scipy.io.wavfile as wav
import... |
<reponame>wheeler-microfluidics/dmf_control_board
# coding: utf-8
import logging
from matplotlib.markers import MarkerStyle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.optimize as optimize
from .feedback import compute_from_transfer_function
logger = logging.getLogger(__name__... |
c = get_config()
app = c.InteractiveShellApp
# This can be used at any point in a config file to load a sub config
# and merge it into the current one.
load_subconfig('ipython_config.py', profile='default')
lines = """
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbo... |
<filename>Python Code/codeChecks.py
import scipy.io as sp
import numpy as np
import matplotlib.pyplot as plt
import math
import os
from collections import defaultdict
from usefulFns import *
allTrialsData, header = loadMatFile('Meetz_2021_1028_1.mat')
# code to check whether valid RT are being rewarded or not
# che... |
import unittest
import os.path
import sys
import argparse
import seaborn as sns
import pandas as pd
import matplotlib as mpl
import statsmodels.api as sm
# mpl.use('Agg')
mpl.rcParams['mathtext.default'] = 'regular'
# mpl.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt
font = {'size' : 20}
plt.rc('font... |
<gh_stars>1-10
import numpy as np
from scipy.optimize import linear_sum_assignment
import tensorflow as tf
from network_utils import add_avg_pool, add_conv
import v3.model as v3_model
small_epsilon = 1e-10
def compute_assignments(locations, confidences, gt_bboxes, num_gt_bboxes, batch_size, alpha):
"""
locations... |
<gh_stars>0
from statistics import mean
from typing import Union
from sqlalchemy_utils import ScalarListType
from app import db
from scraper import SportsReferenceScraper
from .record import Record
from .team import Team
class APPoll(db.Model):
__tablename__ = 'ap_poll'
id = db.Column(db.Integer, primary_ke... |
import numpy as np
import pandas as pd
import scipy.signal as scisig
import os
import matplotlib.pyplot as plt
from load_files import getInputLoadFile, getOutputPath, get_user_input
DEBUG = True
SAMPLING_RATE = 8
ONE_MINUTE_S = 60
THIRTY_MIN_S = ONE_MINUTE_S*30
SECONDS_IN_DAY = 24*60*60
STILLNESS_MOTION_THRESHOLD ... |
# 각도별 얼굴 인식
import cv2
import matplotlib.pyplot as plt
from scipy import ndimage
cascade_file = '../datasets/opencv/haarcascade_frontalface_alt.xml'
cascade = cv2.CascadeClassifier(cascade_file)
img = cv2.imread('../datasets/opencv/girl.jpg')
def face_detect(img):
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
... |
# python -m pip install matplotlib
import matplotlib.pyplot as plt
# python -m pip install numpy
import numpy as np
# python -m pip install scipy
from scipy.stats import norm
from scipy import stats
def variavel_aleatoria(nome: str, media: int, desvio_padrao: int, qtd: int):
va = np.sort(np.random.normal(media, d... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 19 11:29:40 2017
@author: daniel
"""
import Tomography as tom
import quPy as qp
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import json
import io
import scipy.constants as co
#import rydpy
c = 299792458 # m/s, speed of light CODATA 2... |
<reponame>ThomasWink/AML_project<filename>predict_cifar_10.py<gh_stars>0
#Original file by Titu1994, changed for this project
import json
import numpy as np
import argparse
import sklearn.metrics as metrics
from sklearn.model_selection import train_test_split
from sklearn.decomposition import PCA
from scipy.optimize i... |
#!/usr/bin/python3
"""
PARCE: Protocol for Amino acid Refinement through Computational Evolution
Script to score an MD trajectory in PDB format
From publication "PARCE: Protocol for Amino acid Refinement through Computational Evolution"
Computer Physics Communications
Authors: <NAME>, <NAME>, <NAME>, <NAME>
Year: 20... |
# builtin lib
import typing as t
# third party lib
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.cluster import MiniBatchKMeans, KMeans
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import MinMaxScaler, Sta... |
"""
Models for classical robust Student-t Linear and Quadratic
Discriminant Analyses.
"""
import numpy as np
from scipy import stats, special
from ._algo_utils import fit_t, fit_t2
from ._models_lda import LDA
class t_LDA(LDA):
"""Student-t based Linear Discriminant Analysis.
See `_models_lda.LDA` for more... |
import pystan
from data_model.abstract_data_model import AbstractDataModel
import numpy as np
from scipy import stats
from numpy.linalg import inv
import torch
import torch.nn
import torch.nn.functional as F
import torch.optim as optim
class LowRankModel(AbstractDataModel):
def __init__(self, dim_z, dim_x, num_t... |
<gh_stars>1-10
"""
Functions to calculate minimum number of ensembles for 2d maps
Notes
-----
Author : <NAME>
Date : 27 June 2019
Usage
-----
[1] computeMean(datain,typemean)
[2] computeSTD(datain,df)
[3] computePooledSD(xstd,ystd,xn,yn)
[4] computeMinEns(future,climo,alpha)
"""
def com... |
# Copyright 2017 Battelle Energy Alliance, 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 applicable law or agreed t... |
'''
Code to generate thresholds for the detector seen in
Ross, Gordon & Tasoulis, Dimitris & <NAME>. (2012). Nonparametric Monitoring of Data Streams for Changes in Location and Scale. Technometrics. 53. 379-389. 10.1198/TECH.2011.10069.
(thresholds are described here)
Paper recommends 10^6 streams generated. Howev... |
from typing import Dict
from scipy.ndimage import gaussian_filter
from oremda import operator
from oremda.typing import JSONType, PortKey, RawPort
@operator
def gaussian_blur(
inputs: Dict[PortKey, RawPort], parameters: JSONType
) -> Dict[PortKey, RawPort]:
sigma = parameters.get("sigma", 0)
image = in... |
import os
import glob
import subprocess
import numpy as np
import scipy.stats
import astropy.io.fits as fits
import matplotlib.pyplot as plt
plt.ion()
def plot_pixel_diff_dist(eimage1, eimage2, bins=50, range=(-3, 3), title=''):
im1 = fits.open(eimage1)
im2 = fits.open(eimage2)
# These are eimages, so the... |
__all__ = [
"marg_gkde",
"marg_named",
"Marginal",
"MarginalNamed",
"MarginalGKDE",
"param_dist",
"valid_dist",
]
import copy
import warnings
from abc import ABC, abstractmethod
from numpy import zeros, array, Inf
from numpy import min as npmin
from numpy import max as npmax
from pandas imp... |
<reponame>maaleske/colour-demosaicing<gh_stars>0
# -*- coding: utf-8 -*-
"""
Bilinear Bayer CFA Demosaicing
==============================
*Bayer* CFA (Colour Filter Array) bilinear demosaicing.
References
----------
- :cite:`Losson2010c` : <NAME>., <NAME>., & <NAME>. (2010).
Comparison of Color Demosaicing Met... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Line-of-sight (LOS) fitting utilities.
"""
from __future__ import (print_function, division)
import warnings
import numpy as np
from scipy.stats import truncnorm
try:
from scipy.special import logsumexp
except ImportError:
from scipy.misc import logsumexp
... |
import cv2
import numpy as np
import sympy as sp
#linePoint_obj = [(200, 200), (300, 200)]
#areaPoint_obj = [(500, 520), (400, 650), (600, 650), (650, 520)]
def is_in_banned_area(center, bboxArea, areaPoint, factor=0.1, img='NULL'):
"""
判断越线
车辆中心坐标,车辆BBox面积,区域,压线检测圆域系数,是否DEBUG
"""
if len(... |
#!/usr/bin/env python3
import os
import os.path as path
import sys
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import reverse_cuthill_mckee
from tensorflow.keras.datasets import cifar100
from tensorflow.keras.models import load_model
from utils import cifar100_names
if len(sys.a... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
@authors: <NAME>, <NAME>
"""
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.support.ui import Select
from selenium import webdriver
from scipy.constants import minute, hour, milli, nano, micro
from pprint import pprint
from chardet import detec... |
<gh_stars>0
import argparse
import logging
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import scipy
from random import sample
from sklearn.manifold import TSNE
from tqdm import tqdm
from typing import Dict
logger = logging.getLogger('sna')
def load_graph(is_weighted:... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
... |
<reponame>Tlili-ahmed/2BiVQA
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy.optimize import curve_fit
import os
from scipy import stats
from scipy.stats import spearmanr
from sklearn.metrics import mean_squared_error
from statistics import mean
import pandas as pd
from scipy.stats i... |
from ML2 import ML2Estimator
import pandas as pd
import numpy as np
import scipy.integrate as integrate
data = pd.read_stata('sipp1991.dta').values
data=np.delete(data,[0,2,11],1)
y_var=data[:,0]
d_var=data[:,8]
x_var=np.delete(data,[0,8],1)
method_list=np.array(["Lasso", "Ridge", "Random Forest", "Boosted Tree", "Tre... |
<filename>inference.py
import os
import cv2
import torch
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from tqdm import tqdm
from network.ocrnet import MscaleOCR
from loss.optimizer import restore_net
from config import cfg, assert_and_infer_cfg
from patcher import split_in_chunks, merge_fro... |
import cv2
from numba import njit
from scipy.ndimage import label
import numpy as np
## trick.py
def thinning(fillmap, max_iter=100):
"""Fill area of line with surrounding fill color.
# Arguments
fillmap: an image.
max_iter: max iteration number.
# Returns
an image.
"""
l... |
<gh_stars>0
# 第8章: 機械学習
#
# 本章では,<NAME>氏と<NAME>氏が公開しているMovie Review Dataのsentence polarity dataset v1.0を用い,文を肯定的(ポジティブ)もしくは否定的(ネガティブ)に分類するタスク(極性分析)に取り組む.
# 70. データの入手・整形
#
# 文に関する極性分析の正解データを用い,以下の要領で正解データ(sentiment.txt)を作成せよ.
#
# rt-polarity.posの各行の先頭に"+1 "という文字列を追加する(極性ラベル"+1"とスペースに続けて肯定的な文の内容が続く)
# rt-polarit... |
<filename>experiments/archive/fancy_mesh_refinement.py<gh_stars>1-10
"""Try out probsolve_bvp."""
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from probnum import diffeq, filtsmooth
from probnum import random_variables as randvars
from probnum import randvars, statespa... |
<reponame>sumon328/Hacktoberfest_contribution_2021
#just estimate
from statistics import mean
estimate=[100,6654,4644,4,485,4,4964,6497,3668,87,2,67,62524,68,8,47,687,5,78,5,4,5,12,1,25,6,4,65,78,5,4,5,54,5,212,54,5]
estimate.sort()
#print(estimate.sort())
tv=int(0.1*len(estimate))
estimate=estimate[tv:]
estimate=estim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.