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
PatrickOReilly/scikit-learn
sklearn/cluster/tests/test_k_means.py
20
31445
"""Testing for K-means""" import sys import numpy as np from scipy import sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing i...
bsd-3-clause
radjkarl/fancyWidgets
fancywidgets/pyQtBased/_installed_modules.py
1
3835
#this file is auto generated by #CodeEditor.py - do not delete it l=['ahkab (0.18)', 'alabaster (0.7.9)', 'anaconda-clean (1.0)', 'anaconda-client (1.5.1)', 'anaconda-navigator (1.3.1)', 'appbase (0.3.5)', 'appdirs (1.4.0)', 'argcomplete (1.0.0)', 'astroid (1.4.7)', 'astropy (1.2.1)', 'babel (2.3.4)', 'backports.shutil...
gpl-3.0
jwkanggist/EveryBodyTensorFlow
run_tf_slim_example_lenet5_nmist.py
1
17021
#-*- coding: utf-8 -*- #! /usr/bin/env python ''' filename: run_tf_basic_lenet5_mnist.py description: simple end-to-end LetNet5 implementation - For the purpose of EverybodyTensorFlow tutorial - - training with Mnist data set from Yann's website. - the benchmark test error r...
unlicense
fracpete/python-weka-wrapper3
python/weka/plot/__init__.py
4
1786
# 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 program is distributed in the hope that it will be useful, # bu...
gpl-3.0
ameya30/IMaX_pole_data_scripts
my_scripts/noise_test.py
1
1663
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 20 14:55:38 2017 @author: prabhu """ from scipy.io import readsav import numpy as np #from matplotlib import pyplot as plt from astropy.io import fits unbin = readsav("/home/prabhu/sunrise_holly/movie_data/mk_magneto_tr2_reduc_rnr_300_21.sav") b...
mit
qifeigit/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
stainbank/simulocloud
simulocloud/visualise.py
1
5885
""" visualise.py See, plot and visually explore pointclouds """ import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.mplot3d import itertools import simulocloud.exceptions # Mapping of dimension to index in bounds _IDIM = {'x': 0, 'y': 1, 'z': 2} def scatter(pcs, dims, bounds=None, highlight=None,...
mit
Sbalbp/DIRAC
Core/Utilities/Graphs/GraphUtilities.py
10
14613
######################################################################## # $HeadURL$ ######################################################################## """ GraphUtilities is a a collection of utility functions and classes used in the DIRAC Graphs package. The DIRAC Graphs package is derived from the...
gpl-3.0
zrhans/pythonanywhere
pyscripts/ply_CH4.py
1
9135
""" DATA,Chuva,Chuva_min,Chuva_max,VVE,VVE_min,VVE_max,DVE,DVE_min,DVE_max, Temp.,Temp._min,Temp._max,Umidade,Umidade_min,Umidade_max,Rad.,Rad._min,Rad._max, Pres.Atm.,Pres.Atm._min,Pres.Atm._max, Temp.Int.,Temp.Int._min,Temp.Int._max, CH4,CH4_min,CH4_max,HCnM,HCnM_min,HCnM_max,HCT,HCT_min,HCT_max, SO2,SO2_min,SO2_max,...
apache-2.0
MatthieuBizien/scikit-learn
sklearn/linear_model/tests/test_bayes.py
299
1770
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.linear_model.bayes import BayesianRidge, ARDRegres...
bsd-3-clause
hlin117/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
Ziqi-Li/bknqgis
pandas/pandas/tests/dtypes/test_io.py
14
4606
# -*- coding: utf-8 -*- import numpy as np import pandas._libs.lib as lib import pandas.util.testing as tm from pandas.compat import long, u class TestParseSQL(object): def test_convert_sql_column_floats(self): arr = np.array([1.5, None, 3, 4.2], dtype=object) result = lib.convert_sql_column(ar...
gpl-2.0
shangwuhencc/scikit-learn
sklearn/gaussian_process/gaussian_process.py
78
34552
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from ..base import BaseEstimator, RegressorMixin from ..metrics...
bsd-3-clause
partofthething/ace
ace/smoother.py
1
12949
""" Scatterplot smoother with a fixed span. Takes x,y scattered data and returns a set of (x,s) points that form a smoother curve fitting the data with moving least squares estimates. Similar to a moving average, but with better characteristics. The fundamental issue with this smoother is that the choice of span (wind...
mit
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/backends/wx_compat.py
2
5736
#!/usr/bin/env python """ A wx API adapter to hide differences between wxPython classic and phoenix. It is assumed that the user code is selecting what version it wants to use, here we just ensure that it meets the minimum required by matplotlib. For an example see embedding_in_wx2.py """ from __future__ import (abso...
mit
ashmanmode/TTSDNNRepo
src/work_in_progress/oliver/run_dnn_hourly_check.py
3
53690
import cPickle import gzip import os, sys, errno import time import math # numpy & theano imports need to be done in this order (only for some numpy installations, not sure why) import numpy # we need to explicitly import this in some cases, not sure why this doesn't get imported with numpy itself import numpy.distu...
apache-2.0
hwroitzsch/BikersLifeSaver
lib/python3.5/site-packages/numpy/fft/fftpack.py
72
45497
""" Discrete Fourier Transforms Routines in this module: fft(a, n=None, axis=-1) ifft(a, n=None, axis=-1) rfft(a, n=None, axis=-1) irfft(a, n=None, axis=-1) hfft(a, n=None, axis=-1) ihfft(a, n=None, axis=-1) fftn(a, s=None, axes=None) ifftn(a, s=None, axes=None) rfftn(a, s=None, axes=None) irfftn(a, s=None, axes=None...
mit
chriscrosscutler/scikit-image
doc/examples/plot_template.py
20
1663
""" ================= Template Matching ================= In this example, we use template matching to identify the occurrence of an image patch (in this case, a sub-image centered on a single coin). Here, we return a single match (the exact same coin), so the maximum value in the ``match_template`` result corresponds...
bsd-3-clause
BhallaLab/moose
moose-examples/snippets/twocells.py
2
5300
# twocells.py --- # # Filename: twocells.py # Description: # Author:Subhasis Ray # Maintainer: # Created: Sat Aug 11 14:30:21 2012 (+0530) # Version: # Last-Updated: Sun Aug 12 15:45:38 2012 (+0530) # By: subha # Update #: 521 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # Change log: # #...
gpl-3.0
cainiaocome/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
tonylampada/octaveplay
andrew_exercises/mlex1/ex1.py
1
3108
import os import numpy as np from matplotlib.pyplot import * from mpl_toolkits.mplot3d import axes3d, Axes3D from matplotlib import cm import itertools FOLDER = os.path.dirname(os.path.realpath(__file__)) def load_data(): datafile = FOLDER + '/ex1data1.txt' data = np.loadtxt(datafile, delimiter=',') y = ...
mit
jjx02230808/project0223
sklearn/datasets/species_distributions.py
64
7917
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
guschmue/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io_test.py
111
7865
# Copyright 2015 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
DistributedSystemsGroup/YELP-DS
Scikit_Classification.py
2
14584
#!/usr/bin/env python # encoding: utf-8 from time import gmtime, strftime from sklearn import cross_validation from sklearn.metrics import r2_score from sklearn.linear_model import LogisticRegression from sklearn.metrics import mean_squared_error as mse import numpy as np import io, os import json def Result_Evalua...
apache-2.0
yuraic/koza4ok
skTMVA/sci_bdt_electron_BDT_structure.py
1
4530
from array import array import numpy as np import matplotlib.pyplot as plt from sklearn import datasets from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.metrics import classification_report, roc_auc_score, roc_curve from sklearn import tree import cPickle ...
mit
laosiaudi/Wiki-search
src/Heuristic_Bidirection.py
1
7280
#!/usr/bin/python #-*-coding:utf-8-*- import Queue import networkx as nx import matplotlib.pyplot as plt import random import math import time from sets import Set class Heuristic_Bidirection: def __init__(self, Source, Destination, Datalines, Outlines, Inlines): self.Origin= Source self.Destination...
mit
lpsinger/astropy
astropy/utils/compat/optional_deps.py
5
1183
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Checks for optional dependencies using lazy import from `PEP 562 <https://www.python.org/dev/peps/pep-0562/>`_. """ import importlib # First, the top-level packages: # TODO: This list is a duplicate of the dependencies in setup.cfg "all", but # some of...
bsd-3-clause
anaviltripathi/pgmpy
pgmpy/estimators/MLE.py
2
3230
from pgmpy.estimators import BaseEstimator from pgmpy.factors import TabularCPD from pgmpy.models import BayesianModel import numpy as np class MaximumLikelihoodEstimator(BaseEstimator): """ Class used to compute parameters for a model using Maximum Likelihood Estimate. Parameters ---------- mode...
mit
SaganBolliger/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/fontconfig_pattern.py
72
6429
""" A module for parsing and generating fontconfig patterns. See the `fontconfig pattern specification <http://www.fontconfig.org/fontconfig-user.html>`_ for more information. """ # Author : Michael Droettboom <mdroe@stsci.edu> # License : matplotlib license (PSF compatible) # This class is defined here because it m...
agpl-3.0
B3AU/waveTree
examples/cluster/plot_kmeans_stability_low_dim_dense.py
8
4308
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
CJ-Jewell/ThinkStats2
code/timeseries.py
66
18035
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import pandas import numpy as np import statsmodels.formula.api as smf import st...
gpl-3.0
drammock/mne-python
mne/decoding/mixin.py
14
2851
class TransformerMixin(object): """Mixin class for all transformers in scikit-learn.""" def fit_transform(self, X, y=None, **fit_params): """Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X. ...
bsd-3-clause
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/examples/skflow/multioutput_regression.py
9
2552
# 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
meteoswiss-mdr/precipattractor
pymodules/io_tools_attractor.py
1
60532
#!/usr/bin/env python ''' Module to perform various input/output operations on gif radar files and netCDF/CSV files containing the statistics of the attractor. The module also provide functionality to generate filenames, etc Documentation convention from https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT...
gpl-3.0
sgenoud/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
jseabold/statsmodels
statsmodels/examples/ex_kde_confint.py
4
1941
# -*- coding: utf-8 -*- """ Created on Mon Dec 16 11:02:59 2013 Author: Josef Perktold """ import numpy as np from scipy import stats import matplotlib.pyplot as plt import statsmodels.nonparametric.api as npar from statsmodels.sandbox.nonparametric import kernels from statsmodels.distributions.mixture_rvs import mi...
bsd-3-clause
anne-urai/RT_RDK
graphicalModels/examples/exoplanets.py
7
1616
""" The Fergus model of exoplanet detection ======================================= Besides being generally awesome, this example also demonstrates how you can color the nodes and add arbitrary labels to the figure. """ from matplotlib import rc rc("font", family="serif", size=12) rc("text", usetex=True) import daf...
mit
KaelChen/numpy
numpy/doc/creation.py
118
5507
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
bsd-3-clause
bradmontgomery/ml
book/ch05/utils.py
24
7111
# 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 os try: import ujson as json # UltraJSON if available except: import json from matplo...
mit
jorge2703/scikit-learn
sklearn/gaussian_process/gaussian_process.py
83
34544
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from ..base import BaseEstimator, RegressorMixin from ..metrics...
bsd-3-clause
htygithub/bokeh
bokeh/compat/mplexporter/utils.py
2
11621
""" Utility Routines for Working with Matplotlib Objects ==================================================== """ import itertools import io import base64 import numpy as np import warnings import matplotlib from matplotlib.colors import colorConverter from matplotlib.path import Path from matplotlib.markers import ...
bsd-3-clause
DGrady/pandas
pandas/tests/groupby/test_groupby.py
1
150439
# -*- coding: utf-8 -*- from __future__ import print_function import pytest from warnings import catch_warnings from string import ascii_lowercase from datetime import datetime from numpy import nan from pandas import (date_range, bdate_range, Timestamp, Index, MultiIndex, DataFrame, Series, ...
bsd-3-clause
rkpatel33/xlwings-utilities
xlwings_utilities.py
1
2350
""" Wrapper functions for xlwings """ import pandas as pd from xlwings import Workbook, Sheet, Range # Utililty functions for dataframes def clear(range_name, ws=None): """Clear a table started in a range cell, ex: clear('a1'). clear(range_name, ws=None) """ ws = Sheet.active() if ws is None else w...
mit
skyuuka/fast-rcnn
tools/train_svms.py
42
13247
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """ Train post-hoc SVMs using the algorithm and ...
mit
tscholak/smbkmeans
transactions_to_tfidf.py
1
5822
# -*- coding: utf-8 -*- import os import sys import inspect cmd_folder = os.path.realpath( os.path.abspath( os.path.split( inspect.getfile( inspect.currentframe() ) )[0] ) ) if cmd_folder not in sys.path: sys.path.insert...
mit
DSLituiev/scikit-learn
examples/neighbors/plot_kde_1d.py
347
5100
""" =================================== Simple 1D Kernel Density Estimation =================================== This example uses the :class:`sklearn.neighbors.KernelDensity` class to demonstrate the principles of Kernel Density Estimation in one dimension. The first plot shows one of the problems with using histogram...
bsd-3-clause
kkochubey1/docker-sikuli-novnc-off
noVNC/utils/json2graph.py
46
6674
#!/usr/bin/env python ''' Use matplotlib to generate performance charts Copyright 2011 Joel Martin Licensed under MPL-2.0 (see docs/LICENSE.MPL-2.0) ''' # a bar plot with errorbars import sys, json, pprint import numpy as np import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties def usage...
apache-2.0
cmu-delphi/delphi-epidata
src/acquisition/covid_hosp/state_daily/database.py
1
7326
# first party from delphi.epidata.acquisition.covid_hosp.common.database import Database as BaseDatabase from delphi.epidata.acquisition.covid_hosp.common.utils import Utils import pandas as pd class Database(BaseDatabase): # note we share a database with state_timeseries TABLE_NAME = 'covid_hosp_state_timeseri...
mit
ch3ll0v3k/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
mrshu/scikit-learn
examples/plot_isotonic_regression.py
7
1730
""" =================== Isotonic Regression =================== An illustration of the isotonic regression on generated data. The isotonic regression finds a non-decreasing approximation of a function while minimizing the mean squared error on the training data. The benefit of such a model is that it does not assume a...
bsd-3-clause
ben-heil/Data-Science-Bowl-2017
CNN.py
1
3320
# file: CNN.py # description: Implements a CNN that can be used to analyze DICOM images # author: Ben Heil # date: 4/27/17 import matplotlib.pyplot as plt import argparse import math import random import keras import sys import numpy from utilityFunctions import imageCount, readScan, readValidationImages, readBatch, r...
mit
stscieisenhamer/glue
glue/viewers/image/qt/standalone_image_viewer.py
2
5898
from __future__ import absolute_import, division, print_function import numpy as np from qtpy import QtCore, QtWidgets from glue.config import colormaps from glue.viewers.matplotlib.qt.toolbar import MatplotlibViewerToolbar from glue.viewers.matplotlib.qt.widget import MplWidget from glue.viewers.image.composite_arr...
bsd-3-clause
MartinSavc/scikit-learn
sklearn/neighbors/tests/test_kde.py
208
5556
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
themrmax/scikit-learn
sklearn/cluster/bicluster.py
11
20245
"""Spectral biclustering algorithms. Authors : Kemal Eren License: BSD 3 clause """ from abc import ABCMeta, abstractmethod import numpy as np from scipy.linalg import norm from scipy.sparse import dia_matrix, issparse from scipy.sparse.linalg import eigsh, svds from . import KMeans, MiniBatchKMeans from ..base im...
bsd-3-clause
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/examples/learn/wide_n_deep_tutorial.py
29
8985
# 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
darcy0511/Dato-Core
src/unity/python/graphlab/data_structures/sarray.py
13
91593
""" This module defines the SArray class which provides the ability to create, access and manipulate a remote scalable array object. SArray acts similarly to pandas.Series but without indexing. The data is immutable, homogeneous, and is stored on the GraphLab Server side. """ ''' Copyright (C) 2015 Dato, Inc. All rig...
agpl-3.0
TakayukiSakai/tensorflow
tensorflow/examples/skflow/iris_with_pipeline.py
9
1560
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
tawsifkhan/scikit-learn
examples/datasets/plot_iris_dataset.py
283
1928
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
harpone/nonpy
nonpy/nonpy.py
1
18805
# Nonpy - nonparametric time series modeling with Python # Copyright (C) 2014 Heikki Arponen (heikki.a.arponen@gmail.com) # # 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, eit...
gpl-3.0
numenta/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/delaunay/triangulate.py
70
7732
import warnings try: set except NameError: from sets import Set as set import numpy as np from matplotlib._delaunay import delaunay from interpolate import LinearInterpolator, NNInterpolator __all__ = ['Triangulation', 'DuplicatePointWarning'] class DuplicatePointWarning(RuntimeWarning): """Duplicate p...
agpl-3.0
olvhammar/GNURadio-FFTS
Software_CO-O3/Finalize.py
1
6065
#!/usr/bin/env python2 ################################################## # Finalize spectrums ################################################## import ephem import matplotlib.pyplot as plt import numpy as np import math import os import timeit import time import glob import threading import astropy import sys from as...
mit
artwr/airflow
airflow/hooks/base_hook.py
5
3203
# -*- coding: 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
gclenaghan/scikit-learn
sklearn/covariance/tests/test_covariance.py
34
11120
# 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
darshanthaker/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_macosx.py
69
15397
from __future__ import division import os import numpy from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ FigureManagerBase, FigureCanvasBase, NavigationToolbar2 from matplotlib.cbook import maxdict from matplotlib.figure import Figure from matplotl...
agpl-3.0
choderalab/open-forcefield-group
nmr/code/analyze_dcd.py
2
2427
import os import itertools import mdtraj import pandas as pd cos = np.cos sin = np.sin ave = lambda x: x.mean(0).mean(0) phi0 = np.deg2rad(0.0) amino_acids = ["A" , "C" , "D" , "E" , "F" , "G" , "H" , "I" , "K" , "L" , "M" , "N" , "Q" , "R" , "S" , "T" , "V" , "W" , "Y"] labels = ["%s%s" % (a0,a1) for (a0, a1) in ite...
gpl-2.0
aravindhv10/CPP_Wrappers
NewData/SRC/MXNET_DCGAN/OldTrain.py
1
5830
#!/usr/bin/python3 from __future__ import print_function import os import matplotlib as mpl import tarfile import matplotlib.image as mpimg from matplotlib import pyplot as plt import mxnet as mx from mxnet import gluon from mxnet import ndarray as nd from mxnet.gluon import nn, utils from mxnet import autograd impor...
gpl-2.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/tests/indexes/datetimes/test_datetimelike.py
9
2526
""" generic tests from the Datetimelike class """ import numpy as np import pandas as pd from pandas.util import testing as tm from pandas import Series, Index, DatetimeIndex, date_range from ..datetimelike import DatetimeLike class TestDatetimeIndex(DatetimeLike): _holder = DatetimeIndex def setup_method(...
mit
harmslab/epistasis
epistasis/pyplot/nonlinear.py
2
3477
import functools import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt def plot_scale( model=None, yadd=None, yobs=None, yerr=None, function=None, cmap=None, color=None, s=50, alpha=1, ax=None, function_line=True, line_color='r', **kwargs): ...
unlicense
WillArmentrout/galSims
plotting/ClusterNearby.py
1
7183
import matplotlib.pyplot as plt import math import csv import argparse parser = argparse.ArgumentParser() parser.add_argument("iterTotal", type=int, help="Number of Clustering Iterations") args = parser.parse_args() iterTot = args.iterTotal # Prompt User for number of iterations of clustering # Op...
gpl-2.0
stonneau/cwc_tests
src/plot_cond.py
1
1959
""" Created on march 6 2017 @author: stonneau """ import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm def __gen_values(min_point, max_point, inc): assert(max_point > min_point) num_points = int(float(max_point - min_point) / float(in...
gpl-3.0
JosmanPS/scikit-learn
examples/decomposition/plot_sparse_coding.py
247
3846
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
subramgo/Instacart
timeseries_features.py
1
2800
import numpy as np import pandas as pd import gc print('loading prior') priors = pd.read_csv('./data/order_products__prior.csv') train = pd.read_csv('./data/train_new.csv') train_eval = pd.read_csv('./data/train_eval.csv') print('loading orders') orders = pd.read_csv('./data/orders.csv') ### # some memory meas...
apache-2.0
Becksteinlab/GromacsWrapper
gromacs/fileformats/xpm.py
1
10360
# GromacsWrapper: xpm.py # Copyright (c) 2012 Oliver Beckstein <orbeckst@gmail.com> # Copyright (c) 2010 Tsjerk Wassenaar <tsjerkw@gmail.com> # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. """ Gromacs XPM file format ======================= Gromacs stores matrix ...
gpl-3.0
victorbergelin/scikit-learn
sklearn/decomposition/tests/test_pca.py
199
10949
import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_rai...
bsd-3-clause
imaculate/scikit-learn
examples/cluster/plot_adjusted_for_chance_measures.py
105
4300
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
bsd-3-clause
fzalkow/scikit-learn
sklearn/cluster/tests/test_dbscan.py
114
11393
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
deepesch/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
roxyboy/scikit-learn
examples/covariance/plot_lw_vs_oas.py
248
2903
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
bsd-3-clause
RayMick/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
cowlicks/numpy
numpy/doc/creation.py
118
5507
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
bsd-3-clause
PatrickOReilly/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
jcornford/pyecog
pyecog/ndf/make_pdfs.py
1
5148
''' This module is not currently being used ''' from __future__ import print_function import pickle import os import matplotlib.pyplot as plt import numpy as np import matplotlib.font_manager as fm dir = os.path.dirname(__file__) filename = os.path.join(dir, '../HelveticaNeue-Light.otf') prop = fm.FontProperties(fna...
mit
lukeiwanski/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py
46
13101
# 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
widdowquinn/pyani
pyani/pyani_report.py
1
7164
# -*- coding: utf-8 -*- # (c) The James Hutton Institute 2016-2019 # (c) University of Strathclyde 2019 # Author: Leighton Pritchard # # Contact: # leighton.pritchard@strath.ac.uk # # Leighton Pritchard, # Strathclyde Institute for Pharmacy and Biomedical Sciences, # Cathedral Street, # Glasgow, # G1 1XQ # Scotland, # ...
mit
adrn/streams
scripts/figures/paper1_figures.py
1
26475
# coding: utf-8 """ A script for making figures for our Streams Paper 1 """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys import cPickle as pickle import inspect # Third-party import astropy.units as u from astropy.io.misc import fnp...
mit
osblinnikov/ros-docker
noVNC/utils/json2graph.py
46
6674
#!/usr/bin/env python ''' Use matplotlib to generate performance charts Copyright 2011 Joel Martin Licensed under MPL-2.0 (see docs/LICENSE.MPL-2.0) ''' # a bar plot with errorbars import sys, json, pprint import numpy as np import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties def usage...
unlicense
cloudera/hue
desktop/core/ext-py/openpyxl-2.6.4/openpyxl/utils/dataframe.py
2
2069
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl import operator from openpyxl.compat import accumulate def dataframe_to_rows(df, index=True, header=True): """ Convert a Pandas dataframe into something suitable for passing into a worksheet. If index is True then the index will be...
apache-2.0
vdrhtc/Measurement-automation
lib/plotting.py
1
7856
import matplotlib.pyplot as plt from matplotlib import colorbar from numpy import meshgrid, unwrap, append import numpy as np from scipy import fftpack as fp """ Frequently used plotting functions """ def generate_mesh(X, Y): step_X = X[1] - X[0] step_Y = Y[1] - Y[0] return meshgrid(append(X - step_X / 2...
gpl-3.0
ycaihua/scikit-learn
sklearn/covariance/graph_lasso_.py
4
23542
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause
ufaks/addons-yelizariev
sugarcrm_migration/import_sugarcrm.py
16
44410
# -*- coding: utf-8 -*- import logging _logger = logging.getLogger(__name__) try: import MySQLdb import MySQLdb.cursors from pandas import merge, DataFrame except ImportError: pass from openerp.addons.import_framework.import_base import import_base, create_childs from openerp.addons.import_framework....
lgpl-3.0
paladin74/neural-network-animation
matplotlib/blocking_input.py
11
11636
""" This provides several classes used for blocking interaction with figure windows: :class:`BlockingInput` creates a callable object to retrieve events in a blocking way for interactive sessions :class:`BlockingKeyMouseInput` creates a callable object to retrieve key or mouse clicks in a blocking way...
mit
caseyclements/bokeh
bokeh/charts/builder/tests/test_scatter_builder.py
33
2895
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
HeraclesHX/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
PatrickOReilly/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
michigraber/scikit-learn
examples/svm/plot_rbf_parameters.py
57
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radius Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
grantjenks/pyannote-core
setup.py
1
2736
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2014-2017 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limita...
mit
glennlive/gnuradio-wg-grc
gr-fec/python/fec/polar/channel_construction_bec.py
22
8068
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # GNU Radio 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, or (at your option) # any later version. # # GNU Radio is...
gpl-3.0
nesterione/scikit-learn
examples/decomposition/plot_ica_blind_source_separation.py
349
2228
""" ===================================== Blind source separation using FastICA ===================================== An example of estimating sources from noisy data. :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 3 instruments playing simultaneously and 3 microphones recording the mixed si...
bsd-3-clause
jpn--/larch
larch/data_services/h5/h5pod/generic.py
1
31510
import os from pathlib import Path import tables as tb import numpy import pandas import logging from ....util import Dict from ....util.aster import asterize from ....util.text_manip import truncate_path_for_display from ... import _reserved_names_ from ...pod import Pod from ...general import _sqz_same, selector_len...
gpl-3.0
josenavas/qiime
scripts/plot_semivariogram.py
9
15002
#!/usr/bin/env python # File created on 09 Feb 2010 from __future__ import division __author__ = "Antonio Gonzalez Pena" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Antonio Gonzalez Pena", "Kyle Patnode", "Yoshiki Vazquez-Baeza"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "A...
gpl-2.0