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
jwkanggist/EveryBodyTensorFlow
run_slim_lenet5_nmist.py
1
16249
#-*- coding: utf-8 -*- #! /usr/bin/env python ''' filename: run_tf_slim_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 ra...
unlicense
0asa/scikit-learn
examples/manifold/plot_compare_methods.py
259
4031
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
emon10005/sympy
sympy/plotting/tests/test_plot.py
43
8577
from sympy import (pi, sin, cos, Symbol, Integral, summation, sqrt, log, oo, LambertW, I, meijerg, exp_polar, Max, Piecewise) from sympy.plotting import (plot, plot_parametric, plot3d_parametric_line, plot3d, plot3d_parametric_surface) from sympy.plotting.plot import unset...
bsd-3-clause
DamienIrving/ocean-analysis
visualisation/water_cycle/plot_pe_region_data_global.py
1
6007
"""Plot output from calc_pe_spatial_totals.py for globe basin only""" # Import general Python modules import sys, os, pdb import argparse import matplotlib.pyplot as plt import iris import iris.coord_categorisation # Import my modules cwd = os.getcwd() repo_dir = '/' for directory in cwd.split('/')[1:]: repo_di...
mit
nicholasmalaya/arcanus
uq/ps3/compute.py
2
3719
#!/usr/bin/env python import os import numpy as np import matplotlib.mlab as mlab from scipy.integrate import simps from read_data import read_data from hpd import hpd, plotpdfandobs from integral_alt import integral ############################################################################### # Get data (observa...
mit
marcelotrevisani/vtky
vtky/BaseArray.py
1
9900
import numpy as np import pandas as pd import vtk from vtk.util import numpy_support as ns class BaseArray(object): def __init__(self, array, type_array=None): ''' :param array: Receives a pandas DataFrame, or numpy array or vtkDataArray :param type_array: Receives the vtk data type or a...
mit
detrout/debian-statsmodels
docs/source/plots/graphics_gofplots_qqplot.py
38
1911
# -*- coding: utf-8 -*- """ Created on Sun May 06 05:32:15 2012 Author: Josef Perktold editted by: Paul Hobson (2012-08-19) """ from scipy import stats from matplotlib import pyplot as plt import statsmodels.api as sm #example from docstring data = sm.datasets.longley.load() data.exog = sm.add_constant(data.exog, pre...
bsd-3-clause
wzbozon/scikit-learn
sklearn/tests/test_cross_validation.py
15
47366
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.test...
bsd-3-clause
rainwoodman/pypm
examples/nbody.py
3
10288
from mpi4py import MPI import numpy from argparse import ArgumentParser from nbodykit.cosmology import Planck15 from nbodykit.cosmology import EHPower from nbodykit.cosmology.perturbation import PerturbationGrowth from scipy.integrate import quad PowerSpectrum = EHPower(Planck15, redshift=0.0) pt = PerturbationGrowth...
gpl-3.0
LohithBlaze/scikit-learn
examples/manifold/plot_lle_digits.py
181
8510
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
bsd-3-clause
sonnyhu/scikit-learn
examples/cluster/plot_digits_agglomeration.py
377
1694
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Feature agglomeration ========================================================= These images how similar features are merged together using feature agglomeration. """ print(__doc__) # Code source: Gaël Varoquaux #...
bsd-3-clause
joshloyal/scikit-learn
sklearn/gaussian_process/kernels.py
31
67169
"""Kernels for Gaussian process regression and classification. The kernels in this module allow kernel-engineering, i.e., they can be combined via the "+" and "*" operators or be exponentiated with a scalar via "**". These sum and product expressions can also contain scalar values, which are automatically converted to...
bsd-3-clause
macks22/scikit-learn
benchmarks/bench_plot_ward.py
290
1260
""" Benchmark scikit-learn's Ward implement compared to SciPy's """ import time import numpy as np from scipy.cluster import hierarchy import pylab as pl from sklearn.cluster import AgglomerativeClustering ward = AgglomerativeClustering(n_clusters=3, linkage='ward') n_samples = np.logspace(.5, 3, 9) n_features = n...
bsd-3-clause
alvaroing12/CADL
session-5/libs/gif.py
5
1834
"""Utility for creating a GIF. Creative Applications of Deep Learning w/ Tensorflow. Kadenze, Inc. Copyright Parag K. Mital, June 2016. """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def build_gif(imgs, interval=0.1, dpi=72, save_gif=True, saveto='animat...
apache-2.0
ngoix/OCRF
sklearn/utils/tests/test_multiclass.py
34
13405
from __future__ import division import numpy as np import scipy.sparse as sp from itertools import product from sklearn.externals.six.moves import xrange from sklearn.externals.six import iteritems from scipy.sparse import issparse from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sp...
bsd-3-clause
petosegan/scikit-learn
examples/neighbors/plot_digits_kde_sampling.py
251
2022
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
bsd-3-clause
Morwenn/vergesort
bench/bars.py
1
2973
import math import os import numpy from matplotlib import pyplot as plt distribution_names = { "shuffled_16_values_int": "Shuffled (16 values)", "shuffled_int": "Shuffled", "all_equal_int": "All equal", "ascending_int": "Ascending", "descending_int": "Descending", "pipe_organ_int": "Pipe org...
mit
jreback/pandas
pandas/core/flags.py
6
3567
import weakref class Flags: """ Flags that apply to pandas objects. .. versionadded:: 1.2.0 Parameters ---------- obj : Series or DataFrame The object these flags are associated with. allows_duplicate_labels : bool, default True Whether to allow duplicate labels in this o...
bsd-3-clause
fredhusser/scikit-learn
examples/svm/plot_custom_kernel.py
171
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
xcbat/vnpy
docker/dockerTrader/ctaStrategy/tools/multiTimeFrame/strategyBreakOut.py
5
11813
# encoding: UTF-8 """ This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies. """ from ctaBase import * from ctaTemplate import CtaTemplate import numpy as np ######################################################################## class BreakOut(CtaTemplate): """ "infoArray" 字典是用来储存辅助品种信息的, ...
mit
0x0all/scikit-learn
examples/plot_digits_pipe.py
250
1809
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
pprett/statsmodels
statsmodels/examples/tsa/ex_var.py
4
1237
import numpy as np import statsmodels.api as sm from statsmodels.tsa.api import VAR # some example data mdata = sm.datasets.macrodata.load().data mdata = mdata[['realgdp','realcons','realinv']] names = mdata.dtype.names data = mdata.view((float,3)) use_growthrate = False #True #False if use_growthrate: data = 10...
bsd-3-clause
kjyv/dynamical-system-identification
excitation/optimizer.py
2
25323
from __future__ import division from __future__ import print_function from builtins import range from builtins import object from typing import List, Tuple, Dict import sys import random import numpy as np import numpy.linalg as la import matplotlib import matplotlib.pyplot as plt from distutils.version import LooseV...
lgpl-3.0
wangmiao1981/spark
python/pyspark/pandas/missing/indexes.py
16
9920
# # 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
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/examples/pylab_examples/tripcolor_demo.py
3
4220
""" Pseudocolor plots of unstructured triangular grids. """ import matplotlib.pyplot as plt import matplotlib.tri as tri import numpy as np import math # Creating a Triangulation without specifying the triangles results in the # Delaunay triangulation of the points. # First create the x and y coordinates of the point...
gpl-2.0
meduz/scikit-learn
benchmarks/bench_tree.py
131
3647
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
xunyou/vincent
examples/line_chart_examples.py
9
2109
# -*- coding: utf-8 -*- """ Vincent Line Examples """ #Build a Line Chart from scratch from vincent import * import pandas as pd import pandas.io.data as web import datetime all_data = {} date_start = datetime.datetime(2010, 1, 1) date_end = datetime.datetime(2014, 1, 1) for ticker in ['AAPL', 'IBM', 'YHOO', 'MSFT'...
mit
wzbozon/statsmodels
statsmodels/sandbox/tsa/movstat.py
34
14871
'''using scipy signal and numpy correlate to calculate some time series statistics original developer notes see also scikits.timeseries (movstat is partially inspired by it) added 2009-08-29 timeseries moving stats are in c, autocorrelation similar to here I thought I saw moving stats somewhere in python, maybe not)...
bsd-3-clause
nvoron23/scikit-learn
examples/linear_model/plot_sparse_recovery.py
243
7461
""" ============================================================ Sparse recovery: feature selection for sparse linear models ============================================================ Given a small number of observations, we want to recover which features of X are relevant to explain y. For this :ref:`sparse linear ...
bsd-3-clause
kernsuite-debian/lofar
LCU/checkhardware/show_bad_spectra.py
1
2645
#!/usr/bin/env python3 import os import numpy as np import matplotlib.pyplot as plt import time obs_id_to_plot = '' station_to_plot = '' spectraPath = r'/localhome/stationtest/bad_spectra' def main(): files = full_listdir(spectraPath) for file_name in files: file_data = file_name[file_name.rfind('/...
gpl-3.0
dparks1134/DBB
dbb/plots/gcCoveragePlot.py
1
8081
############################################################################### # # # 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 # ...
gpl-3.0
KeplerGO/kpub
scripts/science-categories/categorize.py
1
2061
"""Categorize publications into fine-grained categories """ from pprint import pprint import pandas as pd import kpub FILENAME = "k2-categories.csv" CATEGORIES = { 'as': 'Asteroseismology', 'ga': 'Galactic Archaeology', 'wd': 'White Dwarfs', 'cv': 'Cataclysmic V...
mit
bloomberg/bqplot
bqplot/market_map.py
1
9455
# Copyright 2015 Bloomberg Finance L.P. # # 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 i...
apache-2.0
ElDeveloper/scikit-learn
examples/linear_model/plot_lasso_model_selection.py
311
5431
""" =================================================== Lasso model selection: Cross-Validation / AIC / BIC =================================================== Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-validation to select an optimal value of the regularization paramet...
bsd-3-clause
yavalvas/yav_com
build/matplotlib/lib/mpl_examples/pylab_examples/cursor_demo.py
6
2028
#!/usr/bin/env python # -*- noplot -*- """ This example shows how to use matplotlib to provide a data cursor. It uses matplotlib to draw the cursor and may be a slow since this requires redrawing the figure with every mouse move. Faster cursoring is possible using native GUI drawing, as in wxcursor_demo.py """ from...
mit
nitish-tripathi/Simplery
Scikit/DataPreprocessing.py
1
2093
from io import StringIO import numpy as np import pandas as pd from sklearn.preprocessing import Imputer, OneHotEncoder def imput_missing_data(data): """ Method that demonstrates imputing missing data """ print data.isnull().sum() print data.values # Add Missing value using interpolation #...
mit
aigamedev/nuclai15
dota2/extract_data_vectors.py
2
3546
from __future__ import (print_function, absolute_import) import io import collections from smoke.io.wrap import demo as io_wrp_dm from smoke.replay import demo as rply_dm from smoke.replay.const import Data import pandas as pd import config with io.open('1481687622.dem', 'rb') as infile: demo_io = io_wrp_dm.Wrap...
gpl-3.0
jakobworldpeace/scikit-learn
sklearn/tests/test_metaestimators.py
52
4990
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
jhnnsnk/nest-simulator
pynest/examples/hh_phaseplane.py
12
5096
# -*- coding: utf-8 -*- # # hh_phaseplane.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, ...
gpl-2.0
liuzhaoguo/FreeROI-1
froi/gui/component/unused/volumedintensitydialog.py
6
2368
__author__ = 'zhouguangfu' # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from PyQt4.QtCore import * from PyQt4.QtGui import * import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplo...
bsd-3-clause
evertrol/healpy
setup.py
2
18554
#!/usr/bin/env python # Bootstrap setuptools installation. We require setuptools >= 3.2 because of a # bug in earlier versions regarding C++ sources generated with Cython. See: # https://pypi.python.org/pypi/setuptools/3.6#id171 try: import pkg_resources pkg_resources.require("setuptools >= 3.2") except: ...
gpl-2.0
norbert/fickle
test/backend_test.py
1
1757
from sklearn import datasets from fickle.testing import TestCase from fickle.predictors import GenericSVMClassifier as Backend class BackendTest(TestCase): def test_load(self): backend = Backend() dataset = datasets.load_iris() self.assertTrue(backend.load(dataset)) def test_isloade...
mit
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/metrics/__init__.py
1
3388
""" The :mod:`sklearn.metrics` module includes score functions, performance metrics and pairwise metrics and distance computations. """ from . import cluster from .classification import accuracy_score from .classification import brier_score_loss from .classification import classification_report from .classification im...
mit
chainer/chainercv
chainercv/visualizations/vis_instance_segmentation.py
2
6121
from __future__ import division import numpy as np from chainercv.utils.mask.mask_to_bbox import mask_to_bbox from chainercv.visualizations.colormap import voc_colormap from chainercv.visualizations import vis_image def vis_instance_segmentation( img, mask, label=None, score=None, label_names=None, ...
mit
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/mpl_toolkits/axisartist/axis_artist.py
18
52709
""" axis_artist.py module provides axis-related artists. They are * axis line * tick lines * tick labels * axis label * grid lines The main artist class is a AxisArtist and a GridlinesCollection. The GridlinesCollection is responsible for drawing grid lines and the AxisArtist is responsible for all other artists...
apache-2.0
robcarver17/pysystemtrade
sysproduction/data/volumes.py
1
3936
import datetime as datetime import pandas as pd from syscore.objects import missing_contract, arg_not_supplied, missing_data from sysdata.arctic.arctic_futures_per_contract_prices import arcticFuturesContractPriceData from sysdata.futures.futures_per_contract_prices import futuresContractPriceData from sysobjects.contr...
gpl-3.0
costypetrisor/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
wedgeCountry/SMP
Test.py
1
2664
from SMP import SMP import sklearn.datasets from sklearn.multiclass import OneVsRestClassifier import numpy as np import pylab as pl from matplotlib.colors import ListedColormap class Classifier_1vsA(): def __init__(self, classifier, max_it = 400, disp=1): self.disp = disp self.classifier = classifier self.cl...
gpl-3.0
ericmjl/bokeh
examples/plotting/file/elements.py
1
1856
import pandas as pd from bokeh.models import ColumnDataSource, LabelSet from bokeh.plotting import figure, output_file, show from bokeh.sampledata.periodic_table import elements elements = elements.copy() elements = elements[elements["atomic number"] <= 82] elements = elements[~pd.isnull(elements["melting point"])] m...
bsd-3-clause
JsNoNo/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
aabadie/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
8
11823
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels \ import RBF, Constan...
bsd-3-clause
PmagPy/PmagPy
programs/dmag_magic.py
1
2595
#!/usr/bin/env python # -*- python-indent-offset: 4; -*- # -*- mode: python-mode; python-indent-offset: 4 -*- import sys import os import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") from pmagpy import ipmag from pmagpy import pmag def main(): """ NAME dmag_magic.py ...
bsd-3-clause
rs2/pandas
pandas/tests/indexes/period/test_partial_slicing.py
2
5323
import numpy as np import pytest from pandas import DataFrame, Series, date_range, period_range import pandas._testing as tm class TestPeriodIndex: def test_pindex_slice_index(self): pi = period_range(start="1/1/10", end="12/31/12", freq="M") s = Series(np.random.rand(len(pi)), index=pi) ...
bsd-3-clause
Winand/pandas
doc/sphinxext/numpydoc/plot_directive.py
89
20530
""" A special directive for generating a matplotlib plot. .. warning:: This is a hacked version of plot_directive.py from Matplotlib. It's very much subject to change! Usage ----- Can be used like this:: .. plot:: examples/example.py .. plot:: import matplotlib.pyplot as plt plt.plot...
bsd-3-clause
brainsqueeze/Image_correction
src/workers/correct.py
1
4955
# __author__ = 'Dave' import cv2 from skimage import io from skimage.transform import probabilistic_hough_line import matplotlib.pyplot as plt import os import warnings import random import numpy as np warnings.filterwarnings('ignore', category=RuntimeWarning) class CorrectImage(object): def __init__(self): ...
mit
googledatalab/pydatalab
tests/stackdriver/commands/monitoring_tests.py
4
4798
# Copyright 2016 Google Inc. 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 applicable law or agreed ...
apache-2.0
treycausey/scikit-learn
sklearn/linear_model/tests/test_ridge.py
1
17457
import numpy as np import scipy.sparse as sp from scipy import linalg from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/examples/skflow/out_of_core_data_classification.py
9
2462
# 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
chrsrds/scikit-learn
examples/plot_anomaly_comparison.py
9
6338
""" ============================================================================ Comparing anomaly detection algorithms for outlier detection on toy datasets ============================================================================ This example shows characteristics of different anomaly detection algorithms on 2D d...
bsd-3-clause
dimitri-justeau/niamoto-core
niamoto/data_marts/dimensions/base_dimension.py
2
12926
# coding: utf-8 import io from datetime import datetime from sqlalchemy.engine.reflection import Inspector from geoalchemy2 import Geography, Geometry import sqlalchemy as sa import pandas as pd from niamoto.db import metadata as meta from niamoto.db.connector import Connector from niamoto.conf import settings from ...
gpl-3.0
aayushidwivedi01/spark-tk
regression-tests/sparktkregtests/testcases/dicom/dicom_export_dcm_test.py
11
4051
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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
gboeing/osmnx
osmnx/osm_xml.py
1
14677
"""Read/write .osm formatted XML files.""" import bz2 import xml.sax from pathlib import Path from xml.etree import ElementTree as etree import networkx as nx import numpy as np import pandas as pd from . import settings from . import utils from . import utils_graph class _OSMContentHandler(xml.sax.handler.Content...
mit
phbradley/tcr-dist
tcrdist/processing.py
1
8021
import pandas as pd import numpy as np from .blast import parse_unpaired_dna_sequence_blastn, get_qualstring from .objects import TCRChain, TCRClone from . import util from .compute_probs import * from .find_clones import findClones __all__ = ['processNT', 'readPairedSequences', 'filterOutRow', ...
mit
francescorandi/optics
Datasets.py
1
8249
# -*- coding: utf-8 -*- """ Dataset class. """ import matplotlib.pyplot as pyplot from numpy import array, loadtxt, savetxt, imag, real, dtype from scipy.constants import physical_constants energyUnits = ('eV', 'cm-1', 'THz') #List of energy units available __wavelength = 'electron volt-inverse meter relationship' _...
gpl-3.0
openfisca/openfisca-tunisia
setup.py
1
1844
#! /usr/bin/env python # -*- coding: utf-8 -*- """Tunisia specific model for OpenFisca -- a versatile microsimulation free software""" from setuptools import setup, find_packages classifiers = """\ Development Status :: 2 - Pre-Alpha License :: OSI Approved :: GNU Affero General Public License v3 Operating System...
agpl-3.0
gheinrich/DIGITS-GAN
digits/extensions/view/imageSegmentation/view.py
1
10053
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import json import os import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import PIL.Image import skfmm import digits from digits.utils import subclass, override from digits.utils.constants ...
bsd-3-clause
chenyyx/scikit-learn-doc-zh
examples/zh/svm/plot_svm_nonlinear.py
62
1119
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learned by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn imp...
gpl-3.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/pylab_examples/annotation_demo2.py
12
6310
from matplotlib.pyplot import figure, show from matplotlib.patches import Ellipse import numpy as np if 1: fig = figure(1,figsize=(8,5)) ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-4,3)) t = np.arange(0.0, 5.0, 0.01) s = np.cos(2*np.pi*t) line, = ax.plot(t, s, lw=3, color='p...
gpl-2.0
mfjb/scikit-learn
sklearn/tests/test_calibration.py
213
12219
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_greater, assert_almost_equal, ...
bsd-3-clause
tayebzaidi/HonorsThesisTZ
ThesisCode/gen_lightcurves/parse_periodic_spaceMod.py
1
7678
import sys import os import json import numpy as np from ANTARES_object import LAobject import scipy.interpolate as scinterp from mpi4py import MPI sys.path.append('../classification/') import bandMap import pickle import glob import pandas as pd def periodicProcessing(): """ This method does the equivalent t...
gpl-3.0
ldirer/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
99
4608
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
arjoly/scikit-learn
sklearn/metrics/tests/test_classification.py
20
50188
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import la...
bsd-3-clause
QuLogic/cartopy
lib/cartopy/io/ogc_clients.py
2
34553
# Copyright Cartopy Contributors # # This file is part of Cartopy and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Implements RasterSource classes which can retrieve imagery from web services such as WMS and WMTS. The matplotlib in...
lgpl-3.0
secimTools/SECIMTools
src/secimtools/anovaModules/changeDFOrder.py
2
1307
import pandas as pd import copy as copy def changeDFOrder(data,combN,factors): """ Since OLS (ANOVA method) takes the first group as base line we need to change the order of the DF to get all the possible contrasts. This function adds a "1_" before the name of the group, that way we can change the or...
mit
sekikn/incubator-airflow
airflow/providers/exasol/hooks/exasol.py
5
7205
# # 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...
apache-2.0
jstoxrocky/statsmodels
statsmodels/tsa/ar_model.py
20
34034
from __future__ import division from statsmodels.compat.python import iteritems, range, string_types, lmap import numpy as np from numpy import dot, identity from numpy.linalg import inv, slogdet from scipy.stats import norm from statsmodels.regression.linear_model import OLS from statsmodels.tsa.tsatools import (lagm...
bsd-3-clause
astocko/statsmodels
statsmodels/sandbox/tsa/examples/ex_mle_arma.py
33
4587
# -*- coding: utf-8 -*- """ TODO: broken because of changes to arguments and import paths fixing this needs a closer look Created on Thu Feb 11 23:41:53 2010 Author: josef-pktd copyright: Simplified BSD see license.txt """ from __future__ import print_function import numpy as np from numpy.testing import assert_almost...
bsd-3-clause
mmottahedi/neuralnilm_prototype
scripts/e390.py
2
6051
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
florian-f/sklearn
sklearn/manifold/tests/test_isomap.py
31
3991
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
kdebrab/pandas
pandas/tests/tslibs/test_parsing.py
3
6380
# -*- coding: utf-8 -*- """ Tests for Timestamp parsing, aimed at pandas/_libs/tslibs/parsing.pyx """ from datetime import datetime import numpy as np import pytest from dateutil.parser import parse import pandas.util._test_decorators as td from pandas import compat from pandas.util import testing as tm from pandas._l...
bsd-3-clause
henridwyer/scikit-learn
sklearn/linear_model/tests/test_sgd.py
129
43401
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
Nathx/think_stats
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
thjashin/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/ops.py
32
46479
# 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
anne-urai/serialDDM
graphicalModels/setup.py
6
1246
#!/usr/bin/env python try: from setuptools import setup, Extension setup, Extension except ImportError: from distutils.core import setup from distutils.extension import Extension setup, Extension import os import re import sys if sys.argv[-1] == "publish": os.system("python setup.py sdist up...
mit
hantek/deeplearn_hsi
hsi_utils.py
1
29258
#!/usr/bin/python # # Copyright (c) 2013-2015, Zhouhan LIN # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
bsd-2-clause
mantidproject/mantid
qt/python/mantidqt/widgets/sliceviewer/test/test_sliceviewer_zoom.py
3
1599
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
keflavich/fil_finder
fil_finder/rollinghough.py
2
5684
# Licensed under an MIT open source license - see LICENSE import numpy as np from scipy.stats import scoreatpercentile import matplotlib.pyplot as p def rht(mask, radius, ntheta=180, background_percentile=25, verbose=False): ''' Parameters ---------- mask : numpy.ndarray Boolean or integ...
mit
timothydmorton/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
rubikloud/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
songtaohe/Map
Parser.py
1
3074
import xml.etree.ElementTree import numpy as np import matplotlib.pyplot as plt import code from MyRTree import RTree roadForMotorDict = {'motorway','trunk','primary','secondary','tertiary','unclassified','residential','service'} roadForMotorBlackList = {'None', 'pedestrian','footway','bridleway','steps','path','side...
mit
trungnt13/scikit-learn
sklearn/linear_model/least_angle.py
42
49357
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
bsd-3-clause
themrmax/scikit-learn
examples/cluster/plot_birch_vs_minibatchkmeans.py
333
3694
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
bsd-3-clause
paulromano/openmc
openmc/data/photon.py
8
44955
from collections import OrderedDict from collections.abc import Mapping, Callable from copy import deepcopy from io import StringIO from math import pi from numbers import Integral, Real import os import h5py import numpy as np import pandas as pd from scipy.interpolate import CubicSpline import openmc.checkvalue as ...
mit
Vutshi/qutip
qutip/gui/about.py
1
14367
# This file is part of QuTiP. # # QuTiP 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. # # QuTiP is distributed in the ...
gpl-3.0
fraricci/pymatgen
pymatgen/analysis/surface_analysis.py
4
82693
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module defines tools to analyze surface and adsorption related quantities as well as related plots. If you use this module, please consider citing the following works:: R. Tran, Z. Xu, B. Radhakri...
mit
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/testing/jpl_units/__init__.py
6
3064
#======================================================================= """ This is a sample set of units for use with testing unit conversion of matplotlib routines. These are used because they use very strict enforcement of unitized data which will test the entire spectrum of how unitized data might be used (it is...
mit
Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam
PyFoam/Basics/RunDatabase.py
1
10646
# ICE Revision: $Id: $ """ Collects data about runs in a small SQLite database """ # don't look at it too closely. It's my first sqlite-code import sqlite3 from os import path import datetime import re import sys from PyFoam.Error import error from .CSVCollection import CSVCollection from PyFoam.ThirdParty.six imp...
gpl-2.0
JensWehner/votca-scripts
xtp/xtp_timecorrelation.py
2
5380
#!/usr/bin/env python import sqlite3 import sys import numpy as np #import scipy.stats as st import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.patches as mpatches import argparse from matplotlib.pyplot import cm import itertools import numpy.ma as ma import os class MyParser(argparse.Argumen...
apache-2.0
ina-foss/ID-Fits
lib/tools.py
1
3158
# ID-Fits # Copyright (c) 2015 Institut National de l'Audiovisuel, INA, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at...
lgpl-3.0
zyndagj/bedgraph-ica
bedgraph-ica.py
1
12302
#!/usr/bin/python from os.path import splitext import numpy as np import sys from sklearn.decomposition import FastICA from sklearn.utils.linear_assignment_ import linear_assignment as hungarian import pywt import argparse myColors = ("#85BEFF", "#986300", "#009863", "#F2EC00", "#F23600", "#C21BFF", "#85FFC7") colorD...
bsd-2-clause