text string |
|---|
<filename>deliravision/utils/image_ops.py
from scipy.ndimage import zoom
import SimpleITK as sitk
import numpy as np
from delira.utils.decorators import dtype_func
sitk_img_func = dtype_func(sitk.Image)
def calculate_origin_offset(new_spacing, old_spacing):
"""
Calculates the origin offset of two spacings
... |
<reponame>ausaafnabi/Machine-Learning-Projects<filename>Classifier/SVM.py
import pandas as pd
import pylab as pl
import numpy as np
import os
import scipy.optimize as opt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
DATASET_PATH = os.path.join("... |
<filename>autofit/graphical/utils.py
from functools import reduce
from operator import mul
from typing import (
Iterable, Tuple, TypeVar, Dict, NamedTuple, Optional, Union
)
import warnings
import numpy as np
from scipy import special
from scipy.special import psi, polygamma
from scipy.linalg import block_diag
fro... |
from __future__ import absolute_import
import pandas as pd
import itertools as it
import sqlite3
from io import open
from itertools import imap, ifilter, izip
from igraph import *
import h5py
import random
from functools import partial
# build an id to audio matcher (melgram)
from madmom.audio.signal import Signal
from... |
#!/usr/bin/env python
# Import Modules
#-------------------------------------------------------
# Scipy and Numpy
from scipy import *
import scipy.special as special
# Mesh generator
import mesh as tri
# Non-symmetric Gaussian Solver
import nsymgauss as NSG
# Quadrature data
import quad as GQD
# Shape function mo... |
'''
Partial solution to assignment 1. The folder stucture and files used are given.
The concatenated audio (all.wav) as well as US114_F60_TG_VSDRC000.TextGrid are included as an example.
Note that I am using a Mac to write this. Adjust accordingly.
'''
from pathlib import Path
from intervaltree import IntervalTree
fro... |
<filename>Sparsity and Decision trees/Code.py
##### Problem 2f #####
for i in [1e-10, 1e-9, 1e-8, 1e-7, 1e-6, 1e-5]:
LASSO(imDims, measurements, X, i)
print('lambda:', i)
plt.show()
##### Problem 3 #####
def LS(U, y):
"""
Input: U is an n X d matrix with orthonormal columns and y is an n X 1 vector... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on May, 2020
<NAME> <<EMAIL>>
"""
import numpy as np
from scipy import sparse
from sknetwork.utils.format import directed2undirected
def edgelist2adjacency(edge_list: list, undirected: bool = False) -> sparse.csr_matrix:
"""Build an adjacency matrix from... |
<gh_stars>1-10
import numpy as np
import scipy.interpolate, scipy.integrate
from openmdao.api import Component, Problem, Group
import os
class Battery(Component):
"""The `Battery` class represents a battery component in an OpenMDAO model.
A `Battery` models battery performance by finding a general batte... |
from os.path import isfile, join
import pytest
from enstools.io.encoding import check_sz_availability, check_libpressio_availability
def create_synthetic_dataset(directory):
"""
Creates three synthetic netcdf datasets (1d,2d,3d) into the provided directory.
:param directory:
:return: None
"""
i... |
<reponame>disc04/simplydrug<filename>simplydrug/simplydrug.py
# AUTOGENERATED! DO NOT EDIT! File to edit: index.ipynb (unless otherwise specified).
__all__ = ['handle_exceptions', 'add_layout', 'order_wells', 'heatmap_plate', 'run_statistics', 'normalize_z',
'histogram_feature', 'get_growth_scores', 'filter... |
import shutil
from unittest import TestCase
import numpy as np
import scipy.linalg as sl
import scipy.optimize as so
from PTMCMCSampler import PTMCMCSampler
class GaussianLikelihood(object):
def __init__(self, ndim=2, pmin=-10, pmax=10):
self.a = np.ones(ndim) * pmin
self.b = np.ones(ndim) * pm... |
<reponame>ornlneutronimaging/ImagingReso
import glob
import numbers
import os
import re
import zipfile
import numpy as np
import pandas as pd
import periodictable as pt
from scipy.constants import Avogadro
from scipy.interpolate import interp1d
from six.moves import input
from six.moves.urllib.request import urlopen
... |
<filename>molmolpy/moldock/uber_docker_analysis.py
# -*- coding: utf-8 -*-
# !/usr/bin/env python
#
# @file __init__.py
# @brief init for parser directory
# @author <NAME>
#
# <!--------------------------------------------------------------------------
# Copyright (c) 2016-2019,<NAME>.
# All rights reserved.
... |
"""
BubbleNet: Bubble Dynamics Informed Neural Networks <https://hanfengzhai.net/BubbleNet>
@ <NAME> <https://hanfengzhai.net/> | <<EMAIL>>
"""
import sys
sys.path.insert(0, '../Utilities/') # OPTIONAL: only if you want to use the plotting function with py
import tensorflow as tf
import numpy as np
import ma... |
#!/usr/bin/env python
# coding: utf-8
# The Receiver Operating Characteristic "ROC" illustrates the performance of the binary classifier by plotting the false alarm probability ($P_{FA}$) on the horizontal axis and the detection probability ($P_D$) on the vertical axis. The area under the ROC-curve (AUC) is used to pr... |
import os,sys
import argparse
import pandas as pd
import re
import math
import timeit
import copy
import json
import random
from sklearn.utils import shuffle
from tqdm import tqdm
import json
import networkx as nx
import matplotlib.pyplot as plt
import scipy as sp
import numpy as np
import collections
import pprint
fro... |
<reponame>DionEngels/MBxPython
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 7 13:13:07 2020
@author: s150127
"""
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
def gaussian(height, center_x, center_y, width_x, width_y):
"""Returns a gaussian function with the given parameters""... |
"""
Hidden Markov Tree model
"""
from abc import ABCMeta
from collections import namedtuple
import os
import scipy
from config import RES_DIR, CHROM_SIZES
from data_provider import SeqLoader
from hmm.HMMModel import _ContinuousEmission
from hmm.bwiter import bw_iter, IteratorCondition
__author__ = 'eranroz'
import ... |
'''Statistical tests for NDVars
Common Attributes
-----------------
The following attributes are always present. For ANOVA, they are lists with the
corresponding items for different effects.
t/f/... : NDVar
Map of the statistical parameter.
p_uncorrected : NDVar
Map of uncorrected p values.
p : NDVar | None
... |
<filename>src/MicEMD/fdem/target.py
# -*- coding: utf-8 -*-
"""
The target class, represent the target in underground detection
Class:
- Target: the target class in FDEM
"""
__all__ = ['Target']
import numpy as np
from scipy.constants import mu_0
class Target(object):
"""Refer in particular to cylinder targets.... |
# plt.style.use('dark_background')
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm #colormap
import signal_transmitter as st
import Atmosphere.use_aris as use_aris
from scipy.ndimage.filters import gaussian_filter
import sys
sys.path.append('./GalaxySpectrum/')
import GalaxySpectrum.spectru... |
###_____________________ Ordinary Differential Eqs _________________________###
import numpy as np
import matplotlib.pyplot as plt
# Para integrar EDOs vamos a usar la función `odeint` del paquete `integrate`,
# que permite integrar sistemas del tipo:
# $$ \frac{d\mathbf{y}}{dt}=\mathbf{f}\left(\mathbf{y},t\right... |
import pandas as pd
df = pd.read_excel('C:/Users/xqm50/Downloads/2019_Holiday_Program.xlsx',sheet_name=0)
# df: drop the first 3 columns:
df.drop(['KO KEY BRAND','KO KEY PACKAGE','Weeks'], axis = 1, inplace = True)
df.head()
df.shape
# define X_train, y_trian, X_test, y_test:
from sklearn import preprocessing
X_l... |
<reponame>archanpatkar/Shannon
import math
# import ctypes
# import pickle
from pprint import pprint
from fractions import Fraction
from collections import namedtuple, OrderedDict
# Taken from
# https://stackoverflow.com/questions/21017698/converting-int-to-bytes-in-python-3
def int_to_bytes(number):
return number... |
<filename>risk/src/plots_funs.py
import sys
import os
import matplotlib.pyplot as plt
import pickle
import numpy as np
from scipy.stats import sem, t
from scipy import mean as mean_sp
from milp_mespp.core import extract_info as ext
# from core import retrieve_data as rd
this_path = os.path.dirname(os.path.dirname(os.... |
from scipy.integrate import solve_ivp
import numpy as np
from ode_helpers import state_plotter
def f(t, y, model1, model2):
dydt = [1]
for i in range(len(model1.equations())):
sumT = 0
string = model1.equations()[i]
listOfWords = string.split()
# print(listOfWords)
y1v... |
import os
import random
import numpy as np
import scipy.misc as misc
import imageio
from tqdm import tqdm
import cv2
from PIL import Image
import torch
path = '../dataset/DIV2K/DIV2K_train_HR/0001.png' #path to img
hr = Image.open(path) #PIL file
hr = np.array(hr).astype(np.uint8) #np array, range 0-255, w h c
#c... |
<filename>src/Components/misc/obs_aod/ABC/abc_c6_aux.py
"""
This module contains auxiliary functions used by the MODIS Collection 6 Neural Net Retrieval.
<NAME>, 2016.
"""
import os, sys
from matplotlib.pyplot import cm, imshow, plot, figure
from matplotlib.pyplot import xlabel, ylabel, title, grid... |
<filename>analyse_bandwidth.py
import os
import time
import json
import logging
import argparse
import sys
sys.path.append(os.path.join("libs", "soft"))
import numpy as np
import pandas as pd
import tensorflow as tf
from scipy import stats
from tensorflow.keras import backend as K
from data import C... |
""" Routines related to flexure, air2vac, etc. """
import inspect
import numpy as np
import copy
from matplotlib import pyplot as plt
from matplotlib import gridspec
from scipy import interpolate
from astropy import units
from astropy.coordinates import solar_system, ICRS
from astropy.coordinates import UnitSpheric... |
<reponame>xrloong/DECO
#
# maximize 40x+30y
# x>=0, y>=0
# x+y<=240
#
import sympy as sp
import deco
from deco.solver import Problem, Variable, Constraint
from deco.solver import deSolve
x, y = sp.symbols("x,y")
variables = [Variable(x, 0, 240), Variable(y, 0, 240)]
constraints = [
Constraint(x>=0),
C... |
<gh_stars>0
from scipy.signal import stft, istft
from glob import glob
import soundfile as sf
import numpy as np
from sklearn.metrics import mean_squared_error
clean_files = sorted(glob('stft_test_file/*.flac'))
# test for stft and istft
print("full complex number")
mse = np.array([])
for file in clean_files:
a... |
#!/usr/bin/env python
"""Provides scikit interface."""
import numpy as np
from collections import defaultdict
from scipy.sparse import csr_matrix
from ego.encode import make_encoder
_bitmask_ = 4294967295
def convert_dict_to_sparse_matrix(feature_rows, feature_size):
if len(feature_rows) == 0:
# case of... |
"""
https://www.hackerrank.com/challenges/fraudulent-activity-notifications/problem?h_l=interview&playlist_slugs%5B%5D%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D%5B%5D=sorting&isFullScreen=true&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen
Given d <- number of trailing days needed before bank sends n... |
<reponame>YuLin-code/MP-MIM<gh_stars>0
import scipy.sparse
import numpy as np
import os
import cv2
def scale_to_RGB(channel,truncated_percent):
truncated_down = np.percentile(channel, truncated_percent)
truncated_up = np.percentile(channel, 100 - truncated_percent)
channel_new = ((channel - truncated_down)... |
'''
steps:
load best performed ROI masks
for given number of ROIs wanted, combine them and use that as the wanted mask
train a new classifier and save the testing accuracy
'''
'''
you could try to see whether combining parcels improves performance.
That's going to be the most important bit, because we'll... |
# https://stackoverflow.com/questions/15853469/putting-current-class-as-return-type-annotation
# can't use this while supporting python 3.6 (PyPy 7.3), have to use strings for now
# from __future__ import annotations
from typing import Any, Dict, Iterable, Optional, List, TYPE_CHECKING, cast
from typing_extensions impo... |
<reponame>h2oai/article-information-2019<gh_stars>1-10
"""
License
Copyright 2019 <NAME>, <NAME>, <NAME>, <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/LICENS... |
import lib
import datetime
import torch
import argparse
import sys
import utils
import logging
from tensorboardX import SummaryWriter
from lib.model.mpnn import mp_sequential, mp_conv_residual, mp_conv_type, mp_conv_v2, global_pooling
import numpy as np
import time
import os
from utils.types import str2bool
from tqdm i... |
<reponame>victorathanasio/Personal-projects
# %%
from sympy import *
import pandas as pd
import numpy as np
init_printing(use_unicode=True)
# %%
x, y = symbols('x y')
def check_maximum(f, interval, symbol):
possiveis_max = []
borda1 = (f.subs(symbol, interval.args[0]).evalf())
borda2 = (f.... |
#!/usr/bin/python
import os
import argparse
import yaml
import scipy.io
parser = argparse.ArgumentParser()
parser.add_argument('input', type=str)
parser.add_argument('-o', '--output', type=str, default=None)
parser.add_argument('-v', '--verbose', action='store_true')
args = parser.parse_args()
if args.output is None... |
import glob
import pickle
from time import time
from scipy.signal import windows, resample
from scipy import interpolate
import numpy as np
import sys
sys.path.append('../Dependencies/')
sys.path.append('../Dependencies/models/')
from hprModel import hprModelAnal,hprModelSynth
from sineModel import sineModelAnal,sine... |
<gh_stars>0
from __future__ import division
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import hoomd
import hoomd.md
#import matplotlib.pyplot as plt
import numpy as np
from scipy.special import erf as erf
import os
import sys
import datetime
import ewald_module as em
import md_... |
import os
import numpy as np
import procedural_city_generation
class Surface(object):
def __init__(self, input_name):
print("Surface is being set up for getting of getSurfaceHeight")
path = os.path.dirname(procedural_city_generation.__file__)
with open(path+"/temp/"+input_name+"_heightm... |
<reponame>ludvikka/rs_sb3<filename>test_gripper.py
import numpy as np
from time import sleep
#import mujoco_py
import robosuite as suite
from custom_task import LiftSquareObject
from custom_utils import euler_angel_to_quat
from custom_gym_wrapper import CustomGymWrapper
from robosuite import load_controller_config
fr... |
"""
Geo_plotting
------------
Module which groups the geographical map plots.
"""
from mpl_toolkits.basemap import Basemap, cm
import matplotlib.pyplot as plt
import scipy.ndimage as ndimage
import numpy as np
#from Mscthesis.Statistics.stats_functions import compute_spatial_density
def plot_in_map(coordinates, re... |
"""
Description : This file implements the function to evaluation accuracy of log parsing
Author : LogPAI team
License : MIT
"""
import sys
import pandas as pd
from collections import defaultdict
import scipy.special
from sklearn.metrics import accuracy_score
from nltk.metrics.distance import edit_distance
im... |
from modbamtools.utils import *
from operator import itemgetter
from itertools import groupby
from scipy.signal import savgol_filter
def binerize_mod_het_call(call, min_prob=0.5, max_prob=0.5):
prob = call / 255
if prob < min_prob:
return -1
elif prob > max_prob:
return 1
else:
... |
"""Implement custom kmeans.
It supports any distance measure defined in scipy.spatial.distance.
"""
import numpy as np
from scipy.spatial import distance
from sklearn.cluster import KMeans
def run_kmeans(spectral_embeddings, n_clusters, custom_dist, max_iter):
"""Run CustomKMeans with a custom distance measure su... |
import os
import gzip
import sys
import subprocess
import numpy
# for tests
# https://docs.scipy.org/doc/scipy/reference/
# tutorial/stats.html#t-test-and-ks-test
from scipy import stats
from scipy.stats import mannwhitneyu
import matplotlib
# this code appended to prevent this error:
# self.tk = _tkinter.create(screen... |
<filename>watch_all_output_image_NYU_SMHand.py
import json
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
import pandas as pd
import numpy as np
import scipy.io as sio
import _pickle as cPickle
import time, os, math
import collections
from tqdm import tqdm
import matplotlib.pyplot as plt
import pickle
import... |
import numpy as np
from builtins import range
from builtins import zip
from scipy import sparse
from .partition import LabelSpacePartitioningClassifier
class MajorityVotingClassifier(LabelSpacePartitioningClassifier):
"""Majority Voting ensemble classifier
Divides the label space using provided clusterer cl... |
<filename>features/initial_feature_set/nr_vqm_feature_sel_iter_fs_train_test_svr_all_combined.py
# -*- coding: utf-8 -*-
"""
Author: <NAME>
"""
# Load libraries
import warnings
import time
import pandas
import math
import random as rnd
import matplotlib.pyplot as plt
from matplotlib import rc
import scipy.stats
import ... |
<filename>comancpipeline/MapMaking/Types.py
import numpy as np
import h5py
from astropy import wcs
from matplotlib import pyplot
from tqdm import tqdm
import pandas as pd
from scipy import linalg as la
import healpy as hp
from comancpipeline.Tools.median_filter import medfilt
from comancpipeline.Tools import binFuncs,... |
<gh_stars>10-100
import numpy as np
import scipy
from ... import operators
__all__ = ['subspace2psd','subspace2freq']
#------------------------------------
def subspace2psd(subspace, n_psd = None ):
'''
Subspace to pseudospetrum (psd) transformation,
uisng maximum entropy principle.
Parame... |
from __future__ import print_function
import matplotlib
matplotlib.use('tkAgg')
import matplotlib.pyplot as plt
from scipy.sparse import csr_matrix
from dolfin import *
import scipy
import numpy as np
import healpy as hp
from deepsphere import utils
# Test for PETSc and SLEPc
if not has_linear_algebra_backend("PET... |
<reponame>eroots/gams
import scipy.signal as signal
from scipy.ndimage import gaussian_filter
from scipy.interpolate import griddata
from PyQt5.uic import loadUiType
from PyQt5 import QtWidgets, QtCore, QtGui
import numpy as np
from copy import deepcopy
from geoh5py.workspace import Workspace
from matplotlib import cm
... |
import mne
import numpy as np
import scipy.sparse as sp
"""
Functions below are mostly used for evaluating Graph Convolutional Recurrent Attention Model (GCRAM) originally proposed by <NAME> et al.
AutoGCN does not require precomputing adjacency matrices.
"""
def get_sensor_pos(ch_names):
"""
Get EEG sensor... |
<reponame>luangtatipsy/ai-zero-to-production
import pickle
from typing import Tuple
import numpy as np
import pandas as pd
from scipy import sparse
from src.utils.preprocessing import preprocess
tfidf = pickle.load(open("models/tfidf.pickle", 'rb'))
def load_preset(path: str = "logs/train_df.csv") -> Tuple[pd.DataFr... |
#!/usr/bin/env python3
"""httpsdate.py is a script for secure time synchronisation"""
__version__ = '0.2.0'
import argparse
import os
import prctl
import pwd
import sys
import time
import urllib.request
from concurrent import futures
from datetime import datetime, timezone
from statistics import median
# Exit codes... |
from collections.abc import Sized
from typing import cast
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
import numpy as np
import numpy.typing as npt
from scipy.sparse import coo_matrix
from ._typing_utils import Float
from ._typing_utils import Int
from ._t... |
<filename>src/modeling/em.py
import math
from typing import Tuple
import numpy as np
from scipy.special import logsumexp
from src.modeling.gmm import GaussianMixture
def e_step(X: np.ndarray, mixture: GaussianMixture) -> Tuple[np.ndarray, float]:
"""E-step : Softly assigns each datapoint to a gaussian component... |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import time
import numpy as np
import sklearn.cross_validation
import sklearn.metrics
import theano
import theano.tensor as T
import lasagne
import sys, os.path
from scipy.misc import imresize, imread
from random i... |
<gh_stars>1-10
import os, json, csv
import numpy as np
from scipy import stats
from VoiceEncoder.util import case_to_dvec
from rdsv import RefAudioLibrary, Diarize, diar_to_rttm, rttmto_RALrttm
from pyannote.database.util import load_rttm
from pyannote.metrics.diarization import DiarizationErrorRate
from param import ... |
<reponame>KatharinaHermann/tum-Advanced-DL-for-robotics-RL
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import numpy as np
import scipy.ndimage as ndimage
import os
import sys
#sys.path.append(os.path.join(os... |
<filename>radmc-3d/version_0.41/opac/dust_continuum/bohrenhuffman_python/makedustopac.py<gh_stars>1-10
from bhmie import *
import numpy as np
from scipy.interpolate import interp1d
import math
def compute_opac_mie(optconst_file,matdens,agraincm,lamcm,
theta=None,logawidth=None,wfact=3.0,na=20,
... |
<reponame>YuHsin1998/EllSeg
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 29 16:16:57 2019
@author: rakshit
"""
import os
import sys
import cv2
import copy
import glob
import argparse
import matplotlib
import numpy as np
import deepdish as dd
import scipy.io as scio
sys.path.append('..')
from... |
<filename>data_providers/rekuten.py
import tempfile
import os
import scipy.io
import cv2
import glob
import csv
from scipy import misc
import numpy as np
from .base_provider import ImagesDataSet, DataProvider
# from .downloader import download_data_url
class RekutenDataSet(ImagesDataSet):
n_classes = 37
de... |
import eispice
from scipy import interpolate
import numpy as np
import matplotlib.pylab as plt
import serial
import time
import pickle
chargeVoltage=[3.023, 3.398, 3.490, 3.557, 3.618, 3.656, 3.721, 3.846, 3.943, 4.057, 4.184]
chargeQuantity=[74.2, 583, 1086.5, 1590.0, 2183.6, 2687.1, 3190.6, 3784.2, 4287.7, 4796.5, 5... |
import os
import random
import sys
import numpy as np
from scipy.special import softmax
import tensorflow as tf
from tqdm import tqdm
from io_utils.io_utils import load_data, save_data
from data_processing.tokenization import tokenize_text, sentenize_text
from data_processing.postprocessing import decode_entity
from ... |
import numpy as NP
import copy
from astropy.io import fits
from astropy.io import ascii
from astropy import coordinates as coord
from astropy.coordinates import Galactic, FK5
from astropy import units
import astropy.cosmology as CP
import scipy.constants as FCNST
from scipy import interpolate
import matplotlib.pyplot a... |
import aemulus_data as AD
from classy import Class
from cluster_toolkit import massfunction
from cluster_toolkit import bias
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as op
import emcee
name = 'de1fg'
if '0' in name or '1' in name:
symmetric = False
else:
symmetric = True #A symm... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from processEmail import email_processing
from processEmail import email_processing_and_index_filtering
import scipy.io
from sklearn import svm
from processEmail import email_features
################## (1) Email Preprocessing & Index co... |
# Time: O(n^3 * 4^n) = O(1), n = 4: tree is n level, n^2 vertex per level; 4 ops per vertex. Generally DFS/BFS O(V+E)
# Space: O(n^2) = O(1)
# You have 4 cards each containing a number from 1 to 9.
# You need to judge whether they could operated through *, /, +, -, (, ) to get the value of 24.
#
# Example 1:
# Input:... |
<reponame>p10rahulm/covidSims
""""
Copyright [2020] [Indian Institute of Science, Bangalore]
SPDX-License-Identifier: Apache-2.0
""""
__name__ = "validation script for data vs model validation"
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as stats
import math
from modules.... |
#!/usr/bin/python
import main
from numpy import *
from matplotlib import pyplot
def smooth (x, radius, iters = 1):
if iters == 0:
return x
ix = cumsum(x, 0)
sx = (ix[radius:,:] - ix[:-radius]) / radius
return smooth(sx, radius, iters - 1)
#----( beat functions )-------------------------------------------... |
import pandas
import numpy as np
import patsy
import argparse
import statsmodels.discrete.count_model as cm
import seaborn as sb
from scipy.stats import nbinom
#
# TODO -- this should really be part of bin3C or use proxigenomics_toolkit
# and derive all this information itself. The logic for producing the
# ... |
#coding:utf-8
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 <NAME> <<EMAIL>>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Scikit learn interface for :class:`~gensim.models.hdpmodel.HdpModel`.
Follows scikit-learn API conventions to facilitate using gensim along with scikit-lea... |
import numpy as np
from numpy.linalg import lstsq as optimizer
from scipy.spatial.transform import Rotation as rotation_util
median_object_size_map = {
'Cyclist': (1.76, 1.75, 0.6),
'Van': (4.98, 2.13, 1.88),
'Tram': (14.66, 3.61, 2.6),
'Car': (0.25, 0.13, 0.15),
'Misc': (2.52, 1.65, 1.51),
'Pe... |
<filename>Code/ModelSelection/datafold-master/datafold/pcfold/distance.py
#!/usr/bin/env python3
import abc
from typing import Optional, Sequence, Type, Union
import numpy as np
import scipy.sparse
import scipy.spatial
from scipy.spatial.distance import cdist, pdist, squareform
from sklearn.metrics import pairwise_di... |
from abc import ABC, abstractmethod
from scipy.optimize import Bounds
from collections import namedtuple
from .utils import config_space_to_search_space, config_space_to_domain
Evaluation = namedtuple('Evaluation', ['value', 'duration'])
class BenchmarkBase(ABC):
@abstractmethod
def evaluate(self, kwargs, ... |
<filename>src/scripts/calc_per_layer_sparsity.py
import os, sys
from os import listdir
from os.path import isfile, join
from statistics import mean
from collections import OrderedDict
from custom.checkpoint_utils_fp32 import Checkpoint
MB = 1024*1024
out_dir = '/path/to/store/output'
model_dir = '/path/to/model'
ch... |
# coding: utf-8
# # resultsVol_1: Getting data
#
# Anish ran synapse detection on the chessboard dataset and has provided locations of potential synapses.
# Here, we pull data from those locations and export it into a nice dataset for further analysis.
# In[1]:
import csv
import ndio
import numpy as np
import h5py
... |
<filename>pcd_registration.py<gh_stars>1-10
from scipy.spatial.transform import Rotation as Rot
from gslr import GSLR_rotation
import open3d as o3d
import numpy as np
from sklearn.neighbors import BallTree
def T_err(R1, t1, R2, t2):
T1, T2 = np.identity(4), np.identity(4)
T1[:3, :3], T2[:3, :3] = R1, R2
T... |
#Script which takes all autolabels generated
#under a given sequence root, and builds TFrecord files
#(for depth image classifier training)
#This does no shuffling -- TODO: handle that with a separate utility
import sys
import pickle
import ColorFilters
import numpy as np
from RootDirector import *
from DepthTrainingTF... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import linregress
def draw_plot():
# Read data from file
data = pd.read_csv('epa-sea-level.csv')
data = data[['Year', 'CSIRO Adjusted Sea Level']]
# Create scatter plot
plt.scatter(data['Year'], data['CSIRO Ad... |
import sys
import numpy as np
import pandas as pd
from statistics import mode
def read_file(filename):
text, tags = [], []
with open(filename, encoding='utf-8') as f:
t, ta = [], []
for line in f.readlines():
if line=="\n" and t and ta:
text.append(t)
... |
import plotly.figure_factory as ff
import plotly.graph_objects as go
import statistics
import random
import pandas as pd
import csv
df=pd.read_csv("data.csv")
data=df["temp"].tolist()
def random_set_of_mean(counter):
dataset=[]
for i in range(0,counter):
random_index=random.randint(0,len(data)-1)
... |
<filename>Python/nslsqr.py<gh_stars>1-10
# Implementation of nsLSQR
import numpy as np
from aux_routines import jac_free, jac_transpose_free
from scipy.linalg import solve_triangular
import sys
# Auxiliar function to compute:
# | J | * v
# | s*I |
def augmented_dot(Jv, s, v, m, n):
M = m+n
res = np.zeros(M)
... |
from __future__ import division
from scipy.stats import ttest_ind, ttest_1samp, ttest_rel, mannwhitneyu, norm
from collections import OrderedDict
from numpy.random import randint
import matplotlib.gridspec as gridspec
from matplotlib.lines import Line2D
from matplotlib.ticker import MultipleLocator, MaxNLocator, Linea... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from numpy import array
from numpy import eye,dot,zeros,sort
from scipy.linalg import svd,inv,eig
if __name__=='__main__':
m=array([[1,0,0,0,2],
[0,0,3,0,0],
[0,0,0,0,0],
[0,4,0,0,0]])
#py的svd得出的d是一个数组
u,d,vt=svd(m)
print '---... |
"""Definitions for common filters."""
import numpy as np
import numpy.random as rnd
import numpy.linalg as la
from scipy.linalg import expm
import scipy.integrate as s_integrate
import scipy.stats as stats
import abc
from warnings import warn
from copy import deepcopy
import matplotlib.pyplot as plt
import gncpy.math ... |
<reponame>bheberlein/hypro
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Functions to do radiometric calibrations.
@author: <NAME> (<EMAIL>)
"""
import logging, os, numpy as np
logger = logging.getLogger(__name__)
from numba import njit, stencil
from ENVI import read_envi_header
def make_radio_cali_file_Hyspe... |
<filename>src/HafrenHaver/resize_gui.py
#! /usr/bin/env python3
#from queue import Queue
import pygame
from pygame import RESIZABLE, FULLSCREEN, VIDEORESIZE
from pygame import mixer, display
from scipy.constants import golden
from constants import DEFAULT_TITLE, DEFAULT_ICONTITLE, DEFAULT_ICON
from constants import ... |
<filename>IK_debug.py
from sympy import *
from time import time
from mpmath import radians
import tf
import numpy
'''
Format of test case is [ [[EE position],[EE orientation as quaternions]],[WC location],[joint angles]]
You can generate additional test cases by setting up your kuka project and running `$ roslaunch ku... |
import gym
import numpy as np
import gym_MAOC
from scipy.optimize import minimize
from scipy.optimize import NonlinearConstraint
env = gym.make('MAOC-v0')
# Uncomment following line to save video of our Agent interacting in this environment
# This can be used for debugging and studying how our agent is performing
# e... |
#!/usr/bin/env python
from __future__ import (print_function, division)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from scipy.interpolate import griddata
from scipy.stats import norm
from scipy.optimize import curve_fit
from astropy.io import fits
import os
import mat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.