text string |
|---|
import numpy as np
import pickle
from riglib.filter import Filter
from riglib.bmi.goal_calculators import ZeroVelocityGoal_ismore
from scipy.signal import butter,lfilter
from ismore import ismore_bmi_lib
import tables
from ismore.invasive.make_global_armassist_hull import global_hull
# Path:
# 7742 -- constant assist... |
<filename>ps3/eigenfaces.py
import math
import numpy as np
import scipy.io
import matplotlib.pyplot as plt
# Load yalefaces.mat data
M = scipy.io.loadmat('yalefaces.mat')["M"]
# Flatten each 2x2 matrix to a col vector and find the mean
M_flattened = np.zeros((1024, 2414))
sum = np.zeros((1024, 1))
for i in range(2414... |
<reponame>babsey/spatio-temporal-activity-sequence
# -*- coding: utf-8 -*-
#
# plot_sequence_networks_connections.py
#
# Copyright 2017 <NAME>
# The MIT License
import numpy as np
import matplotlib as mpl
import pylab as pl
import scipy.io as sio
from mpl_toolkits.axes_grid1 import make_axes_locatable
from lib.panel_... |
<reponame>abarnert/levicivita
import cmath
import math
import pathlib
import sys
import unittest
from unittest.util import safe_repr as sr
from levicivita import *
from levicivita import lmath
from levicivita import lcmath
class _TestBaseLeviCivita(unittest.TestCase):
def setUp(self):
for name in 'ε pi e... |
"""Publish the vaccination data for a country in Twitter."""
# =============================================================================
# Imports
# =============================================================================
# Standard
import argparse
import os
import sys
# Third party
import tweepy
import pa... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
import os
import weakref
import platform
import warnings
from fractions import Fraction
import numpy as np
import matplotlib as mpl
from matplotlib.figure im... |
<filename>sklearn_rvm/em_rvm.py
"""Relevance vector machine using expectation maximization like algorithm.
Based on
--------
https://github.com/JamesRitchie/scikit-rvm
https://github.com/ctgk/PRML/blob/master/prml/kernel/relevance_vector_regressor.py
"""
# Author: <NAME>
# <NAME>
# License: BSD 3 clau... |
<filename>src/tests/unittests/utilities/test_optimization.py
import unittest
import lmfit
import matplotlib.pyplot as plt
import numpy as np
import pandas
import scipy.optimize
from qtt.algorithms.functions import linear_function
from qtt.utilities.optimization import (AverageDecreaseTermination,
... |
<gh_stars>0
"""Port of the Matlab Truncated Normal and Student's t-distribution toolbox v2.0 by <NAME>"""
from re import U
import numpy as np
from scipy.special import erfc, erfcx, erfcinv
from scipy.optimize import root
DTYPE = np.float64
def ln_phi(x):
"""computes logarithm of tail of Z~N(0,1) mitigating numer... |
import re
import os
import matplotlib.pyplot as plt
import re
import numpy as np
from scipy import stats
from matplotlib.patches import Rectangle
fig = plt.figure()
ax = fig.add_subplot(111)
PROJECTS_LIST = "../../info/settings-project.txt"
RESULT_PATH="../../data/complexity-and-change-data/"
#RESULT_PATH="/home/s... |
import conv2d
import model_process
import dataset_loader
import numpy as np
import torch.optim as optim
import matplotlib.pyplot as plt
from PIL import Image
from scipy.io import wavfile
NEED_TO_CREATE_DATASET = False
NEED_TO_CREATE_H5 = False
if NEED_TO_CREATE_DATASET:
dataset_loader.create_dataset("WAV_mini_s... |
<reponame>Dictanova/term-eval
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__copyright__ = """
Copyright 2018 Dictanova
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
ht... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 10 14:27:10 2021
@author: <NAME> from the Bioimaging Facility of the John Innes Centre.
"""
# Imports the necessary libraries.
from ncempy.io import dm
import numpy as np
import matplotlib.pyplot as plt
from skimage import filters, morphology, segmentation, m... |
<filename>MATH7370/Final_project/g_lotka_volterra_model.py
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import integrate
from scipy.optimize import minimize
from sklearn.metrics import mean_squared_error
def get_interaction_matrix(r1, r2, a12, a21, k1, k2):
return np... |
<filename>dedup.py
import six
assert six.PY3, "Run me with Python3"
import numpy as np
import scipy.sparse
import csr_csc_dot as ccd
import time
import sys
import re
from sklearn.feature_extraction.text import HashingVectorizer
discard_re=re.compile(r"[^a-zA-ZåäöÅÄÖ0-9 ]") #regex to discard characters which are not o... |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: matrix.py
# Purpose: matrix and linear algebra based math utility programs
#
# Author: <NAME>
#
# Created: 22/09/2012
# Last Modified: 12/24/2014
# Copyright: (c) <NAME>, 2012 - 2015... |
import numpy as np
import scipy.linalg as sl
from collections import defaultdict
from ase.dft.kpoints import monkhorst_pack
import os
def eigen_to_G(evals, evecs, efermi, energy):
""" calculate green's function from eigenvalue/eigenvector for energy(e-ef): G(e-ef).
:param evals: eigen values
:param evecs... |
from algebreb.listas.listas_productos_notables import ListaBinomioAlCuadrado
from sympy.abc import a, b, c, x, y , z
import json
caracteristicas = {}
caracteristicas['cantidad'] = 5
caracteristicas['variables'] = [x, y]
caracteristicas['dominio'] = 'ZZ'
caracteristicas['fraccion'] = False
caracteristicas['gmin'] = 1
... |
<reponame>Prithwijit-Chak/simpeg<gh_stars>100-1000
from SimPEG import tests, utils
import numpy as np
import SimPEG.electromagnetics.analytics.FDEMcasing as Casing
import unittest
from scipy.constants import mu_0
n = 50
freq = 1.0
a = 5e-2
b = a + 1e-2
sigma = np.r_[10.0, 5.5e6, 1e-1]
mu = mu_0 * np.r_[1.0, 100.0, 1.... |
import sys
import os
import argparse
import json
import datetime
import numpy as np
import cv2
from math import sin, cos, atan2, pi
import csv
import rosbag
import sensor_msgs.point_cloud2
print(sys.path)
sys.path.append('../')
from common.camera_model import CameraModel
from process.globals import X_MIN, Y_MIN, RES, R... |
<reponame>somyamohanty/topic-modelling
#!/usr/bin/env python
import scipy as sp
import csv
import datetime
# import nltk.stem
import gensim
import string
import os.path
import sys
from collections import Counter
from dateutil import parser
from pattern.vector import stem, PORTER, LEMMA
from operator import itemgetter
... |
# produces kde of various period ratio distributions
# requires matplotlib
import numpy as np
import matplotlib.pyplot as plt
import pylab as P
from scipy.stats import gaussian_kde
def parse_list(line):
return [float(x) for x in line.split(" ")]
fig = plt.figure()
kde_name = ["adj", "snr", "all"];
... |
<reponame>Julia-Bobo-Hu/IoTAnalytics-Realtime-Ingestion-Inference<gh_stars>1-10
# ----------------------------------------------------------------------------
# File name: SGFilter.py
#
# Created on: Aug. 11 2020
#
# by <NAME>
#
# Description:
#
# 1) This module Smoothness filter for Time series data
#
#
#
# --... |
# -*- coding: utf-8 -*-
import os
import numpy as np
from scipy.signal import firwin, lfilter
from sprocket.util import HDF5, extfrm, static_delta
def low_cut_filter(x, fs, cutoff=70):
"""Low cut filter
Parameters
---------
x : array, shape(`samples`)
Waveform sequence
fs: array, int
... |
<gh_stars>0
from flask import session, flash, redirect, url_for
from statistics import mean
from webapp.items.models import Category
from webapp.items.forms import ItemSearchForm
def serialize_item(item):
item = {
'title': item.title.title(),
'price': int(item.price),
'discounted_price': c... |
import os
from scipy.stats import truncnorm
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import cv2
from skimage import transform
import numpy as np
import matplotlib.pyplot as plt
import loadModel
import tensorflow as tf
import math
import OpenEXR
import Imath
import exr2p... |
# Collection of base classes for FastEMRIWaveforms Packages
# Copyright (C) 2020 <NAME>, <NAME>, <NAME>, <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License... |
from cmath import nan
from collections import OrderedDict
import torch.nn as nn
from torch.optim import *
from torch.utils.data import DataLoader
import numpy as np
from omegaconf import DictConfig
import copy
import time
import logging
from .misc import *
from .algorithm import *
def run_serial(
cfg: DictCo... |
<gh_stars>0
from scipy.special import jn, jn_zeros,jv
from scipy.interpolate import interp1d,interp2d,RectBivariateSpline
from scipy.optimize import fsolve
from wigner_functions import *
import numpy as np
import itertools
class wigner_transform():
def __init__(self,theta=[],l=[],s1_s2=[(0,0)],logger=None,ncpu=Non... |
# Here we will similate a Sort-Seq experiment for pdgoR with the hypothesis that
# there three overlapping RNAP binding sites
#load tools
import scipy as sp
import numpy as np
import pandas as pd
from Bio import SeqIO
import math
import matplotlib.pyplot as plt
from IPython.core.pylabtools import figsize
import sys
sy... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 11 23:17:26 2018
@author: <NAME>
"""
from shapely.geometry import Point, LineString
import scipy.spatial
import geopandas as gpd
import pandas as pd
import numpy as np
import networkx as nx
import osmnx as ox
import scipy.spatial
import time
import... |
import os
import math
import random
from collections import Counter
import numpy as np
import scipy.ndimage as ndi
from PIL import Image
from skimage import transform
from matplotlib import pyplot as plt
from keras.preprocessing.image import ImageDataGenerator
import utils
from config import *
def load_labels_dict(... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: shirui <<EMAIL>>
import re
import warnings
import argparse
from scipy.constants import Boltzmann as KB
from scipy.constants import Avogadro as NA
import numpy as np
import pandas as pd
from argparse import RawTextHelpFormatter
from scipy.integrate import simps
fro... |
# -*- coding: utf-8 -*-
"""
Quadratic solver and plotter example
"""
import math
import scipy.optimize as sp
import matplotlib.pyplot as plt
import numpy
def GetRoots(a,b,c):
# term inside sqrt
term = b**2 - 4*a*c
#handle the complex roots
factor = 1.0
if term < 0:
factor = 1j
te... |
#!/usr/bin/env python
# coding: utf-8
# # Prevendo o Nível de Satisfação dos Clientes do Santander
# ## 1.0 - Problema de negócio
# Descrição do problema:
# A satisfação do cliente é uma medida fundamental de sucesso.
# Clientes insatisfeitos cancelam seus serviços e raramente expressam sua insatisfação antes de sai... |
<reponame>luciebakels/gadgetanalyse
import numpy as np
import sys
import os
from constants import *
from snapshot import *
import haloanalyse as ha
from scipy.interpolate import interp1d
import velociraptor_python_tools as vpt
from scipy.optimize import brentq, curve_fit
import GasDensityProfiles as gdp
class OrbitTre... |
# ------------------------------------------ This app is a cycle detector --------------------------------------------
# Simple API. JSON Request with following format:
# {
# 'year': "2020",
# 'month': "12",
# 'day': "24",
import pandas as pd
import numpy as np
from flask import Flask,jsonify,js... |
<filename>Loan-Approval-Analysis/code.py<gh_stars>0
# --------------
# Importing header files
import numpy as np
import pandas as pd
from scipy.stats import mode
import warnings
warnings.filterwarnings('ignore')
#Reading file
bank_data = pd.read_csv(path)
#Code starts here
bank = pd.read_csv(path)
c... |
<reponame>Misha91908/test_staffdb<filename>staffcatalog/views.py
import statistics
import numpy
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render
from django import template
from django.db.models.query import QuerySet
# Create your views here.
from django.urls import reverse
f... |
<reponame>loramf/mlforhealthlabpub
"""
This script contains functions for generating synthetic data.
The code is based on https://github.com/Jianbo-Lab/L2X
"""
from __future__ import absolute_import, division, print_function
import sys, os, time
import numpy as np
import pandas as pd
import scipy as sc
import ite... |
<reponame>mkoeppel/Bicycle_Ridge
"""
necessary functions to process data in the main app
"""
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import KBinsDiscretizer
from sklearn.pr... |
<reponame>infarot/Fabric-error-detector
# -*- coding: utf-8 -*-
import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.... |
"""
a pure-python implementation of exponential random graph models (ERGMs). Adapted from https://github.com/jcatw/ergm
Classes:
ergm: uses adjacency matrix representation for graphs
"""
import time
import numpy as np
import math
from scipy import sparse
from util import index_to_edge, log_msg
class ERGM:
... |
# coding: utf-8
### -------------------------------------------------------------------------
### ensemble.py
### <NAME>, SBRG, 2018
### -------------------------------------------------------------------------
### "ensemble.py" provides a class object for computing with a population
### of allele-paramete... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, render_template_string
from scipy.signal import savgol_filter
import json, re
page = '''
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Temperature logger</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"><... |
<reponame>jagrio/MachineLearningSlippage
#!/usr/bin/env python
import time
from copy import deepcopy, copy
import math
import scipy.io as sio
import shutil
import os, errno
from random import shuffle
import numpy as np
import matplotlib
from pylab import *
from featext import *
from ml_training import *
import matplotl... |
"""
** deeplean-ai.com **
** dl-lab **
created by :: GauravBh1010tt
"""
from __future__ import division
from operator import itemgetter
from collections import defaultdict
import scipy.stats as measures
import numpy as np
###################### CALCULATING MRR [RETURNS MRR VALUE] ######################
def mrr(out,... |
<reponame>harmslab/likelihood<filename>likelihood/fitters/base.py
__description__ = \
"""
Fitter base class allowing different classes of fits.
"""
__author__ = "<NAME>"
__date__ = "2017-05-10"
import numpy as np
import scipy.stats
import scipy.optimize as optimize
import corner
import pandas as pd
import re, inspect... |
# Imports for plotting graphs and general mathematics
import math
import matplotlib.pyplot as plot
import statistics
import sys
# User chooses what mode they want to enter the program in.
def start_program():
if __name__ == "__main__":
start_mode = input("""Would you like to:
1.) Line graph of your data
... |
<reponame>cmatija/probreg
from __future__ import print_function
from __future__ import division
import abc
from collections import namedtuple
import six
import numpy as np
import open3d as o3
from . import transformation as tf
from . import gaussian_filtering as gf
from . import gauss_transform as gt
from . import se3_... |
import numpy as np
import pandas as pd
#import random
import scipy as sc
import scipy.stats as stats
from scipy.special import factorial,digamma
import numdifftools as nd
from scipy.optimize import minimize
from joblib import Parallel, delayed
###############################################################... |
import util
import numpy as np
import tensorflow as tf
from keras.utils.np_utils import *
import riemannian
from scipy import signal
import pyriemann
from pyriemann.utils.mean import mean_covariance
MOVEMENT_START = 1 * 160 # MI starts 1s after trial begin
MOVEMENT_END = 5 * 160 # MI lasts 4 seconds
NOISE... |
from robotarm import Room, make_dh
import math
from math import pi, atan2, sqrt, sin, acos
import numpy as np
from numpy import arccos
import matplotlib.pyplot as plt
from scipy import interpolate as interp
points = [
[[0.5, 0, 0.0], 0],
[[-0.4, .4, 0.5], 5],
[[-0.4, 0.1, 0.2], 10],
[[0,-... |
<filename>data_ingestion/data_loader_prediction.py
import pandas as pd
from scipy.io import arff
class Data_Getter_Pred:
"""
This class shall be used for obtaining the data from the source for prediction.
Version: 1.0
Revisions: None
"""
def __init__(self, file_object, logger_object):
... |
<gh_stars>1-10
# MIT License
#
# Copyright (c) 2020 WGCN Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sympy import *
from sympy.utilities.codegen import codegen
from sympy.codegen.ast import Assignment
from sympy.codegen.fnodes import Module
from sympy.printing import fcode
import re
from .extra_models import Model_SA, Model_Menter_1eq
i = symbols('i', integer = True... |
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
"""A simulated experiment model used by the sckript fit.py
Model name: m4a
Definition:
group index j = 1 ... J
input index d = 1 ... D
explanatory variable x = [x_1 ... x_D]
response variable y
local parameter alpha = [alpha_1 ... alpha_J]
local parameter beta = [[beta_11 ... beta_1D] ... [beta... |
import numpy as np
import wave as wave
import scipy.signal as sp
import sounddevice as sd
import matplotlib.pyplot as plt
sample_wave_file = ".CMU_ARCTIC/cmu_us_aew_arctic/wav/arctic_a0001.wav"
wav = wave.open(sample_wave_file)
n_speech = wav.getnframes()
n_noise_only = 40000
n_sample = n_noise_only + n_speech
sampl... |
"""A pre-processing layer of the RCN model. See Sec S8.1 for details.
"""
import logging
import numpy as np
from scipy.ndimage import maximum_filter
from scipy.ndimage.filters import gaussian_filter
from scipy.signal import fftconvolve
LOG = logging.getLogger(__name__)
class Preproc(object):
"""
A simplified... |
<filename>openmdao/solvers/linear/direct.py
"""LinearSolver that uses linalg.solve or LU factor/solve."""
import warnings
import numpy as np
import scipy.linalg
import scipy.sparse.linalg
from scipy.sparse import csc_matrix
from openmdao.solvers.solver import LinearSolver
from openmdao.matrices.dense_matrix import D... |
<reponame>RSB-Balaji/ComputationalFinance
from datetime import datetime as dt
import numpy as np
import scipy.stats as stats
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
import yfinance as yf
from prettytable import PrettyTable
class PortfolioSet:
"""
PortfolioSet class... |
<filename>muse_redshifting_qsoHW10.py
#!/usr/bin/env python
from PyQt5 import QtGui, QtCore # (the example applies equally well to PySide)
import pyqtgraph as pg
import sys
import os
from astropy.io import fits
from astropy.table import Table, Column, vstack, unique
from scipy.signal import savgol_filter
from scipy.in... |
<filename>Hof-Moreth-et-al-2021/brightfield_GUI.py<gh_stars>0
from PyQt5.QtWidgets import QApplication, QDialog, QWidget, QPushButton, QMainWindow, QLineEdit, QLabel, QHBoxLayout, QVBoxLayout, QFileDialog, QComboBox
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
from PyQt5 import QtWidgets
from matplotli... |
<gh_stars>0
import plotly.figure_factory as ff
import plotly.graph_objects as go
import pandas as pd
import statistics
import random
import csv
df = pd.read_csv("School2.csv")
data = df["Math_score"].tolist()
def random_set_of_mean(counter):
dataset = []
for i in range(0, counter):
random_index = rand... |
<filename>lib/functions.py
'''
CS5242 Project - Classification of videos actions using breakfast action datasets
-----------------
Group Members:
<NAME> (A0185994E)
<NAME> (A0186008E)
<NAME> (A0186097N)
<NAME> (A0186064B)
-----------------
List of packages (Python 3.5):
Keras 2.3.1
tensorflow ... |
import sympy
class LieTransform:
ps = []
qs = []
variables = []
new_variables = []
dim = 0
dims = 0 # dims = 2*dim
hamiltonian = 0
mat_hamiltonian = [[]]
frequency = []
generator_list= [0]
generator_function = 0
max_degree = 0
normalform_flag = False
normalform_c... |
<filename>graphzoom/aae_dec/aae_dec_embedding.py
import numpy as np
import scipy.io as sio
import torch.nn as nn
import torch
import torch.nn.functional as F
import matplotlib as mpl
mpl.use('TkAgg')
import warnings
warnings.filterwarnings("ignore")
# 作者 dreamcold(康玉健)
# 时间 2020-10-25
# 我们实验的网络结构
data_dict = {
'... |
<gh_stars>1-10
import matplotlib.pyplot as plt
import numpy as np
import cv2
from scipy.ndimage import filters as filters
from mpl_toolkits.axes_grid1 import make_axes_locatable
from .. import utils
from .. import superpixel_analysis as sup
# TODO
# update handles st defaults follow matplotlib conventions
# updat... |
"""
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two gaussians with EM
and variational dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... |
#%%
import numpy as np
import pandas as pd
import futileprot.viz
import altair as alt
import altair_saver
import scipy.stats
colors, palette = futileprot.viz.altair_style()
# Add metadata
DATE = '2021-08-16'
RUN_NO = 1
STRAINS = 'DoubleKO'
MEDIUM = 'acetate'
# Load the measurement data
data = pd.read_csv(f'./output... |
<reponame>jaidevd/ttpy
#This is a clone of the MATLAB spectral discretization for the Henon-Heiles potential
#Using the Hermite-DVR representation
#The goal is to compute many eigenfunctions of this operator
import numpy as np
from scipy.linalg import toeplitz
from tt.eigb import *
import tt
import time
from math impor... |
"""
CCT 建模优化代码
GPU CUDA 加速 cctpy 束流跟踪
注意测试代码中的 ga32 和 ga64 定义为
ga32 = GPU_ACCELERATOR(float_number_type=GPU_ACCELERATOR.FLOAT32)
ga64 = GPU_ACCELERATOR(float_number_type=GPU_ACCELERATOR.FLOAT64,block_dim_x=512)
2021年6月17日 增加 CPU 模式
作者:赵润晓
日期:2021年5月4日
"""
# 是否采用 CPU 模式运行
from packages.beamline import Beamline
from ... |
"""
<NAME>
<NAME> Lab
FateTrack - nuclear feature extraction
2021
fatetrack_nucFeatureExtraction.py
"""
# Import various libraries
import numpy as np
import time, os, sys, math
import matplotlib.pyplot as plt
import glob
from scipy import ndimage as ndi
from skimage import color, feature, filters, io, measure, morpholo... |
<filename>python/utils/nearestCirculant.py
# -*- coding: UTF-8 -*-
import numpy as np
from scipy.optimize import minimize
from scipy.linalg import kron, circulant, inv
from scipy.sparse.linalg import cg
from scipy.sparse import csr_matrix, diags
from scipy.io import mmwrite, mmread
# ----------------
#MINIMIZE = True
... |
from __future__ import print_function
from math import pi
from PDSim.scroll import scroll_geo
import PDSim.scroll.core as core
from PDSim.core.motor import Motor
from PDSim.flow.flow import FlowPath
from PDSim.flow.flow_models import IsentropicNozzleWrapper
from PDSim.core.containers import Tube,ControlVolume
from Coo... |
<reponame>gdmcbain/scipy
import pickle
import numpy as np
import numpy.testing as npt
from numpy.testing import assert_allclose, assert_equal
from pytest import raises as assert_raises
import numpy.ma.testutils as ma_npt
from scipy._lib._util import getfullargspec_no_self as _getfullargspec
from scipy import stats
... |
from ConfigParser import SafeConfigParser
from pymobility.models.mobility import gauss_markov, reference_point_group, \
tvc, truncated_levy_walk, random_direction, random_waypoint, random_walk
import numpy as np
import logging
import sys #for argv
from scipy.spatial.distance import cdist
#configPath = "/path/to/f... |
<reponame>dfm/turnstile
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["estimate_tau", "kernel"]
import numpy as np
from scipy.optimize import minimize
from scipy.linalg import cho_factor, cho_solve
from scipy.ndimage.filters import gaussian_filter
def acor_fn(x):
"""Compute... |
<gh_stars>1-10
# Copyright 2018-2021 Streamlit Inc.
#
# 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 ... |
<filename>sympy/polys/fglmtools.py
"""Implementation of matrix FGLM Groebner basis conversion algorithm. """
from __future__ import print_function, division
from sympy.polys.monomials import monomial_mul, monomial_div
from sympy.core.compatibility import range
def matrix_fglm(F, ring, O_to):
"""
Converts the... |
import pandas as pd
from numpy import array
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import matplotlib as mpl
import scipy as sp
import numpy as np
import seaborn as sns
import matplotlib.style as style
style.use('seaborn-colorblind')
SMALL_SIZE = 8
MEDIUM_SIZE = 10
BIGGER_SIZE = 16
mpl.rcPar... |
'''
Compare normal IIR filtering with zero-phase filtering
Use digital filter
XiaoCY 2021-02-08
'''
#%%
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as sig
fs = 100. # sampling frequency (Hz)
fsig = 1. # signal frequency (Hz)
Wp =... |
import pandas as pd
import numpy as np
from collections import Counter
from scipy.cluster.hierarchy import linkage, fcluster
from scipy.spatial.distance import squareform
def dataset_stats(churn_data):
if 'is_churn' in churn_data:
churn_data['is_churn'] = churn_data['is_churn'].astype(float)
summary... |
"""
Distributions and Probability Tools
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from scipy.stats import multivariate_normal
#plt.style.use('seaborn')
def C(n,m):
# Cnm means the combinational number of n boxes with m balls
return mat... |
import numpy as np
import random
import scipy
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib.pyplot as plt
def load_data(mode='train'):
"""
Function to (download and) load the MNIST data
:param mode: train or test
:return: images and the corresponding labels
"""
m... |
"""
Solve the Missing Pixels problem using two approaches:
* Wavelet basis as a sparsifying basis
* Total Vatiation
"""
from __future__ import division
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import compsense
def show_results(P, alg, x, a... |
<gh_stars>1-10
#!/usr/bin/env python3
import scipy.spatial.distance
import imageio
import os
files = [f for f in os.listdir('.') if f.endswith('png')]
imgs = []
print ('first is ', files[0])
print ('total ', len(files))
for f in files:
img = imageio.imread(f, pilmode = 'RGBA')
if len(imgs) == 0 or img.size... |
import cv2
import numpy as np
from scipy.ndimage.measurements import label
from classifier import hog_features, spatial, color_histogram
class Heatmap(object):
def __init__(self, y_start, y_stop, scale, params, pixel_per_cell=8,
cell_per_block=2, cell_per_steps=2, size=(64, 64)):
self.y... |
<reponame>UCSD-E4E/AID_ICML_2021
#!/usr/bin/env python
# coding: utf-8
# # Prerequisites
#
# To run this notebook, `tensorflow` and `microfaune` need to be installed.
#
# To train or check prediction results, the datasets *freefield* and *warblr* must be unzipped in a folder (its path is specified in the next cell).... |
<reponame>LauraOlivera/gammapy<gh_stars>0
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Spectral models for Gammapy."""
import operator
import numpy as np
import scipy.optimize
import scipy.special
import astropy.units as u
from astropy import constants as const
from astropy.table import Table
from... |
import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.preprocessing import Imputer
from sklearn.cross_validation import StratifiedShuffleSplit
from scipy.sparse import csr_matrix
from sklearn.metrics import log_loss
# Input data files are available in the "../input/" directory.
# Any results you w... |
<gh_stars>0
import numpy as np
import csv
import os
import pickle
from scipy.signal import butter, lfilter, savgol_filter, savgol_coeffs, filtfilt
import matplotlib.pyplot as plt
# from scipy.misc import imresize
# from processing import savitzky_golay_filter
conditions = [
'exaggeratedly while sitting', 'quickly ... |
<gh_stars>1000+
"""
======================================
Sparse inverse covariance estimation
======================================
Using the GraphicalLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the... |
<gh_stars>0
from torch.optim.optimizer import Optimizer, required
import torch
import pdb
import pickle
import math
import logging
import scipy
import scipy.stats
import scipy.stats.mstats
class SVRG(Optimizer):
r"""Implements the standard SVRG method
"""
def __init__(self, params, nbatches, lr=0.01):
... |
import argparse
import numpy as np
from numpy import sqrt,pi,exp
import scipy as sp
from astropy.cosmology import FlatLambdaCDM,WMAP5,WMAP7,WMAP9,Planck13,Planck15
from astropy import units as u
from astropy.units import cds
import matplotlib.pyplot as plt
import astropy.constants as cc
from scipy.special import zeta
f... |
<filename>iembdfa/AutoInterpolation.py
import pandas as pd
import itertools
from scipy.stats.stats import pearsonr
import numpy as np
#raw_data = {'patient': [1,np.nan, 1, 2, 2],
#'obs': [1, 2, 3, np.nan, 2],
#'treatment': [0.3, 1.4, 0.5, 1.2, 0.9],
#'score': ['strong', 'weak', 'normal', 'weak'... |
"""Advanced tools for dense recursive polynomials in ``K[x]`` or ``K[X]``. """
from __future__ import print_function, division
from sympy.core.compatibility import range
from sympy.polys.densearith import (
dup_add_term, dmp_add_term,
dup_lshift,
dup_add, dmp_add,
dup_sub, dmp_sub,
dup_mul, dmp_mu... |
<gh_stars>0
import re
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.decomposition import NMF, non_negative_factorization
from sklearn.decomposition import _nmf as nmf # For testing internals
from scipy.sparse import csc_matrix
import pytest
from sklearn.utils._testi... |
<gh_stars>10-100
import pandas as pd
import patsy
import numpy as np
import warnings
from statsmodels.tools.sm_exceptions import ValueWarning
"""
A predict-like function that constructs means and pointwise or
simultaneous confidence bands for the function f(x) = E[Y | X*=x,
X1=x1, ...], where X* is the focus variable... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.