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 |
|---|---|---|---|---|---|
batteries03/generative-adversarial-networks | src/mnist.py | 1 | 15569 | import numpy as np
import pickle
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import time, os
import tensorflow as tf
import layers
EPOCHS = 100
STEPS_PER_CHECKPOINT = 5
BATCH_SIZE = 100
TRAINING_DIR = './model/'
with open('../dataset/... | mit |
huobaowangxi/scikit-learn | sklearn/grid_search.py | 103 | 36232 | """
The :mod:`sklearn.grid_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.de>
# ... | bsd-3-clause |
befelix/GPy | GPy/examples/classification.py | 6 | 7792 | # Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
"""
Gaussian Processes classification examples
"""
import GPy
default_seed = 10000
def oil(num_inducing=50, max_iters=100, kernel=None, optimize=True, plot=True):
"""
Run a Gaussian process cl... | bsd-3-clause |
aayushkapadia/chemical_reaction_simulator | Simulator/Simulator.py | 1 | 1339 | from Reaction import *
import matplotlib.pyplot as plt
class Simulator:
def __init__(self,crn):
self.crn = crn
self.simulationData = dict()
self.crn.prepare()
for chemical_name in self.crn.concentrations:
self.simulationData[chemical_name] = []
def addInSimulationData(self,concentrations):
for chemic... | mit |
marcotcr/lime-experiments | generate_data_for_compare_classifiers.py | 1 | 9116 | import sys
import copy
sys.path.append('..')
import time
import numpy as np
import scipy as sp
import sklearn
import xgboost
import xgboost.sklearn
import explainers
from load_datasets import *
from sklearn.metrics import accuracy_score
from sklearn import ensemble, cross_validation
import pickle
import parzen_windows
... | bsd-2-clause |
vmonaco/single-hashing | single_hash.py | 1 | 2647 | '''
Created on Nov 20, 2012
@author: vinnie
'''
from utils import *
def in1d_running(q, A):
'''
j where q[k] in A for 0 <= k <= j
This is the maximum index j where q[0:j] is in A
'''
j = 0
while j < len(q) and q[j] in A:
j += 1
return j
def s_A(Q, A):
'''
s(A) = {(i,j) |... | mit |
junwucs/h2o-3 | h2o-py/docs/conf.py | 2 | 9583 | # -*- coding: utf-8 -*-
#
# H2O documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 5 15:32:52 2015.
#
# 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.
#
# All con... | apache-2.0 |
wathen/PhD | MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/SplitMatrix/TH/Solver.py | 1 | 5642 | from dolfin import assemble, MixedFunctionSpace, tic,toc
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import CheckPetsc4py as CP
import StokesPrecond
import NSpreconditioner
import MaxwellPrecond as MP
import MatrixOperations as MO
import PETScIO as IO
import numpy as np
import P as P... | mit |
skyuuka/fast-rcnn | tools/train_svms.py | 42 | 13247 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Train post-hoc SVMs using the algorithm and ... | mit |
bataeves/kaggle | instacart/imba/f1_optimal.py | 2 | 1524 | import pandas as pd
import numpy as np
from joblib import Parallel, delayed
import multiprocessing
from utils import fast_search
none_product = 50000
def applyParallel(dfGrouped, func):
retLst = Parallel(n_jobs=multiprocessing.cpu_count())(delayed(func)(group) for name, group in dfGrouped)
return pd.concat(r... | unlicense |
mr3bn/DAT210x | Module6/assignment3.py | 1 | 3383 | import matplotlib.pyplot as plt
import pandas as pd
def load(path_test, path_train):
# Load up the data.
# You probably could have written this..
with open(path_test, 'r') as f: testing = pd.read_csv(f)
with open(path_train, 'r') as f: training = pd.read_csv(f)
# The number of samples between training a... | mit |
davidgbe/scikit-learn | benchmarks/bench_glm.py | 297 | 1493 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... | bsd-3-clause |
lbishal/scikit-learn | benchmarks/bench_covertype.py | 120 | 7381 | """
===========================
Covertype dataset benchmark
===========================
Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART
(decision tree), RandomForest and Extra-Trees on the forest covertype dataset
of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ... | bsd-3-clause |
yyl/btc-price-analysis | sentiment_app.py | 1 | 6536 | """
The Bokeh applet to demonstrate the relatinship of news and BTC price
"""
import logging
logging.basicConfig(level=logging.DEBUG)
### bokeh import
from bokeh.plotting import figure, curdoc
from bokeh.models import Plot, ColumnDataSource
from bokeh.properties import Instance
from bokeh.server.app import bokeh_app
... | gpl-2.0 |
7even7/DAT210x | Module5/assignment8.py | 1 | 5205 | import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
matplotlib.style.use('ggplot') # Look Pretty
def drawLine(model, X_test, y_test, title):
# This convenience method will take care of plotting your
# test observati... | mit |
BillFoland/daisyluAMR | networks/AMR_NN_Forward.py | 1 | 6957 |
import os
import numpy as np
import h5py
import matplotlib.pyplot as plt
import pandas as pd
import pickle
import argparse
import ConfigParser
import sys
import shlex
from string import Template
import time
import argparse
import distutils.util
parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
parser.a... | mit |
dessn/sn-bhm | dessn/snana/convert_snana_data.py | 1 | 14063 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 15 12:42:49 2016
@author: shint1
"""
import numpy as np
import pandas as pd
import os
import pickle
import inspect
import re
import fnmatch
import hashlib
import logging
from scipy.stats import norm
from scipy.stats import binned_statistic
from dessn.snana.systematic_nam... | mit |
siutanwong/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
minhlongdo/scipy | doc/source/tutorial/examples/newton_krylov_preconditioning.py | 99 | 2489 | import numpy as np
from scipy.optimize import root
from scipy.sparse import spdiags, kron
from scipy.sparse.linalg import spilu, LinearOperator
from numpy import cosh, zeros_like, mgrid, zeros, eye
# parameters
nx, ny = 75, 75
hx, hy = 1./(nx-1), 1./(ny-1)
P_left, P_right = 0, 0
P_top, P_bottom = 1, 0
def get_precon... | bsd-3-clause |
wooga/airflow | tests/providers/apache/hive/hooks/test_hive.py | 1 | 34850 | #
# 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... | apache-2.0 |
joernhees/scikit-learn | examples/exercises/plot_iris_exercise.py | 31 | 1622 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
evanbiederstedt/CMBintheLikeHoodz | patchwork/Patchwork_nside512_ex1.py | 1 | 22119 |
from __future__ import (division, print_function, absolute_import)
# In[2]:
#get_ipython().magic(u'matplotlib inline')
import math
import matplotlib.pyplot as plt
import numpy as np
import healpy as hp
import pyfits as pf
import astropy as ap
import os
from scipy.special import eval_legendre ##special scipy funct... | mit |
mhdella/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
xiaoxiamii/scikit-learn | sklearn/utils/__init__.py | 79 | 14202 | """
The :mod:`sklearn.utils` module includes various utilities.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite,
... | bsd-3-clause |
tectronics/pmtk3 | python/demos/linregDemo1.py | 26 | 1104 | #!/usr/bin/python2.4
import numpy
import scipy.stats
import matplotlib.pyplot as plt
def main():
# true parameters
w = 2
w0 = 3
sigma = 2
# make data
numpy.random.seed(1)
Ntrain = 20
xtrain = numpy.linspace(0,10,Ntrain)
ytrain = w*xtrain + w0 + numpy.random.random(Ntrain)*sigma
... | mit |
tarashor/vibrations | py/main.py | 1 | 9937 | import fem.model
import fem.mesh
import fem.solver
import fem.geometry as g
import utils
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
def solve(width, curvature, corrugation_amplitude, corrugation_frequency, layers, N, M):
geometry = g.Corrug... | mit |
kcompher/FreeDiscovUI | freediscovery/utils.py | 1 | 7763 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import os.path
from contextlib import contextmanager
import pandas as pd
import numpy as np
import uuid
try: # sklearn v0.1... | bsd-3-clause |
nmayorov/scikit-learn | examples/linear_model/plot_ard.py | 29 | 2828 | """
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with Bayesian Ridge Regression.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary l... | bsd-3-clause |
pratapvardhan/pandas | asv_bench/benchmarks/algorithms.py | 3 | 3286 | import warnings
from importlib import import_module
import numpy as np
import pandas as pd
from pandas.util import testing as tm
for imp in ['pandas.util', 'pandas.tools.hashing']:
try:
hashing = import_module(imp)
break
except:
pass
from .pandas_vb_common import setup # noqa
class ... | bsd-3-clause |
aejax/KerasRL | test.py | 1 | 8131 | from agent import *
from value import *
from keras.optimizers import *
import keras.backend as K
import gym
import timeit
import argparse
import cPickle as pkl
import matplotlib
#Force matplotlib to use any Xwindows backend
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import simple_dqn
import atari_dqn
impor... | gpl-3.0 |
DucQuang1/py-earth | pyearth/test/test_earth.py | 1 | 13869 | '''
Created on Feb 24, 2013
@author: jasonrudy
'''
import pickle
import copy
import os
from nose.tools import (assert_equal, assert_not_equal, assert_true,
assert_almost_equal, assert_list_equal, assert_raises)
import numpy
from scipy.sparse import csr_matrix
from sklearn.utils.validation imp... | bsd-3-clause |
Srisai85/scikit-learn | examples/neighbors/plot_species_kde.py | 282 | 4059 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
zhenv5/scikit-learn | sklearn/linear_model/bayes.py | 220 | 15248 | """
Various bayesian regression
"""
from __future__ import print_function
# Authors: V. Michel, F. Pedregosa, A. Gramfort
# License: BSD 3 clause
from math import log
import numpy as np
from scipy import linalg
from .base import LinearModel
from ..base import RegressorMixin
from ..utils.extmath import fast_logdet, p... | bsd-3-clause |
OpringaoDoTurno/airflow | docs/conf.py | 23 | 8948 | # -*- coding: utf-8 -*-
#
# Airflow documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 9 20:50:01 2014.
#
# 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... | apache-2.0 |
Aasmi/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
mwv/scikit-learn | sklearn/decomposition/tests/test_truncated_svd.py | 240 | 6055 | """Test truncated SVD transformer."""
import numpy as np
import scipy.sparse as sp
from sklearn.decomposition import TruncatedSVD
from sklearn.utils import check_random_state
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
assert_raises, assert_greater,
... | bsd-3-clause |
hwroitzsch/BikersLifeSaver | lib/python3.5/site-packages/numpy/core/tests/test_multiarray.py | 2 | 220131 | from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decimal import Decimal
import numpy as... | mit |
larsmans/scipy | scipy/interpolate/fitpack.py | 25 | 46138 | #!/usr/bin/env python
"""
fitpack (dierckx in netlib) --- A Python-C wrapper to FITPACK (by P. Dierckx).
FITPACK is a collection of FORTRAN programs for curve and surface
fitting with splines and tensor product splines.
See
http://www.cs.kuleuven.ac.be/cwis/research/nalag/research/topics/fitpack.html
... | bsd-3-clause |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/manifold/setup.py | 99 | 1243 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | mit |
costypetrisor/scikit-learn | examples/cluster/plot_lena_compress.py | 271 | 2229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Vector Quantization Example
=========================================================
The classic image processing example, Lena, an 8-bit grayscale
bit-depth, 512 x 512 sized image, is used here to illustrate
how ... | bsd-3-clause |
Parisson/Telemeta | telemeta/management/commands/telemeta-export-item-revisions-plot.py | 2 | 2723 | from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from telemeta.models import *
import datetime, time, calendar, itertools
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.dates... | agpl-3.0 |
michigraber/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
michaelpacer/scikit-image | doc/examples/applications/plot_geometric.py | 28 | 3253 | """
===============================
Using geometric transformations
===============================
In this example, we will see how to use geometric transformations in the context
of image processing.
"""
from __future__ import print_function
import math
import numpy as np
import matplotlib.pyplot as plt
from skim... | bsd-3-clause |
Djabbz/scikit-learn | sklearn/cross_decomposition/tests/test_pls.py | 215 | 11427 | import numpy as np
from sklearn.utils.testing import (assert_array_almost_equal,
assert_array_equal, assert_true, assert_raise_message)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_
from nose.tools import assert_equal
def test_pls():
d =... | bsd-3-clause |
lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/io/test_feather.py | 3 | 4068 | """ test feather-format compat """
import pytest
feather = pytest.importorskip('feather')
import numpy as np
import pandas as pd
from pandas.io.feather_format import to_feather, read_feather
from feather import FeatherError
from pandas.util.testing import assert_frame_equal, ensure_clean
@pytest.mark.single
class ... | mit |
MaxHalford/Prince | setup.py | 1 | 3727 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'prince'
DESCRIPTION = 'Statistical factor... | mit |
hsamleandro/Salmonella_pub | scripts/makeconsensus.py | 1 | 2884 | #!/usr/bin/python
import argparse
import pandas as pd
import os
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
def numpos(var):
newpos = []
for i in range(len(var)):
if len(var.ix[i,'REF'])==1:
newpos.append([var.ix[i,'POS']-1])
else:
a... | gpl-2.0 |
rishikksh20/scikit-learn | sklearn/tests/test_kernel_approximation.py | 78 | 7586 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
rraadd88/dms2dfe | dms2dfe/lib/plot_pdb.py | 2 | 1725 | #!usr/bin/python
# Copyright 2016, Rohan Dandage <rraadd_8@hotmail.com,rohan@igib.in>
# This program is distributed under General Public License v. 3.
"""
================================
``plot_pdb``
================================
"""
from Bio.PDB import PDBParser,PDBIO
from collections import Counter
import re
... | gpl-3.0 |
weidel-p/nest-simulator | pynest/examples/plot_weight_matrices.py | 9 | 6702 | # -*- coding: utf-8 -*-
#
# plot_weight_matrices.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2 of the Li... | gpl-2.0 |
pavelchristof/gomoku-ai | tensorflow/examples/learn/iris_custom_decay_dnn.py | 37 | 3774 | # 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 appl... | apache-2.0 |
Tjorriemorrie/trading | 18_theoryofruns/runs.py | 1 | 2893 | import logging
import numpy as np
import argparse
import pandas as pd
from time import time
from pprint import pprint
from random import random, choice, shuffle, randint
from main import loadData, loadQ, saveQ, getBackgroundKnowledge, summarizeActions
from world import DATA, PERIODS, ACTIONS, getState, getReward
'''
... | mit |
jld23/saspy | saspy/tests/test_sasdata.py | 1 | 18298 | import os
import unittest
import pandas as pd
from IPython.utils.tempdir import TemporaryDirectory
from pandas.util.testing import assert_frame_equal
import saspy
from saspy.sasdata import SASdata
from saspy.sasresults import SASresults
class TestSASdataObject(unittest.TestCase):
@classmethod
def setUpClass... | apache-2.0 |
fenderglass/Nano-Align | nanoalign/random_forest.py | 1 | 2935 | #(c) 2015-2016 by Authors
#This file is a part of Nano-Align program.
#Released under the BSD license (see LICENSE file)
from __future__ import print_function
import random
from itertools import chain
import numpy as np
from sklearn.ensemble import RandomForestRegressor
from sklearn.feature_selection import f_regress... | bsd-2-clause |
ezhouyang/class | combine.py | 1 | 3583 | #coding:utf-8
'''
尝试利用多特征融合的手段
'''
import csv
import nltk
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
from sklearn.feature_selection import RFE
def read_file():
print "读文件"
f = open... | apache-2.0 |
stczhc/neupy | tests/algorithms/rbfn/test_rbf_kmeans.py | 1 | 1908 | import numpy as np
import matplotlib.pyplot as plt
from neupy import algorithms
from base import BaseTestCase
data = np.array([
[0.11, 0.20],
[0.25, 0.32],
[0.64, 0.60],
[0.12, 0.42],
[0.70, 0.73],
[0.30, 0.27],
[0.43, 0.81],
[0.44, 0.87],
[0.12, 0.92],
[0.56, 0.67],
[0.3... | mit |
futurulus/scipy | scipy/interpolate/tests/test_rbf.py | 45 | 4626 | #!/usr/bin/env python
# Created by John Travers, Robert Hetland, 2007
""" Test functions for rbf module """
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (assert_, assert_array_almost_equal,
assert_almost_equal, run_module_suit... | bsd-3-clause |
jjx02230808/project0223 | examples/applications/plot_outlier_detection_housing.py | 243 | 5577 | """
====================================
Outlier detection on a real data set
====================================
This example illustrates the need for robust covariance estimation
on a real data set. It is useful both for outlier detection and for
a better understanding of the data structure.
We selected two sets o... | bsd-3-clause |
EVEprosper/vincent_lexicon | setup.py | 1 | 3918 | """Project setup for vincent_lexicon"""
from os import path, listdir
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import importlib
HERE = path.abspath(path.dirname(__file__))
def get_version(package_name):
"""find __version__ for making package
Args:
... | apache-2.0 |
Ryanglambert/pybrain | examples/supervised/evolino/superimposed_sine.py | 25 | 3496 | from __future__ import print_function
#!/usr/bin/env python
__author__ = 'Michael Isik'
from pylab import plot, show, ion, cla, subplot, title, figlegend, draw
import numpy
from pybrain.structure.modules.evolinonetwork import EvolinoNetwork
from pybrain.supervised.trainers.evolino import EvolinoTrainer
from l... | bsd-3-clause |
rougier/Neurosciences | basal-ganglia/topalidou-et-al-2014/model.py | 1 | 10880 | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License.
#
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr)
# Meropi Topalidou (Meropi.Topalidou@inria.fr)
# -------... | bsd-3-clause |
cchauve/lrcstats | src/sanity_checks/maf_stats.py | 2 | 2823 | from __future__ import division
import getopt
import sys
import numpy as np
import matplotlib as mpl
mpl.use('agg')
import matplotlib.pyplot as plt
def getAlignedBases(read):
'''
Given a read alignment, returns the number of non-'-' chars.
'''
bases = 0
for char in read:
if char != "-":
bases += 1
return ... | gpl-3.0 |
rbalda/neural_ocr | env/lib/python2.7/site-packages/pybrain/tools/neuralnets.py | 3 | 13927 | # Neural network data analysis tool collection. Makes heavy use of the logging module.
# Can generate training curves during the run (from properly setup IPython and/or with
# TkAgg backend and interactive mode - see matplotlib documentation).
__author__ = "Martin Felder"
__version__ = "$Id$"
from pylab import ion, f... | mit |
gwpy/gwpy.github.io | docs/latest/plotter/colors-1.py | 7 | 1123 | from __future__ import division
import numpy
from matplotlib import (pyplot, rcParams)
from matplotlib.colors import to_hex
from gwpy.plotter import colors
rcParams.update({
'text.usetex': False,
'font.size': 15
})
th = numpy.linspace(0, 2*numpy.pi, 512)
names = [
'gwpy:geo600',
'gwpy:kagra',
'... | gpl-3.0 |
michaelkourlas/gini | frontend/src/gbuilder/UI/GraphWindow.py | 11 | 6860 | import numpy
import warnings
warnings.simplefilter('ignore',numpy.RankWarning)
from numpy.lib.polynomial import *
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
from matplotlib.figure im... | mit |
donK23/pyData-Projects | HolmesTopicModels/holmes_topic_models/preprocessing.py | 1 | 4373 | #!/usr/bin/python
""" preprocessing
Text preprocessing: Data wrangling and text vectorization.
Author: datadonk23
Date: 24.10.18
"""
import re
import unicodedata
from sklearn.datasets import load_files
from sklearn.feature_extraction import stop_words
from sklearn.feature_extraction.text import TfidfVectorizer
im... | apache-2.0 |
Sonophoto/pyDGW | SimpleExample.py | 1 | 3179 | """
*************************************************************************
____ _ _ _____ ____ __ __
/ ___|(_)_ __ ___ _ __ | | ___ | ___/ ___|| \/ |
\___ \| | '_ ` _ \| '_ \| |/ _ \ | |_ \___ \| |\/| |
___) | | | | | | | |_) | | __/ | _| ___) ... | bsd-2-clause |
GGoussar/scikit-image | doc/examples/xx_applications/plot_coins_segmentation.py | 5 | 5075 | """
==================================================
Comparing edge-based and region-based segmentation
==================================================
In this example, we will see how to segment objects from a background. We use
the ``coins`` image from ``skimage.data``, which shows several coins outlined
agains... | bsd-3-clause |
harisbal/pandas | pandas/io/stata.py | 1 | 107807 | """
Module contains tools for processing Stata files into DataFrames
The StataReader below was originally written by Joe Presbrey as part of PyDTA.
It has been extended and improved by Skipper Seabold from the Statsmodels
project who also developed the StataWriter and was finally added to pandas in
a once again improv... | bsd-3-clause |
cybernet14/scikit-learn | sklearn/utils/setup.py | 296 | 2884 | 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 |
damaggu/SAMRI | samri/report/registration.py | 1 | 3055 | import hashlib
import multiprocessing as mp
import pandas as pd
from os import path
from joblib import Parallel, delayed
from nipype.interfaces import ants, fsl
def measure_sim(path_template, substitutions, reference,
metric="MI",
radius_or_number_of_bins = 8,
sampling_strategy = "None",
sampling_percentage=0.3,
... | gpl-3.0 |
gfyoung/pandas | pandas/tests/plotting/test_datetimelike.py | 2 | 55641 | """ Test cases for time series specific (freq conversion, etc) """
from datetime import date, datetime, time, timedelta
import pickle
import sys
import numpy as np
import pytest
from pandas._libs.tslibs import BaseOffset, to_offset
import pandas.util._test_decorators as td
from pandas import DataFrame, Index, NaT, S... | bsd-3-clause |
ShujiaHuang/AsmVar | src/AsmvarAlterAlign/ASV_AlterAlignMain.py | 2 | 8698 | """
===============================================================================
Use pysam model to calculate the AS from bam file
===============================================================================
Author : Shujia Huang
Date : 2014-03-25 14:29:08
"""
import sys
import re
import optparse
import os
impo... | mit |
vibhorag/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
nachitoys/distributionalSemanticStabilityThesis | mkl.py | 2 | 6182 | from modshogun import *
from numpy import *
from sklearn.metrics import r2_score
from scipy.stats import randint
from scipy.stats import randint as sp_randint
from scipy.stats import expon
from mkl_regressor import *
from time import localtime, strftime
if __name__ == "__main__":
import Gnuplot, Gnuplot.funcutil... | gpl-2.0 |
lukauskas/dgw | dgw/data/containers.py | 2 | 20085 | from logging import debug
import pandas as pd
import numpy as np
from dgw.data.parsers.pois import map_to_bins
from dgw.dtw import no_nans_len
class AlignmentsDataIndexer(object):
"""
A wrapper around `_NDFrameIndexer` that would return `AlignmentsData` objects instead of `pd.Panel` objects
"""
_ndfra... | gpl-3.0 |
wlamond/scikit-learn | examples/svm/plot_iris.py | 65 | 3742 | """
==================================================
Plot different SVM classifiers in the iris dataset
==================================================
Comparison of different linear SVM classifiers on a 2D projection of the iris
dataset. We only consider the first 2 features of this dataset:
- Sepal length
- Se... | bsd-3-clause |
louispotok/pandas | pandas/io/api.py | 14 | 1146 | """
Data IO api
"""
# flake8: noqa
from pandas.io.parsers import read_csv, read_table, read_fwf
from pandas.io.clipboards import read_clipboard
from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
from pandas.io.pytables import HDFStore, get_store, read_hdf
from pandas.io.json import read_json
from pandas.i... | bsd-3-clause |
channsoden/hannsoden-bioinformatics | WholeGenomePhylogeny/WGP2_multiple_alignment.py | 1 | 5866 | #!/usr/bin/env python
# Standard modules
import os, sys
import subprocess as sp
from multiprocessing import Pool
# Nonstandard modules
from Bio import SeqIO
import pandas as pd
# My modules
import fasta_tools
from processing_tools import mapPool
from SLURM_tools import submit
from SLURM_tools import job_wait
import W... | gpl-3.0 |
jmmease/pandas | pandas/core/util/hashing.py | 6 | 10548 | """
data hash pandas / numpy objects
"""
import itertools
import numpy as np
from pandas._libs import hashing, tslib
from pandas.core.dtypes.generic import (
ABCMultiIndex,
ABCIndexClass,
ABCSeries,
ABCDataFrame)
from pandas.core.dtypes.common import (
is_categorical_dtype, is_list_like)
from panda... | bsd-3-clause |
rahlk/CSC579__Computer_Performance_Modeling | simulation/proj1/tasks/task5.py | 1 | 2063 | from __future__ import division
from __future__ import print_function
import os
import sys
import functools
# Update path
root = os.path.join(os.getcwd().split('proj1')[0], 'proj1')
if root not in sys.path:
sys.path.append(root)
import numpy as np
import pandas as pd
import multiprocessing
from pdb import set_tra... | mit |
maropu/spark | python/pyspark/ml/feature.py | 15 | 212774 | #
# 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 us... | apache-2.0 |
bloyl/mne-python | mne/utils/check.py | 1 | 27421 | # -*- coding: utf-8 -*-
"""The check functions."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
from builtins import input # no-op here but facilitates testing
from difflib import get_close_matches
from distutils.version import LooseVersion
import operator
import os
import o... | bsd-3-clause |
nealchenzhang/EODAnalyzer | plot.py | 1 | 2672 | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
#
# Created on Tue Jun 13 10:04:11 2017
# @author: nealcz @Aian_fund
# This program is personal trading platform desiged when employed in
# Aihui Asset Mana... | mit |
DGrady/pandas | setup.py | 2 | 28313 | #!/usr/bin/env python
"""
Parts of this file were taken from the pyzmq project
(https://github.com/zeromq/pyzmq) which have been permitted for use under the
BSD license. Parts are from lxml (https://github.com/lxml/lxml)
"""
import os
import sys
import shutil
import warnings
import re
import platform
from distutils.v... | bsd-3-clause |
okadate/romspy | romspy/make/boundary/bry_bio_fennel_linear.py | 1 | 2258 | # -*- coding: utf-8 -*-
"""
Program to make bry nc file
okada on 2014/10/21
"""
import numpy as np
import pandas as pd
Chl2C = 0.05 # okada (=1/20 gChl/gC)
PhyCN = 6.625 # (=106/16 molC/molN)
Phy2Zoo = 0.1
def bry_bio_fennel_linear(dims, csvfiles):
print 'bry_bio_fennel_linear:', 'w', csv... | mit |
adamrp/qiime | qiime/plot_rank_abundance_graph.py | 15 | 4175 | #!/usr/bin/env python
# File created on 17 Aug 2010
from __future__ import division
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Jens Reeder", "Emily TerAvest"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski"
__email__ = "justinak@gmai... | gpl-2.0 |
timestocome/Test-stock-prediction-algorithms | Curves, Markov and Bayes/StockCurves.py | 1 | 5652 |
# http://github.com/timestocome
#
# Data is from http://finance.yahoo.com
#
#
# let's take another look at the gain loss curves
#
# Whoa, baby look at that BitCoin Volatility distribution
# what does it mean, idk?
# there is the obvious
# it's a highly volitile market prone to sudden changes
#
# might also mean m... | mit |
belltailjp/scikit-learn | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
imaculate/scikit-learn | benchmarks/bench_plot_omp_lars.py | 28 | 4471 | """Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model impo... | bsd-3-clause |
PATRIC3/p3diffexp | expression_transform.py | 1 | 22822 | #!/usr/bin/env python
import argparse
import pandas as pd
import json
import sys
import numpy as np
import requests
import os
import uuid
import csv
from scipy import stats
from itertools import islice
try:
from lib import diffexp_api
except ImportError:
import diffexp_api
#requires 2.7.9 or greater to deal w... | mit |
cauchycui/scikit-learn | sklearn/ensemble/__init__.py | 217 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
chrsrds/scikit-learn | examples/cluster/plot_birch_vs_minibatchkmeans.py | 16 | 3640 | """
=================================
Compare BIRCH and MiniBatchKMeans
=================================
This example compares the timing of Birch (with and without the global
clustering step) and MiniBatchKMeans on a synthetic dataset having
100,000 samples and 2 features generated using make_blobs.
If ``n_clusters... | bsd-3-clause |
toastedcornflakes/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
rowhit/h2o-2 | py/testdir_single_jvm/test_GLM2_basic_cmp.py | 9 | 7620 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_exec, h2o_glm, h2o_jobs
import h2o_print as h2p
SCIPY_INSTALLED = True
try:
import scipy as sp
import numpy as np
import sklearn as sk
print "numpy, scipy and sklearn are installed. W... | apache-2.0 |
detrout/debian-statsmodels | statsmodels/examples/tsa/arma_plots.py | 33 | 2516 | '''Plot acf and pacf for some ARMA(1,1)
'''
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.tsa.arima_process as tsp
from statsmodels.sandbox.tsa.fftarma import ArmaFft as FftArmaProcess
import statsmodels.tsa.stattools as tss
from statsmodels.graphics.tsap... | bsd-3-clause |
qPCR4vir/orange3 | Orange/widgets/visualize/owparallelgraph.py | 3 | 35083 | #
# OWParallelGraph.py
#
from collections import defaultdict
import os
import sys
import math
import numpy as np
from PyQt4.QtCore import QLineF, Qt, QEvent, QRect, QPoint, QPointF
from PyQt4.QtGui import QGraphicsPathItem, QPixmap, QColor, QBrush, QPen, QToolTip, QPainterPath, QPolygonF, QGraphicsPolygonItem
from O... | bsd-2-clause |
rahulk90/inference_introspection | optvaemodels/vae_evaluate.py | 2 | 2979 | import numpy as np
from theano import config
import theano.tensor as T
from sklearn.decomposition import PCA
"""
External function to deal with evaluation of model
"""
def getPrior(vae, nsamples=100):
""" Sample from Prior """
z = np.random.randn(nsamples,vae.params['dim_stochastic'])
return z
def sample(... | mit |
sonnyhu/scikit-learn | examples/decomposition/plot_pca_iris.py | 65 | 1485 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
PCA example with Iris Data-set
=========================================================
Principal Component Analysis applied to the Iris dataset.
See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f... | bsd-3-clause |
TUW-GEO/rt1 | tests/test_rtmetrics.py | 1 | 4649 | import unittest
from itertools import combinations
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from rt1.rtmetrics import RTmetrics
from rt1 import rtfits
class TestRTMetrics(unittest.TestCase):
@staticmethod
def mock_series():
d1 = pd.Series([43.04, 20.55, 8.98, -15.27, 2... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.