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 |
|---|---|---|---|---|---|
Chilipp/psyplot | tests/test_project.py | 1 | 75156 | """Test module of the :mod:`psyplot.project` module"""
import os
import os.path as osp
import shutil
import six
import pytest
import unittest
import yaml
from itertools import chain
import _base_testing as bt
import test_data as td
import test_plotter as tp
import xarray as xr
import psyplot.data as psyd
import psyplot... | gpl-2.0 |
rs2/pandas | pandas/tests/scalar/timedelta/test_formats.py | 11 | 1261 | import pytest
from pandas import Timedelta
@pytest.mark.parametrize(
"td, expected_repr",
[
(Timedelta(10, unit="d"), "Timedelta('10 days 00:00:00')"),
(Timedelta(10, unit="s"), "Timedelta('0 days 00:00:10')"),
(Timedelta(10, unit="ms"), "Timedelta('0 days 00:00:00.010000')"),
... | bsd-3-clause |
spalaciob/py-dbclasd | dbclasd.py | 1 | 14247 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DESCRIPTION: Python implementation of the DBCLASD algorithm: a non-parametric clustering algorithm
@copyright: Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH or its licensors, as applicable (2015)
@author: Sebastian Palacio
"""
import sys
import time
im... | gpl-2.0 |
CharlesGulian/Deconv | do_sexstats.py | 1 | 2900 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 16 10:36:10 2016
@author: charlesgulian
"""
import os
import matplotlib.pyplot as plt
import numpy as np
#from astropy.io import fits
# Later add command line functionality
dir_name = os.getcwd()
n = open(dir_name + '/img_name_compare.txt','r')
img_tag1 = (n.readline()... | gpl-3.0 |
kylerbrown/scikit-learn | examples/svm/plot_iris.py | 225 | 3252 | """
==================================================
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 |
danqhu/Machine-Learning-Algorithm | K-Means/K-Means.py | 1 | 5066 | import numpy as np
import random
import time
import os
import matplotlib.pyplot as plt
class KMeans():
def fit(self, xTrain, numOfCluster, numOfIteration = 1000, epsilon = 0.00000001, numOfRandomInitialization = 10):
self.initialization(xTrain, numOfCluster, numOfIteration, epsilon, numOfRandomInitializa... | gpl-3.0 |
geopandas/geopandas | doc/source/conf.py | 1 | 13315 | # -*- coding: utf-8 -*-
#
# GeoPandas documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 15 08:08:14 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... | bsd-3-clause |
vantares/trading-with-python | lib/vixFutures.py | 79 | 4157 | # -*- coding: utf-8 -*-
"""
set of tools for working with VIX futures
@author: Jev Kuznetsov
Licence: GPL v2
"""
import datetime as dt
from pandas import *
import os
import urllib2
#from csvDatabase import HistDataCsv
m_codes = dict(zip(range(1,13),['F','G','H','J','K','M','N','Q','U','V','X','Z'])) #m... | bsd-3-clause |
markroxor/gensim | gensim/sklearn_api/ldaseqmodel.py | 1 | 3151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Chinmaya Pancholi <chinmayapancholi13@gmail.com>
# Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Scikit learn interface for gensim for easy use of gensim with scikit-lear... | lgpl-2.1 |
alfeinsod/xastropy | xastropy/PH136/exercises/ccd_exerc.py | 7 | 6460 | """Module to perform the CCD exercise for PH136.
"""
# Import libraries
from numpy import *
from astropy.io import fits
from matplotlib.backends.backend_pdf import PdfPages
# ###############
# Read FITS file, plot image
def plot_img(pp,fil):
# Imports
from matplotlib import pyplot
# Read the image
f... | bsd-3-clause |
SiLab-Bonn/testbeam_analysis | testbeam_analysis/examples/kalman_filter.py | 2 | 13846 | ''' This is an example how to use a kalman filter to improve tracking by taking into account multiple scattering.
In the example a telescope consisting of six Mimosa26 sensors (18.5 um x 18.5 um) and one ATLAS FE-I4 plane (50 um x 250 um) is considered.
It is assumed, that only at the Mimosa26 sensor multiple scatterin... | mit |
nvoron23/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 204 | 5442 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
jamesmorad/pLUX | return_random_sumpod.py | 1 | 5845 | #!/usr/bin/env ipython
import EvtReader_PyMod
import RQReader_PyMod
import GetPodOverlaps_PyMod
import numpy as np
import random
import glob
import os
import fnmatch
import math
import matplotlib.pyplot as plt
def rand_pulse_area_phe(pulse_area):
my_list = ['A'] * 4 + ['B'] * 24 + ['C'] * 24 + ['D'... | mit |
TariqAHassan/BioVida | biovida/images/_image_tools.py | 1 | 5019 | # coding: utf-8
"""
General Tools for the Image Subpackage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import numpy as np
from PIL import Image
from time import sleep
from scipy.misc import imread, imresize
from skimage.color.colorconv import rgb2gray
# General Support Tools
from biovida.support_tools.suppor... | bsd-3-clause |
SusanJL/iris | lib/iris/tests/unit/quickplot/test_outline.py | 11 | 2277 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
deepakantony/sms-tools | lectures/04-STFT/plots-code/stft-system.py | 5 | 1461 | import numpy as np
import time, os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import utilFunctions as UF
import matplotlib.pyplot as plt
from scipy.signal import hamming
(fs, x) = UF.wavread('../../../sounds/piano.wav')
w = np.ham... | agpl-3.0 |
Ziqi-Li/bknqgis | pandas/asv_bench/benchmarks/panel_ctor.py | 7 | 2304 | from .pandas_vb_common import *
from datetime import timedelta
class Constructors1(object):
goal_time = 0.2
def setup(self):
self.data_frames = {}
self.start = datetime(1990, 1, 1)
self.end = datetime(2012, 1, 1)
for x in range(100):
self.end += timedelta(days=1)
... | gpl-2.0 |
MaxStrange/ArtieInfant | scratch/autoencoder/vae.py | 1 | 17584 | """
This module contains all the code necessary for the VAE.
The general use is to instantiate a VAE with the appropriate
hyper parameters, then to train it with a dataset. You can
then load the resulting weights into a VAE later.
Much of this code was taken from here: https://blog.keras.io/building-autoencoders-in-k... | mit |
peterfpeterson/mantid | scripts/PyChop.py | 3 | 1189 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# py... | gpl-3.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/tseries/frequencies.py | 1 | 28215 | from datetime import datetime
from pandas.compat import range, long, zip
from pandas import compat
import re
import numpy as np
from pandas.core.algorithms import unique
from pandas.tseries.offsets import DateOffset
from pandas.util.decorators import cache_readonly
import pandas.tseries.offsets as offsets
import pand... | gpl-3.0 |
tomsilver/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/__init__.py | 69 | 28184 | """
This is an object-orient plotting library.
A procedural interface is provided by the companion pylab module,
which may be imported directly, e.g::
from pylab import *
or using ipython::
ipython -pylab
For the most part, direct use of the object-oriented library is
encouraged when programming rather tha... | gpl-3.0 |
maxlikely/scikit-learn | examples/manifold/plot_mds.py | 261 | 2616 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | bsd-3-clause |
petebachant/seaborn | seaborn/utils.py | 19 | 15509 | """Small plotting-related utility functions."""
from __future__ import print_function, division
import colorsys
import warnings
import os
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.colors as mplcol
import matplotlib.pyplot as plt
from distutils.version import LooseVersion
pandas_... | bsd-3-clause |
smartscheduling/scikit-learn-categorical-tree | doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py | 256 | 2406 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
mitschabaude/nanopores | scripts/numerics/analyticalPNPS.py | 1 | 10917 | " analytical test problem to validate 2D and 3D solvers "
import math
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from collections import OrderedDict
from dolfin import *
from nanopores import *
from nanopores.physics.simplepnps import *
# --- define parameters ---
add_params(
bV = -0.1, # [V]
r... | mit |
IshankGulati/scikit-learn | sklearn/feature_extraction/tests/test_image.py | 38 | 11165 | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from numpy.testing import assert_raises
from sklearn.feature_extraction.image import (
img_to_gra... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/extension/base/setitem.py | 1 | 11351 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from .base import BaseExtensionTests
class BaseSetitemTests(BaseExtensionTests):
def test_setitem_scalar_series(self, data, box_in_series):
if box_in_series:
data = pd.Series(data)
data[0] = data[1]
... | bsd-3-clause |
ZenDevelopmentSystems/scikit-learn | examples/plot_kernel_ridge_regression.py | 230 | 6222 | """
=============================================
Comparison of kernel ridge regression and SVR
=============================================
Both kernel ridge regression (KRR) and SVR learn a non-linear function by
employing the kernel trick, i.e., they learn a linear function in the space
induced by the respective k... | bsd-3-clause |
DylanM-Marshall/FIDDLE | _deprecated/TORCHmodels/dataPrep/data4trainng.py | 2 | 11354 | #!/usr/bin/env python
import os
import sys
sys.path.append('/Users/umut/Projects/genome/python/lib')
import genome.db
from optparse import OptionParser
import h5py
import pandas as pd
import numpy as np
from numpy import linalg as LA
from scipy.stats import norm
import numpy.random as npr
############################... | gpl-3.0 |
vybstat/scikit-learn | sklearn/cluster/tests/test_bicluster.py | 226 | 9457 | """Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... | bsd-3-clause |
bgroveben/python3_machine_learning_projects | introduction_to_ml_with_python/mglearn/mglearn/plot_cross_validation.py | 4 | 8922 | import numpy as np
import matplotlib.pyplot as plt
def plot_group_kfold():
from sklearn.model_selection import GroupKFold
groups = [0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3]
plt.figure(figsize=(10, 2))
plt.title("GroupKFold")
axes = plt.gca()
axes.set_frame_on(False)
n_folds = 12
n_sample... | mit |
murali-munna/scikit-learn | sklearn/utils/estimator_checks.py | 41 | 47834 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import inspect
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memory
from sklearn.ut... | bsd-3-clause |
Unidata/MetPy | v0.9/api/generated/metpy-plots-ctables-1.py | 7 | 1033 | import numpy as np
import matplotlib.pyplot as plt
import metpy.plots.ctables as ctables
def plot_color_gradients(cmap_category, cmap_list, nrows):
fig, axes = plt.subplots(figsize=(7, 6), nrows=nrows)
fig.subplots_adjust(top=.93, bottom=0.01, left=0.32, right=0.99)
axes[0].set_title(cmap_category + ' colo... | bsd-3-clause |
drabastomek/practicalDataAnalysisCookbook | Codes/Chapter07/ts_handlingData.py | 1 | 2607 | import numpy as np
import pandas as pd
import pandas.tseries.offsets as ofst
import matplotlib
import matplotlib.pyplot as plt
# change the font size
matplotlib.rc('xtick', labelsize=9)
matplotlib.rc('ytick', labelsize=9)
matplotlib.rc('font', size=14)
# files we'll be working with
files=['american.csv', 'columbia.cs... | gpl-2.0 |
michaelneuder/image_quality_analysis | bin/nets/wip/ssim_nets/ssim_net_new.py | 1 | 4561 | #!/usr/bin/env python3
import os
import matplotlib as mpl
mpl.use('Agg'); os.environ['TF_CPP_MIN_LOG_LEVEL']='2';
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import matplotlib.gridspec as gridspec
import iqa_tools
def main():
print('welcome to ssim net... | mit |
AndreasAntener/mavlink | pymavlink/tools/mavgpslag.py | 43 | 3446 | #!/usr/bin/env python
'''
calculate GPS lag from DF log
'''
import sys, time, os
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--plot", action='store_true', default=False, help="plot errors")
parser.add_argument("--minspeed", type=float, default=6, help="minimu... | lgpl-3.0 |
dbrnz/opencor | src/plugins/support/PythonSupport/tests/data/importtests.py | 3 | 2369 | if __name__ == '__main__':
# Make sure that we can import the modules that should be bundled with our
# Python package
try:
import bz2
except ImportError:
print("The 'bz2' module is not present!")
try:
import ipykernel
except ImportError:
print("The 'ipykernel' ... | gpl-3.0 |
TomAugspurger/pandas | pandas/core/indexes/category.py | 1 | 25692 | from typing import Any, List
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import index as libindex
from pandas._libs.hashtable import duplicated_int64
from pandas._libs.lib import no_default
from pandas._typing import Label
from pandas.util._decorators import Appender, c... | bsd-3-clause |
thientu/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
harshaneelhg/scikit-learn | sklearn/linear_model/tests/test_omp.py | 272 | 7752 | # Author: Vlad Niculae
# Licence: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equa... | bsd-3-clause |
chrsrds/scikit-learn | sklearn/ensemble/tests/test_base.py | 1 | 5052 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raise_message
from sklearn.datasets import load_iris
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble.base import _set_random_... | bsd-3-clause |
q1ang/scikit-learn | examples/svm/plot_svm_nonlinear.py | 268 | 1091 | """
==============
Non-linear SVM
==============
Perform binary classification using non-linear SVC
with RBF kernel. The target to predict is a XOR of the
inputs.
The color map illustrates the decision function learned by the SVC.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn imp... | bsd-3-clause |
ishank08/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 28 | 3792 | # 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 |
wkfwkf/statsmodels | statsmodels/datasets/longley/data.py | 25 | 1930 | """Longley dataset"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
The classic 1967 Longley Data
http://www.itl.nist.gov/div898/strd/lls/data/Longley.shtml
::
Longley, J.W. (1967) "An Appraisal of Least Squares Programs for the
El... | bsd-3-clause |
sunzhxjs/JobGIS | lib/python2.7/site-packages/pandas/io/tests/test_common.py | 9 | 2087 | """
Tests for the pandas.io.common functionalities
"""
from pandas.compat import StringIO
import os
from os.path import isabs
import nose
import pandas.util.testing as tm
from pandas.io import common
try:
from pathlib import Path
except ImportError:
pass
try:
from py.path import local as LocalPath
e... | mit |
dch312/scipy | scipy/stats/stats.py | 3 | 148718 | # Copyright (c) Gary Strangman. All rights reserved
#
# Disclaimer
#
# This software is provided "as-is". There are no expressed or implied
# warranties of any kind, including, but not limited to, the warranties
# of merchantability and fitness for a given application. In no event
# shall Gary Strangman be liable fo... | bsd-3-clause |
totalgood/twote | twote/bot.py | 1 | 18388 | #!python
"""Script and Bot class for interracting with Twitter continuously logging activity to postgresql db
python 2.7 or 3.5
python manage.py shell_plus
>>> run twote/bot python machinelearning ai nlp happy sad depressed angry upset joy bliss unhappy
"""
from __future__ import print_function, unicode_literals, di... | mit |
Clyde-fare/scikit-learn | sklearn/tree/tests/test_export.py | 130 | 9950 | """
Testing for export functions of decision trees (sklearn.tree.export).
"""
from re import finditer
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingClassifier
from sklearn... | bsd-3-clause |
arjoly/scikit-learn | examples/cluster/plot_agglomerative_clustering.py | 343 | 2931 | """
Agglomerative clustering with and without structure
===================================================
This example shows the effect of imposing a connectivity graph to capture
local structure in the data. The graph is simply the graph of 20 nearest
neighbors.
Two consequences of imposing a connectivity can be s... | bsd-3-clause |
ywcui1990/htmresearch | htmresearch/support/nlp_classification_plotting.py | 9 | 12290 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
IntersectAustralia/asvo-tao | core/sageimport_mpi/ApplyToAllTables.py | 1 | 5794 | import pg
import getpass
import math
import string
import sys
import settingReader
import numpy
import matplotlib.pyplot as plt
class ProcessTables(object):
def __init__(self,Options):
'''
Constructor
'''
self.Options=Options
self.serverip=self.Options['PGDB:serverip']... | gpl-3.0 |
userbz/DeMix | deprecated/Version_0/pre1_featureLockmassClone.py | 1 | 3556 | # bo.zhang@ki.se
# precursor mass recalibration based on the first-pass Morpheus search
# spectral cloning based on TOPP feature map
# MGF generation
import sys
import os
import csv
import subprocess
import cPickle
import bz2
import tempfile
from multiprocessing import Process
import pandas
import numpy
from sklearn... | mit |
joegomes/deepchem | deepchem/models/tensorflow_models/__init__.py | 1 | 30137 | """Helper operations and classes for general model building.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import collections
import pickle
import os
import time
import warnings
import numpy as np
import pandas as pd
import tensorflow as tf
import tem... | mit |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/frame/test_sorting.py | 2 | 26264 | import random
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
IntervalIndex,
MultiIndex,
NaT,
Series,
Timestamp,
date_range,
)
from pandas.api.types import CategoricalDtype
from pandas.tests.frame.common import TestData
import pandas.ut... | apache-2.0 |
maropu/spark | python/pyspark/pandas/tests/test_typedef.py | 15 | 16852 | #
# 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 |
jmoy/plotdf | plotdf/__init__.py | 1 | 3726 | # (c) Jyotirmoy Bhattacharya [jyotirmoy@jyotirmoy.net
# Licensed under GPLv3
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHOR BE LIAB... | gpl-3.0 |
zihua/scikit-learn | sklearn/feature_extraction/tests/test_image.py | 25 | 11187 | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn... | bsd-3-clause |
laurensstoop/HiSPARC-BONZ | egg/legacy/egg_saskia_v5.4.py | 1 | 16811 | # -*- coding: utf-8 -*-
#
############################################################################
#
# Program for analysing HiSPARC data
#
# This software is made under the GNU General Public License, version 3 (GPL-3.0)
#
###########################################################################... | gpl-3.0 |
ericmjl/protein-convolutional-nets | experiments/subsample/train.py | 1 | 8395 | # This script opens up all of the graphs from disk, and performs learning on
# them. This script is best run on the Rous cluster, where all of the graphs
# are located on disk (it occupies ~200GB of space, because pickling is
# not efficient.
from graphfp.layers import FingerprintLayer, LinearRegressionLayer,\
Gra... | mit |
osh/kerlym | kerlym/dqn_old.py | 1 | 11481 | import logging,os,cPickle,time
from statbin import statbin
from random import choice, random, sample
import numpy as np
import networks
class D2QN:
def __init__(self, env, nframes=1, epsilon=0.1, discount=0.99, train=1, update_nsamp=1000, timesteps_per_batch=1000, dropout=0, batch_size=32, nfit_epoch=1, epsilon_s... | mit |
escherba/clustering-metrics | clustering_metrics/ranking.py | 1 | 19888 | """
Motivation
----------
Assume that there is a data set of mostly unique samples where a hidden binary
variable is dependent on the number of similar samples that exist in the set
(i.e. a sample is called positive if it has many neighbors) and that our goal
is to label all samples in this set. Given sparse enough d... | bsd-3-clause |
DOV-Vlaanderen/pydov | pydov/search/grondwaterfilter.py | 1 | 4525 | # -*- coding: utf-8 -*-
"""Module containing the search classes to retrieve DOV groundwater screen
data."""
import pandas as pd
from owslib.fes import And, Not, PropertyIsNull
from ..types.grondwaterfilter import GrondwaterFilter
from .abstract import AbstractSearch
class GrondwaterFilterSearch(AbstractSearch):
... | mit |
NaturalHistoryMuseum/vision | vision/io_functions.py | 3 | 1853 | import csv
import glob
import os
import sys
import skimage.io
import matplotlib.pyplot as plt
import numpy as np
def read_image(filename, **kwargs):
return plt.imread(filename, **kwargs)[:, :, :3]
def write_image(filename, image, **kwargs):
if image.dtype.type == np.bool_:
image_out = 255 * image
... | gpl-2.0 |
wanggang3333/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
jnez71/aLQR | demo_trap.py | 1 | 5789 | from __future__ import division
import numpy as np
import numpy.linalg as npl
from matplotlib import pyplot as plt
import matplotlib.animation as ani
import alqr
# Basic linear particle
nstates = 4
ncontrols = 2
drag = 3
def linearize(x):
A = np.array([
[ 0, 0, 1, 0],
[ 0, 0, 0, 1],
... | mit |
ishank08/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py | 78 | 6016 | """
Testing for the gradient boosting loss functions and initial estimators.
"""
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_equal
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_ra... | bsd-3-clause |
mattgiguere/scikit-learn | sklearn/svm/tests/test_bounds.py | 280 | 2541 | import nose
from nose.tools import assert_equal, assert_true
from sklearn.utils.testing import clean_warning_registry
import warnings
import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression... | bsd-3-clause |
nicain/dipde_dev | dipde/internals/network.py | 1 | 10013 | # Copyright 2013 Allen Institute
# This file is part of dipde
# dipde 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.
#
# dipde is dis... | gpl-3.0 |
alexanderpanchenko/vec2synset | jnt/matching/synset_fetchers.py | 1 | 18558 | import requests
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
import ujson as json
import re
from os.path import splitext
from time import time
from pandas import read_csv
from collections import defaultdict, Counter
from traceback import format_exc
import cPickle as pickle
from time imp... | apache-2.0 |
hsuantien/scikit-learn | examples/text/mlcomp_sparse_document_classification.py | 292 | 4498 | """
========================================================
Classification of text documents: using a MLComp dataset
========================================================
This is an example showing how the scikit-learn can be used to classify
documents by topics using a bag-of-words approach. This example uses
a s... | bsd-3-clause |
robbymeals/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 204 | 5442 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
nvoron23/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | 276 | 3790 | # Authors: Lars Buitinck <L.J.Buitinck@uva.nl>
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.utils.testing import (assert_equal, assert_in,
... | bsd-3-clause |
mgaitan/scipy | tools/refguide_check.py | 29 | 23595 | #!/usr/bin/env python
"""
refguide_check.py [OPTIONS] [-- ARGS]
Check for a Scipy submodule whether the objects in its __all__ dict
correspond to the objects included in the reference guide.
Example of usage::
$ python refguide_check.py optimize
Note that this is a helper script to be able to check if things ar... | bsd-3-clause |
jorik041/scikit-learn | sklearn/ensemble/partial_dependence.py | 251 | 15097 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
mitschabaude/nanopores | scripts/howorka/video.py | 1 | 5662 | """plot/save video of molecule convection on PNPS force field"""
import numpy, dolfin, os
from matplotlib import pyplot
import matplotlib.tri as mtri
import matplotlib
import nanopores
from nanopores.physics.convdiff import ConvectionDiffusion
nanopores.add_params(
log = True,
video = False,
levels = 7,
... | mit |
icdishb/scikit-learn | examples/tree/plot_iris.py | 271 | 2186 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
viktorstaikov/raytracer-python | raytracer.py | 1 | 5704 | import numpy as np
import matplotlib.pyplot as plt
import sys
import time
w = 100
h = 50
def normalize(x):
x /= np.linalg.norm(x)
return x
def intersect_plane(O, D, P, N):
# Return the distance from O to the intersection of the ray (O, D) with the
# plane (P, N), or +inf if there is no intersection... | mit |
GuessWhoSamFoo/pandas | asv_bench/benchmarks/sparse.py | 5 | 4780 | import itertools
import numpy as np
import scipy.sparse
from pandas import (SparseSeries, SparseDataFrame, SparseArray, Series,
date_range, MultiIndex)
def make_array(size, dense_proportion, fill_value, dtype):
dense_size = int(size * dense_proportion)
arr = np.full(size, fill_value, dtyp... | bsd-3-clause |
liberatorqjw/scikit-learn | sklearn/linear_model/tests/test_passive_aggressive.py | 31 | 6147 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.base import ClassifierMixin
from skle... | bsd-3-clause |
prernaa/NLPCourseProj | Preliminary experimentation/code/UnigramSVMIgnoreUNK.py | 1 | 4521 | import sys
sys.path.append("/Users/Prerna/Desktop/Prerna/NTU/Courses-Year4-Sem1/NLP/SemEval15/code");
import extractTypes #importing file for extracting types from input
from collections import OrderedDict # OrderedDict to sort feature names in dictionary struct
#filename = "test_input.tsv";
#filename = "../... | mit |
gengliangwang/spark | python/pyspark/pandas/tests/indexes/test_category.py | 15 | 4626 | #
# 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 |
jpautom/scikit-learn | examples/covariance/plot_robust_vs_empirical_covariance.py | 73 | 6451 | 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 |
kashif/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 42 | 2944 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from itert... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/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... | mit |
anntzer/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py | 2 | 64407 | """Fast Gradient Boosting decision trees for classification and regression."""
# Author: Nicolas Hug
from abc import ABC, abstractmethod
from functools import partial
import numpy as np
from timeit import default_timer as time
from ...base import (BaseEstimator, RegressorMixin, ClassifierMixin,
i... | bsd-3-clause |
PMBio/gptwosample | gptwosample/plot/plot_basic.py | 1 | 6108 | '''
Plot GPTwoSample predictions
============================
Module for easy plotting of GPTwoSample results.
:py:class:`gptwosample.plot.plot_basic.plot_results` plots
training data, as well as sausage_plots for a GPTwoSample
experiment. You can give interval indices for plotting, if u chose
Created on Feb 10, 20... | apache-2.0 |
MadsJensen/CAA | sk_predict_condition_ali_grads.py | 1 | 1408 | import numpy as np
import pandas as pd
from my_settings import (tf_folder, subjects_select)
from sklearn.ensemble import AdaBoostClassifier
from sklearn.cross_validation import StratifiedShuffleSplit, cross_val_score
from sklearn.grid_search import GridSearchCV
from sklearn.preprocessing import StandardScaler
from skl... | bsd-3-clause |
ueshin/apache-spark | python/pyspark/pandas/tests/test_series_datetime.py | 15 | 10917 | #
# 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 |
yaukwankiu/armor | geometry/edges.py | 1 | 3878 | # armor.geometry.edges
# module for edge detecting and stuff
import copy
import numpy as np
import numpy.ma as ma
from scipy.signal import fftconvolve
#from armor import pattern
def find(a):
"""
use straightforward summing of mask criteria
"""
m1 = ma.zeros(a.matrix.shape)
m2 = ma.zeros(a.matrix.s... | cc0-1.0 |
magne-max/zipline-ja | tests/pipeline/test_engine.py | 1 | 46832 | """
Tests for SimplePipelineEngine
"""
from __future__ import division
from collections import OrderedDict
from itertools import product
from operator import add, sub
from nose_parameterized import parameterized
from numpy import (
arange,
array,
concatenate,
float32,
float64,
full,
log,
... | apache-2.0 |
ual/urbansim | urbansim/models/tests/test_util.py | 5 | 5846 | import string
import numpy as np
import pandas as pd
import pytest
from pandas.util import testing as pdt
from .. import util
@pytest.fixture
def test_df():
return pd.DataFrame(
{'col1': range(5),
'col2': range(5, 10)},
index=['a', 'b', 'c', 'd', 'e'])
@pytest.fixture
def choosers():
... | bsd-3-clause |
lorenzo-desantis/mne-python | examples/decoding/plot_ems_filtering.py | 19 | 2981 | """
==============================================
Compute effect-matched-spatial filtering (EMS)
==============================================
This example computes the EMS to reconstruct the time course of
the experimental effect as described in:
Aaron Schurger, Sebastien Marti, and Stanislas Dehaene, "Reducing mu... | bsd-3-clause |
JVillella/tensorflow | tensorflow/examples/learn/boston.py | 75 | 2549 | # 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 |
ron8hu/spark | python/pyspark/sql/tests.py | 3 | 173313 | # -*- encoding: utf-8 -*-
#
# 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 ... | apache-2.0 |
tjhei/burnman_old2 | misc/paper_fit_data.py | 2 | 4188 | # BurnMan - a lower mantle toolkit
# Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
# Released under GPL v2 or later.
"""
This script reproduces Cottaar, Heister, Rose, Unterborn (2014) Figure 4
This example demonstrates BurnMan's functionality to fit thermoelastic data to
both 2nd and... | gpl-2.0 |
zfrenchee/pandas | pandas/tests/sparse/test_array.py | 4 | 33223 | from pandas.compat import range
import re
import operator
import pytest
import warnings
from numpy import nan
import numpy as np
from pandas.core.sparse.api import SparseArray, SparseSeries
from pandas._libs.sparse import IntIndex
from pandas.util.testing import assert_almost_equal
import pandas.util.testing as tm
... | bsd-3-clause |
cameronlai/ml-class-python | skeletons/ex8/ex8_cofi.py | 1 | 7137 | import numpy as np
import matplotlib.pyplot as plt
import scipy.io as sio
from scipy import optimize
from ex8_utility import *
## Machine Learning Online Class - Exercise 8: Anomaly Detection and Collaborative Filtering
# Instructions
# ------------
#
# This file contains code that helps you get started on the
# ... | mit |
Erotemic/utool | utool/experimental/pandas_highlight.py | 1 | 9040 | from __future__ import absolute_import, division, print_function, unicode_literals # NOQA
# print, rrr, profile = ut.inject2(__name__)
def monkey_to_str_columns(self, latex=False):
import numpy as np
import pandas as pd
import utool as ut
frame = self.tr_frame
highlight_func = 'max'
highlight... | apache-2.0 |
bthirion/scikit-learn | sklearn/preprocessing/tests/test_data.py | 30 | 61609 |
# Authors:
#
# Giorgio Patrini
#
# License: BSD 3 clause
import warnings
import numpy as np
import numpy.linalg as la
from scipy import sparse
from distutils.version import LooseVersion
from sklearn.utils import gen_batches
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing im... | bsd-3-clause |
kaushik94/lifelines | lifelines/utils.py | 1 | 11439 | from __future__ import print_function
from datetime import datetime
import numpy as np
import pandas as pd
from pandas import to_datetime
def group_survival_table_from_events(groups, durations, censorship, min_observations, limit=-1):
"""
Joins multiple event series together into dataframes. A generalizatio... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.