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 |
|---|---|---|---|---|---|
Gaia3D/GeepsSpatialStatistic | Widget_MoransI.py | 1 | 36993 | # -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import os
from pysal import W, Moran, Moran_Local
import numpy as np
from qgis.core import *
from Utility import *
from gui.ui_form_morans_i import Ui_Form_Parameter as Ui_Form
import matplotlib.pyplot as plt
from xlwt import Workbook
class ... | apache-2.0 |
JsNoNo/scikit-learn | sklearn/semi_supervised/label_propagation.py | 71 | 15342 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
musically-ut/statsmodels | statsmodels/graphics/gofplots.py | 29 | 26714 | from statsmodels.compat.python import lzip, string_types
import numpy as np
from scipy import stats
from statsmodels.regression.linear_model import OLS
from statsmodels.tools.tools import add_constant
from statsmodels.tools.decorators import (resettable_cache,
cache_readonly,
... | bsd-3-clause |
lauringlab/variant_pipeline | scripts/reciprocal_variants.py | 1 | 6150 | from __future__ import division
import argparse
import pandas as pd
import pysam
import copy
import numpy as np
import yaml
parser = argparse.ArgumentParser(description='This script is designed to read in a csv of putative variant calls from deepSNV and query the bam file for the number of reads matching the referen... | apache-2.0 |
LiaoPan/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
janelia-idf/hybridizer | tests/volume_to_adc.py | 4 | 5108 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import matplotlib.pyplot as plot
import numpy
from numpy.polynomial.polynomial import polyfit,polyadd,Polynomial
import yaml
INCHES_PER_ML = 0.078
VOLTS_PER_ADC_UNIT = 0.0049
def load_numpy_data(path):
with open(path,'r') as fid:
hea... | bsd-3-clause |
sgenoud/scikit-learn | examples/plot_digits_pipe.py | 5 | 1781 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axes_divider3.py | 6 | 1032 | import mpl_toolkits.axes_grid.axes_size as Size
from mpl_toolkits.axes_grid import Divider
import matplotlib.pyplot as plt
fig1 = plt.figure(1, (5.5, 4))
# the rect parameter will be ignore as we will set axes_locator
rect = (0.1, 0.1, 0.8, 0.8)
ax = [fig1.add_axes(rect, label="%d"%i) for i in range(4)]
horiz = [S... | gpl-2.0 |
glennq/scikit-learn | examples/neighbors/plot_species_kde.py | 39 | 4039 | """
================================================
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 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/pandas/util/testing.py | 9 | 72423 | from __future__ import division
# pylint: disable-msg=W0402
import random
import re
import string
import sys
import tempfile
import warnings
import inspect
import os
import subprocess
import locale
import unittest
import traceback
from datetime import datetime
from functools import wraps, partial
from contextlib impo... | gpl-2.0 |
MJuddBooth/pandas | pandas/tests/io/generate_legacy_storage_files.py | 1 | 12877 | #!/usr/bin/env python
"""
self-contained to write legacy storage (pickle/msgpack) files
To use this script. Create an environment where you want
generate pickles, say its for 0.18.1, with your pandas clone
in ~/pandas
. activate pandas_0.18.1
cd ~/
$ python pandas/pandas/tests/io/generate_legacy_storage_files.py \
... | bsd-3-clause |
frank-tancf/scikit-learn | sklearn/linear_model/sag.py | 29 | 11291 | """Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# Licence: BSD 3 clause
import numpy as np
import warnings
from ..exceptions import ConvergenceWarning
from ..utils import check_array
from ..utils.extmath import row_norms
from .base import ... | bsd-3-clause |
jaidevd/scikit-learn | examples/tree/plot_tree_regression.py | 95 | 1516 | """
===================================================================
Decision Tree Regression
===================================================================
A 1D regression with decision tree.
The :ref:`decision trees <tree>` is
used to fit a sine curve with addition noisy observation. As a result, it
learns ... | bsd-3-clause |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/datasets/tests/test_svmlight_format.py | 228 | 11221 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | mit |
jzt5132/scikit-learn | examples/linear_model/plot_logistic_path.py | 349 | 1195 | #!/usr/bin/env python
"""
=================================
Path with L1- Logistic Regression
=================================
Computes path on IRIS dataset.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from datetime import datetime
import numpy as np
import... | bsd-3-clause |
silgon/rlpy | rlpy/Domains/PuddleWorld.py | 4 | 5624 | """Puddle world domain (navigation task)."""
from .Domain import Domain
import numpy as np
import matplotlib.pyplot as plt
__copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy"
__credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann",
"William Dabney", "Jonathan P. How"]
__licen... | bsd-3-clause |
obernal/mining-emergency-reports | tfidf_topics_data_extraction.py | 1 | 4364 | import logging
import json
import glob
import argparse
import csv
from gensim import models
from gensim import matutils
from sklearn.feature_extraction.text import TfidfVectorizer
#from sklearn.feature_extraction.text import SPANISH_STOP_WORDS
from time import time
from nltk.corpus import stopwords
from nltk.tokenize i... | mit |
cojacoo/testcases_echoRD | gen_test1123.py | 1 | 4420 | import numpy as np
import pandas as pd
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, sys
try:
import cPickle as pickle
except:
import pickle
#connect echoRD Tools
pathdir='../echoRD' #path to echoRD
lib_path = os.path.abspath(pathdir)
#sys.path.append(lib_pa... | gpl-3.0 |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/pandas/stats/misc.py | 15 | 10856 | from numpy import NaN
from pandas import compat
import numpy as np
from pandas.core.api import Series, DataFrame, isnull, notnull
from pandas.core.series import remove_na
from pandas.compat import zip
def zscore(series):
return (series - series.mean()) / np.std(series, ddof=0)
def correl_ts(frame1, frame2):
... | gpl-2.0 |
nhejazi/scikit-learn | examples/applications/plot_species_distribution_modeling.py | 35 | 7372 | """
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | bsd-3-clause |
mikeireland/chronostar | projects/scocen/YV_comps.py | 1 | 3436 | """
XU for stars in the fit (stars with RV).
"""
import numpy as np
from astropy.table import Table
import matplotlib.pyplot as plt
import copy
plt.ion()
#~ import sys
#~ sys.path.insert(0, '/Users/marusa/chronostar/chronostar/')
from chronostar.component import SphereComponent
from chronostar import tabletool
# Pre... | mit |
deroneriksson/incubator-systemml | src/main/python/tests/test_mllearn_numpy.py | 12 | 8831 | #!/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 |
anurag313/scikit-learn | sklearn/metrics/tests/test_regression.py | 272 | 6066 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... | bsd-3-clause |
gclenaghan/scikit-learn | sklearn/exceptions.py | 18 | 4332 | """
The :mod:`sklearn.exceptions` module includes all custom warnings and error
classes used across scikit-learn.
"""
__all__ = ['NotFittedError',
'ChangedBehaviorWarning',
'ConvergenceWarning',
'DataConversionWarning',
'DataDimensionalityWarning',
'EfficiencyWarn... | bsd-3-clause |
henrykironde/scikit-learn | examples/linear_model/plot_ols_3d.py | 350 | 2040 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Sparsity Example: Fitting only features 1 and 2
=========================================================
Features 1 and 2 of the diabetes-dataset are fitted and
plotted below. It illustrates that although feature... | bsd-3-clause |
mattilyra/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 58 | 9948 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
vortex-ape/scikit-learn | examples/preprocessing/plot_map_data_to_normal.py | 9 | 4544 | """
=================================
Map data to a normal distribution
=================================
This example demonstrates the use of the Box-Cox and Yeo-Johnson transforms
through :class:`preprocessing.PowerTransformer` to map data from various
distributions to a normal distribution.
The power transform is ... | bsd-3-clause |
peri-source/peri | docs/_static/arch_polyfit.py | 1 | 2138 | import numpy as np
import matplotlib.pyplot as pl
import peri
import peri.states
import peri.opt.optimize as opt
from peri.mc import sample
class PolyFitState(peri.states.State):
def __init__(self, x, y, order=2, coeffs=None):
self._data = y
self._xpts = x
params = ['c-%i' %i for i in xr... | mit |
ibis-project/ibis | ibis/tests/expr/test_value_exprs.py | 2 | 42691 | import functools
import operator
import os
from collections import OrderedDict
from datetime import date, datetime, time
from operator import methodcaller
import numpy as np
import pandas as pd
import pytest
import toolz
import ibis
import ibis.common.exceptions as com
import ibis.expr.analysis as L
import ibis.expr.... | apache-2.0 |
bjodah/PubChemPy | setup.py | 1 | 1766 | #!/usr/bin/env python
import os
from setuptools import setup
if os.path.exists('README.rst'):
long_description = open('README.rst').read()
else:
long_description = '''PubChemPy is a wrapper around the PubChem PUG REST API that provides a way to interact
with PubChem in Python. It allows chemical searches (in... | mit |
jblackburne/scikit-learn | sklearn/datasets/tests/test_rcv1.py | 322 | 2414 | """Test the rcv1 loader.
Skipped if rcv1 is not already downloaded to data_home.
"""
import errno
import scipy.sparse as sp
import numpy as np
from sklearn.datasets import fetch_rcv1
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing i... | bsd-3-clause |
beepee14/scikit-learn | sklearn/metrics/__init__.py | 214 | 3440 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
fengzhyuan/scikit-learn | examples/text/document_clustering.py | 230 | 8356 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
MechCoder/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 46 | 7057 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# License: BSD 3 clause
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process import regression_models as regression
from sklearn.gaussian_proce... | bsd-3-clause |
stulp/dmpbbo | demos_python/dmp/demoDmp.py | 1 | 3300 | # This file is part of DmpBbo, a set of libraries and programs for the
# black-box optimization of dynamical movement primitives.
# Copyright (C) 2018 Freek Stulp
#
# DmpBbo 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... | lgpl-2.1 |
aetilley/scikit-learn | examples/feature_stacker.py | 246 | 1906 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | bsd-3-clause |
pianomania/scikit-learn | sklearn/gaussian_process/tests/test_gpc.py | 49 | 6016 | """Testing for Gaussian process classification """
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
import numpy as np
from scipy.optimize import approx_fprime
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.gaussian_process.kernels import RBF, Constant... | bsd-3-clause |
evgchz/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 20 | 4491 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
mattvonrocketstein/smash | smashlib/ipy3x/core/usage.py | 1 | 22917 | # -*- coding: utf-8 -*-
"""Usage information for the main IPython applications.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
# Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu>
#
# Distributed under the terms of... | mit |
abhishekkrthakur/scikit-learn | examples/applications/plot_outlier_detection_housing.py | 9 | 5578 | """
====================================
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 |
DaveBackus/Data_Bootcamp | Code/Python/bootcamp_mini_basics.py | 1 | 3994 | """
For Class #1 of an informal mini-course at NYU Stern, Fall 2014.
Topics: calculations, assignments, strings, slicing, lists, data frames,
reading csv and xls files
Repository of materials (including this file):
* https://github.com/DaveBackus/Data_Bootcamp
Written by Dave Backus, Sarah Beckett-Hile, and Glenn O... | mit |
zfrenchee/pandas | asv_bench/benchmarks/replace.py | 1 | 1650 | import numpy as np
import pandas as pd
from .pandas_vb_common import setup # noqa
class FillNa(object):
goal_time = 0.2
params = [True, False]
param_names = ['inplace']
def setup(self, inplace):
N = 10**6
rng = pd.date_range('1/1/2000', periods=N, freq='min')
data = np.rand... | bsd-3-clause |
robotsinthesun/monkeyprint | monkeyprintImageHandling.py | 1 | 6910 | # -*- coding: latin-1 -*-
#
# Copyright (c) 2015-2016 Paul Bomke
# Distributed under the GNU GPL v2.
#
# This file is part of monkeyprint.
#
# monkeyprint 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... | gpl-2.0 |
eegroopm/pyLATTICE | gui/__init__.py | 1 | 3678 | # define authorship information
__authors__ = ['Evan Groopman', 'Thomas Bernatowicz']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2012'
__license__ = 'GPL'
# maintanence information
__maintainer__ = 'Evan Groopman'
__email__ = 'eegroopm@gmail.co... | gpl-2.0 |
ZENGXH/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
ameliecordier/IIK | datahandler/analyser.py | 1 | 1117 | # -*- coding: utf-8 -*-
import csv
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def isValid(p, ep):
return p in ep.patterns
# CLASS ANALYSER
class Analyser:
"""
Reprรฉsentation d'un rรฉsultat d'analyse
"""
def __init__(self):
"""
:para... | mit |
nhenezi/kuma | vendor/packages/ipython/docs/sphinxext/inheritance_diagram.py | 98 | 13648 | """
Defines a docutils directive for inserting inheritance diagrams.
Provide the directive with one or more classes or modules (separated
by whitespace). For modules, all of the classes in that module will
be used.
Example::
Given the following classes:
class A: pass
class B(A): pass
class C(A): pass
... | mpl-2.0 |
mjgrav2001/scikit-learn | sklearn/decomposition/pca.py | 192 | 23117 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Michael Eickenberg <michael.eickenberg@inria.fr>
#
# Lice... | bsd-3-clause |
carlthome/librosa | librosa/core/constantq.py | 1 | 35939 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Constant-Q transforms'''
from __future__ import division
import warnings
import numpy as np
from numba import jit
from . import audio
from .fft import get_fftlib
from .time_frequency import cqt_frequencies, note_to_hz
from .spectrum import stft, istft
from .pitch impor... | isc |
petosegan/scikit-learn | examples/linear_model/plot_iris_logistic.py | 283 | 1678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... | bsd-3-clause |
meduz/scikit-learn | examples/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
MartinDelzant/scikit-learn | examples/ensemble/plot_gradient_boosting_quantile.py | 392 | 2114 | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
import matplotlib.pyplot as plt
from skle... | bsd-3-clause |
subutai/nupic.research | projects/meta_cl/tests/custom_dendrites_metrics_test.py | 2 | 4672 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, 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 |
billyhunt/osf.io | scripts/analytics/email_invites.py | 55 | 1332 | # -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from utils import plot_dates, mkdirp
user_collection = database['user']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH, 'figs', 'features')
mkdirp(FIG_PATH)
def analyze_email_invi... | apache-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/matplotlib/colors.py | 4 | 66887 | """
A module for converting numbers or color arguments to *RGB* or *RGBA*
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
range 0-1.
This module includes functions and classes for color specification
conversions, and for mapping numbers to colors in a 1-D array of colors called
a colormap. Color... | mit |
stefansommer/jetflows | code/examples/barimages1.py | 1 | 2966 | #!/usr/bin/python
#
# This file is part of jetflows.
#
# Copyright (C) 2014, Henry O. Jacobs (hoj201@gmail.com), Stefan Sommer (sommer@di.ku.dk)
# https://github.com/nefan/jetflows.git
#
# jetflows is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | agpl-3.0 |
mfherbst/spack | var/spack/repos/builtin/packages/py-illumina-utils/package.py | 5 | 1968 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
ceb8/astroquery | astroquery/vo_conesearch/conesearch.py | 2 | 17045 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Support VO Simple Cone Search capabilities."""
# STDLIB
import warnings
# THIRD-PARTY
import numpy as np
# ASTROPY
from astropy.io.votable.exceptions import vo_warn, W25
from astropy.utils.console import color_print
from astropy.utils.exceptions impo... | bsd-3-clause |
hermessc/DPDCFD | cluster/code.py | 1 | 6981 | #!/usr/bin/env python3
#!/usr/bin/python3
# Evaluation of number of clusters for different timesteps in a xyz file.
from fnc import *
#from gui import *
ppo = 9
box = 30
conc = 0.05
frameskip = 25
flag_hist = 0
flag_ave = 0
flag_pbc = 1
interval = 250000
RHO = 3
FRAME_COLLECTION = 500
PLURCHAIN = 15
timecounter ... | gpl-3.0 |
jeremiedecock/snippets | python/matplotlib/hist_logscale_xy.py | 1 | 1889 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make a histogram using a logarithmic scale on X and Y axis
See:
- http://stackoverflow.com/questions/6855710/how-to-have-logarithmic-bins-in-a-python-histogram
"""
import numpy as np
import matplotlib.pyplot as plt
# SETUP #########################################... | mit |
vivekmishra1991/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
bcfriesen/PyRT | src/main.py | 1 | 1926 | # number of angle points
n_mu_pts = 10
# number of physical grid depth points
n_depth_pts = 10
# thermalization parameter. 1 = LTE; 0 = pure scattering
epsilon = 1.0e-4
import numpy as np
np.set_printoptions(linewidth=200)
# mean intensity
J_n = np.zeros(n_depth_pts)
# initial "guess" for J
J_n[:] = 2
# source f... | mit |
rubikloud/scikit-learn | examples/calibration/plot_compare_calibration.py | 241 | 5008 | """
========================================
Comparison of Calibration of Classifiers
========================================
Well calibrated classifiers are probabilistic classifiers for which the output
of the predict_proba method can be directly interpreted as a confidence level.
For instance a well calibrated (bi... | bsd-3-clause |
kmather73/ggplot | ggplot/tests/test_theme_mpl.py | 12 | 3907 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import matplotlib as mpl
import six
from nose.tools import assert_true
from ggplot.tests import image_comparison, cleanup
from ggplot import *
def _diff(a, b):
ret = {}
for key, val in a.items():
... | bsd-2-clause |
wwu-numerik/scripts | python/profiler_ana/msfem.py | 1 | 1117 | #!/usr/bin/env python3
import logging
import sys
import pandas_common as pc
common_string = pc.common_substring(sys.argv[1:])
merged = 'merged_{}.csv'.format(common_string)
baseline_name = 'msfem.all'
header, current = pc.read_files(sys.argv[1:])
headerlist = header['profiler']
current = pc.sorted_f(current, True)
c... | bsd-2-clause |
eranchetz/nupic | nupic/research/monitor_mixin/plot.py | 8 | 5063 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014-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 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/jupyter_core/tests/dotipython_empty/profile_default/ipython_console_config.py | 24 | 21691 | # Configuration file for ipython-console.
c = get_config()
#------------------------------------------------------------------------------
# ZMQTerminalIPythonApp configuration
#------------------------------------------------------------------------------
# ZMQTerminalIPythonApp will inherit config from: TerminalIP... | gpl-3.0 |
NunoEdgarGub1/scikit-learn | sklearn/linear_model/logistic.py | 105 | 56686 | """
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
imp... | bsd-3-clause |
rahuldhote/scikit-learn | examples/missing_values.py | 233 | 3056 | """
======================================================
Imputing missing values before building an estimator
======================================================
This example shows that imputing the missing values can give better results
than discarding the samples containing any missing value.
Imputing does not ... | bsd-3-clause |
I--P/numpy | numpy/linalg/linalg.py | 4 | 75738 | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | bsd-3-clause |
JosmanPS/scikit-learn | sklearn/externals/joblib/__init__.py | 86 | 4795 | """ Joblib is a set of tools to provide **lightweight pipelining in
Python**. In particular, joblib offers:
1. transparent disk-caching of the output values and lazy re-evaluation
(memoize pattern)
2. easy simple parallel computing
3. logging and tracing of the execution
Joblib is optimized to be **fast*... | bsd-3-clause |
BiaDarkia/scikit-learn | examples/applications/svm_gui.py | 124 | 11251 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
shikhardb/scikit-learn | sklearn/cluster/setup.py | 263 | 1449 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
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
cblas_libs, blas_info = ... | bsd-3-clause |
hlin117/statsmodels | statsmodels/iolib/summary2.py | 21 | 19583 | from statsmodels.compat.python import (lrange, iterkeys, iteritems, lzip,
reduce, itervalues, zip, string_types,
range)
from statsmodels.compat.collections import OrderedDict
import numpy as np
import pandas as pd
import datetime
import textw... | bsd-3-clause |
glennq/scikit-learn | examples/linear_model/plot_theilsen.py | 100 | 3846 | """
====================
Theil-Sen Regression
====================
Computes a Theil-Sen Regression on a synthetic dataset.
See :ref:`theil_sen_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the Theil-Sen
estimator is robust against outliers. It has a breakd... | bsd-3-clause |
pratapvardhan/pandas | pandas/tests/sparse/frame/test_analytics.py | 4 | 1161 | import pytest
import numpy as np
from pandas import SparseDataFrame, DataFrame, SparseSeries
from pandas.util import testing as tm
@pytest.mark.xfail(reason='Wrong SparseBlock initialization '
'(GH 17386)')
def test_quantile():
# GH 17386
data = [[1, 1], [2, 10], [3, 100], [np.nan, np.nan]]... | bsd-3-clause |
keflavich/scikit-image | doc/examples/plot_local_equalize.py | 14 | 2384 | """
============================
Local Histogram Equalization
============================
This examples enhances an image with low contrast, using a method called *local
histogram equalization*, which spreads out the most frequent intensity values in
an image.
The equalized image [1]_ has a roughly linear cumulative... | bsd-3-clause |
rs2/pandas | pandas/tests/reshape/test_union_categoricals.py | 2 | 14321 | import numpy as np
import pytest
from pandas.core.dtypes.concat import union_categoricals
import pandas as pd
from pandas import Categorical, CategoricalIndex, Series
import pandas._testing as tm
class TestUnionCategoricals:
def test_union_categorical(self):
# GH 13361
data = [
(list... | bsd-3-clause |
beepee14/scikit-learn | examples/ensemble/plot_forest_importances_faces.py | 403 | 1519 | """
=================================================
Pixel importances with a parallel forest of trees
=================================================
This example shows the use of forests of trees to evaluate the importance
of the pixels in an image classification task (faces). The hotter the pixel,
the more impor... | bsd-3-clause |
kou/arrow | dev/archery/archery/integration/datagen.py | 3 | 46538 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
eawag-rdm/kobo-post | kobopost/mark_skipped.py | 1 | 16491 | # _*_ coding: utf-8 _*_
"""Usage:
mark_skipped [options] <questionaire> <form_definition> <outpath>
mark_skipped (-h | --help)
Processes <questionaire>, an xlsx-file, based on <form_definition>, an xls file,
and writes the output to an apropriately named file in <outpath>
Options:
-h --help This help... | agpl-3.0 |
wlamond/scikit-learn | sklearn/ensemble/weight_boosting.py | 29 | 41090 | """Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseWeightBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each ot... | bsd-3-clause |
arabenjamin/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | 394 | 1770 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal, assert_almost_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([T... | bsd-3-clause |
rajul/ginga | ginga/examples/matplotlib/example5_mpl.py | 7 | 5896 | #! /usr/bin/env python
#
# example5_mpl.py -- Load a fits file into a Ginga widget with a
# matplotlib backend.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
... | bsd-3-clause |
qiwsir/vincent | examples/scatter_chart_examples.py | 9 | 2130 | # -*- coding: utf-8 -*-
"""
Vincent Scatter Examples
"""
#Build a Line Chart from scratch
from vincent import *
import pandas as pd
import pandas.io.data as web
import datetime
all_data = {}
date_start = datetime.datetime(2010, 1, 1)
date_end = datetime.datetime(2014, 1, 1)
for ticker in ['AAPL', 'IBM', 'YHOO', 'MS... | mit |
gtrensch/nest-simulator | pynest/examples/balancedneuron.py | 8 | 7344 | # -*- coding: utf-8 -*-
#
# balancedneuron.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,... | gpl-2.0 |
rpereira-dev/ENSIIE | UE/S2/Projet/Mathematiques/code/Q20/EDP.py | 1 | 3036 | #!/usr/bin/env python
import numpy as np
import scipy.linalg as la
import matplotlib.pyplot as plt
import math
# nombre de points
M = 296
N = M
# parametres
K = 100
r = 0.04
o = 0.1 # sigma
T = 1.0
L = 4.0 * K
# discretisation
t = np.linspace(0, T, N + 1)
S = np.linspace(0, L, M + 2)
dT = T / float(N)
dS = L / flo... | gpl-3.0 |
tbabej/astropy | astropy/visualization/tests/test_histogram.py | 2 | 1919 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from numpy.testing import assert_allclose
try:
import matplotlib.pyplot as plt
HAS_PLT = True
except ImportError:
HAS_PLT = False
t... | bsd-3-clause |
WesleyyC/Restaurant-Revenue-Prediction | Ari/working_regressors/GradientBoost.py | 2 | 2292 | from sklearn.cross_validation import KFold
from sklearn.cross_validation import train_test_split
from sklearn.metrics import mean_squared_error
from math import sqrt
import numpy as np
import pandas as pd
import scipy as sci
### Plotting function ###
from matplotlib import pyplot as plt
from sklearn.metrics import r... | mit |
manjunaths/tensorflow | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 153 | 6723 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
yask123/scikit-learn | examples/calibration/plot_calibration.py | 225 | 4795 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
PaulGrimal/peach | tutorial/optimization/continuous-simulated-annealing.py | 6 | 2293 | ################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: continuous-simulated-annealing.py
# Optimization of functions by simulated annealing
####################################################################... | lgpl-2.1 |
maxikov/bikedatan | time_histogram.py | 1 | 2853 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This p... | gpl-3.0 |
chrissly31415/amimanera | competition_scripts/caterpillar/run_gbm-br6.py | 1 | 8471 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as pl
import copy
from sklearn.cross_validation import KFold, PredefinedSplit
from sklearn.pipeline import make_pipeline
from sklearn.metrics import mean_squared_error
import sklearn.utils
import sklearn
import time
import warnings
warnings.filt... | lgpl-3.0 |
silky/sms-tools | lectures/05-Sinusoidal-model/plots-code/spec-sine-synthesis-lobe.py | 24 | 2626 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
from scipy.fftpack import fft, ifft
import math
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import... | agpl-3.0 |
yuanagain/seniorthesis | venv/lib/python2.7/site-packages/matplotlib/sphinxext/tests/tinypages/conf.py | 14 | 8466 | # -*- coding: utf-8 -*-
#
# tinypages documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 18 11:58:34 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.
#
#... | mit |
schae234/gingivere | tests/raw_data_clf.py | 2 | 3422 | from __future__ import print_function
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import classification_report
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.decomposition impo... | mit |
rgommers/scipy | tools/refguide_check.py | 7 | 31826 | #!/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 |
cwu2011/scikit-learn | sklearn/metrics/tests/test_common.py | 43 | 44042 | from __future__ import division, print_function
from functools import partial
from itertools import product
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinarizer, MultiLabelBinarizer
from sklearn.utils.multiclass impo... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/tree/export.py | 35 | 16873 | """
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Trevor... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.