text string |
|---|
<gh_stars>1-10
import numpy as np
from scipy.interpolate import interp1d
from scipy.ndimage import median_filter
from sklearn.preprocessing import StandardScaler, PolynomialFeatures
from sklearn.linear_model import LinearRegression
from scipy.stats import binned_statistic
def model_ivar(ivar, sky, wave, mask=None):
... |
# create test image based on the percentage of the input events
import os
import sys
import numpy as np
import scipy.misc as spm
import random
random.seed(99999)
#root_path = '/home/anguyen/workspace/paper_src/2018.icra.event.source' # not .source/dataset --> wrong folder
cwd = os.getcwd()
print 'current dir: ', c... |
<reponame>jinlinyi/SparsePlanes
import numpy as np
import argparse, os, cv2, torch, pickle, quaternion
import pycocotools.mask as mask_util
from collections import defaultdict
from tqdm import tqdm
from scipy.linalg import eigh
from scipy.ndimage.measurements import center_of_mass
from scipy.special import softmax
from... |
import sys
from itertools import combinations
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
n = int(sys.stdin.readline().rstrip())
A = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(n, n)
def main():
B = floyd_warshall(A, directed=... |
import math
from sympy import symbols, solve, pprint
p1 = [ 0, 0 ]
p2 = [ 6, 504 ]
m = None
m1 = ( p2[ 1 ] - p1[ 1 ] )
m2 = ( p2[ 0 ] - p1[ 0 ] )
def line( x0, y0, m ):
x, y = symbols( 'x, y' )
eq = m * ( x - x0 ) + y0 - y
sln = solve( eq, y )
return 'y = {0}'.format( sln[0] )
if __name__ == '__main__':
if... |
<reponame>AayushKucheria/digital-health
# -*- coding: utf-8 -*-
"""Futurice Digital Healthcare 3
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1jDNS-UMNCSLa4mE66IwM5w97AY-yWllH
Instal Libraries
"""
!pip install PyWavelets
!pip install tslearn
"""Im... |
<reponame>trajanov/scattertext
from pandas import DataFrame
from scipy.sparse import issparse
from sklearn.preprocessing import RobustScaler
from scattertext.representations.Doc2VecBuilder import Doc2VecBuilder
from scattertext.termscoring.RankDifference import RankDifference
from scattertext.categoryprojector.Categor... |
<filename>source_code/seq_df_conditon2Mpost.py<gh_stars>1-10
## Author: <NAME>
## Contact: <EMAIL>
## Date: Feb 23, 2019
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
def sedf_post_sample_rtn(cca_comp, h_c,d_c, d_obs_c, c_dd_star):
'''This is the function to sample posterior in C... |
import os
import math
from math import sqrt
import ctypes
from datetime import datetime
import random
from psychopy import visual
from psychopy.visual import circle
from PIL import Image
from PIL import ImageFilter
import numpy as np
from numpy.random import randint, normal, shuffle
from numpy import (mod, sin, cos, t... |
""" Module to plot and save the results of the experiments
on HCP data """
#Author: <NAME> (<EMAIL>)
#Date: 22 February 2021
import numpy as np
import matplotlib.pyplot as plt
import pickle
import pandas as pd
import xlsxwriter
import os
import sys
from scipy import io
def find_relfactors(model, res_dir, BestMod... |
#
# Solve -laplace(u) = f in (0, 2*pi)x(-1, 1)
# with T(u) = 0 on y = -1 and y = 1
# and periodicity in the x direction
#
# We shall combine Fourier and Shen basis
from __future__ import division
from sympy import symbols, integrate, pi, lambdify, Number
from numpy.polynomial.legendre import leggauss ... |
from typing import Tuple
import sys
import pytest
from scanpy import settings as s
from anndata import AnnData
from scipy.sparse import issparse
import numpy as np
from matplotlib.testing.compare import compare_images
import matplotlib.pyplot as plt
from squidpy.im import ImageContainer
from tests.conftest import D... |
#!/usr/bin/env python
# encoding: utf-8
import json
import csv
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.patches as mpatches
from itertools import combinations
from scipy.optimize import curve_fit
from scipy.spatial.distance import cosine, euclidean, pdist, sq... |
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import cumtrapz as cumtrapz
from scipy.constants import c as c_luz #metros/segundos
c_luz_km = c_luz/1000
import sys
import os
from os.path import join as osjoin
from pc_path import definir_path
path_git, path_datos_global = definir_path()
... |
"""Global Vector Embeddings.
"""
"""
Copyright 2017 <NAME>. See also NOTICE.md.
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 a... |
"""
You will need to run 'run_csv()' functiop. It will find all .csv files in the
directory. You will need to get rid of everything but leave header, time and dA
columns, see files in the folder.
It will be more work to have this code to read excel files.
Date: July 10, 2018
Authors: By <NAME>, <NAME>
"""
... |
'''
choose_probes.py
Choose probes across target sets, as evenly spaced as possible.
Check for heterodimer clashes when adding probes to the set.
'''
import sys
import numpy as np
from Bio import SeqIO
import pandas as pd
import os
import math
import primer3
import matplotlib.pyplot as plt
import logging
from scipy imp... |
<reponame>DomInvivo/pna<gh_stars>0
import time
import os
import pickle
import numpy as np
import dgl
import torch
from scipy import sparse as sp
import numpy as np
class load_SBMsDataSetDGL(torch.utils.data.Dataset):
def __init__(self,
data_dir,
name,
split):
... |
<filename>policies.py
# Copyright 2021 DeepMind Technologies Limited
#
# 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 a... |
import numpy as np
import ast
import plotly.graph_objects as go
from scipy.signal import medfilt, detrend
from abc import ABCMeta, abstractmethod
from importlib import import_module
from ..signals.bvp import BVPsignal
from ..utils import filters, printutils
from ..utils import detrending
def methodFactory(methodName, ... |
import numpy as np
import pandas as pd
import math
from scipy.stats import norm
## calculate zscore
def func_zscore(df,var_name,l_name,m_name,s_name,newvar_name1,newvar_name2,newvar_name3):
df.ix[(df[var_name] > 0) & (abs(df[l_name]) >= 0.01),newvar_name1] = ((df[var_name] / df[m_name]) ** df[l_name] -1)/(d... |
import numpy as np
class EMatch:
"""
Construct a class to compute E_Match as in formula 10 using a function to pass directly the personalized blendshapes
in delta space delta_p (dp)
k:= num_of_blendshapes
f:= num_frames
n:= num_features
"""
def __init__(self, tckf, uk, daf):
... |
import matplotlib.pyplot as plt
import numpy as np
import datetime
import time
from scipy import interpolate
sondefile = '20210308-093511-dreams-manta-cleaned.csv'
gpsfile = 'navfix-log.txt'
line = True
gps_vec = []
sonde_vec = []
with open(sondefile) as fp:
while line:
line = fp.readline().rstrip()
... |
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import linregress
def extrapolate(x, y, start, end):
# first, determine the slope of the line
(slope, intercept, rvalue, pvalue, stderr) = linregress(x, y)
# then, build the x and y 'coordinates' based on the required range
x_fut = [i... |
##########################################################################
#
# This file is part of Lilith
# made by <NAME> and <NAME>
#
# Web page: http://lpsc.in2p3.fr/projects-th/lilith/
#
# In case of questions email <EMAIL>
#
#
# Lilith is free software: you can redistribute it and/or modify
# it under ... |
#!/usr/bin/env python3
# TODO: Update interface usage.
import sys
sys.path.append("..")
# Ignore warnings.
import warnings
warnings.filterwarnings("ignore")
import pickle
import logging
import numpy as np
import pandas as pd
from os import listdir
from sklearn.model_selection import train_test_split
from sklearn.... |
# coding: utf-8
# In[2]:
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sklearn.metrics import mean_squared_error, r2_score
from scipy import stats
# Import the dataset
dataset = pd.read_csv('train.csv')
full_dataset = dataset.iloc[:, :].v... |
"""
Derived module from dmdbase.py for higher order dmd.
Reference:
- <NAME>, <NAME>, Higher Order Dynamic Mode Decomposition.
Journal on Applied Dynamical Systems, 16(2), 882-925, 2017.
"""
from past.utils import old_div
import numpy as np
import scipy as sp
from scipy.linalg import pinv2
from mosessvd imp... |
"""Scorers, or acquisition functions in the context of Bayesian optimization.
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
Citrine Informatics 2019-2020
"""
from abc import ABCMeta, abstractmethod
from typing import Sequence
import math
from scipy.specia... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by HazzaCheng on 2019-09-26
import librosa
import numpy as np
import random
import keras.backend as K
from tensorflow.python.keras import Input
from tensorflow.python.keras.engine import InputLayer
from tensorflow.python.keras.engine import InputSp... |
<gh_stars>1-10
import numpy as np
from scipy.fft import rfft, rfftfreq
import pandas as pd
def HarmonicRatio(data,ml=False):
# calculate fft for each axis
ampl = rfft(data)
freq = rfftfreq(len(data),1/100) # 100 is the sampling frequency
# find dominant frequency
dom_freq = freq[np.argmax(ampl)]
... |
<gh_stars>1-10
import cma
import tqdm
from pytorch_pretrained_biggan import BigGAN, truncated_noise_sample, BigGANConfig
import torch
import torchvision
from torchvision.transforms import ToPILImage
from torchvision.utils import make_grid
from torch.optim import SGD, Adam
import os
import re
import sys
import numpy as ... |
<reponame>mi-erasmusmc/Sard<filename>models/RegressionGen.py
<<<<<<< HEAD
"""
Linear model from github.com/clinicalml/omop-learn
"""
import numpy as np
import scipy.sparse
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import FunctionTransformer
===... |
from scipy import *
from scipy import optimize
# Declare the experimental data
x = array([0, 10, 20, 50, 100, 200, 400])
y = array([0, 9, 10, 17, 18, 20, 19])
# Define the objective function
def residuals (p):
[vmax,Km] = p
return y - vmax*x/(Km+x)
# Fit the model to the data
output = optimize.leastsq (residu... |
"""Script to run pose and shape evaluation for different datasets and methods."""
import argparse
import os
from datetime import datetime
import time
from typing import List, Optional, Tuple
import random
import sys
from scipy.spatial.transform import Rotation
import numpy as np
import matplotlib.pyplot as plt
import ... |
<reponame>zeta1999/minicore
from collections import Counter
import numpy as np
from scipy.io import mmread, mmwrite
import scipy.sparse as sp
import sys
import itertools
import minicore
def xopen(x):
if x.endswith(".xz"):
import lzma
return lzma.open(x)
elif x.endswith(".gz"):
import g... |
from __future__ import division
from PIL import Image
from sympy.solvers import solve
from sympy import Symbol, Eq, solveset
import requests
from sqlalchemy import and_
from scraper.database import init_db, db_session
from scraper.models import Lecture, Practical
from scraper.captcha import captcha_solver
def bunk_lec... |
import numpy as np
import scipy as sp
from functools import reduce
import time
import os
import sys
import tempfile
import h5py
import pyscf
from pyscf import gto, scf
from pyscf import mcscf
from pyscf.mcscf import addons
from pyscf.dmrgscf import dmrgci
from pyscf import dft
from pyscf.dft import numint
class MCP... |
"""Load the LibriSpeech ASR corpus."""
import os
import sys
import subprocess
from tqdm import tqdm
from scipy.io import wavfile
from python.params import MIN_EXAMPLE_LENGTH, MAX_EXAMPLE_LENGTH
from python.dataset.config import CACHE_DIR, CORPUS_DIR
from python.dataset import download
from python.dataset.txt_files i... |
<filename>word2vec/evaluation.py
import numpy as np
from scipy.stats import spearmanr, pearsonr
class WordSim:
def __init__(self, word1, word2, scores):
self.word1 = word1
self.word2 = word2
self.scores = scores
def evaluate(self, emb, r='spearman'):
word1_index = np.array([w.i... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import sklearn.gaussian_process as gp
import scipy.linalg as la
from scipy.stats import gaussian_kde
def rw_metropolis_hastings(f,llh,lpr,cov,x0,n,burn_in,update=50,verbose=False,debug=False):
X = [x0]
y = f(x0)
loglikelihood = ... |
<gh_stars>0
import sympy as sp
import numpy as np
def cd(f, x, xStart, h= 1.0E-4):
df = (f.evalf(subs={x : xStart + h}) - f.evalf(subs={x : xStart - h}))/(2*h)
return df;
def cd2(f, x, xStart, h= 1.0E-4):
df = (f.evalf(subs={x : xStart + h}) - 2*f.evalf(subs={x : xStart}) + f.evalf(subs={x : xStart - h}))... |
<gh_stars>1-10
#!/usr/bin/env python3
"""This module reads in calibration metadata from file in the early fases of LOFAR. In the future this should be replaced by reading the metadata from the files.
.. moduleauthor:: <NAME> <<EMAIL>>
Modified by <NAME> for use with LOFAR for Lightning Imaging
"""
## Imports
import... |
from scipy import signal
def execute(context):
if not context.data is None \
and not context.freq is None:
N = context.data.size
T = context.freq
b, a = signal.butter(4, [0.02, 0.1], 'band')
context.data = signal.lfilter(b, a, context.data)
context.prev = __name__ |
<reponame>Ignacio-Ibarra/text_mining_squared
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 6 11:19:05 2021
@author: <NAME>
"""
#Paquetes
import pandas as pd
import numpy as np
import random
import os
import time
import matplotlib.pyplot as plt
from functools import reduce
from collections import Counter
#Ruta direc... |
<reponame>alisonpeard/spatial-louvain<gh_stars>0
"""
Module for creating the SpatialGraph class.
The SpatialGraph class is a child class of NetworkX's Graph class
and inherits all its functionality. It has the additional
attributes dists, locs and part which to store the
pairwise distances between nodes, node spatial ... |
<filename>model.py<gh_stars>0
#import
import csv
import cv2
import numpy as np
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda, Conv2D, AveragePooling2D, Cropping2D
from keras.callbacks import EarlyStopping
from scipy import ndimage
#define correction factor for left and right image... |
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
from __future__ import division, print_function
# viability imports
import pyviability as viab
from pyviability import helper
from pyviability import libviability as lv
from pyviability import tsm_style as topo
# model imports
import examples.AWModel as awm
import examp... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 09:08:22 2020
@author: Shane
"""
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import scipy
import scipy.stats
import glob
import statsmodels.stats.api as sms
#import matplotlib for plotting
import matplotlib.pyplot as plt
... |
<gh_stars>1-10
import warnings
import numpy as np
import pandas as pd
from scipy.linalg import eigh
from netanalytics.graph import Graph
from netanalytics.degree import laplacian_matrix, degree_distribition_distance
from netanalytics.graphlets import GDD_agreement, GCD
from netanalytics.subnetworks import common_sub... |
<reponame>yuanfangtardis/vscode_project
##########################################################################
#
# This file is part of Lilith
# made by <NAME> and <NAME>
#
# Web page: http://lpsc.in2p3.fr/projects-th/lilith/
#
# In case of questions email <EMAIL>
#
#
# Lilith is free software: you can redi... |
<reponame>nakul3112/Logistic_Regression
import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy
from PIL import Image
from scipy import ndimage
import glob
import sklearn
from sklearn.model_selection import train_test_split
def load_dataset(database_path):
# open dataset
dataset_db = h5... |
<reponame>diagnosisda/dxda<gh_stars>1-10
# ETH Zurich, IBI-CIMS, <NAME> (<EMAIL>)
# Utils for PHM datasets
import numpy as np
import tensorflow as tf
#import matplotlib.pyplot as plt
from scipy.io import loadmat
from glob import glob
def get_cwru_list(load, dir="./data/cwru/", mode="all"):
""" Get file a list of... |
"""
Tests functions in data_generator.py
"""
import unittest
import numpy as np
from scipy.integrate import quad
import net_est.data.data_generator as data_gen
class TestDataGenerator(unittest.TestCase):
def testGenerateInput(self):
with self.assertRaises(TypeError):
data_gen.generate_traini... |
import argparse
import numpy as np
try:
import scipy.optimize as opt
except:
print('scipy not available. Will not run fit to estimate survey time.')
parser = argparse.ArgumentParser(description='Parameters for VLASS design calculator')
parser.add_argument('--fov', type=float, help='S-band primary beam ... |
import matplotlib.pyplot as plt
import numpy as np
import pathlib
import pandas as pd
import random
import seaborn as sns
import sys
import warnings
from numba import jit
from numpy import linalg as la
from scipy.special import loggamma
from scipy.stats import chi2
from scipy.linalg import toeplitz, solve
from sklearn... |
import tensorflow as tf
import numpy as np
import random
import math
import PIL.Image
from scipy.ndimage.filters import gaussian_filter
import vgg16
vgg16.download()
model = vgg16.VGG16()
def load_image(filename):
image = PIL.Image.open(filename)
return np.float32(image)
def save_image(image, filename):... |
import sys
import numpy as np
from matplotlib import pyplot as pl
from scipy.spatial.distance import pdist, squareform
from scipy.spatial import cKDTree as kdtree
def FitPlane(pnts):
"""
Given a set of 3D points pnts.shape = (x, 3),
return the normal vector (nx, ny, nz)
"""
c = pnts.mean(axis = 0)
... |
<reponame>AlanMartines/gold-ratio
# Notes:
# (0,0) is upper left corner
# distance from the top of the nose to the centre of the lips should be 1.618 times the distance
# from the centre of the lips to the chin
# ---> top of nose is the 1st point, centre of lips is the half-way point of the y-component of the 10th po... |
<gh_stars>1-10
# Copyright (c) 2014, <NAME>, <NAME>
# Distributed under the terms of the GNU General public License, see LICENSE.txt
import numpy as np
from scipy import stats
from scipy.special import erf
from ..core.model import Model
from ..core.parameterization import ObsAr
from .. import kern
from ..core.paramete... |
<gh_stars>1-10
from config import *
import pandas as pd
import numpy as np
import networkx as nx
import scipy.stats
from sklearn import metrics
import bct
import matplotlib.pyplot as plt
def get_adjmtx(corrmtx,density,verbose=False):
assert density<=1
cutoff=scipy.stats.scoreatpercentile(corrmtx[np.... |
<filename>shared/cross_validation.py<gh_stars>1-10
# Copyright 2020 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 r... |
import json
from concurrent.futures import ProcessPoolExecutor, wait, ALL_COMPLETED
from itertools import product
import numpy as np
import pandas as pd
import psopy
import scipy.optimize as scopt
from src import config, arguments
from src.plot import plot
from src.utils.goal_function import goal_function
def main(... |
<gh_stars>0
"""
Predict sample temperatrue as function of actual temperature measured ny
temperature controller.
<NAME>, Dec 14, 2016
"""
from numpy import *
__version__ = "1.0"
from table import table
from logging import info
import logging; logging.basicConfig(level=logging.INFO)
from time_string import timestamp
fro... |
# TODO merge common tests and Natural Language ones
# default libraries
import os
# user interface
import tkinter as tk
from datetime import datetime
from tkinter import filedialog
from msvcrt import getch
import random
import numpy as np
from scipy.io.wavfile import read, write
from .ABC_weighting import a_weight
#... |
"""
Multivariate Wald-Wolfowitz test for two samples in separate CSV files.
See:
Friedman, <NAME>., and <NAME>.
"Multivariate generalizations of the Wald-Wolfowitz and Smirnov two-sample tests."
The Annals of Statistics (1979): 697-717.
Given multivariate sample X of length m and sample Y ... |
import time
import ctypes as ct
from numba import njit, prange
import numpy as np
from scipy.sparse import spdiags, diags
from scipy.sparse.linalg import spsolve
from scipy import interpolate
from consav.misc import elapsed
# local
import modelfuncs
import income_process
eps_low = 1e-12
##############
# 1. generi... |
<reponame>IBM/oct-glaucoma-vf-estimate<filename>python_code/oct_dataflow_tp.py
import cv2
import random
from PIL import Image
import pickle
import random
from glob import glob
from tensorpack.utils.gpu import get_num_gpu
import matplotlib.pyplot as plt
import numpy as np
import sys
import os
from tensorpack import *
im... |
# Experiment to perform semantic correlation matching (SCM)
# take care of some imports
from scipy.io import loadmat
import numpy as np
from sklearn.metrics import label_ranking_average_precision_score, average_precision_score
from crossmodal import correlation_matching, semantic_matching
# read features data from... |
<gh_stars>0
"""This module provides the classes QuerySpan and the OptimizerConfiguration"""
import storage
import pandasql as pdsql
import statistics
import progressbar
from custom_logging import bao_logging
from presto_query_optimizer import always_required_optimizers
from session_properties import BAO_DISABLED_OPTIMI... |
<gh_stars>1-10
import numpy as np
import scipy.signal
def filter_frequency_response(a, b, w=np.arange(0, np.pi, 0.1)):
"""
Function that generates the frequency response of a digital filter given the coeficients of
polynomials a0 + a_1*x + a_2*x^2 + ... and b0 + b_1*x + b_2*x^2 + ...
This function eva... |
import datetime
import os
import uuid
from scipy.stats import beta
import json
from random import shuffle
from flask import Flask, send_from_directory, jsonify, make_response, request
from pymongo import MongoClient
from pymongo.collection import Collection
app = Flask(__name__, static_url_path="")
total_memes = 757... |
# Copyright (c) 2018, Lehrstuhl für Angewandte Mechanik, Technische Universität München.
#
# Distributed under BSD-3-Clause License. See LICENSE-File for more information
#
#
from unittest import TestCase
import numpy as np
from scipy.linalg import qr, lu_factor, lu_solve
from scipy.sparse import csr_matrix
from sci... |
<filename>Sequences/Combinatorics/Partitions.py
from Sequences.Figurate import gen_pentagonal
from Sequences.Simple import naturals, powers, evens
from Sequences.Divisibility import primes
from Sequences.Recurrence import tribonacci
from Sequences.Manipulations import offset
from Sequences.MathUtils import factors
fro... |
<filename>merge.py<gh_stars>1-10
"""
<NAME> - <EMAIL>
"""
import os, re, sys
import array
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid import AxesGrid
# Scipy extras
from scipy.integrate import simps, cumtrapz, trapz
from scipy.interpolate import interp1d
from s... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 3 14:10:12 2019
@author: Dominic
"""
from numba import njit, float64, int64
from scipy import integrate
from math import exp, log, pi
import numpy as np # I USE NUMPY FOR EXP, LOG AND SQRT AS THEY HANDLE IMAGINARY PARTS
from ..finutils.FinGlobalVariables import gDaysI... |
<filename>spb/interactive.py
import numpy as np
import param
import panel as pn
from sympy import latex, Tuple
from spb.series import (
InteractiveSeries,
_set_discretization_points
)
from spb.ccomplex.complex import _build_series as _build_complex_series
from spb.vectors import _preprocess, _build_series as _b... |
from scipy.stats import norm
from statsmodels.discrete.discrete_model import Probit
from statsmodels.tools.tools import add_constant
import numpy as np
from tqdm import tqdm
import random
import warnings
warnings.filterwarnings("ignore")
def im(param):
return np.true_divide(norm.pdf(param), norm.cdf(param))
d... |
# coding: utf-8
############################################
## Load Packages Used
############################################
# built-in package
import os
import sys
sys.path.append('/Users/chenshan/google_driver/github/ipython-notebook-spark/spark-1.6.0-bin-cdh4/spark-1.6.0-bin-cdh4/python')
sys.path.append('/Us... |
from .adt import ADT
from .adt import memo as ADTmemo
from .prelude import *
from . import atl_types as T
from . import builtins as B
from .frontend import AST
from fractions import Fraction
# --------------------------------------------------------------------------- #
# ------------------------------------------... |
<reponame>MStarmans91/WORC<filename>WORC/classification/trainclassifier.py
#!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... |
<reponame>rebecarivas/Projeto-IC-SENAC
import matplotlib.pyplot as plt
from scipy import stats
x = [315, 960, 1635]
y = [1000, 3000, 5000]
#parâmetros importantes da regressão linear (y = a * x +b): slope= a; intercept =b; r= o R ao quadrado da reta; std_err = erro padrão
slope, intercept, r, p, std_err = stats.linre... |
<filename>scorelib/score.py
"""Functions for scoring paired system/reference RTTM files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
import numpy as np
from scipy.linalg impor... |
# Copyright 2022 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>research/develop/2016-11-24-irio-traveled-speeds-between-meals.py
# coding: utf-8
# # Traveled speeds between meals
#
# The Quota for Exercise of Parliamentary Activity says that meal expenses can be reimbursed just for the politician, excluding guests and assistants. Creating a feature with information of... |
from datetime import *
import datetime
from numpy import *
import statsmodels.api as sm
import statsmodels.tsa.stattools as ts
import scipy.io as sio
import pandas as pd
def normcdf(X):
(a1,a2,a3,a4,a5) = (0.31938153, -0.356563782, 1.781477937, -1.821255978, 1.330274429)
L = abs(X)
K = 1.0 ... |
#<NAME> - 180401060
from sympy import Symbol
def notPoly_integrating(a, b, inDatas):
integral = 0
deltax = 1
n = int((b-a)/deltax)
for i in range(n-1):
integral += deltax * (inDatas[a] + inDatas[a+deltax])/2
a += deltax
return integral
def desired_poly_integrating(PolyCoefficient... |
<reponame>okkhoury/Sudoku-Solver
from keras.models import Sequential
from keras.layers import Dense
from keras.models import model_from_json
import numpy as np
import skimage
from skimage import io
import matplotlib.pyplot as plt
from skimage import transform
from skimage.morphology import skeletonize_3d
import scipy
... |
import numpy as np
from tqdm import tqdm_notebook as tqdm
import scipy as sp
import numba
def to_uint8(img):
""" Convert to uint8 and clip"""
return np.clip(img, 0, 255).astype(np.uint8)
def laplacian(img):
""" Laplacian """
return (np.roll(img, 1, 0) + np.roll(img, -1, 0) +
np.roll(img, 1... |
<reponame>MrEliptik/DMFinalProject
import cv2
import os
import pickle
import numpy as np
import imutils
import dlib
from scipy.spatial import distance
from imutils import paths
from imutils import face_utils
def getFacialFeatures(img, visualize=False):
# initialize dlib's face detector (HOG-based) and then create
... |
from collections import defaultdict
import numpy as np
import pandas as pd
from scipy.sparse import coo_matrix, hstack
class Encoder():
"""
Helper class to encode levels of a categorical Variable.
"""
def __init__(self):
self.column_mapper = None
def fit(self, levels):
"""
... |
"""
Script calculates trends for temperature profiles over the polar cap. We
assess warming contributions from SST and sea ice compared to reanalysis.
Notes
-----
Author : <NAME>
Date : 17 July 2019
"""
### Import modules
import datetime
import numpy as np
import matplotlib.pyplot as plt
import cmocean
from... |
from itertools import chain, combinations
from typing import List, Tuple
from numpy import linalg
from scipy import stats
from scipy.stats import chi2
from src.regressions import least_squares, ridge_regression
from src.evaluation_metrics import *
from src.helpers import *
import math
import copy
def confidence_in... |
<filename>homeproc/qcm/traceproc.py
"""
Module comprising processing of QCM traces and markers.
@author: Dr. <NAME>
@date: Jan 2021
"""
import pathlib
import numpy as np
import pandas as pd
import scipy.signal as sig
import plotly.graph_objects as go
from dateutil import parser
from scipy.signal import find_peaks, p... |
import matplotlib.pyplot as plt
import seaborn as sb
import sys
import scipy
import scipy.signal
import matplotlib.dates as mdates
import pandas as pd
import numpy as np
import datetime
from datetime import date, timedelta
sys.path.append('/Users/hn/Documents/00_GitHub/Ag/NASA/Python_codes/')
sys.path.append('/home/hno... |
import os
import numpy as np
import scipy
from numpy.fft import fft2, ifft2
from scipy.signal import gaussian, convolve2d
import matplotlib.pyplot as plt
import collections
import random as rand
def patchify(img, patch_shape):
X, Y = img.shape
x, y = patch_shape
shape = (X - x + 1, Y - y + ... |
import click
import numpy as np
import sys
from scipy import stats
AUTO_XLIMITS = {
'cdf': (0, 10000, .05),
'pdf': (-10000, 10000, .05),
'ppf': (0, 1, .01)
}
def get_dist_callable(distribution):
try:
return getattr(stats, distribution)
except AttributeError:
click.echo('scipy.stat... |
"""
Main business model for the application
The module shouldn't depend on other parts of the package.
"""
import re
import collections
import fractions
from datetime import datetime
from dataclasses import dataclass
from typing import Any, Callable, cast, Dict, List, Optional, Set, Tuple, TypeVar
from typing_extensi... |
<filename>lib/datasets/imagenet.py
import os
from datasets.imdb import imdb
import datasets.ds_utils as ds_utils
import xml.etree.ElementTree as ET
import numpy as np
import scipy.sparse
import scipy.io as sio
import utils.cython_bbox
import cPickle
import subprocess
import uuid
from voc_eval import imagenet_eval
from ... |
<reponame>nmardirossian/pyscf
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''
Non-relativistic restricted Hartree-Fock with point group symmetry.
The symmetry are not handled in a separate data structure. Note that during
the SCF iteration, the orbitals are grouped in terms of symmetry irreps.
But the orbi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.