repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
jemromerol/apasvo
apasvo/picking/apasvotrace.py
1
30191
# encoding: utf-8 ''' @author: Jose Emilio Romero Lopez @copyright: Copyright 2013-2014, Jose Emilio Romero Lopez. @license: GPL @contact: jemromerol@gmail.com This file is part of APASVO. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Pu...
gpl-3.0
roxyboy/scikit-learn
examples/linear_model/plot_robust_fit.py
238
2414
""" Robust linear estimator fitting =============================== Here a sine function is fit with a polynomial of order 3, for values close to zero. Robust fitting is demoed in different situations: - No measurement errors, only modelling errors (fitting a sine with a polynomial) - Measurement errors in X - M...
bsd-3-clause
TimothyHelton/k2datascience
k2datascience/cluster.py
1
9060
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Clustering Module .. moduleauthor:: Timothy Helton <timothy.j.helton@gmail.com> """ import logging import os.path as osp import bokeh.io as bkio import bokeh.models as bkm import bokeh.plotting as bkplt from bokeh.sampledata.us_states import data as states import ma...
bsd-3-clause
loli/sklearn-ensembletrees
sklearn/svm/tests/test_bounds.py
42
2112
import nose from nose.tools import assert_true import numpy as np from scipy import sparse as sp from sklearn.svm.bounds import l1_min_c from sklearn.svm import LinearSVC from sklearn.linear_model.logistic import LogisticRegression dense_X = [[-1, 0], [0, 1], [1, 1], [1, 1]] sparse_X = sp.csr_matrix(dense_X) Y1 = ...
bsd-3-clause
rexshihaoren/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
12
10796
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...
bsd-3-clause
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/pandas/core/strings.py
1
45903
import numpy as np from pandas.compat import zip from pandas.core.common import isnull, _values_from_object, is_bool_dtype import pandas.compat as compat from pandas.util.decorators import Appender, deprecate_kwarg import re import pandas.lib as lib import warnings import textwrap _shared_docs = dict() def _get_ar...
mit
anurag313/scikit-learn
sklearn/cluster/mean_shift_.py
96
15434
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
bsd-3-clause
rmdort/clipper
containers/python/test_sklearn_cifar_container.py
3
1871
import numpy as np import os import pandas as pd import rpc import sys from sklearn_cifar_container import SklearnCifarContainer from sklearn.metrics import accuracy_score classes = [ 'airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck' ] positive_class = classes.index('airp...
apache-2.0
cainiaocome/scikit-learn
examples/covariance/plot_covariance_estimation.py
250
5070
""" ======================================================================= Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood ======================================================================= When working with covariance estimation, the usual approach is to use a maximum likelihood estimator,...
bsd-3-clause
synthicity/activitysim
activitysim/abm/models/trip_destination.py
2
19741
# ActivitySim # See full license in LICENSE.txt. from __future__ import (absolute_import, division, print_function, ) from future.standard_library import install_aliases install_aliases() # noqa: E402 from builtins import range import logging import numpy as np import pandas as pd from activitysim.core import trac...
agpl-3.0
alan-unravel/bokeh
examples/interactions/interactive_bubble/data.py
49
1265
import numpy as np from bokeh.palettes import Spectral6 def process_data(): from bokeh.sampledata.gapminder import fertility, life_expectancy, population, regions # Make the column names ints not strings for handling columns = list(fertility.columns) years = list(range(int(columns[0]), int(columns[-...
bsd-3-clause
PiotrGrzybowski/NeuralNetworks
networks/neurons/optimizer.py
1
5209
import numpy as np import matplotlib.pyplot as plt from drawnow import drawnow import time from neurons.activations import bipolar LEAST_MEAN_ERROR = 'least_mean_square' DISCRETE_ERROR = 'discrete' class Optimizer: def __init__(self, loss, learning_rate, epochs, stop_error): self.loss = loss sel...
apache-2.0
badlogicmanpreet/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/font_manager.py
69
42655
""" A module for finding, managing, and using fonts across platforms. This module provides a single :class:`FontManager` instance that can be shared across backends and platforms. The :func:`findfont` function returns the best TrueType (TTF) font file in the local or system font path that matches the specified :class...
agpl-3.0
raoulbq/scipy
scipy/signal/waveforms.py
17
14814
# 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...
bsd-3-clause
thomasmeagher/DS-501
3/text_analytics/solutions/exercise_02_sentiment.py
46
2798
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
mit
nrhine1/scikit-learn
sklearn/datasets/tests/test_base.py
205
5878
import os import shutil import tempfile import warnings import nose import numpy from pickle import loads from pickle import dumps from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn...
bsd-3-clause
pele-python/mcpele
examples/sfHS_WCA_fluid/radial_distribution_function.py
2
4232
from __future__ import division import numpy as np from scipy.special import gamma import matplotlib.pyplot as plt from pele.potentials import HS_WCA from pele.optimize import LBFGS_CPP from mcpele.monte_carlo import _BaseMCRunner from mcpele.monte_carlo import RandomCoordsDisplacement from mcpele.monte_carlo import Re...
gpl-3.0
gvanhorn38/active_neurofinder
movie.py
1
1737
""" Create a video out of the images """ from matplotlib import pyplot as plt import matplotlib.animation as animation import numpy as np from scipy import interpolate from glob import glob from util import load_images, load_regions import os from scipy.misc import imread from PIL import Image def create_movie(datas...
mit
zorroblue/scikit-learn
sklearn/datasets/tests/test_20news.py
75
3266
"""Test the 20news downloader, if the data is available.""" import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import SkipTest from sklearn import datasets def test_20news(): try: data = dat...
bsd-3-clause
sarathid/Learning
Intro_to_ML/tools/email_preprocess.py
10
2628
#!/usr/bin/python import pickle import cPickle import numpy from sklearn import cross_validation from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_selection import SelectPercentile, f_classif def preprocess(words_file = "../tools/word_data.pkl", authors_file="../tools/email_authors.p...
gpl-3.0
icereval/modular-file-renderer
mfr/ext/tabular/configuration.py
3
1191
# -*- coding: utf-8 -*- """Configuration object for the mfr_tabular module.""" from .libs import ( csv_pandas, tsv_pandas, dta_pandas, sav_pandas, xlsx_xlrd ) from mfr import Config """Defines a list of functions that can handle a particular file type. The functions will be attempted in order, f...
apache-2.0
timqian/sms-tools
lectures/6-Harmonic-model/plots-code/f0Twm-piano.py
19
1261
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackman import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF import stft as STFT...
agpl-3.0
dilawar/moose-full
moose-examples/snippets/insertSpines.py
2
2798
######################################################################### ## This program is part of 'MOOSE', the ## Messaging Object Oriented Simulation Environment. ## Copyright (C) 2015 Upinder S. Bhalla. and NCBS ## It is made available under the terms of the ## GNU Lesser General Public License version 2...
gpl-2.0
kashif/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
83
5888
""" =============================================================================== 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
cbertinato/pandas
pandas/tests/plotting/test_datetimelike.py
1
57288
""" Test cases for time series specific (freq conversion, etc) """ from datetime import date, datetime, time, timedelta import pickle import sys import numpy as np import pytest import pandas.util._test_decorators as td from pandas import DataFrame, Index, NaT, Series, isna from pandas.core.indexes.datetimes import ...
bsd-3-clause
dbarbier/ot-svn
python/doc/sphinxext/numpydoc/tests/test_docscrape.py
3
18530
# -*- encoding:utf-8 -*- from __future__ import division, absolute_import, print_function import sys import textwrap from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc from nose.tools import * if sys.version_info[0] >= 3: six...
gpl-3.0
AnasGhrab/scikit-learn
sklearn/tests/test_cross_validation.py
27
41664
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn...
bsd-3-clause
lgarren/spack
var/spack/repos/builtin/packages/py-yt/package.py
3
4127
############################################################################## # 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
YihaoLu/statsmodels
statsmodels/datasets/statecrime/data.py
25
3128
#! /usr/bin/env python """Statewide Crime Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """Public domain.""" TITLE = """Statewide Crime Data 2009""" SOURCE = """ All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below. """ DESCRSHORT = """State ...
bsd-3-clause
JRock007/boxxy
dist/Boxxy.app/Contents/Resources/lib/python2.7/numpy/lib/twodim_base.py
37
26758
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function from numpy.core.numeric import ( asanyarray, arange, zeros, greater_equal, multiply, ones, asarray, where, int8, int16, int32, int64, empty, promote_types ) from numpy.core import iinfo __...
mit
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/pandas/core/sparse/scipy_sparse.py
18
5516
""" Interaction with scipy.sparse matrices. Currently only includes SparseSeries.to_coo helpers. """ from pandas.core.index import MultiIndex, Index from pandas.core.series import Series from pandas.compat import OrderedDict, lmap def _check_is_partition(parts, whole): whole = set(whole) parts = [set(x) for ...
mit
tim777z/seaborn
doc/sphinxext/plot_generator.py
38
10035
""" Sphinx plugin to run example scripts and create a gallery page. Lightly modified from the mpld3 project. """ from __future__ import division import os import os.path as op import re import glob import token import tokenize import shutil import json import matplotlib matplotlib.use('Agg') import matplotlib.pyplot...
bsd-3-clause
jonpdx/gsoc2014
contour sem tiff down sample.py
1
2985
# -*- coding: utf-8 -*- # <nbformat>2</nbformat> # <codecell> ############################################################################### # Import Libraries import time as time import numpy as np import scipy as sp import pylab as pl import Image # from sklearn.feature_extraction.image import grid_to_graph from s...
gpl-2.0
cjermain/numpy
numpy/lib/twodim_base.py
83
26903
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function from numpy.core.numeric import ( asanyarray, arange, zeros, greater_equal, multiply, ones, asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal, ) from numpy.core import...
bsd-3-clause
wangyum/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
20
12315
# 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
TNick/pylearn2
pylearn2/scripts/papers/jia_huang_wkshp_11/evaluate.py
44
3208
from __future__ import print_function from optparse import OptionParser import warnings try: from sklearn.metrics import classification_report except ImportError: classification_report = None warnings.warn("couldn't find sklearn.metrics.classification_report") try: from sklearn.metrics import confusion...
bsd-3-clause
weigq/pytorch-pose
evaluation/utils.py
2
1239
def visualize(oriImg, points, pa): import matplotlib import cv2 as cv import matplotlib.pyplot as plt import math fig = matplotlib.pyplot.gcf() # fig.set_size_inches(12, 12) colors = [[255, 0, 0], [255, 85, 0], [255, 170, 0], [255, 255, 0], [170, 255, 0], [85, 255, 0], [0, 255, 0], ...
gpl-3.0
sangwook236/SWDT
sw_dev/python/rnd/test/machine_vision/opencv/opencv_transformation.py
2
12844
#!/usr/bin/env python # -*- coding: UTF-8 -*- import math import numpy as np import cv2 as cv from matplotlib import pyplot as plt # REF [site] >> https://docs.opencv.org/master/da/d6e/tutorial_py_geometric_transformations.html def geometric_transformation(): #-------------------- # Scaling. img = cv.imread('../....
gpl-3.0
magne-max/zipline-ja
zipline/lib/labelarray.py
1
20669
""" An ndarray subclass for working with arrays of strings. """ from functools import partial from operator import eq, ne import re import numpy as np from numpy import ndarray import pandas as pd from toolz import compose from zipline.utils.compat import unicode from zipline.utils.preprocess import preprocess from z...
apache-2.0
giserh/mpld3
mpld3/__init__.py
20
1109
""" Interactive D3 rendering of matplotlib images ============================================= Functions: General Use ---------------------- :func:`fig_to_html` convert a figure to an html string :func:`fig_to_dict` convert a figure to a dictionary representation :func:`show` launch a web server to view...
bsd-3-clause
EnvGen/toolbox
scripts/concoct/nr_approved_bins_summary.py
1
1775
#!/usr/bin/env python """ Based on all checkm results, creates a table containing the nr of approved genomes for all binning runs it can find within binning/*. @author: alneberg """ from __future__ import print_function import sys import os import argparse import pandas as pd import glob def find_checkm_dirs(): ...
mit
landryb/QGIS
python/plugins/processing/algs/qgis/VectorLayerScatterplot.py
15
3160
# -*- coding: utf-8 -*- """ *************************************************************************** EquivalentNumField.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *******************...
gpl-2.0
saiwing-yeung/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
nvoron23/scikit-learn
sklearn/svm/setup.py
321
3157
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('svm', parent_package, top_path) config.add_subpackage('tests') # Section L...
bsd-3-clause
snfactory/cubefit
cubefit/tests/test_fitting.py
2
12205
#/usr/bin/env py.test from __future__ import print_function import os import sys import sysconfig import numpy as np from numpy.fft import fft2, ifft2 from numpy.testing import assert_allclose from scipy.optimize import check_grad, approx_fprime import cubefit from cubefit.fitting import (sky_and_sn, ...
mit
Averroes/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
dialounke/pylayers
pylayers/gui/PylayersGui.py
1
23274
# -*- coding: utf-8 -*- """ PyLayers GUI .. autommodule:: :members: To run this code. type python PylayersGui.py """ from pylayers.simul.link import * import pylayers.util.pyutil as pyu import pylayers.signal.standard as std from pylayers.util.project import * import json # TEST import matplotlib matpl...
mit
mxjl620/scikit-learn
examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py
218
3893
""" ============================================== Feature agglomeration vs. univariate selection ============================================== This example compares 2 dimensionality reduction strategies: - univariate feature selection with Anova - feature agglomeration with Ward hierarchical clustering Both metho...
bsd-3-clause
Eric89GXL/scikit-learn
sklearn/metrics/cluster/bicluster/bicluster_metrics.py
13
2597
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_arrays def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shape.""" a_rows, a_cols = check_arrays(*a) b_rows,...
bsd-3-clause
alberlab/alabtools
alabtools/plots.py
1
10761
# Copyright (C) 2017 University of Southern California and # Nan Hua # # Authors: Nan Hua # # 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 Licen...
gpl-3.0
clovett/MissionPlanner
Lib/site-packages/numpy/lib/twodim_base.py
70
23431
""" Basic functions for manipulating 2d arrays """ __all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu', 'tril','vander','histogram2d','mask_indices', 'tril_indices','tril_indices_from','triu_indices','triu_indices_from', ] from numpy.core.numeric import asanyarr...
gpl-3.0
matthiasmengel/sealevel
sealevel/print_projection_numbers.py
1
4093
# This file is part of SEALEVEL - a tool to estimates future sea-level rise # constrained by past obervations and long-term sea-level commitment # Copyright (C) 2016 Matthias Mengel working at PIK Potsdam # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pub...
gpl-3.0
mattcaldwell/zipline
zipline/transforms/ta.py
6
8006
# # Copyright 2013 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
alliemacleay/MachineLearning_CS6140
Tests/hw4_tests.py
1
4429
from sklearn.metrics import roc_auc_score __author__ = 'Allison MacLeay' import CS6140_A_MacLeay.utils.Adaboost as adab import CS6140_A_MacLeay.utils as utils import CS6140_A_MacLeay.Homeworks.HW4 as decTree import CS6140_A_MacLeay.Homeworks.HW3 as hw3 import CS6140_A_MacLeay.Homeworks.hw4 as hw4 import CS6140_A_MacL...
mit
antoinecarme/pyaf
tests/HourOfWeek/test_Business_Hourly_LunchTime.py
1
2087
import pandas as pd import numpy as np import pyaf.ForecastEngine as autof np.random.seed(seed=1960) #get_ipython().magic('matplotlib inline') df = pd.DataFrame() lTimeVar = 'Time' lSignalVar = 'Signal' N = 10000 df[lTimeVar + '_Hourly'] = pd.date_range('2000-1-1', periods=N, freq='1h') df['Hour'] = df[lTimeVar ...
bsd-3-clause
antworteffekt/EDeN
eden/iterated_semisupervised_feature_selection.py
1
7729
import random import logging import numpy as np from sklearn.semi_supervised import LabelSpreading from sklearn.feature_selection import RFECV from sklearn.linear_model import SGDClassifier from sklearn.preprocessing import LabelEncoder logger = logging.getLogger(__name__) def semisupervised_target(target=None, ...
mit
jjhelmus/scipy
scipy/fftpack/basic.py
2
21565
""" Discrete Fourier Transforms - basic.py """ # Created by Pearu Peterson, August,September 2002 from __future__ import division, print_function, absolute_import __all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', 'fft2','ifft2'] from numpy import zeros, swapaxes import numpy from . import _fftpack im...
bsd-3-clause
Ninad998/deepstylometry-python
crosslingual/MLModelCreatorWord.py
1
4039
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import os from sklearn.ensemble import RandomForestClassifier import pandas as pd import numpy as np np.random.seed(123) databaseConnectionServer = 'srn01.cs.cityu.edu.hk' documentTable = 'document' def loadData(documentTable, samples ...
mit
exa-analytics/atomic
exatomic/nwchem/inputs.py
2
9896
# -*- coding: utf-8 -*- # Copyright (c) 2015-2020, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Input Generator and Parser ############################# Every attempt is made to follow the Documentation on the NWChem `website`_ with a general theme of the input Generator ac...
apache-2.0
kcompher/BuildingMachineLearningSystemsWithPython
ch06/01_start.py
6
3961
# 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 # # This script trains multinomial Naive Bayes on the tweet corpus # to find two different results: # -...
mit
IndraVikas/scikit-learn
sklearn/utils/tests/test_linear_assignment.py
421
1349
# Author: Brian M. Clapper, G Varoquaux # License: BSD import numpy as np # XXX we should be testing the public API here from sklearn.utils.linear_assignment_ import _hungarian def test_hungarian(): matrices = [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], ...
bsd-3-clause
HaydenFaulkner/phd
processing/VEN/S2S/s2vt_captioner_old.py
1
26012
DEVICE_ID = 0 """ Script to generate captions from video features""" from collections import OrderedDict import argparse import cPickle as pickle import h5py import math import matplotlib.pyplot as plt import numpy as np import os import random import sys sys.path.append('/home/hayden/caffe-recurrent/python') # lib...
mit
sourabhdattawad/BuildingMachineLearningSystemsWithPython
ch08/norm.py
23
2242
import numpy as np class NormalizePositive(object): def __init__(self, axis=0): self.axis = axis def fit(self, features, y=None): # count features that are greater than zero in axis `self.axis`: if self.axis == 1: features = features.T binary = (features > 0) ...
mit
pianomania/scikit-learn
sklearn/neighbors/tests/test_dist_metrics.py
36
6957
import itertools import pickle import numpy as np from numpy.testing import assert_array_almost_equal import scipy from scipy.spatial.distance import cdist from sklearn.neighbors.dist_metrics import DistanceMetric from sklearn.neighbors import BallTree from sklearn.utils.testing import SkipTest, assert_raises_regex ...
bsd-3-clause
madgik/exareme
Exareme-Docker/src/mip-algorithms/CART/cart_lib.py
1
34421
from __future__ import division from __future__ import print_function import sys from os import path import numpy as np import pandas as pd import json import itertools import logging sys.path.append(path.dirname(path.dirname(path.abspath(__file__))) + '/utils/') from algorithm_utils import TransferData, PRIVACY_MAGI...
mit
jabeerahmed/testrepo
term1/Lessons/LaneDetection/hough_transform.py
1
6249
import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 import os COLOR_SWATCH = [ [255, 64, 0], [255, 128, 0], [255, 191, 0], [255, 255, 0], [191, 255, 0], [128, 255, 0], [64, 255, 0], [0, 255, 0], [0, 255, 64], [0, 255, 128], [0, 255, 191], [0, 255, 255], [0, 191, 25...
gpl-2.0
mikekestemont/ruzicka
code/05latin_testviz.py
1
1217
from __future__ import print_function import os import time import json import sys import pickle import matplotlib import matplotlib.pyplot as plt import seaborn as sb from scipy.spatial.distance import squareform, pdist import numpy as np from sklearn.preprocessing import LabelEncoder from ruzicka.distance_metrics i...
mit
benoitsteiner/tensorflow
tensorflow/contrib/factorization/python/ops/gmm_test.py
44
8747
# 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
dancingdan/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test.py
21
54488
# 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
DevinCharles/igpt
examples/mapGenerator.py
1
3325
# coding: utf-8 import folium import pandas as pd from os.path import splitext def mapGenerator(files,data_info='default', map_opts='default',serve_files=False): createMap(files,data_info, map_opts) if serve_files: try: startServer() except Exception as e: ...
gpl-2.0
jmschrei/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
evgchz/scikit-learn
examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py
252
3490
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================================================== Gaussian Processes classification example: exploiting the probabilistic output ============================================================================== A two-dimensional regression exerci...
bsd-3-clause
ishanic/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
ArtsiomCh/tensorflow
tensorflow/contrib/training/python/training/feeding_queue_runner_test.py
76
5052
# 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
nmayorov/scikit-learn
sklearn/mixture/gmm.py
19
30655
""" Gaussian Mixture Models. This implementation corresponds to frequentist (non-Bayesian) formulation of Gaussian Mixture Models. """ # Author: Ron Weiss <ronweiss@gmail.com> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Bertrand Thirion <bertrand.thirion@inria.fr> import warnings import numpy as...
bsd-3-clause
rahul-c1/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
heli522/scikit-learn
examples/classification/plot_classifier_comparison.py
181
4699
#!/usr/bin/python # -*- coding: utf-8 -*- """ ===================== Classifier comparison ===================== A comparison of a several classifiers in scikit-learn on synthetic datasets. The point of this example is to illustrate the nature of decision boundaries of different classifiers. This should be taken with ...
bsd-3-clause
nonsk131/USRP2016
generate_tests0000-0999.py
1
3341
from isochrones.dartmouth import Dartmouth_Isochrone from isochrones.utils import addmags import numpy as np import pandas as pd file = open('/tigress/np5/true_params.txt','a') def get_index(n): if n < 10: return '000' + str(n) elif n < 100: return '00' + str(n) elif n < 1000: retu...
mit
raysteam/zeppelin
python/src/main/resources/python/zeppelin_python.py
1
9358
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
fedhere/SESNCfAlib
getSpecOSNC.py
1
1534
import pandas as pd import numpy as np import json import os import glob import inspect import optparse import time import copy import os import pylab as pl import numpy as np import scipy import json import sys import pickle as pkl import scipy as sp import numpy as np from scipy import optimize from scipy.interpola...
mit
chenyyx/scikit-learn-doc-zh
examples/zh/svm/plot_iris.py
1
4011
# -*- coding:UTF-8 -*- """ =========================================================== 在鸢尾花卉数据集上绘制不同的 SVM 分类器 =========================================================== 在鸢尾花卉数据集的 2D 投影上的不同线性 SVM 分类器的比较。我们只考虑这个数据集的前 2 个特征: - 萼片长度 - 萼片宽度 此示例显示如何绘制具有不同 kernel 的四个 SVM 分类器的决策表面。 线性模型 ``LinearSVC()`` 和 ``SVC(kernel='l...
gpl-3.0
lbishal/scikit-learn
examples/applications/svm_gui.py
287
11161
""" ========== 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
ningchi/scikit-learn
examples/ensemble/plot_adaboost_regression.py
26
1523
""" ====================================== 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
PatrickChrist/scikit-learn
examples/feature_selection/plot_permutation_test_for_classification.py
250
2233
""" ================================================================= Test with permutations the significance of a classification score ================================================================= In order to test if a classification score is significative a technique in repeating the classification procedure aft...
bsd-3-clause
tongwang01/tensorflow
tensorflow/examples/tutorials/input_fn/boston.py
19
2448
# 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
stverhae/incubator-airflow
airflow/contrib/hooks/bigquery_hook.py
9
38929
# -*- coding: utf-8 -*- # # 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 writing, software ...
apache-2.0
antgonza/qiita
qiita_pet/handlers/api_proxy/tests/test_artifact.py
1
15279
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
kyleabeauchamp/EnsemblePaper
code/figures/plot_1D_example.py
1
2904
import scipy.stats import ALA3 import numpy as np import matplotlib.pyplot as plt from fitensemble import belt import matplotlib matplotlib.rcParams.update({'font.size': 18}) num_frames = 10000000 z = np.random.normal(size=(num_frames, 1)) rho = np.random.random_integers(0, 1, size=(num_frames, 1)) * 2 - 1 x = 0.5 * (...
gpl-3.0
lazywei/scikit-learn
examples/semi_supervised/plot_label_propagation_digits.py
268
2723
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
bsd-3-clause
kwentz10/Photosynthesis_Optimization_Modeling
Trait_Based_Photo_Model_Meadow_Plant_Traits_Plot_Each_Meadow.py
1
19462
# -*- coding: utf-8 -*- """ Photosynthesis and Stomatal Conductance Model Created 9/27/2016 Katherine Wentz This is a program that runs photosynthesis and stomatal conductance given changes in leaf- level traits. I derive photosynthesis from a stomatal conductance model. That way I am able to void the ci term. I am ...
mit
CforED/Machine-Learning
sklearn/_build_utils/__init__.py
21
1125
""" Utilities useful during the build. """ # author: Andy Mueller, Gael Varoquaux # license: BSD from __future__ import division, print_function, absolute_import HASH_FILE = 'cythonize.dat' DEFAULT_ROOT = 'sklearn' # WindowsError is not defined on unix systems try: WindowsError except NameError: WindowsError...
bsd-3-clause
joernhees/scikit-learn
sklearn/cluster/tests/test_mean_shift.py
23
3957
""" Testing for mean shift clustering methods """ import numpy as np import warnings from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_array_equal from sklearn....
bsd-3-clause
DBernardes/ProjetoECC
Eficiência_Quântica/Codigo/CCDinfo.py
1
1100
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Criado em 18 de Outubro de 2016 Descricao: este modulo tem como entrada o cabecalho de uma imagen fits e a quantidade de imagens da serie obtidam retornado uma string com as principais informacoes do CCD. @author: Denis Varise Bernardes & Eder Martioli ...
mit
ShawnMurd/MetPy
tests/calc/test_basic.py
1
32604
# Copyright (c) 2008,2015,2017,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Test the `basic` module.""" import numpy as np import pandas as pd import pytest import xarray as xr from metpy.calc import (add_height_to_pressure, add_pressure_...
bsd-3-clause
vshtanko/scikit-learn
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/backends/backend_cairo.py
10
19252
""" A Cairo backend for matplotlib Author: Steve Chaplin Cairo is a vector graphics library with cross-device output support. Features of Cairo: * anti-aliasing * alpha channel * saves image files as PNG, PostScript, PDF http://cairographics.org Requires (in order, all available from Cairo website): cairo, pyc...
gpl-3.0
blackball/an-test6
util/compare-runs.py
1
3995
#! /usr/bin/env python import matplotlib matplotlib.use('Agg') from astrometry.util.fits import * from astrometry.util.file import * from pylab import * from optparse import * import os from glob import glob from numpy import * def get_field(fieldname, m1, m2, nil, preproc=None): t1 = [] t2 = [] for k,v in m1.it...
gpl-2.0
noferini/AliceO2
Analysis/Scripts/update_ccdb.py
3
5974
#!/usr/bin/env python3 # Copyright CERN and copyright holders of ALICE O2. This software is # distributed under the terms of the GNU General Public License v3 (GPL # Version 3), copied verbatim in the file "COPYING". # # See http://alice-o2.web.cern.ch/license for full licensing information. # # In applying this licen...
gpl-3.0
KevinHock/rtdpyt
profiling/test_projects/flaskbb_lite_2/mprof.py
3
17606
#!/usr/bin/env python import glob import os import os.path as osp import sys import re import copy import time import math from optparse import OptionParser, OptionValueError import memory_profiler as mp ALL_ACTIONS = ("run", "rm", "clean", "list", "plot") help_msg = """ Available commands: run run a give...
gpl-2.0
tswast/google-cloud-python
securitycenter/docs/conf.py
2
11946
# -*- coding: utf-8 -*- # # google-cloud-securitycenter documentation build configuration file # # 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. # # All configuration values have a default; v...
apache-2.0