text string |
|---|
<gh_stars>0
from sklearn import datasets
from sklearn.svm import SVC
from scipy import misc
from sklearn import tree
import subprocess
def treeMaker():
clf = tree.DecisionTreeClassifier()
digits = datasets.load_digits()
clf = clf.fit(digits.data, digits.target)
tree.export_graphviz(clf,
... |
import scipy.optimize
import numpy as np
import torch
from ..functional import nac_weight, sparsity_error
from ..abstract import ExtendedTorchModule
from ._abstract_recurrent_cell import AbstractRecurrentCell
class PosNACLayer(ExtendedTorchModule):
"""Implements the NAC (Neural Accumulator)
Arguments:
... |
import numpy as np
from scipy import optimize
import fem
import graph
import os
def lagrange(x, w, ijt, ijc, nod, nelt, nelc, lc_bar): # 停留条件関数
r[:, 0], r[:, 1], r[:, 2] = x[:nod], x[nod:nod * 2], x[nod * 2:nod * 3]
lam = x[nod * 3:]
lght, lghc = fem.length(r, ijt, ijc, nelt, nelc)
nablaLt, nablaLc =... |
from matplotlib import pyplot as plt
import numpy as np
import pymc as pm
from scipy.stats.mstats import mquantiles
from IPython.core.pylabtools import figsize
def logistic(x, beta, alpha=0):
return 1.0 / (1.0 + np.exp(np.dot(beta, x) + alpha))
def main():
np.set_printoptions(precision=3, suppress=True)
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Jun 3, 2020
@author: <NAME> <<EMAIL>>
"""
import numpy as np
from scipy import sparse
from sknetwork.topology.dag_core import fit_core
from sknetwork.utils.base import Algorithm
class DAG(Algorithm):
"""Build a Directed Acyclic Graph from an adjacency... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 16 22:22:02 2022
@author: dhulls
"""
# import numpy as np
from numpy import log, exp, sqrt
import torch, time, sys
# import autograd
import autograd.numpy as np
import matplotlib.pyplot as plt
# import matplotlib.image as mpimg
import scipy.integra... |
import numpy as np
import os
import scipy.io
import scipy.sparse as sp
import torch
from helper import (check_equal, check_isclose, save_return_value,
write_equal, check_nans, print_small, print_close_equal)
def test_sage_linear():
all_close = 1.0
device = torch.device("cuda" if torch.cuda... |
<filename>zenml/hypothesis_tests/t_test.py
from scipy.stats import ttest_ind, ttest_rel
from ..utils import is_valid_alt_hypothesis, get_p_value, effect_size, get_power
def t_test(alt_hypothesis, intervention_data,
no_intervention_data, variance_assumption='equal',
is_paired=False):
"""
... |
<filename>examples/solvers using low level utilities/dumb_test.py
import numpy as np
import scipy as sp
import scipy.sparse
import scipy.special
import scipy.optimize
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.path
import time
plt.ion()
import pybie2d
NB = 5000
helmholtz_k = 100.0
squi... |
import time
import os
import numpy as np
import scipy
from npMatrix3d import *
from npMatrix2d import *
# ============================================================================
#
# This file contains code for all Fisher Scoring based (univariate/"one-
# model") parameter estimation methods developed during the c... |
import numpy as np
from scipy import stats
from scipy.special import gamma, hyp1f1
# Helper function
def r2(pos, pos_src):
r2 = 0.1**2
for i in range(len(pos_src)):
r2 += (pos[i]-pos_src[i])**2
return r2
# Pandel time distribution class convolved with Gauss
class pandel():
def __init__(self,... |
import os
import numpy as np
from pathlib import Path
from hmdscollagen.training.session import init_experiment
from hmdscollagen.data.utilities import load, save, print_orthogonal
from scipy.ndimage import zoom
if __name__ == "__main__":
# Initialize experiment
args, config, device, snapshots_dir, snapshot_n... |
#!/usr/bin/env python
# Models for generating and fitting networks
# <NAME>, 5/11/2012
from __future__ import division
import numpy as np
import scipy.optimize as opt
from scipy.stats import norm
from scipy.linalg import inv, solve
from time import time
from itertools import permutations
from Utility import logit, i... |
<reponame>andrenarchy/pseudopy
import numpy
from matplotlib import pyplot
import shapely.geometry as geom
from shapely.ops import cascaded_union
from .utils import get_paths, plot_finish
class NormalEvals(object):
def __init__(self, evals):
self.evals = evals
def plot(self, epsilons, **kwargs):
... |
<gh_stars>1-10
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright 2019.12.19 <NAME>
# Distributed under terms of the MIT license.
"""
A module to analyze results of metadynamics
Available class:
GaussianC : This class is performed as gaussian function.
Metad_result : This class... |
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.views.generic.edit import CreateView
from django.views.generic.list import ListView
from django.views.generic.detail import Detail... |
# coding: utf-8
# In[1]:
# Load dependencies
import pandas as pd
import sys
sys.path.insert(0,'../../statistics_helper/')
from openpyxl import load_workbook
from excel_utils import *
# # Estimating the biomass of Cnidarians
# To estimate the total biomass of cnidarians, we combine estimates for two main groups whi... |
<gh_stars>1-10
import os
import sys
import numpy as np
from scipy.interpolate import BSpline
__author__ = "<NAME> <<EMAIL>>"
__version__ = "v1.0"
class SingleSFFTConfigure_Numpy:
@staticmethod
def SSCN(NX, NY, KerHW, KerPolyOrder=2, BGPolyOrder=2, ConstPhotRatio=True, NUM_CPU_THREADS_4SUBTRACT=8):
im... |
from math import sin, pi
import numpy as np
from sympy import Symbol, integrate
# function for the trapezoidal rule
def Simpson(a,b,f,n):
h = (b-a)/float(n)
sum = f(a)/float(2);
for i in range(1,n):
sum = sum + f(a+i*h)*(3+(-1)**(i+1))
sum = sum + f(b)/float(2)
return sum*h/3.0
# function to integ... |
<filename>unused/unused.py
import numpy as np
import utils
import itertools
from shapely.geometry import Polygon
import pandas as pd
# import collections
import utils_vis as vis
import scipy
# import matplotlib.pyplot as plt
import torch
def dist_score(B, B_data, DIST_MEAS='xyw', DIRECTION=True):
'''
compute e... |
import pytest
import numpy as np
import cmath
import math
from numpy.testing import assert_almost_equal
def test_phasor():
from electricpy.phasor import phasor
magnitude = 10
# basic angles test case 0
z1 = phasor(magnitude, 0)
z2 = phasor(magnitude, 30)
z3 = phasor(magnitude, 45)
z4 = phas... |
#!/usr/bin/python3
'''
Abstract:
This is a program for :
1. Choose a source and corresponding Av.
2. Find the most suitable template for that source.
3. Save result
Usage:
fit_SED.py [SED table] [Av table] [Star template]
Editor:
Jacob975
##################################
# Python3 ... |
<filename>datagen/img_generator/pose_sampler.py
import cv2
import numpy as np
import os
import sys
from os.path import isfile, join
# hahahaha
import airsimdroneracingvae as airsim
# print(os.path.abspath(airsim.__file__))
from airsimdroneracingvae.types import Pose, Vector3r, Quaternionr
import airsimdroneracingvae.ty... |
from fractions import Fraction
def solution(pegs):
"""
Main driver function for the solution.
:param n: List of peg positions
:type n: List[int]
:return: Radius of first gear if exists, [-1, -1] otherwise
:rtype: List[int, int]
"""
val = 0
multiplier = -1
total_pegs = len(p... |
from math import dist
from sys import path
from scipy.spatial import distance
path.append(".")
from shared.utils import *
from shared.serial_setup import *
from measurer import Measurer
from time import sleep
print("""
__ ___ _ _ _
/\ /\/ / / __\___ | | | ___ ___| |_
\ \ / / / / ... |
<reponame>ChenQingya/instagan
import argparse
import numpy as np
import scipy.io as sio
from pathlib import Path
from tqdm import tqdm
from PIL import Image
def main():
parser = create_argument_parser()
args = parser.parse_args()
generate_ccp_dataset(args)
def create_argument_parser():
parser = argparse.Argument... |
<reponame>GVolM/Serffser_symulation
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 10 10:18:35 2019
@author: vgrigore
surf model
"""
import matplotlib.pyplot as plt
from scipy import optimize
from scipy.interpolate import interp1d as inter
import numpy as np
class surfboard_shape(object):
def __init__(... |
<filename>halotools/empirical_models/assembias_models/correlation_assembias.py
r"""
This module contains the `~halotools.empirical_models.CorrelationAssembias` class.
This module implements an assembly bias model originally designed by <NAME>.
It works by imposing a correlated noisy percentile on the secondary paramete... |
import numpy as np
from scipy import signal
def modulate(data, sample_rate):
modulator_frequency = sample_rate
carrier_frequency = 21000.0
modulation_index = 1.0
time = np.arange(sample_rate) / sample_rate
modulator = data # np.sin(2.0 * np.pi * modulator_frequency * time) * modulation_index
... |
<filename>diff_mone_analysis.py
import numpy as np
#import h5py
import pickle
#from scipy.io import loadmat, savemat
from scipy import stats
import statsmodels.stats.multitest as smt
from scipy.special import loggamma as gammaln
import matplotlib.pyplot as plt
from venn import venn
cmaps = ["cool", list("rgb"), "plasma... |
"""
Email: <EMAIL>
"""
import cv2
import numpy as np
from scipy import ndimage
import imutils
class Detect:
def __init__(self, imageName):
self.image = cv2.imread(imageName, cv2.IMREAD_COLOR)
self.grayimage = cv2.cvtColor(self.image, cv2.COLOR_BGR2GRAY)
# Detect Hough Circles
def detectC... |
# Copyright 2019 <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, softwar... |
import pandas as pd
from scipy.stats import randint as sp_randint, rv_continuous
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import SGDClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier, RadiusNeighborsClassifier
from sklearn.svm im... |
<reponame>clausmichele/openeo-python-client<filename>examples/udf/smooth_savitzky_golay.py
from typing import Dict
import xarray
from scipy.signal import savgol_filter
from openeo_udf.api.datacube import DataCube
def apply_datacube(cube: DataCube, context: Dict) -> DataCube:
"""
Applies a savitzky-golay smooth... |
from operator import itemgetter
import os
import numpy as np
import csv
from collections import defaultdict
import pickle
from tqdm import tqdm
import pickle
import itertools
from skbio.stats.distance import mantel
from scipy.stats import spearmanr
import plotly.graph_objects as go
print('Load average annotation vari... |
<gh_stars>1-10
# coding: utf-8
from __future__ import print_function
import torch.utils.data as data
from PIL import Image
import os, sys, glob, time, math
import os.path, random
import errno
import numpy as np
import torch, threading
import codecs
import shutil
import torchvision
from torchvision.datasets.utils import... |
import torch
import scipy.cluster
if torch.cuda.is_available():
import torch_cluster.nearest_cuda
def nearest(x, y, batch_x=None, batch_y=None):
r"""Clusters points in :obj:`x` together which are nearest to a given query
point in :obj:`y`.
Args:
x (Tensor): Node feature matrix
:m... |
<reponame>JordiManyer/bddc
###############################################################################
##### MAIN PROGRAM #####
###############################################################################
import sys
sys.path.append("./libs_v1")
import numpy... |
import matplotlib as mpl
mpl.use('agg')
import os
import sys
from glob import glob
from time import time
import numpy as np
import pylab as plt
import ccgpack as ccg
from scipy import stats
cmap = plt.cm.jet
cmap.set_under('w')
cmap.set_bad('gray',0.)
add = 'processed_images/'
ccg.ch_mkdir(add)
add = 'processed_im... |
import numpy as np
from scipy import linalg
from ..base import Preprocessor
from ..statistics import calculate_covariance_matrix
__all__ = [
"PrincipalComponentAnalysis",
]
class PrincipalComponentAnalysis(Preprocessor):
"""Principal Component Analysis (PCA)
A statistical procedure that uses an orthogo... |
<gh_stars>0
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from scipy.interpolate import interp2d
import datetime
import numpy as np
from aet import AET
from display import Display
from light import Light
from shading import Shading
from space import Space
from transform import *
import ill... |
<reponame>gferraro2019/python-meegkit<gh_stars>10-100
"""Test SNS functions."""
from numpy.testing import assert_allclose
from scipy.io import loadmat
from meegkit import sns
def test_sns():
"""Test against NoiseTools."""
mat = loadmat('./tests/data/snsdata.mat')
x = mat['x']
y_sns = mat['y_sns']
... |
<reponame>joselvira/BiomecanicaPython<filename>Funciones/effectSize.py
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 05 17:02:27 2016
Última revisión: 16/06/2019
@author: YoMismo
"""
from __future__ import division, print_function #division #Ensure division returns float
# ============================... |
# Copyright 2017 Diamond Light Source
#
# 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 writ... |
import numpy as np
import scipy.optimize as opt
import quant_risk as qr
import pandas as pd
from pandas.tseries.offsets import QuarterEnd, BusinessDay
from tqdm import tqdm
import datetime as dt
global count
count = 0
class ObjectiveFunction:
@staticmethod
def sharpe(weights: np.array, prices: pd.DataFrame,... |
try:
from statistics import mean
except ImportError:
def mean(x):
return sum(x)/len(x)
from music import inversion, Chord
import re
parser = re.compile(r"^([iv]+|[IV]+)([+|o]?)((?:[0-9]+)(?:\/[0-9]+)*)?$")
intervals = {
"I": 1, "II": 2, "III": 3, "IV": 4, "V": 5, "VI": 6, "VII": 7
}
fig_base_parser... |
<reponame>ryaninhust/pyxclib
"""
Data tools for multi-labels datasets
Uses sparse matrices which is suitable for large datasets
"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.datasets import load_svmlight_file, dump_svmlight_file
import operator
from ..utils.sparse import ll_to_sparse... |
# testing SDR class
import context
import cvxpy as cp
import numpy as np
import scipy.optimize as op
from datetime import datetime
from bath_fitting.SDR_fitting import SDRFit
from bath_fitting.SDR_fitting import delta_eval
K = 2
nz = 100
z = 1j*np.linspace(1, 10, nz)
L = 9
M = [ np.random.rand(L,L) for _ in range... |
# -*- coding: utf-8 -*-
"""Script plots CDI and MEG-MMN dependents for specified cohort"""
# Authors: <NAME> <<EMAIL>>
# License: MIT
from os import path as op
import numpy as np
from scipy import stats
import statsmodels.api as sm
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import pandas as ... |
import av
# import torchaudio
import numpy as np
from fractions import Fraction
# def load_audio_torchaudio(fn):
# data, sr = torchaudio.load(fn)
# return data, sr
def open_audio_av(path):
container = av.open(path)
for stream in container.streams.video:
stream.codec_context.thr... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib
from pylab import rcParams
import matplotlib
import scipy.stats
#%%
# batch_size=256
batch_size=32
#%%
#main NNGP big run (up to 4k training set size:)
training_data = pd.read_csv("results/new_mother_of_all_msweeps_nn_training_result... |
import numpy as np
import argparse
import pickle
from cvxOpt import Log_Log, SVM_Log
from cvxpyMdl import Log_SVM,SVM_SVM
import sys
from sklearn import metrics
from scipy.io import savemat
from compute_statistics import get_acc_precison_recall
import os
def train_predict_score(loss, abs_train_feat, abs_train_label, ... |
import os
import sys
import tensorflow as tf
import numpy as np
import random
import time
import scipy as sp
import json
from setup_imagenet import ImageNet, ImageNetModel
from PIL import Image
def dump(img, path):
#save as npy
np.save(path + ".npy", img)
#save as png file
fig = (img + 0.5)*255
... |
<gh_stars>0
import math
import statistics
import warnings
import numpy as np
from hmmlearn.hmm import GaussianHMM
from sklearn.model_selection import KFold
from asl_utils import combine_sequences
class ModelSelector(object):
'''
base class for model selection (strategy design pattern)
'''
def __init... |
<gh_stars>0
# Create your tasks here
from __future__ import absolute_import, unicode_literals
from celery import shared_task, app
import pandas as pd
import pickle
from scipy.sparse import coo_matrix
from lightfm import LightFM
from movie_stream.models import Rating, Movie, LightFMModel
from django.dispatch import rece... |
<gh_stars>0
import collections
import numpy as np
import math
import os
import random
from six.moves import urllib
from six.moves import xrange # pylint: disable=redefined-builtin
import pandas as pd
data_index = 0
class Options(object):
def __init__(self, datafile, vocabulary_size):
self.vocabulary_size = v... |
'''
Different routines used by field, dset, grid etc.
Note: g2g functionality was moved to gridtile.py due to dependence on f2py.
'''
import scipy as sp
def scalar2slice(*args):
val=[]
for i in args:
if sp.isscalar(i): i=slice(i,i+1)
val.append(i)
return tuple(val)
def find_nearest(arra... |
<filename>pcwg/core/interpolators.py
from scipy import interpolate
import numpy as np
from math import pow, sqrt
from ..core.status import Status
class BaseInterpolator(object):
def write_summary(self, x, y):
for i in range(len(x)):
Status.add("{0} {1}".format(x[i], y[i]), verbosity=3)
... |
<gh_stars>1-10
'''
Auxiliar functions used in the calculation of the Measures
'''
import numpy as np
import pandas as pd
import operator
from sys import exit as exit
from warnings import warn as warning
from scipy.stats import entropy as entropy
from sklearn.preprocessing import LabelEncoder #' ... |
#!/usr/bin/env python2.7
# encoding: utf-8
#
# matplotlib-ref-density.py -- matplotlib example script
# Copyright (C) 2011 <NAME> (<EMAIL>)
#
# This work is licensed under the Creative Commons Attribution-Share Alike
# 3.0 Unported License. To view a copy of this license, visit
# http://creativecommons.org/licenses/b... |
<reponame>devangovender/TrimPointDector<gh_stars>0
#!/usr/bin/python
''' Detects the tstart and end trimpoints of an audio file. '''
import sys
import numpy
import sklearn.cluster
import time
import scipy
import os
from pyAudioAnalysis import audioFeatureExtraction as aF
from pyAudioAnalysis import audioTrainTest as aT... |
<filename>iceact/instrument_response.py
from eventio import IACTFile
import pandas as pd
import numpy as np
from scipy.spatial import KDTree
from argparse import ArgumentParser
from iceact.plotting import plot_camera
import matplotlib.pyplot as plt
parser = ArgumentParser()
parser.add_argument('input_file')
parser.ad... |
<reponame>msgoff/sympy
"""
This code is automatically generated. Never edit it manually.
For details of generating the code see `rubi_parsing_guide.md` in `parsetools`.
"""
from sympy.external import import_module
matchpy = import_module("matchpy")
if matchpy:
from matchpy import Pattern, ReplacementRule, Custom... |
<gh_stars>0
import numpy as np
from scipy import signal
def pre_emphasis(signal_batch, emph_coeff=0.95, axis=-1) -> np.array:
"""
Pre-emphasis of higher frequencies given a batch of signal.
Args:
signal_batch(np.array): batch of signals, represented as numpy arrays
emph_coeff(floa... |
<reponame>cloudbutton/lithops-array
import ast
import logging
import abc
import sympy
import numpy as np
from operator import *
from collections import namedtuple
from numpywren.matrix import BigMatrix
from numpywren.matrix_init import shard_matrix
from numpywren import exceptions
#from numpywren.compiler import lpcom... |
# -*- coding: utf-8 -*-
"""
.. module:: skimpy
:platform: Unix, Windows
:synopsis: Simple Kinetic Models in Python
.. moduleauthor:: SKiMPy team
[---------]
Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB),
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland
Licensed under the ... |
<reponame>NKI-ECOG/ecogVIS
import numpy as np
from pynwb import TimeSeries
from ecogvis.signal_processing.detect_events import detect_events, threshcross
from scipy.io import wavfile
import os
def test_detect_events():
here_path = os.path.dirname(os.path.abspath(__file__))
fs1, data1 = wavfile.read(os.path.jo... |
from datetime import datetime, timedelta
import numpy
import matplotlib.pyplot as plt
import scipy.io as spio
import csv
import copy
import sys
from os.path import dirname, abspath, join
sys.path.insert(0,dirname(dirname(dirname(abspath(__file__)))))
from fleet_request import FleetRequest
from grid_info import GridIn... |
<reponame>harrispopgen/bxd_mutator_manuscript
import numpy as np
import argparse
from collections import defaultdict
from cyvcf2 import VCF
import pandas as pd
from singleton_calling_utils import *
from pyfaidx import Fasta
import scipy.stats as ss
p = argparse.ArgumentParser()
p.add_argument(
"--ref",
require... |
import os
import redis
import pytest
import time
import math
import random
import statistics
from rmtest import ModuleTestCase
from create_test_rdb_file import load_into_redis
if os.environ['REDISTIMESERIES'] != '':
REDISTIMESERIES = os.path.realpath(os.environ['REDISTIMESERIES'])
else:
REDISTIMESERIES = os.p... |
#!/usr/bin/env python
import numpy as np
import xarray as xr
import pandas as pd
import sqlite3 as sql
from datetime import datetime, timedelta
from dateutil.parser import parse
from scipy import io, interpolate
import sys
def mtime_to_datetime(mtime):
"""Convert from Matlab time to datetime.datetime
"""
... |
<reponame>cartemic/Research-Scripts
###
# script for measuring cell size from triple point locations and post
# processed tube data
###
import os
import datetime
import numpy as np
import pandas as pd
import seaborn as sns
import uncertainties as un
from matplotlib import pyplot as plt
from matplotlib.ticker import P... |
from cvxopt import matrix, printing
from numpy import array
import numpy as np
import scipy
from numpy import pi
from numpy import tan,arctan,sin,cos,arctan2,sign,fmod,sqrt
from time import sleep
import math
import cvxopt
cvxopt.matrix_repr = printing.matrix_str_default
printing.options['dformat'] = '%.2f'
printing.op... |
<gh_stars>0
# This version of the ACF code is designed to run without the stupid index step
# It is also totally stripped down and only saves the information that I actually use.
# the corr_run function takes
import scipy
from numpy.random import normal
import matplotlib.image as mpimg
import random
import numpy as np... |
<filename>ptmcmc.py
import numpy as np
from scipy import interpolate
import matplotlib
from datetime import datetime
from scipy.stats.mstats import mquantiles
import os
from astropy.io import fits
import glob
from parameters import *
import sys
import argparse
from astropy.table import Table
##sys.path.insert(0, 'pytho... |
from __future__ import print_function
import numpy as np
from scipy.stats import norm
from scipy.stats import rv_continuous
import resource
def populate_triu(P, c_rv):
'''
Populates the upper triangle of P with connection probabilities
sampled from c_rv. P_ij is the probability for a connection from
... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 27 23:08:38 2021
@author: zengke
"""
import numpy as np
import pandas as pd
from pandas.api.types import is_array_like
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram
from sklearn.cluster import Fe... |
<filename>evaluation/evaluate_drop_quoref_ropes.py
import json
import re
import string
import numpy as np
from os import listdir
from os.path import isfile, join, exists
from typing import Union, List, Tuple, Set
from scipy.optimize import linear_sum_assignment
def _answer_to_bags(
answer: Union[str, List[str... |
<reponame>keflavich/TurbuStat<gh_stars>0
# Licensed under an MIT open source license - see LICENSE
'''
Dendrogram statistics as described in Burkhart et al. (2013)
Two statistics are contained:
* number of leaves + branches vs. $\delta$ parameter
* statistical moments of the intensity histogram
Requires the... |
<filename>LANL Earthquake Prediction/Simple Parameter Tuning.py<gh_stars>1-10
import os
import time
import warnings
import traceback
import numpy as np
import pandas as pd
from scipy import stats
from scipy.stats import pearsonr
import scipy.signal as sg
import multiprocessing as mp
from scipy.signal import... |
"""
Bezier curve recipe
"""
# adapted from:
# https://stackoverflow.com/a/12644499/1098683
import numpy as np
from scipy.misc import comb
def bernstein(i, n, t):
"""
The iᵗʰ Bernstein basis polynomial of degree n, i as a function of t
"""
# return comb(n, i) * (t ** (n - i)) * (1 - t) ** i
re... |
<reponame>saransh13/hexrd3
import numpy as np
from hexrd import constants
from hexrd import symmetry, symbols
import warnings
import h5py
from pathlib import Path
from scipy.interpolate import interp1d
import time
class unitcell:
'''
>> @AUTHOR: <NAME>, Lawrence Livermore National Lab, <EMAIL>
>> @DAT... |
<gh_stars>1000+
# -*- coding: utf-8 -*-
import operator
import numpy as np
import scipy.sparse as sp
from sklearn.base import copy
from sklearn.naive_bayes import (BaseDiscreteNB, BaseNB, BernoulliNB,
GaussianNB, MultinomialNB)
from splearn import BlockRDD
from splearn.base import Sp... |
<filename>deeppavlov_agent/utils/http_api_stress_test.py<gh_stars>10-100
import argparse
import asyncio
import uuid
from statistics import mean, median
from time import time
import aiohttp
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--url', type=str)
parser.add_argument('-pf', '--phrasesfile', help=... |
<reponame>rongwang-fudan/OSCAR_Agriculture_Global<gh_stars>0
"""
Copyright: IIASA (International Institute for Applied Systems Analysis), 2016-2018; CEA (Commissariat a L'Energie Atomique) & UVSQ (Universite de Versailles et Saint-Quentin), 2016
Contributor(s): <NAME> (<EMAIL>)
This software is a computer program ... |
<filename>Segmentation_UGSCNN/Spherical_UNet/python_scripts_for_filters_orders/matlab_equivalent_functions.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 20 12:23:37 2020
@author: fa19
"""
import numpy as np
import scipy.io as sio
def ismember(a_vec, b_vec):
""" MATLAB equivalent ismember... |
# -*- coding: utf-8 -*-
#! /usr/bin/python
#--------------------------- modifiable constants -----------------------------
_NAME_OF_CREATED_DIRECTORY = "histo_results"
_NAME_OF_PDF_FILE = "histo"
_NAME_OF_PDF_FILE_2 = "histoComp"
_COLOR_FIRST_DATA = ['blue', 'b']
_COLOR_SECOND_DATA = ['green', 'g']
_PATH_TO_DEFAULT_DI... |
<filename>jjp068/Scratch_Model_Performance.py
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from Statistical_Analysis_Models import plot_results
from sklearn.model_selection import ... |
import numpy as np
from scipy import constants as sc
from scipy import interpolate
from scipy import integrate
from scipy import optimize
import time
import os
import multiprocessing as mp
from matplotlib import pyplot as plt
# custom import
import nu
def NREL_AM15_spectra(n=2):
""" NRE... |
<filename>scripts/generate_int_test_vectors.py
"""
Script to generate unit test vectors for number theoretic functions.
* `sudo apt install sagemath`
"""
import json
import os
import pickle
import random
import shutil
import sympy
import numpy as np
from sage.all import Integer, Integers, xgcd, lcm, prod, isqrt, log,... |
<gh_stars>1-10
import pandas as pd
from argparse import ArgumentParser
from scipy.stats import pearsonr
def main():
args = get_args()
df1 = pd.read_csv(filepath_or_buffer=args.pr1,
sep="\t",
header=None,
names=['caller', 'length', 'precision', ... |
<reponame>kctess5/dynamic_parking
import numpy as np
import matplotlib.pyplot as plt
import ujson, time
import csv
from collections import namedtuple
from scipy.interpolate import RegularGridInterpolator
State = namedtuple('State', ['x', 'y', 'theta'])
ExtendedState = namedtuple('ExtendedState', ['x', 'y', 'theta', 't... |
<gh_stars>0
#%% [markdown]
# the aim of this file is to investigate the effect of the
# averaging over decimated and filtered data.
#
# i.e.: if the signal is recorded at f_r = 100 Hz by averaging all the data over
# $dt_r = \frac{1} {f_r}$ period would there be any observable differences for the
# a signal... |
"""
Space Robotics Challenge 2
"""
import numpy as np
import math
from datetime import timedelta
import traceback
import sys
from functools import cmp_to_key
import cv2
from shapely.geometry import Point, LineString, MultiPolygon, Polygon
from statistics import median
from osgar.bus import BusShutdownException
fro... |
from __future__ import print_function
import urllib
import bz2
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
import matplotlib.image as mpimg
import cv2
import plotly.graph_objs as go
import os
from utils.utils_IO import ordered_arr_3d_to_dict, refill_nan_array, arr_2d_t... |
<filename>oldtest.py<gh_stars>0
import numpy as np
import sys
import time
import argparse
import math
import scipy.linalg as sclin
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import StandardScaler
"""
Reference:
https://www.d.umn.edu/~mhampton/m4326svd_example... |
import numpy as np
from data_parser import *
from scipy import spatial
from array import *
#from collaborative import *
def find_baseline(user_id, movie_id, rating_matrix):
N_rating_matrix = np.count_nonzero(rating_matrix)
global_mean = np.sum(rating_matrix)*1.0/N_rating_matrix
user_array = rating_matrix[user_i... |
import pytest
from json_syntax.extras.dynamodb import dynamodb_ruleset
from json_syntax.helpers import NoneType
from fractions import Fraction
from decimal import Decimal
from typing import Dict, List, Optional, Set, Tuple
try:
import attr
except ImportError:
attr = None
def encode(value, typ):
return ... |
#https://qiita.com/hokuto_HIRANO/items/7381095aaee668513487
#https://github.com/hokuto-HIRANO/5Steps-PyTorch-DCGAN
import torch
from torch import nn, optim
from torchvision.utils import save_image
from torch.utils.data import Dataset, DataLoader, TensorDataset
from torchvision import transforms, datasets
import tqdm
f... |
<gh_stars>1-10
"""
Provides the following multilateral methods:
* :func:`time_dummy`
* :func:`geary_khamis`
* :func:`geks`
paired with
* :func:`carli`
* :func:`jevons`
* :func:`dutot`
* :func:`laspeyres`
* :func:`paasche`
* :func:`geom_laspeyres`
* :func:`geom_paasche`
* :func:`drobish`... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.