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
weidel-p/nest-simulator
pynest/examples/sinusoidal_gamma_generator.py
5
12680
# -*- coding: utf-8 -*- # # sinusoidal_gamma_generator.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 ...
gpl-2.0
elkingtonmcb/h2o-2
py/testdir_single_jvm/test_summary2_unifiles.py
9
10223
import unittest, time, sys, random, math, getpass sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i, h2o_util, h2o_browse as h2b, h2o_print as h2p import h2o_summ DO_TRY_SCIPY = False if getpass.getuser()=='kevin' or getpass.getuser()=='jenkins': DO_TRY_SCIPY = True DO_MEDIAN = True ...
apache-2.0
pli1988/portfolioFactory
portfolioFactory/utils/utils.py
1
3534
# -*- coding: utf-8 -*- """ Created on Mon Dec 8 22:09:49 2014 Author: Peter Li and Israel """ import numpy as np from . import customExceptions from .customExceptions import * import pandas as pd def processData(data): """ Function to process timeseries data processData performs 2 steps: - che...
mit
jjhelmus/wradlib
examples/histo_cut_example.py
1
2258
# -*- coding: iso-8859-1 -*- # ------------------------------------------------------------------------------- # Name: module1 # Purpose: # Author: jacobi # Created: 05.04.2011 # ------------------------------------------------------------------------------- #!/usr/bin/env python import wradli...
mit
grlee77/scipy
scipy/optimize/minpack.py
2
34805
import warnings from . import _minpack import numpy as np from numpy import (atleast_1d, dot, take, triu, shape, eye, transpose, zeros, prod, greater, asarray, inf, finfo, inexact, issubdtype, dtype) from scipy.linalg import svd, cholesky, solve_triangular, LinA...
bsd-3-clause
boada/ICD
sandbox/plot_snippets/heatmap_ex.py
1
1211
#!/usr/bin/env python # File: heatmap_ex.py # Created on: Tue 07 Aug 2012 01:48:35 PM CDT # Last Change: Tue 07 Aug 2012 02:06:20 PM CDT # Purpose of script: <+INSERT+> # Author: Steven Boada from matplotlib import pyplot as PLT from matplotlib import cm as CM from matplotlib import mlab as ML import numpy as NP impor...
mit
shangwuhencc/scikit-learn
examples/mixture/plot_gmm_selection.py
248
3223
""" ================================= Gaussian Mixture Model Selection ================================= This example shows that model selection can be performed with Gaussian Mixture Models using information-theoretic criteria (BIC). Model selection concerns both the covariance type and the number of components in th...
bsd-3-clause
dsquareindia/scikit-learn
sklearn/linear_model/least_angle.py
15
57631
""" 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
wlamond/scikit-learn
examples/cluster/plot_cluster_iris.py
350
2593
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initializa...
bsd-3-clause
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/numpy/lib/recfunctions.py
148
35012
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ from __future__ import division, absolute_import, print_function import sys import itertools import numpy as np im...
gpl-3.0
iismd17/scikit-learn
sklearn/linear_model/passive_aggressive.py
97
10879
# Authors: Rob Zinkov, Mathieu Blondel # License: BSD 3 clause from .stochastic_gradient import BaseSGDClassifier from .stochastic_gradient import BaseSGDRegressor from .stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDClassifier): """Passive Aggressive Classifier Read mor...
bsd-3-clause
Vimos/scikit-learn
sklearn/datasets/base.py
4
28293
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import sys import shutil from os import environ...
bsd-3-clause
madjelan/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
272
5245
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
bsd-3-clause
GrimDerp/numpy
numpy/linalg/linalg.py
31
75612
"""Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr...
bsd-3-clause
ryfeus/lambda-packs
pytorch/source/numpy/core/function_base.py
3
16336
from __future__ import division, absolute_import, print_function import functools import warnings import operator from . import numeric as _nx from .numeric import (result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError, asanyarray) from numpy.core.multiarray import add_docstring from n...
mit
tornadomeet/mxnet
example/deep-embedded-clustering/data.py
16
1384
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
lbishal/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
28
11870
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Licence: 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
eredmiles/Fraud-Corruption-Detection-Data-Science-Pipeline-DSSG2015
WorldBank2015/Code/data_pipeline_src/contracts_feature_gen.py
2
7030
#feature generation script for contracts #Emily Grace and Elissa Redmiles import pandas as pd import argparse import datetime as dt import numpy as np from matplotlib import pyplot as plt import currency #arguments section # inputs are: # -f name of file to clean # -p name of the column containing "procurement method...
mit
ericxk/MachineLearningExercise
ML_in_action/chapter7/adaboost.py
1
6050
from numpy import * def loadSimpData(): datMat = matrix([[ 1. , 2.1], [ 2. , 1.1], [ 1.3, 1. ], [ 1. , 1. ], [ 2. , 1. ]]) classLabels = [1.0, 1.0, -1.0, -1.0, 1.0] return datMat,classLabels ##通过阈值比较对数据进行分类,在阈值一边的数据会分到类别-1,其中lt是小于等于 def stumpClassify(dataM...
mit
sergiy-evision/math-algorithms
sf-crime/main.py
1
3238
from __future__ import division from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import KFold from sklearn.cross_validation import cross_val_score from sklearn.neighbors import KNeighborsClassifier from sklearn.ens...
mit
meduz/scikit-learn
sklearn/linear_model/coordinate_descent.py
4
81531
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
PKU-ComNet/school-fiesta
schools/test_main_page_externals.py
1
1835
#!/usr/bin/env python """ Find all external links in the main page with 3 layers or above Also draw a network diagram """ import util import networkx as nx # draw diagram import matplotlib.pyplot as plt from Queue import Queue if __name__ == '__main__': cs_depart_urls = [ 'http://www.cs.ucla.edu/graduat...
apache-2.0
mmottahedi/neuralnilm_prototype
scripts/e321.py
2
6279
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
judithfan/pix2svg
generative/tests/compare_test/sketch_unroll/rdm_sketch.py
1
3736
from __future__ import division from __future__ import print_function from __future__ import absolute_import import os import sys import json import numpy as np from tqdm import tqdm from collections import defaultdict import torch import torch.nn.functional as F from torch.autograd import Variable from dataset_sket...
mit
mxjl620/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
HeraclesHX/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
Ziqi-Li/bknqgis
pandas/pandas/tests/io/parser/header.py
4
9794
# -*- coding: utf-8 -*- """ Tests that the file header is properly handled or inferred during parsing for all of the parsers defined in parsers.py """ import pytest import numpy as np import pandas.util.testing as tm from pandas import DataFrame, Index, MultiIndex from pandas.compat import StringIO, lrange, u cla...
gpl-2.0
TinghuiWang/ActivityLearning
examples/mnist_sda/mnist_sda_sgd.py
1
4377
from actlearn.data.mnist import * from actlearn.models.StackedDenoisingAutoencoder import StackedDenoisingAutoencoder from actlearn.utils.tile_image import tile_image from actlearn.utils.confusion_matrix import get_confusion_matrix from actlearn.utils.classifier_performance import get_performance_array, performance_ind...
bsd-3-clause
davidgbe/scikit-learn
sklearn/metrics/regression.py
175
16953
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
selective-inference/selective-inference
doc/learning_examples/standalone/cleaner_basic_example.py
3
2625
import numpy as np from selection.learning.core import (infer_general_target, normal_sampler, logit_fit, probit_fit) def simulate(n=100): # description of statistical problem truth = np.array([2. , -2.]) / ...
bsd-3-clause
zhoulingjun/zipline
tests/modelling/test_modelling_algo.py
9
7105
""" Tests for Algorithms running the full FFC stack. """ from unittest import TestCase from os.path import ( dirname, join, realpath, ) from numpy import ( array, full_like, nan, ) from numpy.testing import assert_almost_equal from pandas import ( concat, DataFrame, DatetimeIndex, ...
apache-2.0
yandexdataschool/Practical_RL
week04_[recap]_deep_learning/notmnist.py
1
1778
import os from glob import glob import numpy as np from imageio import imread from skimage.transform import resize from sklearn.model_selection import train_test_split def load_notmnist(path='./notMNIST_small', letters='ABCDEFGHIJ', img_shape=(28, 28), test_size=0.25, one_hot=False): # download...
unlicense
wathen/PhD
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/GeneralisedEigen/NoBC/MHDfluid.py
1
12468
import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc Print = PETSc.Sys.Print from dolfin import * # from MatrixOperations import * import numpy as np #import matplotlib.pylab as plt import PETScIO as IO import common import scipy import scipy.io import time import BiLinear as forms import...
mit
zhenv5/scikit-learn
sklearn/feature_extraction/hashing.py
183
6155
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
zuku1985/scikit-learn
examples/manifold/plot_lle_digits.py
138
8594
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
bsd-3-clause
petrosgk/Kaggle-Carvana-Image-Masking-Challenge
test_submit.py
1
1793
import cv2 import numpy as np import pandas as pd from tqdm import tqdm import params input_size = params.input_size batch_size = params.batch_size orig_width = params.orig_width orig_height = params.orig_height threshold = params.threshold model = params.model_factory() df_test = pd.read_csv('input/sample_submissio...
mit
wesleyegberto/courses-projects
ia/machine-learning-sklearn-classificacao/1_classificacao_animais.py
1
1069
# -*- coding: utf-8 -*- """ Introdução a Machine Learning e Classificação - 1 """ # features (1 sim, 0 não) # pelo longo? # perna curta? # faz auau? porco1 = [0, 1, 0] porco2 = [0, 1, 1] porco3 = [1, 1, 0] cachorro1 = [0, 1, 1] cachorro2 = [1, 0, 1] cachorro3 = [1, 1, 1] # 1 => porco, 0 => cachorro treino_x = [porco1...
apache-2.0
TomAugspurger/pandas
pandas/core/arrays/sparse/scipy_sparse.py
1
5381
""" Interaction with scipy.sparse matrices. Currently only includes to_coo helpers. """ from pandas.core.indexes.api import Index, MultiIndex from pandas.core.series import Series def _check_is_partition(parts, whole): whole = set(whole) parts = [set(x) for x in parts] if set.intersection(*parts) != set(...
bsd-3-clause
mjudsp/Tsallis
examples/applications/plot_out_of_core_classification.py
32
13829
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
bsd-3-clause
rahuldhote/scikit-learn
sklearn/semi_supervised/label_propagation.py
128
15312
# coding=utf8 """ Label propagation in the context of this module refers to a set of semisupervised classification algorithms. In the high level, these algorithms work by forming a fully-connected graph between all points given and solving for the steady-state distribution of labels at each point. These algorithms per...
bsd-3-clause
anirudhjayaraman/scikit-learn
examples/ensemble/plot_partial_dependence.py
249
4456
""" ======================== Partial Dependence Plots ======================== Partial dependence plots show the dependence between the target function [1]_ and a set of 'target' features, marginalizing over the values of all other features (the complement features). Due to the limits of human perception the size of t...
bsd-3-clause
woodem/woo
examples/old/concrete/uniax.py
1
8050
#!/usr/bin/python # -*- coding: utf-8 -*- from woo import utils,plot,pack,timing,eudoxos import time, sys, os, copy #import matplotlib #matplotlib.rc('text',usetex=True) #matplotlib.rc('text.latex',preamble=r'\usepackage{concrete}\usepackage{euler}') """ A fairly complex script performing uniaxial tension-compress...
gpl-2.0
h2educ/scikit-learn
sklearn/metrics/scorer.py
211
13141
""" The :mod:`sklearn.metrics.scorer` submodule implements a flexible interface for model selection and evaluation using arbitrary score functions. A scorer object is a callable that can be passed to :class:`sklearn.grid_search.GridSearchCV` or :func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame...
bsd-3-clause
datapythonista/pandas
pandas/io/formats/csvs.py
2
10077
""" Module for formatting output data into CSV files. """ from __future__ import annotations import csv as csvlib import os from typing import ( TYPE_CHECKING, Any, Hashable, Iterator, Sequence, cast, ) import numpy as np from pandas._libs import writers as libwriters from pandas._typing imp...
bsd-3-clause
techmuch/jupyter-handsontables
handsontablesjs/__init__.py
2
6095
import json import numpy as np import pandas as pd try: # prefer Jupyter (i.e. IPyhton 4.x) from traitlets import ( Instance, Unicode, ) from ipywidgets import widgets except ImportError: from IPython.utils.traitlets import ( Instance, Unicode, ) from IP...
mit
ky822/scikit-learn
sklearn/covariance/tests/test_covariance.py
69
11116
# 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
luo66/scikit-learn
sklearn/tests/test_naive_bayes.py
70
17509
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.cross_validation import cross_val_score, train_test_split from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_almost_equal from sklearn.utils.te...
bsd-3-clause
lenovor/scikit-learn
sklearn/utils/multiclass.py
92
13986
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi # # License: BSD 3 clause """ Multi-class / multi-label utility function ========================================== """ from __future__ import division from collections import Sequence from itertools import chain import warnings from scipy.sparse import issparse fro...
bsd-3-clause
lukaspetr/FEniCSopt
supg_anisotrop.py
1
1713
from dolfin import * from scipy.optimize import minimize import numpy as np import time as pyt import pprint import matplotlib.pyplot as plt coth = lambda x: 1./np.tanh(x) from fenicsopt.core.convdif import * from fenicsopt.examples.sc_examples import sc_setup import fenicsopt.exports.results as rs ##################...
mit
rs2/pandas
pandas/tests/util/test_hashing.py
2
10860
import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series import pandas._testing as tm from pandas.core.util.hashing import hash_tuples from pandas.util import hash_array, hash_pandas_object @pytest.fixture( params=[ Series([1, 2, 3] * 3, dtype="int32"),...
bsd-3-clause
xiaoxiamii/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
belltailjp/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ 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
ilo10/scikit-learn
examples/neighbors/plot_species_kde.py
282
4059
""" ================================================ Kernel Density Estimate of Species Distributions ================================================ This shows an example of a neighbors-based query (in particular a kernel density estimate) on geospatial data, using a Ball Tree built upon the Haversine distance metric...
bsd-3-clause
ntim/g4sipm
sample/plots/luigi/dynamic_range_compare.py
1
5235
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os, sys, glob import numpy as np import sqlite3 import matplotlib.pyplot as plt import pickle from contrib import histogram parser = argparse.ArgumentParser() parser.add_argument("path", help="the path to the luigi simulation results directory conta...
gpl-3.0
mne-tools/mne-tools.github.io
0.16/_downloads/plot_mne_inverse_connectivity_spectrum.py
8
3468
""" ============================================================== Compute full spectrum source space connectivity between labels ============================================================== The connectivity is computed between 4 labels across the spectrum between 7.5 and 40 Hz. """ # Authors: Alexandre Gramfort <al...
bsd-3-clause
xavierwu/scikit-learn
sklearn/tree/tests/test_tree.py
11
48140
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
bsd-3-clause
zedyang/oaForex
oanda.py
2
6345
import requests import pandas as pd from utils import update_datetime from statics import API_NAME_OANDA_PRACTICE from statics import PARAMS_NAME_OANDA_ACC, PARAMS_NAME_OANDA_COUNT, \ PARAMS_NAME_OANDA_END, PARAMS_NAME_OANDA_START, PARAMS_NAME_OANDA_D_ALIGN, \ PARAMS_NAME_OANDA_W_ALIGN, PARAMS_NAME_OANDA_INSTRU...
mit
h2oai/h2o-3
h2o-py/h2o/estimators/estimator_base.py
2
27083
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details) # from __future__ import absolute_import, division, print_function, unicode_literals from h2o.utils.compatibility import * # NOQA from datetime import datetime import inspect import warning...
apache-2.0
joelvbernier/hexrd-sandbox
multipanel_ff/dexela_scripts/findorientations.py
1
10116
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Mar 22 19:04:10 2017 @author: bernier2 """ from __future__ import print_function import os import glob import multiprocessing import numpy as np from scipy import ndimage import timeit try: import dill as cpl except(ImportError): import c...
gpl-3.0
CKehl/pylearn2
pylearn2/expr/tests/test_probabilistic_max_pooling.py
44
24662
from __future__ import print_function import numpy as np import warnings from theano.compat.six.moves import xrange from theano import config from theano import function import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams from pylearn2.expr.probabilistic_max_pooling import max_pool_python ...
bsd-3-clause
doyubkim/fluid-engine-dev
src/examples/python_examples/apic_example01.py
1
1798
#!/usr/bin/env python """ Copyright (c) 2018 Doyub Kim I am making my contributions/submissions to this project solely in my personal capacity and am not conveying any rights to any intellectual property of any third parties. """ from pyjet import * import numpy as np import matplotlib.pyplot as plt import matplotli...
mit
nolanliou/tensorflow
tensorflow/contrib/timeseries/examples/known_anomaly.py
53
6786
# Copyright 2017 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
FluidityProject/fluidity
examples/restratification_after_oodc/plot_mixing_stats.py
6
2455
import fluidity_tools import pylab from matplotlib.pyplot import * subplot(121) labels=['0<= T <0.1', '0.1<= T <0.2', '0.2<= T <0.3', '0.3<= T <0.4', '0.4<= T <0.5', '0.5<= T <0.6', '0.6<= T <0.7', '0.7<= T <0.8', '0.8<= T <0.9', '0.9<= T < 1.0', '1.0<= T < 1.1', '1.1<= T <1.2', '1.2<= T <1.3', '1.3<= T <1.4', '1.4<=...
lgpl-2.1
michaelaye/pyciss
pyciss/meta.py
1
2895
"""This module deals with the metadata I have received from collaborators. It defines the location of ring resonances for the RingCube plotting. """ import pandas as pd import pkg_resources as pr def get_order(name): ratio = name.split()[1] a, b = ratio.split(":") return int(a) - int(b) def get_resonan...
isc
xiaoxiamii/scikit-learn
sklearn/utils/graph.py
289
6239
""" Graph utilities and algorithms Graphs are represented with their adjacency matrices, preferably using sparse matrices. """ # Authors: Aric Hagberg <hagberg@lanl.gov> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Jake Vanderplas <vanderplas@astro.washington.edu> # License: BSD 3 clause impo...
bsd-3-clause
anilmuthineni/tensorflow
tensorflow/tools/dist_test/python/census_widendeep.py
54
11900
# 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
gviejo/ThalamusPhysio
python/main_test_mutual_information.py
1
13015
import ternary import numpy as np import pandas as pd from functions import * import sys from functools import reduce from sklearn.manifold import * from sklearn.cluster import * from pylab import * import _pickle as cPickle from skimage.filters import gaussian #########################################################...
gpl-3.0
demianw/dipy
dipy/viz/tests/test_fvtk.py
8
2879
""" Testing vizualization with fvtk """ import numpy as np from dipy.viz import fvtk from dipy import data import numpy.testing as npt @npt.dec.skipif(not fvtk.have_vtk) @npt.dec.skipif(not fvtk.have_vtk_colors) def test_fvtk_functions(): # Create a renderer r = fvtk.ren() # Create 2 lines with 2 diff...
bsd-3-clause
vital-ai/beaker-notebook
plugin/ipythonPlugins/src/dist/python3/beaker_runtime3.py
1
19742
# Copyright 2014 TWO SIGMA OPEN SOURCE, LLC # # 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 agre...
apache-2.0
xavierwu/scikit-learn
sklearn/feature_extraction/dict_vectorizer.py
234
12267
# Authors: Lars Buitinck # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from array import array from collections import Mapping from operator import itemgetter import numpy as np import scipy.sparse as sp from ..base import BaseEstimator, TransformerMixin from ..externals import six from ..ext...
bsd-3-clause
tdhoang0412/python-class
Monday_2017-04-24/code/bessel_recursion.py
1
1278
# Verification of scipys Bessel function implementation # - recursion relation import scipy.special as ss import numpy as np import matplotlib.pyplot as plt import matplotlib # for nicer plots, make fonts larger and lines thicker matplotlib.rcParams['font.size'] = 12 matplotlib.rcParams['axes.linewidth'] = 2.0 # No...
gpl-3.0
patverga/torch-relation-extraction
bin/analysis/plot-sent-len-bar.py
1
1198
import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.colors import sys matplotlib.rc('text', usetex=True) fontsize = 22 font = {'family' : 'serif', 'serif' : 'Times Roman', 'size' : fontsize} matplotlib.rc('font', **font) output_dir = "doc/naacl201...
mit
hrjn/scikit-learn
sklearn/decomposition/tests/test_pca.py
12
21107
import numpy as np import scipy as sp from itertools import product 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_gre...
bsd-3-clause
adammenges/statsmodels
statsmodels/tsa/statespace/tools.py
19
12762
""" Statespace Tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np from statsmodels.tools.data import _is_using_pandas from . import _statespace try: from scipy.linalg.blas import find_best_blas_type except ImportError: # prag...
bsd-3-clause
xubenben/scikit-learn
sklearn/tests/test_metaestimators.py
226
4954
"""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
Yllescas/OCR
OCR.py
1
43143
# -*- coding: utf-8 -*- """ Created on Tue Mar 8 14:47:42 2016 @author: MAQUINA-03 """ import os #Aquí se importa el objeto para recorrer las carpetas import matplotlib.image as mpimg #Este objeto se importa para recorrer los archivos import csv #Esté es e...
gpl-3.0
bthirion/scikit-learn
examples/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...
bsd-3-clause
mattilyra/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
127
1270
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import matplotlib.pyplot as plt from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_rand...
bsd-3-clause
platinhom/ManualHom
Coding/Python/scipy-html-0.16.1/generated/scipy-signal-filtfilt-1.py
1
2375
# The examples will use several functions from `scipy.signal`. from scipy import signal import matplotlib.pyplot as plt # First we create a one second signal that is the sum of two pure sine # waves, with frequencies 5 Hz and 250 Hz, sampled at 2000 Hz. t = np.linspace(0, 1.0, 2001) xlow = np.sin(2 * np.pi * 5 * t) ...
gpl-2.0
karstenw/nodebox-pyobjc
examples/Extended Application/sklearn/examples/model_selection/plot_randomized_search.py
47
3287
""" ========================================================================= Comparing randomized search and grid search for hyperparameter estimation ========================================================================= Compare randomized search and grid search for optimizing hyperparameters of a random forest. ...
mit
cbmoore/statsmodels
statsmodels/examples/ex_pandas.py
29
4021
# -*- coding: utf-8 -*- """Examples using Pandas """ from __future__ import print_function from statsmodels.compat.python import zip from datetime import datetime import numpy as np from pandas import DataFrame, Series, datetools import statsmodels.api as sm import statsmodels.tsa.api as tsa data = sm.datasets....
bsd-3-clause
procoder317/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
83
17276
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true from sklearn.utils.testing import assert_raises...
bsd-3-clause
Midafi/scikit-image
doc/examples/plot_shapes.py
22
1913
""" ====== Shapes ====== This example shows how to draw several different shapes: - line - Bezier curve - polygon - circle - ellipse Anti-aliased drawing for: - line - circle """ import math import numpy as np import matplotlib.pyplot as plt from skimage.draw import (line, polygon, circle, ...
bsd-3-clause
Hiyorimi/scikit-image
doc/examples/features_detection/plot_orb.py
33
1807
""" ========================================== ORB feature detector and binary descriptor ========================================== This example demonstrates the ORB feature detection and binary description algorithm. It uses an oriented FAST detection method and the rotated BRIEF descriptors. Unlike BRIEF, ORB is c...
bsd-3-clause
ethertricity/bluesky
check.py
1
4049
#!/usr/bin/python from __future__ import print_function import traceback print("This script checks the availability of the libraries required by BlueSky, and the capabilities of your system.") print() np = sp = mpl = qt = gl = glhw = pg = False # Basic libraries print("Checking for numpy ", end=' ') try: ...
gpl-3.0
longyangking/ML
tensorflow/pde.py
1
1666
import tensorflow as tf import numpy as np #import PIL.Image #from io import StringIO #from IPython.display import clear_output, Image, display import matplotlib.pyplot as plt #def DisplayArray(a,fmt='jpeg',rng=[0,1]): # a = (a - rng[0])/float(rng[1] - rng[0])*255 # a = np.uint8(np.clip(a,0,255)) # f = St...
lgpl-3.0
Widukind/dlstats
dlstats/fetchers/esri.py
1
26324
# -*- coding: utf-8 -*- """ Created on Fri Oct 16 10:59:20 2015 @author: salimeh """ import time from datetime import datetime from urllib.parse import urljoin import logging import re import pandas from lxml import etree import requests from dlstats.utils import Downloader, get_ordinal_from_period, make_store_path...
agpl-3.0
aabadie/scikit-learn
examples/feature_selection/plot_permutation_test_for_classification.py
94
2264
""" ================================================================= 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
tsilifis/chaos_basispy
demos/demos_quad/poly_quad_CC.py
1
1248
import numpy as np import scipy.stats as st import matplotlib.pyplot as plt import chaos_basispy as cb def f(xi, a, b, c, W): assert xi.shape[0] == 10 assert W.shape[0] == 10 return a + b * np.dot(W.T, xi) + c * np.dot(xi.reshape(1,xi.shape[0]), np.dot(np.dot(W, W.T) , xi)) dim = 10 np.random.seed(1234...
gpl-3.0
tapomayukh/projects_in_python
sandbox_tapo/src/skin_related/BMED_8813_HAP/Features/single_feature/best_kNN_PC/cross_validate_categories_kNN_PC_BMED_8813_HAP_scaled_method_II_shape.py
1
4446
# Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import ro...
mit
gpetretto/pymatgen
pymatgen/apps/battery/plotter.py
9
3443
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ This module provides plotting capabilities for battery related applications. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Mater...
mit
runt18/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/projections/polar.py
1
21012
import math import numpy as npy import matplotlib rcParams = matplotlib.rcParams from matplotlib.artist import kwdocd from matplotlib.axes import Axes from matplotlib import cbook from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker import Formatter, Locator from matplotlib.tr...
agpl-3.0
trankmichael/scikit-learn
examples/linear_model/plot_ols.py
220
1940
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
Cophy08/rodeo
rodeo/kernel.py
8
7985
# start compatibility with IPython Jupyter 4.0+ try: from jupyter_client import BlockingKernelClient except ImportError: from IPython.kernel import BlockingKernelClient # python3/python2 nonsense try: from Queue import Empty except: from queue import Empty import atexit import subprocess import uuid i...
bsd-2-clause
davidwhogg/HoneyComb
exptime/code/exptime.py
1
12174
""" This file is part of the HoneyComb project. Copyright 2015 David W. Hogg (NYU). """ import os import numpy as np import cPickle as pickle import matplotlib.pyplot as pl import matplotlib.transforms as transforms pl.rc("text", usetex=True) pl.rc("font", family="serif") # multiprocessing trix DON'T WORK from multipr...
mit
pedrofeijao/RINGO
src/ringo/plot_ml_estimate.py
1
1794
#!/usr/bin/env python2 import argparse import pandas as pd import matplotlib matplotlib.use('Agg') # Force matplotlib to not use any Xwindows backend. import matplotlib.pyplot as plt matplotlib.style.use('ggplot') if __name__ == '__main__': parser = argparse.ArgumentParser( description="Plots a boxplot ...
mit
arabenjamin/pybrain
examples/rl/environments/linear_fa/bicycle.py
26
14462
from __future__ import print_function """An attempt to implement Randlov and Alstrom (1998). They successfully use reinforcement learning to balance a bicycle, and to control it to drive to a specified goal location. Their work has been used since then by a few researchers as a benchmark problem. We only implement th...
bsd-3-clause
JPFrancoia/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
50
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
salomanders/NbodyPythonTools
nbdpt/cosmography.py
1
6058
import scipy as sp #from scipy import trapz import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pylab as pl from pylab import * import sys #ApJ Komatsu et al. 2009 omega_M=.274 omega_L=.726 omega_K=1.-omega_M-omega_L omega_K=0 h=.705 age=13.72 """ print ' *** *** *** *** *** *** *** ***...
mit
LUTAN/tensorflow
tensorflow/examples/learn/iris_custom_model.py
50
2613
# 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