repo_name stringlengths 7 90 | path stringlengths 5 191 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 976 581k | license stringclasses 15
values |
|---|---|---|---|---|---|
MostafaGazar/tensorflow | tensorflow/examples/skflow/text_classification_character_rnn.py | 6 | 3028 | # 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 |
COMBINE-lab/matryoshka_work | coredomains-import/python-src/compute_overlap_one_chromo.py | 1 | 7902 | # parse their domains, our domains, compute overlap
import sys
#import numpy.bisect
#import numpy
#import igraph
import collections
import matplotlib.pyplot as plt
import matplotlib
import math
Domain = collections.namedtuple("Domain", ["start", "end"])
def jaccard(D1, D2, N):
arr1 = [0 for i in xrange(N)]
for d1... | gpl-3.0 |
alshedivat/tensorflow | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 24 | 6776 | # 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 |
tomlof/scikit-learn | sklearn/feature_selection/__init__.py | 140 | 1302 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
dchud/dnflow | ui.py | 2 | 12153 | import logging
import sqlite3
from flask_oauthlib.client import OAuth
from flask import g, jsonify, request, redirect, session, flash, make_response
from flask import Flask, render_template, url_for, send_from_directory, abort
import pandas as pd
import redis
from rq import Queue
import numpy as np
from queue_tasks i... | cc0-1.0 |
tomsercu/metarunlog | metarunlog/__init__.py | 1 | 22170 | #!/usr/bin/env python
# Metarunlog, experiment management tool.
# Author: Tom Sercu
# Date: 2015-01-23
from metarunlog import cfg # NOTE cfg is modified by MetaRunLog._loadBasedirConfig() with custom configuration.
from metarunlog.exceptions import *
from metarunlog.util import nowstring, sshify, _decode_dict, _decode... | mit |
PatrickChrist/scikit-learn | sklearn/neighbors/classification.py | 132 | 14388 | """Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by ... | bsd-3-clause |
smblance/ggplot | ggplot/utils/color.py | 13 | 72058 | """
Python module for color functions.
"""
from __future__ import division
from __future__ import print_function
from __future__ import with_statement
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import types
from functools import partial
from collections import Iterable
fro... | bsd-2-clause |
curiousguy13/shogun | examples/undocumented/python_modular/graphical/regression_lars.py | 26 | 3327 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from modshogun import RegressionLabels, RealFeatures
from modshogun import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression
from modshogun import MeanSquaredError
# we compare LASSO with ordinary least-squares (OLE)
# in the idea... | gpl-3.0 |
eriklindernoren/ML-From-Scratch | mlfromscratch/examples/ridge_regression.py | 1 | 2967 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Import helper functions
from mlfromscratch.supervised_learning import PolynomialRidgeRegression
from mlfromscratch.utils import k_fold_cross_validation_sets, normalize, Plot
from mlfromscratch.utils import tra... | mit |
espenhgn/elephant | elephant/spike_train_correlation.py | 3 | 25850 | # -*- coding: utf-8 -*-
"""
This modules provides functions to calculate correlations between spike trains.
:copyright: Copyright 2015-2016 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import numpy as np
import neo
import quantities as ... | bsd-3-clause |
shangwuhencc/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 |
tosolveit/scikit-learn | sklearn/utils/tests/test_class_weight.py | 90 | 12846 | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... | bsd-3-clause |
pianomania/scikit-learn | sklearn/utils/extmath.py | 19 | 27505 | """
Extended math utilities.
"""
# Authors: Gael Varoquaux
# Alexandre Gramfort
# Alexandre T. Passos
# Olivier Grisel
# Lars Buitinck
# Stefan van der Walt
# Kyle Kastner
# Giorgio Patrini
# License: BSD 3 clause
from __future__ import division
from funct... | bsd-3-clause |
msultan/mdtraj | mdtraj/geometry/tests/test_thermodynamic_properties.py | 8 | 6594 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Kyle A. Beauchamp
# Contributors:
#
# MDTraj is free software:... | lgpl-2.1 |
arjoly/scikit-learn | examples/gaussian_process/plot_gpc.py | 103 | 3927 | """
====================================================================
Probabilistic predictions with Gaussian process classification (GPC)
====================================================================
This example illustrates the predicted probability of GPC for an RBF kernel
with different choices of the hy... | bsd-3-clause |
deeplycloudy/brawl4d | radar/collection.py | 1 | 6930 | import pandas
import numpy as np
import pyart
def diagnose_vcp(radar):
# swp_start = radar.sweep_start_ray_index['data']
# swp_end = radar.sweep_end_ray_index['data']+1
if 'ppi' in radar.scan_type.lower():
angles = [np.median(el) for el in radar.iter_elevation()]
else:
angles = [np.medi... | bsd-2-clause |
AlexRobson/scikit-learn | examples/cluster/plot_segmentation_toy.py | 258 | 3336 | """
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
spectral clustering is used to separate the circles.
In these settings, the :ref:`spectral_clustering` approach solve... | bsd-3-clause |
krasch/smart-assistants | examples/confusion_matrix.py | 1 | 1299 | # -*- coding: UTF-8 -*-
"""
Print a confusion matrix: list for each action how often each service was recommended
"""
import sys
sys.path.append("..")
import pandas
from recsys.classifiers.temporal import TemporalEvidencesClassifier
from recsys.dataset import load_dataset
from evaluation.metrics import QualityMetri... | mit |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/pandas/tests/test_expressions.py | 7 | 17763 | # -*- coding: utf-8 -*-
from __future__ import print_function
# pylint: disable-msg=W0612,E1101
import nose
import re
from numpy.random import randn
import operator
import numpy as np
from pandas.core.api import DataFrame, Panel
from pandas.computation import expressions as expr
from pandas import compat
from panda... | mit |
surajjumpy/Quantify-property-hazards-before-time-of-inspection | R script/Ex-LatestVersion.py | 1 | 3307 | '''
Based on Abhishek Catapillar benchmark
https://www.kaggle.com/abhishek/caterpillar-tube-pricing/beating-the-benchmark-v1-0
@author Devin
Have fun;)
'''
import pandas as pd
import numpy as np
from sklearn import preprocessing
import xgboost as xgb
from sklearn.feature_extraction import DictVectorizer
def xgb... | gpl-2.0 |
akrherz/iem | scripts/ingestors/other/feel_ingest.py | 1 | 4223 | """Ingest the ISU FEEL Farm data."""
import datetime
import os
import pandas as pd
from pyiem.util import get_dbconn
BASE = "/mnt/home/mesonet/ot/ot0005/incoming/Pierson"
def get_starttimes(cursor):
""" Figure out when we have data """
cursor.execute(
"""
SELECT max(valid at time zone 'UTC-0... | mit |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/pythonic_matplotlib.py | 9 | 2425 | #!/usr/bin/env python
"""
Some people prefer to write more pythonic, object oriented, code
rather than use the pylab interface to matplotlib. This example shows
you how.
Unless you are an application developer, I recommend using part of the
pylab interface, particularly the figure, close, subplot, axes, and
show comm... | mit |
mikebenfield/scikit-learn | sklearn/manifold/isomap.py | 39 | 7519 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
ThomasMiconi/nupic.research | projects/sequence_prediction/discrete_sequences/plotReberGrammar.py | 12 | 2502 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
klieret/pyplot-hierarchical-pie | examples/minimal_example_exploded.py | 1 | 1837 | #!/usr/bin/env python3
import os.path
import matplotlib
import matplotlib.pyplot as plt
from hpie import HPie, Path, stringvalues_to_pv
fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(2, 2)
axs = [ax0, ax1, ax2, ax3]
fig.set_size_inches(10, 10)
# set up some random data
data = stringvalues_to_pv({
'ipsum': ... | bsd-3-clause |
asurve/arvind-sysml | src/main/python/tests/test_mllearn_df.py | 2 | 4586 | #!/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 |
B3AU/waveTree | examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py | 7 | 3849 | """
==============================================
Feature agglomeration vs. univariate selection
==============================================
This example compares 2 dimensionality reduction strategies:
- univariate feature selection with Anova
- feature agglomeration with Ward hierarchical clustering
Both metho... | bsd-3-clause |
nelango/ViralityAnalysis | model/lib/pandas/io/tests/generate_legacy_storage_files.py | 9 | 8044 | """ self-contained to write legacy storage (pickle/msgpack) files """
from __future__ import print_function
from distutils.version import LooseVersion
from pandas import (Series, DataFrame, Panel,
SparseSeries, SparseDataFrame, SparsePanel,
Index, MultiIndex, PeriodIndex, bdate_r... | mit |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/partd/pandas.py | 3 | 6205 | from __future__ import absolute_import
from functools import partial
import numpy as np
import pandas as pd
from pandas.core.internals import create_block_manager_from_blocks, make_block
from . import numpy as pnp
from .core import Interface
from .compatibility import pickle
from .encode import Encode
from .utils im... | gpl-3.0 |
ncareol/lrose-soloPy | lrose_solopy/RadialDisplay.py | 1 | 42236 | # *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2014
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
# ** See LICENSE.TXT for license detai... | bsd-3-clause |
PrinceNgattaiLam/Trafic | TraficLib/envTensorFlow.py | 1 | 9354 | import os, sys
import subprocess
import json
import ast
def wrap(cmd_setenv, program, args=0):
bashCommand = cmd_setenv + " " + program
for flag,value in args.items():
bashCommand = bashCommand + " " + flag + " " + value
command = ["bash", "-c", str(bashCommand)]
p = subprocess.Popen(command... | apache-2.0 |
kazemakase/scikit-learn | sklearn/datasets/species_distributions.py | 198 | 7923 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/lib/matplotlib/tri/trifinder.py | 11 | 3305 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib.tri import Triangulation
import matplotlib._tri as _tri
class TriFinder(object):
"""
Abstract base class for classes used to find the triangles of a
Triangulation in wh... | mit |
idlead/scikit-learn | examples/ensemble/plot_forest_iris.py | 335 | 6271 | """
====================================================================
Plot the decision surfaces of ensembles of trees on the iris dataset
====================================================================
Plot the decision surfaces of forests of randomized trees trained on pairs of
features of the iris dataset.
... | bsd-3-clause |
cogmission/nupic.research | projects/sequence_prediction/continuous_sequence/nupic_output.py | 13 | 6732 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
dmytroKarataiev/MachineLearning | capstone/bolinger.py | 1 | 2693 | """Bollinger Bands."""
import os
import pandas as pd
import matplotlib.pyplot as plt
def symbol_to_path(symbol, base_dir="data"):
"""Return CSV file path given ticker symbol."""
# return os.path.join(base_dir, "{}.csv".format(str(symbol)))
return "{}.csv".format(str(symbol))
def get_data(symbols, dates)... | mit |
gfyoung/pandas | pandas/tests/libs/test_lib.py | 2 | 7946 | import numpy as np
import pytest
from pandas._libs import Timestamp, lib, writers as libwriters
from pandas import Index
import pandas._testing as tm
class TestMisc:
def test_max_len_string_array(self):
arr = a = np.array(["foo", "b", np.nan], dtype="object")
assert libwriters.max_len_string_ar... | bsd-3-clause |
BoltzmannBrain/nupic.research | projects/sequence_prediction/continuous_sequence/data/processSantaFeDataset.py | 13 | 2104 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
untom/scikit-learn | sklearn/decomposition/dict_learning.py | 83 | 44062 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
louispotok/pandas | pandas/tests/indexes/period/test_setops.py | 5 | 10620 | import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pandas.core.indexes.period as period
from pandas import period_range, PeriodIndex, Index, date_range
def _permute(obj):
return obj.take(np.random.permutation(len(obj)))
class TestPeriodIndex(object):
def test_joi... | bsd-3-clause |
pymedusa/SickRage | ext/pint/__init__.py | 3 | 2938 | # -*- coding: utf-8 -*-
"""
pint
~~~~
Pint is Python module/package to define, operate and manipulate
**physical quantities**: the product of a numerical value and a
unit of measurement. It allows arithmetic operations between them
and conversions from and to different units.
:copyright: 2... | gpl-3.0 |
ericdill/chxtools | pyXPCS/XPCS_Code_0407.py | 2 | 22976 | ######################################################################################
##Revised Based on Yorick_Multitau_Code Obtained from Dr. Andrei Fluerasu###############
#################### Coded by Dr. Yugang Zhang #################################
#################### 631-885-4714 #######################... | bsd-3-clause |
tody411/ImageViewerFramework | ivf/batch/sfs.py | 1 | 7594 | # -*- coding: utf-8 -*-
## @package ivf.batch.sfs
#
# ivf.batch.sfs utility package.
# @author tody
# @date 2016/02/05
import numpy as np
import cv2
import matplotlib.pyplot as plt
from ivf.batch.batch import DatasetBatch, CharacterBatch
from ivf.io_util.image import loadNormal, loadRGBA, saveNormal
fr... | mit |
chagaz/SamSpecCoEN | code/setupSubtypeStratifiedCV_computeNetworks.py | 1 | 4164 | # @Author
# Chloe-Agathe Azencott
# chloe-agathe.azencott@mines-paristech.fr
# April 2016
import argparse
import h5py
import numpy as np
import os
import sys
#from sklearn import cross_validation as skcv
DATA_DIR = "/share/data40T/chloe/SamSpecCoEN"
import CoExpressionNetwork
numFolds = 10
def main():
""" ... | mit |
Shaswat27/scipy | scipy/signal/wavelets.py | 9 | 10458 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.dual import eig
from scipy.special import comb
from scipy import linspace, pi, exp
from scipy.signal import convolve
__all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'cwt']
def daub(p):
"""
The coefficient... | bsd-3-clause |
neuroidss/nupic.research | htmresearch/frameworks/layers/l2_l4_inference.py | 4 | 33445 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
TheNameIsNigel/opencog | opencog/python/utility/functions.py | 34 | 11056 | from math import fabs, isnan
from datetime import datetime
from spatiotemporal.unix_time import UnixTime
from utility.generic import convert_dict_to_sorted_lists
from utility.numeric.globals import EPSILON
from numpy import NINF as NEGATIVE_INFINITY, PINF as POSITIVE_INFINITY
from scipy.integrate import quad
__author_... | agpl-3.0 |
HeraclesHX/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 105 | 22788 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
UwHyperloop/Hyperloop | src/hyperloop/chart_generator.py | 2 | 5443 | from hyperloop_sim import HyperloopSim
from openmdao.units.units import convert_units as cu
from matplotlib import pyplot, rcParams
import numpy as np
from time import time
import sys
from os import devnull
def plot(p, x_array, x_varname, y_varnames, x_label, y_label,
title='HyperloopSim', postprocess_funcs=tu... | apache-2.0 |
magnastrazh/NEUCOGAR | nest/noradrenaline/nest-2.10.0/topology/pynest/tests/test_dumping.py | 13 | 3483 | # -*- coding: utf-8 -*-
#
# test_dumping.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 License, o... | gpl-2.0 |
prheenan/Research | Perkins/Projects/Protein/bacteriorhodopsin/2017-7-jcp-paper/Figures/SI/Filtering/main_filtering.py | 1 | 6567 | # force floating point division. Can still use integer with //
from __future__ import division
# other good compatibility recquirements for python3
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
# This file is used for importing the common utilities ... | gpl-3.0 |
kashif/scikit-learn | sklearn/linear_model/tests/test_sag.py | 33 | 28228 | # Authors: Danny Sullivan <dbsullivan23@gmail.com>
# Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# Licence: BSD 3 clause
import math
import numpy as np
import scipy.sparse as sp
from sklearn.linear_model.sag import get_auto_step_size
from sklearn.linear_model.sag_fast import _multinomial_grad_loss_all_sa... | bsd-3-clause |
ltiao/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 |
wholmgren/pvlib-python | pvlib/test/test_psm3.py | 1 | 2667 | """
test iotools for PSM3
"""
import os
from pvlib.iotools import psm3
from conftest import needs_pandas_0_22
import numpy as np
import pandas as pd
import pytest
from requests import HTTPError
BASEDIR = os.path.abspath(os.path.dirname(__file__))
PROJDIR = os.path.dirname(BASEDIR)
DATADIR = os.path.join(PROJDIR, 'dat... | bsd-3-clause |
lily-zhangying/find_best_mall | recomendation system/get_scores.py | 3 | 5354 | __author__ = 'John'
import one_class
import cf
import nmf_analysis
import evaluate
import numpy as np
import pandas as pd
import similarity
import wlas
import pop_rec
import content
from nmf_analysis import mall_latent_helper as nmf_helper
import filter_demo_data
import ensemble
np.random.seed(9001)
result_directory =... | mit |
grlee77/pywt | demo/plot_demo_signals.py | 3 | 1392 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Plot the set of 1D demo signals available in `pywt.data.demo_signal`."""
import numpy as np
import matplotlib.pyplot as plt
import pywt
# use 'list' to get a list of all available 1d demo signals
signals = pywt.data.demo_signal('list')
subplots_per_fig = 5
signal_... | mit |
ellisk42/TikZ | graphEvaluation.py | 1 | 44052 | import math
import numpy as np
import matplotlib.pyplot as plot
xs = range(1,36)
MAXIMUMY = None
def standardError(l):
d = np.array(l) - average(l)
d = d*d
variance = d.sum()/len(l)
deviation = math.sqrt(variance)
return deviation/math.sqrt(len(l))
def bernoulliStandardError(l):
p = average(l... | gpl-3.0 |
Equitable/trump | trump/test/test_orm.py | 2 | 17330 | from trump.orm import Symbol, SetupTrump, SymbolManager, ConversionManager, \
SymbolLogEvent
from trump.templating.templates import GoogleFinanceFT, YahooFinanceFT,\
SimpleExampleMT, CSVFT, FFillIT, FeedsMatchVT, DateExistsVT, PctChangeMT
import pandas as pd
import pytest
from pytest import mark... | bsd-3-clause |
tempbottle/Nuitka | tests/library/compile_library.py | 1 | 4896 | #!/usr/bin/env python
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# ... | apache-2.0 |
JohanComparat/nbody-npt-functions | bin/bin_onePT/project_MF.py | 1 | 8285 | import astropy.units as uu
import astropy.cosmology as co
aa = co.Planck13
import math as m
from scipy.integrate import quad
import os
aah = co.FlatLambdaCDM(H0=100.0 *uu.km / (uu.Mpc *uu.s), Om0=0.307, Tcmb0=2.725 *uu.K, Neff=3.05, m_nu=[ 0. , 0. , 0.06]*uu.eV, Ob0=0.0483)
rhom0 = aah.critical_density0.to(uu.solM... | cc0-1.0 |
vermouthmjl/scikit-learn | sklearn/tests/test_dummy.py | 186 | 17778 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.base import clone
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_eq... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/groupby/test_grouping.py | 1 | 35091 | """ test where we are determining what we are grouping, or getting groups """
import numpy as np
import pytest
import pandas as pd
from pandas import (
CategoricalIndex,
DataFrame,
Index,
MultiIndex,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
from pandas.core.groupby.gro... | bsd-3-clause |
bbcdli/xuexi | vid_ana_k/eva_ori.py | 1 | 9268 | #!/usr/bin/env python
#code source
#https://github.com/axon-research/c3d-keras/blob/master/test_model.py
import matplotlib
matplotlib.use('Agg')
from keras.models import model_from_json
import os
import cv2
import time
import numpy as np
import matplotlib.pyplot as plt
import c3d_keras_model as c3d_model
import sys
imp... | apache-2.0 |
deepesch/scikit-learn | examples/model_selection/plot_roc.py | 96 | 4487 | """
=======================================
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 |
Saurabh7/shogun | examples/undocumented/python_modular/graphical/interactive_svm_demo.py | 16 | 12671 | """
Shogun demo, based on PyQT Demo by Eli Bendersky
Christian Widmer
Soeren Sonnenburg
License: GPLv3
"""
import numpy
import sys, os, csv
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib
from matplotlib import mpl
from matplotlib.colorbar import make_axes, Colorbar
from matplotlib.backends.bac... | mit |
kagayakidan/scikit-learn | sklearn/covariance/tests/test_covariance.py | 69 | 11116 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
mlyundin/scikit-learn | examples/ensemble/plot_voting_decision_regions.py | 230 | 2386 | """
==================================================
Plot the decision boundaries of a VotingClassifier
==================================================
Plot the decision boundaries of a `VotingClassifier` for
two features of the Iris dataset.
Plot the class probabilities of the first sample in a toy dataset
pred... | bsd-3-clause |
zaxliu/scipy | scipy/cluster/tests/test_hierarchy.py | 26 | 35153 | #! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copy... | bsd-3-clause |
Icenowy/MissionPlanner | Lib/site-packages/scipy/optimize/nonlin.py | 53 | 46004 | r"""
Nonlinear solvers
=================
.. currentmodule:: scipy.optimize
This is a collection of general-purpose nonlinear multidimensional
solvers. These solvers find *x* for which *F(x) = 0*. Both *x*
and *F* can be multidimensional.
Routines
--------
Large-scale nonlinear solvers:
.. autosummary::
newton... | gpl-3.0 |
pulinagrawal/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_cocoaagg.py | 70 | 8970 | from __future__ import division
"""
backend_cocoaagg.py
A native Cocoa backend via PyObjC in OSX.
Author: Charles Moad (cmoad@users.sourceforge.net)
Notes:
- Requires PyObjC (currently testing v1.3.7)
- The Tk backend works nicely on OSX. This code
primarily serves as an example of embedding a
matpl... | agpl-3.0 |
SnowWalkerJ/quantlib | quant/data/wind/__init__.py | 1 | 20848 | """Wind数据库接口"""
from collections import defaultdict
import os
import sys
import pickle
from inspect import signature
import warnings
from datetime import date, datetime
from typing import List, Union, Set
import numpy as np
import pandas as pd
import sqlalchemy as sa
import sqlalchemy.sql as sql
from dateutil.parser i... | gpl-3.0 |
rodluger/everest | everest/user.py | 1 | 58742 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
:py:mod:`user.py` - User Python routines
----------------------------------------
This is the gateway to the :py:obj:`everest` catalog, containing
all of the user-facing code.
- :py:class:`Everest` is the main user-facing class for
interfacing with the catalog
- :py... | mit |
meatcomputer/opencog | opencog/python/spatiotemporal/temporal_events/animation.py | 34 | 4896 | from matplotlib.lines import Line2D
from matplotlib.ticker import AutoMinorLocator
from numpy.core.multiarray import zeros
from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium
from spatiotemporal.time_intervals import TimeInterval
from matplotlib import pyplot as plt
from matplotlib import animat... | agpl-3.0 |
ZhiangChen/bendix_dnn | generate_data/import_data_example.py | 1 | 1381 | #!/usr/bin/env python
from six.moves import cPickle as pickle
import matplotlib.pyplot as plt
from visualize_data import Visualizer
import os
import cv2
wd = os.getcwd() # get current work directory
file_name = wd + '/front_dist_data'
with open(file_name,'rb') as f:
save = pickle.load(f) # load file to pickle
pos_d... | mit |
uglyboxer/learn_nums | neuron.py | 1 | 6007 | # A basic single-neuron Perceptron
# Will learn from one set of data, then make educated guesses as to
# the identity of things described in a second set of data
#
# Title: neuron.py
# Author: Cole Howard
# Contact: cole@subtlegears.com
# References:
#
# Usage: python learn_nums.py
#
# Dataset: Written to work on the... | unlicense |
rahuldhote/scikit-learn | examples/ensemble/plot_forest_importances.py | 241 | 1761 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
petroniocandido/pyFTS | pyFTS/tests/cmsfts.py | 1 | 1771 | #!/usr/bin/python
# -*- coding: utf8 -*-
import os
import numpy as np
import pandas as pd
import matplotlib as plt
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import datetime
import pandas as pd
from pyFTS.partitioners import Grid, CMeans, FCM, Entropy
from pyFTS.common import FLR, FuzzyS... | gpl-3.0 |
alexsavio/scikit-learn | examples/cluster/plot_face_segmentation.py | 71 | 2839 | """
===================================================
Segmenting the picture of a raccoon face in regions
===================================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous... | bsd-3-clause |
diyjac/SDC-P3 | attempts/behaviorClone5.py | 1 | 6074 | ## Training model #5
##
## Nvidia's Model from https://arxiv.org/pdf/1604.07316v1.pdf
## Use side cameras
##
## import some useful python modules
import os
from pathlib import Path
import numpy as np
from numpy.random import random
import cv2
import pandas as pd
import json
from keras.models import Sequential, model_fr... | mit |
esc/bquery | bquery/ctable.py | 1 | 13172 | # internal imports
import ctable_ext
# external imports
import numpy as np
import bcolz
from collections import namedtuple
import os
class ctable(bcolz.ctable):
def cache_factor(self, col_list, refresh=False):
"""
Existing todos here are: these should be hidden helper carrays
As in: not n... | mit |
eranchetz/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/geo.py | 69 | 19738 | import math
import numpy as np
import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.artist import kwdocd
from matplotlib.axes import Axes
from matplotlib import cbook
from matplotlib.patches import Circle
from matplotlib.path import Path
from matplotlib.ticker import Formatter, Locat... | agpl-3.0 |
theoryno3/scikit-learn | sklearn/tests/test_metaestimators.py | 226 | 4954 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
Aasmi/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 32 | 6044 | 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 |
rrohan/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 |
krez13/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 34 | 3060 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
loli/sklearn-ensembletrees | examples/ensemble/plot_bias_variance.py | 2 | 7325 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py | 12 | 11510 | # 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 |
Windy-Ground/scikit-learn | sklearn/linear_model/setup.py | 146 | 1713 | 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('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | bsd-3-clause |
mrahnis/surficial | surficial/core/alignment.py | 1 | 12648 | from __future__ import annotations
import warnings
from typing import Union, Optional, Iterable
import networkx as nx
from networkx import DiGraph
import pandas as pnd
from shapely.geometry import Point, LineString, MultiLineString
from shapely.ops import transform, unary_union
from surficial.ops.graph import extend... | bsd-3-clause |
anirudhjayaraman/scikit-learn | doc/conf.py | 210 | 8446 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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.
... | bsd-3-clause |
abhishekgahlot/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 67 | 14842 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
fr... | bsd-3-clause |
Silmathoron/nest-simulator | pynest/nest/tests/test_visualization.py | 5 | 6999 | # -*- coding: utf-8 -*-
#
# test_visualization.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 Lice... | gpl-2.0 |
femtotrader/python-eodhistoricaldata | eod_historical_data/_utils.py | 1 | 1276 | import requests
import datetime
import pandas as pd
from pandas.api.types import is_number
from urllib.parse import urlencode
def _init_session(session):
"""
Returns a requests.Session (or CachedSession)
"""
if session is None:
return requests.Session()
return session
def _url(url, param... | mit |
dhhjx880713/GPy | GPy/util/datasets.py | 3 | 65191 | from __future__ import print_function
import csv
import os
import copy
import numpy as np
import GPy
import scipy.io
import zipfile
import tarfile
import datetime
import json
import re
import sys
from io import open
from .config import *
ipython_available=True
try:
import IPython
except ImportError:
ipython_av... | bsd-3-clause |
mhogg/scipy | scipy/signal/filter_design.py | 2 | 127807 | """Filter design.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy
from numpy import (atleast_1d, poly, polyval, roots, real, asarray, allclose,
resize, pi, absolute, logspace, r_, sqrt, tan, log10,
arctan, arcsinh, sin, exp, cosh,... | bsd-3-clause |
ua-snap/downscale | old/old_bin/tas_cld_ar5_model_data_preprocess.py | 3 | 12236 | #!/usr/bin/python2
# #
# pre-processing of raw downloaded CMIP5 data from the PCMDI portal to something that is standardized for
# use in later downscaling to ALFRESCO AK/Canada extent and resolution needs.
# # # # #
def group_input_filenames( prefix, root_dir ):
import fnmatch, functools, itertools, os, glob
imp... | mit |
stevemclaugh/audio-tagging-toolkit | setup.py | 2 | 1076 | from setuptools import setup, find_packages
from codecs import open
import os.path
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='attk',
version='0.0.88',
description='Audio Tagging Toolkit: A collection of scripts to expedite audio annotation and class... | apache-2.0 |
makokal/scalable-irl | examples/social_navigation/learn_representation.py | 1 | 3002 |
from __future__ import division
import json
import argparse
import numpy as np
import matplotlib
matplotlib.use('Qt4Agg')
from matplotlib import pyplot as plt
from sirl.domains.navigation.social_navigation import SocialNavMDP
from sirl.domains.navigation.local_controllers import POSQLocalController
from sirl.doma... | bsd-3-clause |
gpfreitas/bokeh | bokeh/charts/stats.py | 2 | 7495 | """ Statistical methods used to define or modify position of glyphs.
References:
Wilkinson L. The Grammer of Graphics, sections 7, 7.1
Method Types:
- Bin: Partitions a space before statistical calculation
- Summary: Produces a single value comprising a statistical summary
- Region: Produces two value... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.