repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
iproduct/course-social-robotics | 11-dnn-keras/venv/Lib/site-packages/pandas/tests/indexes/numeric/test_astype.py | 5 | 2943 | import re
import numpy as np
import pytest
from pandas.core.dtypes.common import pandas_dtype
from pandas import Float64Index, Index, Int64Index
import pandas._testing as tm
class TestAstype:
def test_astype_float64_to_object(self):
float_index = Float64Index([0.0, 2.5, 5.0, 7.5, 10.0])
result ... | gpl-2.0 |
Averroes/statsmodels | statsmodels/datasets/ccard/data.py | 25 | 1635 | """Bill Greene's credit scoring data."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission of the original author, who
retains all rights."""
TITLE = __doc__
SOURCE = """
William Greene's `Econometric Analysis`
More information can be found at the web site of the text:
http:... | bsd-3-clause |
dhruv13J/scikit-learn | examples/model_selection/plot_roc.py | 146 | 3697 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
suraj-jayakumar/capstoneproject | sentiment-analysis/supervised_learning/archive/classifier_articles/lstm_d2v/lstm_d2v.py | 2 | 2580 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 15:53:29 2016
@author: suraj
"""
# gensim modules
from gensim.models import Doc2Vec
# np
import numpy as np
from keras.layers.core import Dense, Dropout, Activation
from keras.models import Sequential, model_from_json
from keras.layers.recurrent import LSTM
# class... | mit |
dsquareindia/scikit-learn | sklearn/utils/setup.py | 77 | 2993 | import os
from os.path import join
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('utils', parent_package, top_path)
config.add_subpackage('sparsetools')
... | bsd-3-clause |
cpcloud/vbench | vbench/db.py | 3 | 5573 | from pandas import DataFrame
from sqlalchemy import Table, Column, MetaData, create_engine, ForeignKey
from sqlalchemy import types as sqltypes
from sqlalchemy import sql
import logging
log = logging.getLogger('vb.db')
class BenchmarkDB(object):
"""
Persist vbench results in a sqlite3 database
"""
d... | mit |
Aasmi/scikit-learn | sklearn/externals/joblib/parallel.py | 36 | 34375 | """
Helpers for embarrassingly parallel code.
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
from __future__ import division
import os
import sys
import gc
import warnings
from math import sqrt
import functools
import time
import thr... | bsd-3-clause |
pressel/mpi4py | demo/mandelbrot/mandelbrot-master.py | 11 | 1466 | from mpi4py import MPI
import numpy as np
x1 = -2.0
x2 = 1.0
y1 = -1.0
y2 = 1.0
w = 600
h = 400
maxit = 255
import os
dirname = os.path.abspath(os.path.dirname(__file__))
executable = os.path.join(dirname, 'mandelbrot-worker.exe')
# spawn worker
worker = MPI.COMM_SELF.Spawn(executable, maxprocs=7)
size = worker.G... | bsd-2-clause |
wathen/PhD | MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/ShiftedMassApprox/MHDfluid3d.py | 1 | 10795 | #!/usr/bin/python
# interpolate scalar gradient onto nedelec space
from dolfin import *
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
Print = PETSc.Sys.Print
# from MatrixOperations import *
import numpy as np
#import matplotlib.pylab as plt
import PETScIO as IO
import common
import ... | mit |
yuruofeifei/mxnet | example/kaggle-ndsb1/training_curves.py | 52 | 1879 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
eadgarchen/tensorflow | tensorflow/contrib/learn/python/learn/estimators/debug_test.py | 46 | 32817 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | apache-2.0 |
rgerkin/pyNeuroML | examples/quick_plot.py | 1 | 1359 | '''
Example showing use of pynml.generate_plot()
'''
from pyneuroml import pynml
import math
import random
from matplotlib import pyplot as plt
######## Some example data
ts = [t*0.01 for t in range(20000)]
siny = [math.sin(t/10) for t in ts]
cosey = [ math.exp(t/-80)*math.cos(t/5) for t in ts]
######## Gener... | lgpl-3.0 |
glwagner/py2Periodic | build/lib/py2Periodic/nearInertialWavesInXY.py | 1 | 7790 | import doublyPeriodic
import numpy as np; from numpy import pi
import time
class model(doublyPeriodicModel):
def __init__(
self,
name = "linearizedNIWEquationExample",
# Grid parameters
nx = 128,
Lx = 2.0*pi,
ny = None,
Ly = None... | mit |
poryfly/scikit-learn | examples/covariance/plot_sparse_cov.py | 300 | 5078 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso 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
precision matrix, t... | bsd-3-clause |
nvoron23/scikit-learn | sklearn/mixture/gmm.py | 68 | 31091 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import warnings
import numpy as... | bsd-3-clause |
amas0/patools | patools/trial.py | 1 | 5966 | import os
import numpy as np
import pandas as pd
import patools.packing as pck
class Trial:
def __init__(self, directory=os.getcwd(), nbs=False):
self.packings = self.loadTrials(directory, nbs)
self.df = pd.DataFrame(index=self.packings.keys())
self._getSphereRads()
self._getPartic... | mit |
Basil-M/AMGEN-Summer-Project-2017 | python/code/Random walker/test_niifti.py | 1 | 2531 | import numpy as np
import niipy as nii
import matplotlib.pyplot as plt
from skimage.segmentation import random_walker
from skimage.data import binary_blobs
from skimage.exposure import rescale_intensity
import skimage
FOLDER_PATH= "/scratch/python/datasets/ACDC/ACDC_challenge_20170617/"
patient = 1
frame = 1
debug = 0... | mit |
herilalaina/scikit-learn | examples/cluster/plot_dict_face_patches.py | 36 | 2737 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
aitatanit/gmes | gmes/file_io.py | 1 | 2075 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stderr
from os.path import exists
try:
import psyco
psyco.profile()
from psyco.classes import *
except ImportError:
pass
from sys import modules
if not 'matplotlib.backends' in modules:
import matplotlib
matplotlib.use('TkAgg'... | gpl-3.0 |
elijah513/scikit-learn | examples/classification/plot_lda.py | 164 | 2224 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
ssaeger/scikit-learn | examples/gaussian_process/plot_compare_gpr_krr.py | 67 | 5191 | """
==========================================================
Comparison of kernel ridge and Gaussian process regression
==========================================================
Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn
a target function by employing internally the "kernel trick... | bsd-3-clause |
mne-tools/mne-tools.github.io | stable/_downloads/8d8aff0c4421b0723c62746f25bd3a16/decoding_rsa_sgskip.py | 15 | 6873 | """
.. _ex-rsa-noplot:
====================================
Representational Similarity Analysis
====================================
Representational Similarity Analysis is used to perform summary statistics
on supervised classifications where the number of classes is relatively high.
It consists in characterizing ... | bsd-3-clause |
kyleabeauchamp/HMCNotes | code/correctness/old/test_john_hmc.py | 1 | 1318 | import lb_loader
import pandas as pd
import simtk.openmm.app as app
import numpy as np
import simtk.openmm as mm
from simtk import unit as u
from openmmtools import hmc_integrators, testsystems
sysname = "ljbox"
system, positions, groups, temperature, timestep = lb_loader.load(sysname)
integrator = hmc_integrators.G... | gpl-2.0 |
yunfeilu/scikit-learn | examples/applications/plot_species_distribution_modeling.py | 254 | 7434 | """
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | bsd-3-clause |
lenovor/scikit-learn | sklearn/__check_build/__init__.py | 345 | 1671 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... | bsd-3-clause |
Jacob-Barhak/SharingDiseaseModels | Example1.py | 1 | 1208 | #Example 1: Simple Markov Model
#
#
#The Model uses 2 disease states: Alive, Dead
#
#The Yearly Probability of transition between state Alive and State Dead is: 0.05
#
#Initial Conditions: 100 people start in state Alive, None are Dead
#
#Output requested: Amount of people in each state for years 1-10.
import telluriu... | gpl-3.0 |
shenzebang/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
sergeyk/vislab | vislab/vw3.py | 4 | 22400 | import glob
import numpy as np
import re
import subprocess
import time
import logging
import os
import pandas as pd
import sklearn.grid_search
import vislab.util
vw_cmd = "vw --quiet --compressed"
def _feat_for_vw(id_, feat_name, feat, decimals=6):
"""
Parameters
----------
id_: string
Identi... | bsd-2-clause |
fy2462/apollo | modules/tools/calibration/plot_grid.py | 2 | 1897 | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# 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 ... | apache-2.0 |
whbpt/pepture | plot.py | 1 | 1500 | #!/usr/bin/env python
from __future__ import print_function
#import keras
#from keras.datasets import mnist
#from keras.models import Sequential
#from keras.layers import Dense, Dropout, Flatten
#from keras.layers import Conv2D, MaxPooling2D
#from keras import backend as K
import os, random
import numpy as np
from pept... | mit |
CreativeMachinesLab/aracna | RobotPi/SVMStrategy.py | 2 | 12810 | #! /usr/bin/env python
#import math, pdb, sys
#from numpy import *
#from numpy.linalg import *
#import random
#from copy import copy
from random import choice
from numpy import array, random, ones, zeros, sin, vstack, hstack, argmax, diag, linalg, dot, exp
#from sg import sg # Import shogun
import string, ... | gpl-3.0 |
tbabej/astropy | astropy/visualization/wcsaxes/tests/test_display_world_coordinates.py | 4 | 4688 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..core import WCSAxes
import matplotlib.pyplot as plt
from matplotlib.backend_bases import KeyEvent
from ....wcs import WCS
from ....extern import six
from ....coordinates import FK5
from ....time import Time
from .test_images import BaseImageTests
... | bsd-3-clause |
oscarxie/tushare | tushare/datayes/trading.py | 14 | 4741 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Created on 2015年7月4日
@author: JimmyLiu
@QQ:52799046
"""
from tushare.datayes import vars as vs
import pandas as pd
from pandas.compat import StringIO
class Trading():
def __init__(self, client):
self.client = client
def dy_market_tickRT(se... | bsd-3-clause |
peterdougstuart/PCWG | pcwg/gui/dataset.py | 2 | 52819 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 10 14:27:00 2016
@author: Stuart
"""
import Tkinter as tk
import tkFileDialog
import ttk
import tkMessageBox
import os.path
import re
import pandas as pd
import base_dialog
import validation
from grid_box import GridBox
from grid_box import DialogGridBox
from ..confi... | mit |
myselfHimanshu/UdacityDSWork | Intro to Machine Learning/k_means/k_means_cluster.py | 2 | 2938 | #!/usr/bin/python
"""
skeleton code for k-means clustering mini-project
"""
import pickle
import numpy
import matplotlib.pyplot as plt
import sys
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
def Draw(pred, features, poi, mark_poi=False, name="image.png", f1_n... | gpl-2.0 |
weinbe58/QuSpin | examples/scripts/outdated/boson_MBL.py | 1 | 2746 | from quspin.basis import boson_basis_1d,spin_basis_1d
from quspin.operators import hamiltonian,exp_op
from quspin.tools.measurements import obs_vs_time
import numpy as np
import matplotlib.pyplot as plt
N=10
L=2*N
start=0
stop=10
num=20
endpoint=True
basis = boson_basis_1d(L,Nb=N)
np.random.seed()
U_1 = [[1.0,... | bsd-3-clause |
LSSTDESC/Twinkles | utils/catalog_production/add_om10_properties.py | 2 | 15129 | import numpy as np
import urllib
import os
import argparse
from sklearn.cross_validation import train_test_split
from astroML.plotting import setup_text_plots
import empiriciSN
from MatchingLensGalaxies_utilities import *
from astropy.io import fits
import GCRCatalogs
import pandas as pd
from GCR import GCRQuery
sys.pa... | mit |
3manuek/scikit-learn | sklearn/linear_model/least_angle.py | 42 | 49357 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... | bsd-3-clause |
taxpon/pyzxcvbn | pyzxcvbn/frequency_lists.py | 1 | 679035 | frequency_lists = {"male_names": "james,john,robert,michael,william,david,richard,charles,joseph,thomas,christopher,daniel,paul,mark,donald,george,kenneth,steven,edward,brian,ronald,anthony,kevin,jason,matthew,gary,timothy,jose,larry,jeffrey,frank,scott,eric,stephen,andrew,raymond,gregory,joshua,jerry,dennis,walter,pat... | mit |
mmottahedi/neuralnilm_prototype | scripts/e444.py | 2 | 18520 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/arithmetic/conftest.py | 2 | 5507 | import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
# ------------------------------------------------------------------
# Helper Functions
def id_func(x):
if isinstance(x, tuple):
assert len(x) == 2
return x[0].__name__ + "-" + str(x[1])
else:
retur... | apache-2.0 |
robertsj/ME701_examples | plots/animations/2D_imshow_ani.py | 1 | 1446 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
'''
This function will take data that is complete at the time of making the plot.
It generates an image for each timestep (or whatever you want to animate), and
creates the animation from the list of images.
'''
def make_data(... | mit |
SuperSaiyanSSS/SinaWeiboSpider | ml/svm_utils.py | 1 | 2502 | # coding=utf-8
from __future__ import print_function
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import re
import jieba
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn import svm
path_doc_root = 'H:\py\workplace\/a2\SogouC.reduced2\\Reduced' # 根目录 即存放按类分类好的问本纪
pa... | mit |
adelomana/schema | conditionedFitness/figureClonal/clonal.3.3.py | 2 | 3270 | import matplotlib,numpy,sys,scipy,pickle
import matplotlib.pyplot
sys.path.append('../lib')
import calculateStatistics
### MAIN
matplotlib.rcParams.update({'font.size':36,'font.family':'Times New Roman','xtick.labelsize':28,'ytick.labelsize':28})
thePointSize=12
jarDir='/Users/adriandelomana/scratch/'
# clonal 2
x... | gpl-3.0 |
rileymcdowell/genomic-neuralnet | genomic_neuralnet/analyses/plots/network_comparison/compare_networks.py | 1 | 5046 | from __future__ import print_function
import os
import numpy as np
import pandas as pd
import scipy.stats as sps
import matplotlib.pyplot as plt
import seaborn as sns
from statsmodels.stats.multicomp import pairwise_tukeyhsd
from shelve import DbfilenameShelf
from contextlib import closing
from collections import d... | mit |
ARM-software/lisa | lisa/analysis/functions.py | 1 | 32293 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... | apache-2.0 |
joernhees/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 70 | 7808 | """
Test the fastica algorithm.
"""
import itertools
import warnings
import numpy as np
from scipy import stats
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
... | bsd-3-clause |
zhushun0008/sms-tools | software/transformations_interface/sineTransformations_function.py | 2 | 5029 | # function call to the transformation functions of relevance for the sineModel
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import get_window
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
sys.path.append(os.path.join(os.path.dirname(os.p... | agpl-3.0 |
UNR-AERIAL/scikit-learn | examples/ensemble/plot_random_forest_embedding.py | 286 | 3531 | """
=========================================================
Hashing feature transformation using Totally Random Trees
=========================================================
RandomTreesEmbedding provides a way to map data to a
very high-dimensional, sparse representation, which might
be beneficial for classificati... | bsd-3-clause |
joshbohde/scikit-learn | sklearn/utils/extmath.py | 1 | 6785 | """
Extended math utilities.
"""
# Authors: G. Varoquaux, A. Gramfort, A. Passos, O. Grisel
# License: BSD
import math
from . import check_random_state
import numpy as np
from scipy import linalg
def norm(v):
v = np.asarray(v)
__nrm2, = linalg.get_blas_funcs(['nrm2'], [v])
return __nrm2(v)
def _fast_lo... | bsd-3-clause |
kartikkumar/pagmo | PyGMO/algorithm/_cross_entropy.py | 7 | 6923 | from PyGMO.algorithm import base
class py_cross_entropy(base):
"""
Cross-Entropy algorithm (Python)
"""
def __init__(
self,
gen=500,
elite=0.5,
scale=0.3,
variant=1,
screen_output=False):
"""
Constructs a Cross-E... | gpl-3.0 |
BasuruK/sGlass | Outdoor_Object_Recognition_Engine/train_CNN.py | 1 | 7200 | from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense, Dropout
from keras.callbacks import History, ModelCheckpoint
from keras.preprocessing.image import ImageDataGenerator
from keras.models import load_m... | gpl-3.0 |
LIAMF-USP/word2vec-TF | src/basic_experiment/experiments_eval.py | 1 | 2351 | """
Evaluate all the embeddings produce by the experiments
Before run this program you shuld run
bash experiments_script.sh
"""
import os
import pickle
import sys
import inspect
import matplotlib
matplotlib.use('Agg')
almost_current = os.path.abspath(inspect.getfile(inspect.currentframe()))
currentdir = os.path.dir... | mit |
pv/scikit-learn | sklearn/preprocessing/data.py | 113 | 56747 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# License: BSD 3 clause
from itertools import chain, combina... | bsd-3-clause |
shyamalschandra/scikit-learn | examples/calibration/plot_calibration.py | 33 | 4794 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
yugangzhang/chxanalys | chxanalys/Stitching.py | 1 | 19112 | import sys, os, re, PIL
import numpy as np
from scipy.signal import savgol_filter as sf
import matplotlib.pyplot as plt
from chxanalys.chx_generic_functions import show_img, plot1D
from chxanalys.DataGonio import convert_Qmap
def get_base_all_filenames( inDir, base_filename_cut_length = -7 ):
'''Y... | bsd-3-clause |
thientu/scikit-learn | sklearn/utils/graph.py | 289 | 6239 | """
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD 3 clause
impo... | bsd-3-clause |
shl198/Projects | Modules/f05_IDConvert.py | 2 | 23093 | """
This file includes functions of all kinds of ID converts, such as gene symbols to gene ids, protein ids to gene ids...
"""
import pandas as pd
import os
import subprocess
from Bio import Entrez
Entrez.email = "shl198@eng.ucsd.edu"
#===============================================================================
# T... | mit |
marianotepper/nmu_rfit | rnmu/test/test_climate.py | 1 | 5970 | from __future__ import absolute_import, print_function
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy.io
import scipy.sparse.linalg as sp_linalg
import seaborn.apionly as sns
import sys
import timeit
import rnmu.nmu as nmu
import rnmu.test.utils as test_utils
def ... | bsd-3-clause |
hong-chen/dotfiles | setup.py | 1 | 4636 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import re
class SETUP(object):
def __init__(self):
print(sys.platform)
if 'darwin' in sys.platform:
self.system = 'macOS'
print('Message [SETUP]: Setting up environment on macOS...')
... | mit |
malcolmw/seismic-python | seispy/core/defaults.py | 3 | 2062 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 27 14:00:58 2018
@author: malcolcw
This provides access to default arguments.
"""
import matplotlib.pyplot as plt
DEFAULT_RECTANGLE_KWARGS = {"origin": (33.5731, -116.633, 0),
"strike": 125,
... | gpl-3.0 |
platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-stats-halfgennorm-1.py | 1 | 1149 | from scipy.stats import halfgennorm
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
# Calculate a few first moments:
beta = 0.675
mean, var, skew, kurt = halfgennorm.stats(beta, moments='mvsk')
# Display the probability density function (``pdf``):
x = np.linspace(halfgennorm.ppf(0.01, beta),
... | gpl-2.0 |
KaliLab/optimizer | doc/conf.py | 2 | 8614 | # -*- coding: utf-8 -*-
#
# optimizer documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 12 01:59:02 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | lgpl-2.1 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/tests/indexes/common.py | 3 | 35517 | # -*- coding: utf-8 -*-
import pytest
from pandas import compat
from pandas.compat import PY3
import numpy as np
from pandas import (Series, Index, Float64Index, Int64Index, UInt64Index,
RangeIndex, MultiIndex, CategoricalIndex, DatetimeIndex,
TimedeltaIndex, PeriodIndex, Int... | mit |
kdebrab/pandas | pandas/tests/generic/test_panel.py | 3 | 1831 | # -*- coding: utf-8 -*-
# pylint: disable-msg=E1101,W0612
from warnings import catch_warnings
from pandas import Panel
from pandas.util.testing import (assert_panel_equal,
assert_almost_equal)
import pandas.util.testing as tm
import pandas.util._test_decorators as td
from .test_gener... | bsd-3-clause |
mshakya/PyPiReT | piret/Runs/GAGE.py | 2 | 2713 | # #! /usr/bin/env python
# """Check design."""
# import luigi
# from luigi import LocalTarget
# from piret import Summ
# from luigi.util import inherits, requires
# import pandas as pd
# from plumbum.cmd import Rscript
# @requires(DGE.edgeR)
# class GAGE(luigi.Task):
# """Perform GAGE analysis."""
# exp_des... | bsd-3-clause |
mitdrc/pronto | motion_estimate/scripts/republish_multisense_state.py | 2 | 1128 | #!/usr/bin/python
# MIT uses hokuyo_joint
# other teams use motor_joint, rename here
import os,sys
import lcm
import time
from lcm import LCM
from math import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from threading import Thread
import threading
home_dir =os.getenv("HOME")... | lgpl-2.1 |
CETodd/4501project | main.py | 1 | 13695 | from scipy.misc import imread, imresize, imsave, fromimage, toimage
from scipy.optimize import fmin_l_bfgs_b
import scipy.interpolate
import scipy.ndimage
import numpy as np
import time
import argparse
import warnings
from sklearn.feature_extraction.image import reconstruct_from_patches_2d, extract_patches_2d
from ker... | mit |
trungnt13/scikit-learn | examples/model_selection/plot_train_error_vs_test_error.py | 349 | 2577 | """
=========================
Train error vs Test error
=========================
Illustration of how the performance of an estimator on unseen data (test data)
is not the same as the performance on training data. As the regularization
increases the performance on train decreases while the performance on test
is optim... | bsd-3-clause |
PrashntS/scikit-learn | examples/covariance/plot_robust_vs_empirical_covariance.py | 248 | 6359 | r"""
=======================================
Robust vs Empirical covariance estimate
=======================================
The usual covariance maximum likelihood estimate is very sensitive to the
presence of outliers in the data set. In such a case, it would be better to
use a robust estimator of covariance to guar... | bsd-3-clause |
nick-thompson/neuro | plots/clipping.py | 1 | 1221 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-np.pi, np.pi, 201)
y = np.sin(x)
plt.figure()
plt.subplot(121)
# Color in the axes
plt.axvline(linewidth=1, color='#bbbbbb')
plt.axhline(linewidth=1, color='#bbbbbb')
x_one_one = np.linspace(-1, 1, 201)
# Soft Saturation
plt... | mit |
ericdill/bokeh | examples/plotting/file/unemployment.py | 46 | 1846 | from collections import OrderedDict
import numpy as np
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.models import HoverTool
from bokeh.sampledata.unemployment1948 import data
# Read in the data with pandas. Convert the year column to string
data['Year'] = [str(x) for x in data['Y... | bsd-3-clause |
mayblue9/scikit-learn | examples/linear_model/plot_omp.py | 385 | 2263 | """
===========================
Orthogonal Matching Pursuit
===========================
Using orthogonal matching pursuit for recovering a sparse signal from a noisy
measurement encoded with a dictionary
"""
print(__doc__)
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import OrthogonalM... | bsd-3-clause |
Sentient07/scikit-learn | benchmarks/bench_plot_nmf.py | 28 | 15630 | """
Benchmarks of Non-Negative Matrix Factorization
"""
# Authors: Tom Dupre la Tour (benchmark)
# Chih-Jen Linn (original projected gradient NMF implementation)
# Anthony Di Franco (projected gradient, Python and NumPy port)
# License: BSD 3 clause
from __future__ import print_function
from time imp... | bsd-3-clause |
krez13/scikit-learn | sklearn/linear_model/tests/test_sparse_coordinate_descent.py | 244 | 9986 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | bsd-3-clause |
datapythonista/pandas | pandas/tests/indexes/datetimes/test_ops.py | 3 | 4838 | from datetime import datetime
from dateutil.tz import tzlocal
import pytest
from pandas.compat import IS64
from pandas import (
DateOffset,
DatetimeIndex,
Index,
Series,
bdate_range,
date_range,
)
import pandas._testing as tm
from pandas.tseries.offsets import (
BDay,
Day,
Hour,
... | bsd-3-clause |
glouppe/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 176 | 2169 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... | bsd-3-clause |
SkyRocketToys/ardupilot | libraries/AP_Math/tools/geodesic_grid/plot.py | 110 | 2876 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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, or
# (at your option) any later version.
#
# This fi... | gpl-3.0 |
SidWatch/pyPSD | src/PowerSpectrumDensityProcessor.py | 1 | 2916 | __author__ = 'Administrator'
import yaml
import io
import h5py
import datetime as dt
import math
import numpy as np
import sys, getopt
from matplotlib.mlab import psd
class FrequencyUtility:
def __init__(self):
"""
Constructor
"""
def load_data(self, inputFileName):
with open(... | mit |
jaantollander/Pointwise-Convergence | src_legacy/analysis/plotting.py | 8 | 3846 | # coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.widgets import Button
from src_legacy.analysis.convergence impo... | mit |
Orcuslc/ECSGCC-Data | scripts/max_load_predict/modify_csv.py | 1 | 1192 | import numpy as np
import pandas as pd
import datetime as dt
path = '../../modified-data/dailyDATA_clean.csv'
save_path = '../../modified-data/simp_daily_data_2.csv'
data = pd.read_csv(path, encoding='gbk')
def dump_data(data):
new_data = pd.DataFrame()
new_data['date'] = data['date']
new_data['max_load'] = data... | gpl-3.0 |
kernc/scikit-learn | sklearn/linear_model/randomized_l1.py | 9 | 24350 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
sarahgrogan/scikit-learn | sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | bsd-3-clause |
MTgeophysics/mtpy | mtpy/modeling/modem/plot_rms_maps.py | 1 | 34831 | """
==================
ModEM
==================
# Generate files for ModEM
# revised by JP 2017
# revised by AK 2017 to bring across functionality from ak branch
Revision History:
brenainn.moushall@ga.gov.au 31-03-2020 13:38:10 AEDT:
- Add ability to plot on background geotiff
- Add ability to wr... | gpl-3.0 |
CopyChat/Plotting | Python/TestCode/sankey_demo_rankine.py | 7 | 3810 | """Demonstrate the Sankey class with a practicle example of a Rankine power cycle.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.sankey import Sankey
fig = plt.figure(figsize=(8, 9))
ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[],
title="Rankine Power Cycle: Example 8... | gpl-3.0 |
kcavagnolo/astroML | book_figures/chapter1/fig_moving_objects.py | 3 | 1911 | """
SDSS Moving Object Data
-----------------------
Figure 1.8.
The orbital semimajor axis vs. the orbital inclination angle diagram for the
first 10,000 catalog entries from the SDSS Moving Object Catalog (after
applying several quality cuts). The gaps at approximately 2.5, 2.8, and 3.3 AU
are called the Kirkwood gap... | bsd-2-clause |
teonlamont/mne-python | examples/decoding/plot_linear_model_patterns.py | 4 | 4361 | # -*- coding: utf-8 -*-
"""
===============================================================
Linear classifier on sensor data with plot patterns and filters
===============================================================
Here decoding, a.k.a MVPA or supervised machine learning, is applied to M/EEG
data in sensor space.... | bsd-3-clause |
ibmsoe/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py | 62 | 9268 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | apache-2.0 |
asurve/arvind-sysml2 | src/main/python/tests/test_mllearn_df.py | 4 | 5381 | #!/usr/bin/python
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this f... | apache-2.0 |
narendrameena/featuerSelectionAssignment | example.py | 1 | 2524 | print(__doc__)
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
# Jaques Grobler <jaques.grobler@inria.fr>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.svm import LinearSVC
from sklearn.cross_validation import ShuffleSplit
from sklearn.grid_search import GridS... | cc0-1.0 |
liyinwei/pandas | quickstart/03_selection.py | 1 | 10410 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: liyinwei
@E-mail: coridc@foxmail.com
@Time: 2016/11/21 11:33
@Description:
1.数据选择
2.尽管Python/Numpy已自带选择和赋值,为出于性能上的考虑,官方推荐在生产环境采用pandas中经过优化的方法,包括:
a).at
b).iat
c).loc
d).iloc
e).ix
3.包括以下几个部分
a)获取(Get... | gpl-3.0 |
AZMAG/urbansim | urbansim/utils/tests/test_misc.py | 4 | 5198 | import os
import shutil
import numpy as np
import pandas as pd
import pytest
from .. import misc
class _FakeTable(object):
def __init__(self, name, columns):
self.name = name
self.columns = columns
@pytest.fixture
def fta():
return _FakeTable('a', ['aa', 'ab', 'ac'])
@pytest.fixture
def ... | bsd-3-clause |
kmike/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 3 | 5597 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
nmmarquez/pymc | pymc3/examples/stochastic_volatility.py | 2 | 4664 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from matplotlib.pylab import *
import numpy as np
from pymc import *
from pymc.distributions.timeseries import *
from scipy.sparse import csc_matrix
from scipy import optimize
# <markdowncell>
# Asset prices have time-varying volatility (variance of d... | apache-2.0 |
gertingold/scipy | scipy/signal/spectral.py | 4 | 73530 | """Tools for spectral analysis.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy import fft as sp_fft
from . import signaltools
from .windows import get_window
from ._spectral import _lombscargle
from ._arraytools import const_ext, even_ext, odd_ext, zero_ext
import w... | bsd-3-clause |
kernc/scikit-learn | sklearn/model_selection/_search.py | 16 | 38824 | """
The :mod:`sklearn.model_selection._search` includes utilities to fine-tune the
parameters of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.... | bsd-3-clause |
RodenLuo/LSolver | crop_at_candidate.py | 2 | 11554 | # coding: utf-8
import sys
import numpy as np # linear algebra
subset = sys.argv[1]
crop_window_len = np.int(sys.argv[2])
# subset = 'train1'
# crop_window_len = 13
saving_mm_name = str(crop_window_len * 2 +1) + 'mm_POI'
import cv2
from skimage import segmentation
from sklearn.cluster import DBSCAN
import pandas a... | mit |
freedomDR/shiny-robot | homework/project/project0202.py | 1 | 1432 | import cv2 as cv
import matplotlib.pyplot as plt
def show(img_show, position):
plt.subplot(position[0], position[1], position[2])
plt.imshow(img_show, cmap='Greys_r')
plt.xticks([]), plt.yticks([])
plt.title(position)
# plt.tight_layout()
if __name__ == '__main__':
plt.figure(1)
img = cv.... | gpl-3.0 |
WilliamLanghoff/hemo | scripts/simulations.py | 1 | 4927 |
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import hemo.sims as sims
import scipy.integrate
import system
import importlib
def get_Wt(G, times, soln, liposomes=False):
"""Compute W(t) for an entire network
Parameters
----------
G
Graph Structure
times : arr... | gpl-3.0 |
nikste/tensorflow | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 153 | 6723 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.