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
passiweinberger/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/projections/polar.py
69
20981
import math import numpy as npy 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, Locator from matplotlib.tr...
agpl-3.0
ElDeveloper/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
alshedivat/tensorflow
tensorflow/examples/learn/iris_custom_model.py
43
3449
# 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
RobertABT/heightmap
build/matplotlib/examples/pylab_examples/fancyarrow_demo.py
12
1386
import matplotlib.patches as mpatches import matplotlib.pyplot as plt styles = mpatches.ArrowStyle.get_styles() ncol=2 nrow = (len(styles)+1) // ncol figheight = (nrow+0.5) fig1 = plt.figure(1, (4.*ncol/1.5, figheight/1.5)) fontsize = 0.2 * 70 ax = fig1.add_axes([0, 0, 1, 1], frameon=False, aspect=1.) ax.set_xlim(...
mit
bgris/ODL_bgris
lib/python3.5/site-packages/scipy/signal/waveforms.py
64
14818
# Author: Travis Oliphant # 2003 # # Feb. 2010: Updated by Warren Weckesser: # Rewrote much of chirp() # Added sweep_poly() from __future__ import division, print_function, absolute_import import numpy as np from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \ exp, cos, sin, polyval, po...
gpl-3.0
AndreLamurias/IBRel
src/classification/rext/kernelmodels.py
2
8968
#!/usr/bin/env python #shallow linguistic kernel import sys, os import os.path import xml.etree.ElementTree as ET import logging from optparse import OptionParser import pickle import operator from time import time #from pandas import DataFrame import platform import re import nltk import nltk.data from nltk.tree impo...
mit
rahuldhote/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
242
5885
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
leejz/misc-scripts
make_alignment_mapper.py
1
2562
#!/usr/bin/env python """ -------------------------------------------------------------------------------- Created: Jackson Lee 2012 This script reads in the ecoli reference alignment in a particular format and generates a mapping file which assigns a sequential count of each base pair to the current alignment posi...
mit
cogeorg/BlackRhino
examples/degroot/networkx/drawing/nx_pylab.py
22
27761
""" ********** Matplotlib ********** Draw networks with matplotlib. See Also -------- matplotlib: http://matplotlib.sourceforge.net/ pygraphviz: http://networkx.lanl.gov/pygraphviz/ """ # Copyright (C) 2004-2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Sw...
gpl-3.0
dsullivan7/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
johannah/iceview
setup.py
1
1059
import os import setuptools setuptools.setup( name='iceview', version='0.0.1', package_data={"": ['*.jpg', '*.png', '*.json', '*.txt']}, author='Johanna Hansen', author_email='jh1736@gmail.com', description='Tools for creating mosaics for ice imagery collected by UAVs', long_description=ope...
bsd-3-clause
kaichogami/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
agogear/corpkit
setup.py
1
1451
from setuptools import setup, find_packages setup(name='corpkit', version='1.5', description='A toolkit for working with linguistic corpora', url='http://github.com/interrogator/corpkit', author='Daniel McDonald', package_data={'corpkit': ['*.jar', 'corpkit/*.jar'], 'c...
mit
Delosari/dazer
bin/lib/cloudy_library/Cloudy_plotter2.py
1
5591
from collections import OrderedDict from lmfit import Parameters, minimize, report_fit from lmfit.models import LinearModel from numpy import log10 as nplog10, zeros, min, max, linspace, array, concatenate, isfinite, ...
mit
zhenv5/scikit-learn
sklearn/linear_model/tests/test_theil_sen.py
234
9928
""" 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
FluidityProject/multifluids
tests/gls-Kato_Phillips-mixed_layer_depth/mixed_layer_depth_all.py
1
4603
#!/usr/bin/env python from numpy import arange,concatenate,array,argsort import os import sys import vtktools import math from pylab import * from matplotlib.ticker import MaxNLocator import re from scipy.interpolate import UnivariateSpline import glob #### taken from http://www.codinghorror.com/blog/archives/001018...
lgpl-2.1
jjx02230808/project0223
examples/exercises/plot_cv_digits.py
135
1223
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
imaculate/scikit-learn
examples/applications/plot_out_of_core_classification.py
32
13829
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
bsd-3-clause
Caoimhinmg/PmagPy
setup_scripts/win_pmag_gui_setup.py
3
2161
import distutils.core from distutils.core import setup import py2exe import matplotlib import os import glob import sys sys.setrecursionlimit(3000) directory = os.getcwd() help_data = glob.glob(os.path.join(directory, 'dialogs', 'help_files') + os.path.sep + '*') data_model = glob.glob(os.path.join(directory, 'pmagpy...
bsd-3-clause
JQIamo/artiq
doc/manual/conf.py
1
9407
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ARTIQ documentation build configuration file, created by # sphinx-quickstart on Thu Sep 18 16:51:53 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 # auto...
lgpl-3.0
PascalSteger/gravimage
programs/gi_mc_errors.py
1
2025
#!/usr/bin/env python3 ## Estimates errors using Monte Carlo sampling # Hamish Silverwood, GRAPPA, UvA, 23 February 2015 import numpy as np import gl_helper as gh import pdb import pickle import sys import numpy.random as rand import matplotlib.pyplot as plt #TEST this will eventually go outside def ErSamp_gauss_l...
gpl-2.0
tsherwen/AC_tools
Scripts/Basic_GEOSChem_bpch_plotter.py
1
2474
#!/usr/bin/python # modules import AC_tools as AC import numpy as np import sys import matplotlib.pyplot as plt # Setup, choose species species = 'O3' # 'CO2' RMM_species = 16.*3. res = '4x5' # ( e.g. '4x5', '2x2.5', '0.5x0.666', '0.25x0.3125' ) unit, scale = AC.tra_unit(species, scale=True) # debug/print verbose ...
mit
trankmichael/scipy
doc/source/tutorial/examples/normdiscr_plot2.py
84
1642
import numpy as np import matplotlib.pyplot as plt from scipy import stats npoints = 20 # number of integer support points of the distribution minus 1 npointsh = npoints / 2 npointsf = float(npoints) nbound = 4 #bounds for the truncated normal normbound = (1 + 1 / npointsf) * nbound #actual bounds of truncated normal ...
bsd-3-clause
DPRL/MathSymbolRecognizer
src/svm_lin_classifier.py
1
5412
""" DPRL Math Symbol Recognizers Copyright (c) 2012-2014 Kenny Davila, Richard Zanibbi This file is part of DPRL Math Symbol Recognizers. DPRL Math Symbol Recognizers is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by t...
gpl-3.0
imaculate/scikit-learn
examples/linear_model/plot_logistic_multinomial.py
50
2480
""" ==================================================== Plot multinomial and One-vs-Rest Logistic Regression ==================================================== Plot decision surface of multinomial and One-vs-Rest Logistic Regression. The hyperplanes corresponding to the three One-vs-Rest (OVR) classifiers are repre...
bsd-3-clause
perimosocordiae/scipy
doc/source/tutorial/stats/plots/qmc_plot_conv_mc_sobol.py
12
2386
"""Integration convergence comparison: MC vs Sobol'. The function is a synthetic example specifically designed to verify the correctness of the implementation [2]_. References ---------- .. [1] I. M. Sobol. The distribution of points in a cube and the accurate evaluation of integrals. Zh. Vychisl. Mat. i Mat. Phy...
bsd-3-clause
gnieboer/tensorflow
tensorflow/contrib/learn/python/learn/estimators/kmeans.py
34
10130
# 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
ah-anssi/SecuML
SecuML/core/Clustering/Cluster.py
1
5432
# SecuML # Copyright (C) 2016-2017 ANSSI # # SecuML 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, or # (at your option) any later version. # # SecuML is distributed in the h...
gpl-2.0
jdmcbr/geopandas
geopandas/tests/test_crs.py
1
21680
from distutils.version import LooseVersion import os import random import numpy as np import pandas as pd from shapely.geometry import Point, Polygon, LineString import pyproj from geopandas import GeoSeries, GeoDataFrame, points_from_xy, datasets, read_file from geopandas.array import from_shapely, from_wkb, from_...
bsd-3-clause
alshedivat/tensorflow
tensorflow/examples/get_started/regression/imports85.py
41
6589
# 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
RobertABT/heightmap
build/matplotlib/lib/matplotlib/hatch.py
6
6997
""" Contains a classes for generating hatch patterns. """ from __future__ import print_function import numpy as np from matplotlib.path import Path class HatchPatternBase: """ The base class for a hatch pattern. """ pass class HorizontalHatch(HatchPatternBase): def __init__(self, hatch, density...
mit
samgoodgame/sf_crime
iterations/KK_scripts/KK_development_work/make_kaggle_format_08_20_2045.py
2
1393
# -*- coding: utf-8 -*- """ Created on Sat Aug 19 19:49:47 2017 @author: kalvi """ #required imports import pandas as pd import numpy as np def make_kaggle_format(sample_submission_path, test_transformed_path, prediction_probabilities): """this function requires: sample_submission_path=(filepath for 'sam...
mit
466152112/scikit-learn
examples/manifold/plot_manifold_sphere.py
258
5101
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
pradyu1993/scikit-learn
examples/linear_model/plot_lasso_coordinate_descent_path.py
3
2804
""" ===================== 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 Style. import numpy ...
bsd-3-clause
martynvandijke/Stargazer
docs/source/test.py
1
2173
''' Title: Simple Economic Dispatch Author: Dr. Nikolaos G. Paterakis, TUE Date: 10/1/2017 Purpose: - Import data from excel spreadsheets using pandas - Formulate a problem - Perform sensitivity analysis - Print and plot results using matplotlib ''' #Define dependencies import pandas from pyomo.environ import * def M...
mit
benhamner/Stack-Overflow-Competition
competition_utilities.py
2
3323
from __future__ import division from collections import Counter import csv import dateutil import numpy as np import os import pandas as pd data_path = None submissions_path = None if not data_path or not submissions_path: raise Exception("Set the data and submission paths in competition_utilities.py!") def parse...
bsd-2-clause
Kirubaharan/hydrology
Lake_bathymetry/smg_bathymetry/smg_lake_bathymetry.py
1
1238
__author__ = 'kiruba' import numpy as np import matplotlib.pyplot as plt import pandas as pd import itertools import checkdam.checkdam as cd # calibration y_cal = np.array([100, 1000, 2000, 3000, 4000, 5000]) x_cal = np.array([1875, 2516, 3212, 3901, 4605, 5280]) a_stage = cd.polyfit(x_cal, y_cal, 1) coeff_cal = a_st...
gpl-3.0
nehudesi/MSim
module/tsutil.py
1
32434
''' Version: MRT v3.0 Type: Library Location: C:\MRT3.0\module Author: Chintan Patel Email: chintanlike@gmail.com ''' import math import datetime as dt #import numpy as np import module.qsdateutil as qsdateutil from math import sqrt import pandas as pd from copy import deepcopy import matplotlib.pyp...
agpl-3.0
quheng/scikit-learn
sklearn/datasets/tests/test_mldata.py
384
5221
"""Test functionality of mldata fetching utilities.""" import os import shutil import tempfile import scipy as sp from sklearn import datasets from sklearn.datasets import mldata_filename, fetch_mldata from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_not_in from sklearn.utils.test...
bsd-3-clause
daeilkim/refinery
refinery/bnpy/bnpy-dev/bnpy/viz/PlotELBO.py
1
4539
''' PlotELBO.py Executable for plotting the learning objective function (log evidence) vs. time/number of passes thru data (laps) Usage (command-line) ------- python -m bnpy.viz.PlotELBO dataName aModelName obsModelName algName [kwargs] ''' from matplotlib import pylab import numpy as np import argparse import os i...
mit
AlirezaShahabi/zipline
zipline/utils/events.py
20
16995
# # Copyright 2014 Quantopian, Inc. # # 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 applicable law or agreed to in wr...
apache-2.0
imaculate/scikit-learn
examples/gaussian_process/plot_gpr_noisy_targets.py
64
3706
""" ========================================================= Gaussian Processes regression: basic introductory example ========================================================= A simple one-dimensional regression example computed in two different ways: 1. A noise-free case 2. A noisy case with known noise-level per ...
bsd-3-clause
GiulioGx/RNNs
sources/feat_sel_lupus.py
1
10286
import logging import os import pickle from threading import Thread import numpy import shutil import theano from sklearn import metrics from sklearn.metrics import roc_auc_score from ActivationFunction import Tanh from Configs import Configs from Paths import Paths from datasets.LupusFilter import TemporalSpanFilter...
lgpl-3.0
Eric89GXL/mne-python
examples/stats/plot_fdr_stats_evoked.py
20
2740
""" ======================================= FDR correction on T-test on sensor data ======================================= One tests if the evoked response significantly deviates from 0. Multiple comparison problem is addressed with False Discovery Rate (FDR) correction. """ # Authors: Alexandre Gramfort <alexandre....
bsd-3-clause
jmschrei/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
larsmans/scikit-learn
sklearn/metrics/cluster/supervised.py
17
26843
"""Utilities to evaluate the clustering performance of models Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # License: BSD 3 clause fr...
bsd-3-clause
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/matplotlib/testing/jpl_units/EpochConverter.py
6
5370
#=========================================================================== # # EpochConverter # #=========================================================================== """EpochConverter module containing class EpochConverter.""" #=========================================================================== # Pl...
mit
louispotok/pandas
pandas/tests/dtypes/test_missing.py
3
14294
# -*- coding: utf-8 -*- import pytest from warnings import catch_warnings import numpy as np from datetime import datetime from pandas.util import testing as tm import pandas as pd from pandas.core import config as cf from pandas.compat import u from pandas._libs import missing as libmissing from pandas._libs.tslib ...
bsd-3-clause
Unidata/MetPy
v0.10/_downloads/8de42c0f44fb2568ca140f44d6554022/Four_Panel_Map.py
6
4683
# Copyright (c) 2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Four Panel Map =============== By reading model output data from a netCDF file, we can create a four panel plot showing: * 300 hPa heights and winds * 500 hPa heights and absol...
bsd-3-clause
wlamond/scikit-learn
sklearn/cluster/k_means_.py
9
60297
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
bsd-3-clause
ushiro/persistlab
PersistLabPlugins/persistlabplugins/techniques.py
1
1824
#!/usr/bin/env python import time import re import math from collections import OrderedDict as OD import numpy as np import pandas as pd import matplotlib.pyplot as plt from persistlab import measfile ##from persistlab import figitem from persistlab import batlab __version__ = '0.0' class FigTransient(batlab.Defau...
bsd-3-clause
dsm054/pandas
pandas/tests/frame/test_dtypes.py
1
41160
# -*- coding: utf-8 -*- from __future__ import print_function import pytest from datetime import timedelta import numpy as np from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp, Categorical, compat, concat, option_context) from pandas.compat import u from pandas import _np_v...
bsd-3-clause
karllessard/tensorflow
tensorflow/lite/micro/examples/micro_speech/apollo3/captured_data_to_wav.py
19
1443
# Copyright 2018 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
MikeDacre/slurmy
tests/test_pandas.py
2
7325
""" Tests submitting pandas functions. Pandas is hard to install, so this isn't part of the travis py.test. """ import sys import argparse from uuid import uuid4 import fyrd import pytest try: import numpy as np import pandas as pd canrun = True except ImportError: canrun = False env = fyrd.get_cluster...
mit
ljchang/nltools
examples/02_Analysis/plot_similarity_example.py
1
1669
""" Similarity and Distance ======================= This tutorial illustrates how to calculate similarity and distance between images. """ ######################################################################### # Load Data # --------- # # First, let's load the pain data for this example. from nltools.datasets i...
mit
adrienpacifico/openfisca-france-data
openfisca_france_data/input_data_builders/build_openfisca_survey_data/step_03_fip.py
2
13040
#! /usr/bin/env python # -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redist...
agpl-3.0
alexjc/pylearn2
pylearn2/sandbox/cuda_convnet/specialized_bench.py
44
3906
__authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano....
bsd-3-clause
Odingod/mne-python
mne/time_frequency/tests/test_psd.py
12
5211
import numpy as np import os.path as op from numpy.testing import assert_array_almost_equal from nose.tools import assert_true from mne import io, pick_types, Epochs, read_events from mne.utils import requires_scipy_version, slow_test from mne.time_frequency import compute_raw_psd, compute_epochs_psd base_dir = op.jo...
bsd-3-clause
rseubert/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
ephes/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
ApachePointObservatory/InstrumentBlockGUI
instcalc.py
1
6088
#!/usr/bin/python from scipy import optimize import numpy as np import matplotlib import matplotlib.pyplot as plt from operator import itemgetter class GridData(object): def __init__(self, data=None, bin = None): if data is None: raise Exception("Data must be specified to create a GridData obj...
mit
gerbaudo/fbu
fbu/monitoring.py
1
1915
import matplotlib.mlab as mlab import matplotlib.pyplot as plt from numpy import mean,std,arange,array def plothistandtrace(name,xx,lower,upper): ax = plt.subplot(211) mu = mean(xx) if 'truth' in name else 0. sigma = std(xx) if 'truth' in name else 1. n, bins, patches = plt.hist(xx, bins=50, normed=1, ...
gpl-2.0
zuku1985/scikit-learn
sklearn/cross_decomposition/cca_.py
151
3192
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
zorojean/scikit-learn
sklearn/linear_model/tests/test_perceptron.py
378
1815
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_raises from sklearn.utils import check_random_state from sklearn.datasets import load_iris from sklearn.linear_model import Pe...
bsd-3-clause
santosjorge/cufflinks
cufflinks/ta.py
1
16745
## TECHNICHAL ANALYSIS import pandas as pd import numpy as np # import talib from plotly.graph_objs import Figure from .utils import make_list class StudyError(Exception): pass def _ohlc_dict(df_or_figure,open='',high='',low='',close='',volume='', validate='',**kwargs): """ Returns a dictionary with the act...
mit
JT5D/scikit-learn
sklearn/linear_model/tests/test_base.py
8
3587
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model....
bsd-3-clause
britram/qof
pytools/ipfix2hdf5.py
1
1861
import ipfix import qof import pandas as pd import argparse import bz2 from sys import stdin, stdout, stderr args = None def parse_args(): global args parser = argparse.ArgumentParser(description="Convert an IPFIX file or stream to HDF5") parser.add_argument('ienames', metavar="ie", nargs="+", ...
gpl-2.0
strets123/cbh_chembl_ws_extension
cbh_chembl_ws_extension/compounds.py
1
79983
from tastypie.resources import ALL from tastypie.resources import ALL_WITH_RELATIONS from tastypie.resources import ModelResource from django.conf import settings from django.conf.urls import * from django.core.exceptions import ObjectDoesNotExist from tastypie.authorization import Authorization from tastypie import ht...
mit
IshankGulati/scikit-learn
sklearn/cluster/tests/test_bicluster.py
143
9461
"""Testing for Spectral Biclustering methods""" import numpy as np from scipy.sparse import csr_matrix, issparse from sklearn.model_selection 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 ...
bsd-3-clause
rhattersley/iris
docs/iris/example_code/General/projections_and_annotations.py
6
5396
""" Plotting in different projections ================================= This example shows how to overlay data and graphics in different projections, demonstrating various features of Iris, Cartopy and matplotlib. We wish to overlay two datasets, defined on different rotated-pole grids. To display both together, we m...
lgpl-3.0
thushear/MLInAction
nlp/bayes.py
1
3077
from sklearn import datasets iris = datasets.load_iris() print(iris.data[:5]) print(iris.target[:5]) from sklearn.naive_bayes import GaussianNB gnb = GaussianNB() y_pred = gnb.fit(iris.data, iris.target).predict(iris.data) print('='*40) print(iris.target) print('='*40) print(y_pred) right_num = (iris.target == y_pred)...
apache-2.0
draperjames/qtpandas
qtpandas/models/SupportedDtypes.py
1
5907
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import super from future import standard_library standard_library.install_aliases() import numpy as np from qtpandas.compat import QtCore class SupportedDty...
mit
OpenSeizureDetector/OpenSeizureDetector
kinect_version/benFinder/timeSeries.py
2
9965
#!/usr/bin/python # ############################################################################# # # Copyright Graham Jones, December 2013 # # Original version by Joseph Howse in his book, "OpenCV Computer Vision with # Python" (Packt Publishing, 2013). # http://nummist.com/opencv/ # http://www.packt...
gpl-3.0
nilbody/h2o-3
h2o-py/tests/testdir_algos/kmeans/pyunit_DEPRECATED_get_modelKmeans.py
1
1238
from __future__ import print_function from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import numpy as np from sklearn.cluster import KMeans from sklearn.preprocessing import Imputer def get_modelKmeans(): # Connect to a pre-existing cluster #...
apache-2.0
TomAugspurger/pandas
pandas/core/arrays/_arrow_utils.py
1
4430
from distutils.version import LooseVersion import json import numpy as np import pyarrow from pandas.core.arrays.interval import _VALID_CLOSED _pyarrow_version_ge_015 = LooseVersion(pyarrow.__version__) >= LooseVersion("0.15") def pyarrow_array_to_numpy_and_mask(arr, dtype): """ Convert a primitive pyarrow...
bsd-3-clause
LeeKamentsky/CellProfiler
cellprofiler/utilities/matplotlib_axes_monkey_patch.py
3
7571
# Patches to prior versions of matplotlib # # Code below is adapted from matplotlib: # # This LICENSE AGREEMENT is between John D. Hunter (“JDH”), and the Individual # or Organization (“Licensee”) accessing and otherwise using matplotlib software # in source or binary form and its associated documentation. # # Subject ...
gpl-2.0
aetilley/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
jimhw/trading-with-python
lib/qtpandas.py
77
7937
''' Easy integration of DataFrame into pyqt framework Copyright: Jev Kuznetsov Licence: BSD ''' from PyQt4.QtCore import (QAbstractTableModel,Qt,QVariant,QModelIndex,SIGNAL) from PyQt4.QtGui import (QApplication,QDialog,QVBoxLayout, QHBoxLayout, QTableView, QPushButton, QWidget,QTabl...
bsd-3-clause
ChristianKniep/QNIB
serverfiles/usr/local/lib/networkx-1.6/build/lib/networkx/readwrite/gml.py
3
11740
""" Read graphs in GML format. "GML, the G>raph Modelling Language, is our proposal for a portable file format for graphs. GML's key features are portability, simple syntax, extensibility and flexibility. A GML file consists of a hierarchical key-value lists. Graphs can be annotated with arbitrary data structures. The...
gpl-2.0
JelteF/statistics
5/descent.py
1
1092
import numpy as np import numpy.random as rd import matplotlib.pyplot as plt from pylatex import Plt from scipy.optimize import minimize th1 = 2 th2 = .5 x = np.linspace(0, 10, 101) y = th1 * np.sin(th2 * x) + 0.3 * rd.randn(*x.shape) def J(th): return np.sum((y - th[0] * np.sin(th[1] * x))**2) def derivative1...
mit
TheChymera/LabbookDB
labbookdb/report/utilities.py
1
6075
import pandas as pd def concurrent_cagetreatment(df, cagestays, protect_duplicates=[ 'Animal_id', 'Cage_id', 'Cage_Treatment_start_date', 'Cage_Treatment_end_date', 'Cage_TreatmentProtocol_code', 'Treatment_end_date', 'Treatment_end_date', 'TreatmentProtocol_code', ], ): """ Return a `pandas.Data...
bsd-3-clause
xho95/BuildingMachineLearningSystemsWithPython
ch03/noise_analysis.py
24
2412
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import sklearn.datasets groups = [ 'comp.graphics', 'comp.os.ms-windows.misc', 'comp.sys.ibm.pc.ha...
mit
neilvallon/pyMap
app.py
1
2337
from bottle import * import random, math from datetime import datetime from MapGenerator import * from Tessellation import * def buildHTMLMap(seed, width, height): tstart = datetime.now() m = MapGenerator(int(width), int(height), str(seed)) #m.makeRandom().smooth().smooth().smooth().removeIslands().findSpawns() ...
mit
codrut3/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/ops.py
77
46403
# 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
PatrickOReilly/scikit-learn
examples/applications/plot_outlier_detection_housing.py
110
5681
""" ==================================== 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
q1ang/scikit-learn
sklearn/tests/test_base.py
216
7045
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
bsd-3-clause
ujfjhz/vnpy
docker/dockerTrader/ctaStrategy/tools/multiTimeFrame/ctaStrategyMultiTF.py
5
15034
# encoding: UTF-8 """ This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies. """ from strategyAtrRsi import * from ctaBase import * from ctaTemplate import CtaTemplate ######################################################################## class TC11(CtaTemplate): # Strategy name and author ...
mit
mattgiguere/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
rahul-c1/scikit-learn
sklearn/feature_extraction/hashing.py
29
5648
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
IshankGulati/scikit-learn
examples/neighbors/plot_classification.py
58
1790
""" ================================ Nearest Neighbors Classification ================================ Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColorm...
bsd-3-clause
clemkoa/scikit-learn
sklearn/externals/joblib/__init__.py
54
5087
"""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** and **r...
bsd-3-clause
anntzer/scikit-learn
sklearn/setup.py
11
3287
import sys import os from sklearn._build_utils import cythonize_extensions def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration import numpy libraries = [] if os.name == 'posix': libraries.append('m') config = Configuration('sklearn', ...
bsd-3-clause
ianrenton/geckocam
pi/drawgraphs.py
1
4269
#! /usr/bin/env python # Vivarium monitoring sensor script. Run by a cron job. Reads temperature and # humidity values written to the log file. Outputs charts of the last seven # days for each sensor with min/max lines. Sends alert emails if either figure # goes out of bounds. # Written by Ian Renton (http://ianrento...
bsd-2-clause
wilsonkichoi/zipline
docs/source/conf.py
7
3115
import sys import os from zipline import __version__ as version # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(...
apache-2.0
Jimmy-Morzaria/scikit-learn
sklearn/metrics/pairwise.py
13
41710
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
trungnt13/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
wzbozon/scikit-learn
examples/applications/topics_extraction_with_nmf_lda.py
133
3517
""" ======================================================================================== Topics extraction with Non-Negative Matrix Factorization And Latent Dirichlet Allocation ======================================================================================== This is an example of applying Non Negative Matr...
bsd-3-clause
soylentdeen/cuddly-weasel
gfVerification/compareGfs.py
1
3065
import matplotlib.pyplot as pyplot import numpy import scipy import sys import MoogTools import AstroUtils fig = pyplot.figure(0) fig.clear() ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) baseName = sys.argv[1] arcturusConfig = AstroUtils.parse_config(baseName+"_Solar.cfg") solarConfig = AstroUtils.parse_config(baseName+"...
mit
jniediek/mne-python
mne/viz/utils.py
1
58956
"""Utility functions for plotting M/EEG data """ from __future__ import print_function # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # ...
bsd-3-clause
fcolamar/AliPhysics
PWGLF/NUCLEX/Nuclei/NucleiPbPb/macros_pp13TeV/CorrelationFraction.py
19
2196
import uproot import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm shift_list = [[1, -2], [2, -1], [3, 1], [4, 2]] dcaxy_list = [[0, 1.0], [1, 1.4]] dcaz_list = [[0, 0.5], [1, 0.75], [2, 1.25], [3, 1.50]] pid_list = [[0, 3.25], [1, 3.5]] tpc_list = [[0, 60], [1, 65], [2, 75]...
bsd-3-clause