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
takuya1981/sms-tools
lectures/08-Sound-transformations/plots-code/sineModelTimeScale-functions.py
24
2725
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, triang, blackmanharris, resample from scipy.fftpack import fft, ifft, fftshift import sys, os, functools, time, math from scipy.interpolate import interp1d sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__...
agpl-3.0
akaszynski/vtkInterface
pyvista/plotting/colors.py
1
10079
"""Color module supporting plotting module. Used code from matplotlib.colors. Thanks for your work! SUPPORTED COLORS aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkc...
mit
rohanp/scikit-learn
examples/svm/plot_weighted_samples.py
95
1943
""" ===================== SVM: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. The sample weighting rescales the C parameter, which means that the classifier puts more emphasis on getting these points right. The effect might ...
bsd-3-clause
macks22/scikit-learn
sklearn/ensemble/forest.py
176
62555
"""Forest of trees-based ensemble methods Those methods include random forests and extremely randomized trees. The module structure is the following: - The ``BaseForest`` base class implements a common ``fit`` method for all the estimators in the module. The ``fit`` method of the base ``Forest`` class calls the ...
bsd-3-clause
abhitopia/tensorflow
tensorflow/examples/learn/text_classification.py
39
5106
# 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
gmsanchez/mpc_comparison_rpic2017
vdp_comparison_ltv.py
1
8028
# Control of the Van der Pol # oscillator using pure CasADi. import casadi import casadi.tools as ctools import numpy as np import matplotlib.pyplot as plt import time import scipy.linalg # Set to True if you want to create a QP solver (qpOASES) and # to False if you want to use a NLP solver (IPOPT). isQP = True # ...
gpl-3.0
RomainBrault/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
cancan101/tensorflow
tensorflow/examples/learn/boston.py
13
1945
# 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
sameersingh/onebusaway
ml/oba_ml/ridge_paths.py
1
1512
from __future__ import division import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model from common import * def main(): np.set_printoptions(threshold=np.nan) x_train, y_train, = get_data("training.dat") n_alphas = 100 alphas = np.logspace(-5, 5, n_alp...
apache-2.0
mtat76/atm-py
build/lib/atmPy/for_removal/SMPS/SMPS.py
6
2502
# -*- coding: utf-8 -*- """ Created on Fri Jan 23 16:39:10 2015 @author: htelg """ import sys sys.path.append('/Users/htelg/projecte/POPS/prog/') from POPS_lib import sizedistribution import pandas as pd import numpy as np def bincenters2BinStuff(bincenters): if type(bincenters) != np.ndarray: rai...
mit
espenhgn/LFPy
examples/nsg_example/nsg_example.py
1
8889
#!/usr/bin/env python ''' ################################################################################ # # This is an example scripts using LFPy with a passive cell model adapted from # Mainen and Sejnowski, Nature 1996, for the original files, see # http://senselab.med.yale.edu/modeldb/ShowModel.asp?model=2488 # #...
gpl-3.0
akaszynski/vtkInterface
pyvista/plotting/plotting.py
1
148771
"""Pyvista plotting module.""" import collections import logging import os import time import warnings from functools import wraps from threading import Thread import imageio import numpy as np import vtk from vtk.util import numpy_support as VN from vtk.util.numpy_support import numpy_to_vtk, vtk_to_numpy import py...
mit
anparser/anparser
anparser/plugins/other_plugins/yara_parser.py
1
3312
# -*- coding: utf-8 -*- """ anparser - an Open Source Android Artifact Parser Copyright (C) 2015 Preston Miller This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (a...
gpl-3.0
omarocegueda/dipy
dipy/core/optimize.py
12
15237
""" A unified interface for performing and debugging optimization problems. Only L-BFGS-B and Powell is supported in this class for versions of Scipy < 0.12. All optimizers are available for scipy >= 0.12. """ import abc from distutils.version import LooseVersion import numpy as np import scipy import scipy.sparse as ...
bsd-3-clause
breznak/nupic
src/nupic/research/monitor_mixin/plot.py
20
5229
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
memo/tensorflow
tensorflow/examples/learn/iris_with_pipeline.py
62
1824
# 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
anorfleet/turntable
turntable/press.py
3
11422
'''The press module is used to create Record Collections. ''' import shutil import sys import os import pandas as pd import turntable.utils import traceback import turntable class RecordPress(object): '''This class auto-seralizes any attributes assigned to an instance and clears them from memmory when an a...
mit
licco/zipline
tests/test_algorithm.py
1
30499
# # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
liyu1990/sklearn
examples/model_selection/plot_underfitting_overfitting.py
53
2668
""" ============================ Underfitting vs. Overfitting ============================ This example demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions. The plot shows the function that we want to approximate, wh...
bsd-3-clause
JeroenZegers/Nabu-MSSS
nabu/hyperparameteroptimization/estimators.py
1
9692
import warnings import numpy as np import copy from skopt.space import space as skopt_space from skopt.learning import GaussianProcessRegressor from scipy.linalg import cho_solve from sklearn.utils.validation import check_array from utils import check_parameter_count class BoundedGaussianProcessRegressor(GaussianP...
mit
sonnyhu/scikit-learn
examples/plot_multioutput_face_completion.py
330
3019
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
bsd-3-clause
sebalander/sebaPhD
runExperiment/readArduSerial.py
1
1235
# -*- coding: utf-8 -*- """ Created on Mon May 16 19:00:12 2016 reading arduino uno output @author: sebalander """ # %% IMPORTS import serial import numpy as np import matplotlib.pyplot as plt import datetime import time # %% DECLARATIONS ser = serial.Serial('/dev/ttyUSB0', 9600) N = 50 # number of data points to...
bsd-3-clause
jakevdp/scipy
scipy/stats/morestats.py
6
95788
from __future__ import division, print_function, absolute_import import math import warnings from collections import namedtuple import numpy as np from numpy import (isscalar, r_, log, around, unique, asarray, zeros, arange, sort, amin, amax, any, atleast_1d, sqrt, ceil, floor, a...
bsd-3-clause
brentp/crystal
crystal/tests/test_models.py
2
3828
import pandas as pd import numpy as np import crystal np.random.seed(42) covs = pd.DataFrame({'gender': ['F'] * 10 + ['M'] * 10, 'age': np.random.uniform(10, 25, size=20) }) methylation = np.random.normal(-1, 1, size=(5, covs.shape[0])) cluster = [crystal.Feature('chr1', i* 10, m) for i, m in ...
mit
michalkurka/h2o-3
h2o-py/tests/testdir_algos/glm/pyunit_pubdev_8194_ordinal_fail.py
2
1927
from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.glm import H2OGeneralizedLinearEstimator import pandas as pd # test taken from Ben Epstein. Thank you. # PUBDEV-8197: ordinal prediction returns the wrong class even though other classes ...
apache-2.0
imh/gnss-analysis
gnss_analysis/analysis_io.py
1
2804
#!/usr/bin/env python # Copyright (C) 2015 Swift Navigation Inc. # Contact: Bhaskar Mookerji <mookerji@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS...
lgpl-3.0
0asa/scikit-learn
benchmarks/bench_plot_approximate_neighbors.py
85
6377
""" Benchmark for approximate nearest neighbor search using locality sensitive hashing forest. There are two types of benchmarks. First, accuracy of LSHForest queries are measured for various hyper-parameters and index sizes. Second, speed up of LSHForest queries compared to brute force method in exact nearest neigh...
bsd-3-clause
Gillu13/scipy
scipy/stats/kde.py
17
17717
#------------------------------------------------------------------------------- # # Define classes for (uni/multi)-variate kernel density estimation. # # Currently, only Gaussian kernels are implemented. # # Written by: Robert Kern # # Date: 2004-08-09 # # Modified: 2005-02-10 by Robert Kern. # Contr...
bsd-3-clause
phobson/bokeh
examples/charts/file/heatmap.py
2
2091
import pandas as pd from bokeh.charts import HeatMap, bins, output_file, show from bokeh.layouts import column, gridplot from bokeh.palettes import RdYlGn6, RdYlGn9 from bokeh.sampledata.autompg import autompg from bokeh.sampledata.unemployment1948 import data # setup data sources del data['Annual'] data['Year'] = da...
bsd-3-clause
jiaphuan/models
research/autoencoder/VariationalAutoencoderRunner.py
8
1705
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sklearn.preprocessing as prep import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from autoencoder_models.VariationalAutoencoder import VariationalAutoe...
apache-2.0
dimdat/dimdat
raw_data/us_states_and_territories/build.py
1
1313
import json import os import pandas as pd cols = [ 'iso_3166', 'ansi_alphabetic_code', 'ansi_numeric_code', 'usps_code', 'uscg_code', 'gpo_abbrev', 'ap_abbrev', 'capital', 'established_date', 'total_square_miles', 'total_square_kilometers', 'land_square_miles', 'land...
mit
zqhuang/COOP
mapio/pyscripts/plot_real_data_6plots.py
1
4505
#!/usr/bin/env python #!/usr/bin/env python import numpy as np import healpy as hp from newsetup_matplotlib import * from planckcolors import planck_parchment_cmap, planck_grey_cmap,colombi1_cmap from matplotlib import cm from plot import * import idlsave import pyfits as py nside=512 width=18.0 cmap ...
gpl-3.0
chrisburr/scikit-learn
sklearn/preprocessing/tests/test_label.py
156
17626
import numpy as np from scipy.sparse import issparse from scipy.sparse import coo_matrix from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils.multiclass import type_of_target from sklearn.utils.testing impor...
bsd-3-clause
weissercn/learningml
learningml/GoF/optimisation_and_evaluation/automatisation_sin/optimisation_1000/nn/classifier_eval_wrapper.py
1
1572
import os import signal import numpy as np import math import sys sys.path.insert(0,os.environ["learningml"]+"/GoF") import os import classifier_eval from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.svm import SVC from keras.wrappers.scikit_learn im...
mit
Myasuka/scikit-learn
sklearn/tests/test_common.py
127
7665
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
losonczylab/Zaremba_NatNeurosci_2017
scripts/FigS1_performance_by_mouse.py
1
3298
"""Figure S1 - Task performance by mouse""" FIG_FORMAT = 'svg' import matplotlib as mpl if FIG_FORMAT == 'svg': mpl.use('agg') elif FIG_FORMAT == 'pdf': mpl.use('pdf') elif FIG_FORMAT == 'interactive': mpl.use('TkAgg') import matplotlib.pyplot as plt import seaborn.apionly as sns import lab.analysis.rewa...
mit
fraricci/pymatgen
pymatgen/analysis/interface.py
4
46759
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides classes to store, generate, and manipulate material interfaces. """ from pymatgen.core.surface import SlabGenerator from pymatgen import Lattice, Structure from pymatgen.core.surface i...
mit
PrashntS/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
lcdb/lcdblib
lcdblib/parse/picard.py
1
1930
from io import StringIO import pandas as pd def parse_picardCollect_summary(sample, file): """Parser for picard collectRNAMetrics summary. Parameters ---------- sample: str Sample name which will be added as row index. file: str Path to the fastqc zip file. """ with open(f...
mit
wbengine/SPMILM
egs/1-billion/run_trf.py
1
4738
import os import sys import numpy as np import matplotlib.pyplot as plt sys.path.insert(0, os.getcwd() + '/../../tools/') import wb import trf # revise this function to config the dataset used to train different model def data(tskdir): train = tskdir + 'data/train.txt' valid = tskdir + 'data/valid.txt' te...
apache-2.0
mhdella/scikit-learn
benchmarks/bench_plot_omp_lars.py
266
4447
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function import gc import sys from time import time import numpy as np from sklearn.linear_model impo...
bsd-3-clause
osh/gnuradio
gr-filter/examples/fir_filter_fff.py
47
4014
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
rhyolight/nupic.research
projects/neural_correlations/EXP5-Bar/barMovieDemo.py
10
1554
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/tests/indexes/timedeltas/test_timedelta.py
7
22169
import pytest import numpy as np from datetime import timedelta import pandas as pd import pandas.util.testing as tm from pandas import (timedelta_range, date_range, Series, Timedelta, DatetimeIndex, TimedeltaIndex, Index, DataFrame, Int64Index, _np_version_under1p8) from panda...
mit
moutai/scikit-learn
examples/manifold/plot_manifold_sphere.py
16
5103
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
QuantCrimAtLeeds/PredictCode
open_cp/gui/load_network_model.py
1
6359
""" load_network_model ~~~~~~~~~~~~~~~~~~ """ import open_cp.gui.predictors.geo_clip as geo_clip import open_cp.network import enum as enum import logging import open_cp.gui.projectors as projectors try: import geopandas as gpd except: gpd = None _logger = logging.getLogger(__name__) class NetworkModel(): ...
artistic-2.0
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/tests/arrays/test_integer.py
2
25131
import numpy as np import pytest from pandas.core.dtypes.generic import ABCIndexClass import pandas as pd from pandas.api.types import is_float, is_float_dtype, is_integer, is_scalar from pandas.core.arrays import IntegerArray, integer_array from pandas.core.arrays.integer import ( Int8Dtype, Int16Dtype, ...
apache-2.0
Clyde-fare/scikit-learn
examples/model_selection/plot_confusion_matrix.py
244
2496
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
jeremyfix/pylearn2
pylearn2/cross_validation/tests/test_train_cv_extensions.py
49
1681
""" Tests for TrainCV extensions. """ import os import tempfile from pylearn2.config import yaml_parse from pylearn2.testing.skip import skip_if_no_sklearn def test_monitor_based_save_best_cv(): """Test MonitorBasedSaveBestCV.""" handle, filename = tempfile.mkstemp() skip_if_no_sklearn() trainer = ya...
bsd-3-clause
adykstra/mne-python
mne/decoding/tests/test_transformer.py
5
9446
# Author: Mainak Jas <mainak@neuro.hut.fi> # Romain Trachel <trachelr@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np import pytest from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_allclose, assert_equal) from mne impor...
bsd-3-clause
ywcui1990/htmresearch
htmresearch/support/sequence_learning_utils.py
10
4876
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Snazz2001/BDA_py_demos
demos_ch2/demo2_2.py
19
3023
"""Bayesian data analysis, 3rd ed Chapter 2, demo 2 Illustrate the effect of a prior. Comparison of posterior distributions with different parameter values for Beta prior distribution. """ import numpy as np from scipy.stats import beta import matplotlib.pyplot as plt # Edit default plot settings (colours from co...
gpl-3.0
kazemakase/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
ClimbsRocks/scikit-learn
sklearn/mixture/tests/test_gmm.py
4
20668
# These tests are those of the deprecated GMM class import unittest import copy import sys from nose.tools import assert_true import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_raises) from scipy import stats from sklearn import mixture from ...
bsd-3-clause
cloudera/hue
desktop/core/ext-py/openpyxl-2.6.4/openpyxl/compat/numbers.py
2
1879
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl try: # Python 2 long = long except NameError: # Python 3 long = int from decimal import Decimal NUMERIC_TYPES = (int, float, long, Decimal) try: import numpy NUMPY = True except ImportError: NUMPY = False if NUM...
apache-2.0
BorisJeremic/Real-ESSI-Examples
education_examples/_Chapter_Modeling_and_Simulation_Examples_Dynamic_Examples/upU/coupled_contact_upU_Sequential/plot.py
3
3443
########################################################################################################################### # # # Wet Contact Modelling in Real ESSI ...
cc0-1.0
LohithBlaze/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/cogent/draw/distribution_plots.py
1
26035
#!/usr/bin/env python __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2007-2012, The Cogent Project" __credits__ = ["Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.5.3" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" __status__ = "Production" """This module contains functions ...
mit
markneville/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/artist.py
69
33042
from __future__ import division import re, warnings import matplotlib import matplotlib.cbook as cbook from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath from path import Path ## Note, matplotlib artists use the doc strings for set and get # methods to enable the introspection methods of ...
agpl-3.0
tawsifkhan/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
potash/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
WangWenjun559/Weiss
summary/sumy/sklearn/externals/joblib/parallel.py
29
28665
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause import os import sys import gc import warnings from collections import Sized from math import sqrt import functools import time import thread...
apache-2.0
dariomangoni/chrono
src/demos/python/irrlicht/demo_IRR_crank_plot.py
4
5790
#------------------------------------------------------------------------------ # Name: pychrono example # Purpose: # # Author: Alessandro Tasora # # Created: 1/01/2019 # Copyright: (c) ProjectChrono 2019 #------------------------------------------------------------------------------ import pychrono...
bsd-3-clause
Oscarlight/PiNN_Caffe2
transiNXOR_modeling/transixor_predictor.py
1
3492
import sys, os sys.path.append('../') import numpy as np from itertools import product from pinn_api import predict_ids_grads, predict_ids import matplotlib.pyplot as plt import glob ## ------------ Input --------------- VDS = None VTG = 0.1 VBG = 0.1 ## ------------ True data --------------- ids_file = glob.glob(...
mit
B3AU/waveTree
examples/linear_model/plot_lasso_lars.py
8
1059
#!/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
Islast/BrainNetworksInPython
scona/classes.py
1
24678
import numpy as np import networkx as nx import pandas as pd from scona.make_graphs import assign_node_names, \ assign_node_centroids, anatomical_copy, threshold_graph, \ weighted_graph_from_matrix, anatomical_node_attributes, \ anatomical_graph_attributes, get_random_graphs, is_nodal_match, \ is_anatom...
mit
AlessandroCorsi/fibermodes
plots/neff.py
2
1737
from fibermodes import Wavelength, Mode, constants from fibermodes.material import Silica, SiO2GeO2, Fixed from fibermodes.simulator import PSimulator as Simulator import numpy from matplotlib import pyplot wl = numpy.linspace(800e-9, 1800e-9, 200) print(wl[1] - wl[0]) sim = Simulator(delta=1e-4, epsilon=1e-12) sim...
gpl-3.0
wtmmac/airflow
airflow/contrib/plugins/metastore_browser/main.py
42
5126
from datetime import datetime import json from flask import Blueprint, request from flask.ext.admin import BaseView, expose import pandas as pd from airflow.hooks import HiveMetastoreHook, MySqlHook, PrestoHook, HiveCliHook from airflow.plugins_manager import AirflowPlugin from airflow.www import utils as wwwutils M...
apache-2.0
CallaJun/hackprince
indico/matplotlib/fontconfig_pattern.py
11
6601
""" A module for parsing and generating fontconfig patterns. See the `fontconfig pattern specification <http://www.fontconfig.org/fontconfig-user.html>`_ for more information. """ # Author : Michael Droettboom <mdroe@stsci.edu> # License : matplotlib license (PSF compatible) # This class is defined here because it m...
lgpl-3.0
hmendozap/auto-sklearn
autosklearn/evaluation/util.py
1
2220
import os import lockfile import numpy as np from autosklearn.constants import * from autosklearn.metrics import sanitize_array, \ regression_metrics, classification_metrics, create_multiclass_solution __all__ = [ 'calculate_score', 'get_new_run_num' ] def calculate_score(solution, prediction, task_ty...
bsd-3-clause
SmokinCaterpillar/pypet
examples/example_13_post_processing/main.py
2
6575
__author__ = 'robert' import numpy as np import pandas as pd import logging import os # For path names working under Linux and Windows from pypet import Environment, cartesian_product def run_neuron(traj): """Runs a simulation of a model neuron. :param traj: Container with all parameters. :re...
bsd-3-clause
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/pandas/tests/io/parser/usecols.py
11
18059
# -*- coding: utf-8 -*- """ Tests the usecols functionality 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 from pandas._libs.lib import Timestamp from pandas.compat import StringIO class UsecolsT...
mit
chrissly31415/amimanera
competition_scripts/otto.py
1
27139
#!/usr/bin/python # coding: utf-8 """ Otto product classification """ from qsprLib import * import pandas as pd from sklearn import preprocessing from sklearn.lda import LDA from sklearn.qda import QDA from pandas.tools.plotting import scatter_matrix from xgboost_sklearn import * import xgboost as xgb #from OneH...
lgpl-3.0
Jorge-C/bipy
doc/sphinxext/numpydoc/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
mehdidc/scikit-learn
sklearn/covariance/graph_lasso_.py
11
23920
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause
lfairchild/PmagPy
programs/magic_gui.py
1
23955
#!/usr/bin/env pythonw """ doc string """ # pylint: disable=C0103,E402 print('-I- Importing MagIC GUI dependencies') import matplotlib if not matplotlib.get_backend() == 'WXAgg': matplotlib.use('WXAgg') import wx import wx.lib.buttons as buttons import sys import os import pmagpy from pmagpy import data_model3 fro...
bsd-3-clause
MatthieuBizien/scikit-learn
sklearn/cross_decomposition/pls_.py
35
30767
""" The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Author: Edouard Duchesnay <edouard.duchesnay@cea.fr> # License: BSD 3 clause from distutils.version import LooseVersion from sklearn.utils.extmath import svd_flip from ..base import BaseEstimator, RegressorMixin, TransformerMixin from ..u...
bsd-3-clause
vikhyat/dask
dask/bag/tests/test_bag.py
1
21272
# coding=utf-8 from __future__ import absolute_import, division, print_function from sys import getdefaultencoding import pytest from toolz import (merge, join, pipe, filter, identity, merge_with, take, partial, valmap) import math from dask.bag.core import (Bag, lazify, lazify_task, fuse, map, collect, ...
bsd-3-clause
vybstat/scikit-learn
sklearn/neighbors/regression.py
100
11017
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by Arna...
bsd-3-clause
cschlosberg/me-class
methylation_interpolation.py
1
91637
### Custom container Class definitions class Window: def __init__(self,low,high,bins,bp_window_size=None): self.low = low self.high = high self.len = self.high-self.low self.bins = bins # print "Window Bins: ",self.bins self.x = list() self.x_raw_meth = list()...
gpl-3.0
ShashShukla/SIFT
Application/image_transformation/pano.py
1
2277
import cv2 import numpy as np import math #from matplotlib import pyplot as plt img = cv2.imread('cat.jpg',0) def resize(image, width): r = float(width) / image.shape[1] dim = (int(image.shape[0] * r),width) image = cv2.resize(image, dim, interpolation=cv2.INTER_AREA) return image img = resize(img,40...
mit
schreiberx/sweet
benchmarks_sphere/paper_jrn_nla_rexi_linear/sph_rexi_linear_paper_gaussian_ts_comparison_earth_scale_cheyenne_performance/postprocessing_output_h_err_vs_dt.py
1
3189
#! /usr/bin/env python3 import sys import matplotlib.pyplot as plt import re from matplotlib.lines import Line2D # # First, use # ./postprocessing.py > postprocessing_output.txt # to generate the .txt file # fig, ax = plt.subplots(figsize=(10,7)) ax.set_xscale("log", nonposx='clip') ax.set_yscale("log", nonposy=...
mit
bdmckean/MachineLearning
fall_2017/hw3/CNN3.py
1
4904
import argparse import pickle import gzip from collections import Counter, defaultdict import keras from keras.models import Sequential from keras.layers import Conv2D from keras.layers import Dense from keras.layers import MaxPool2D from keras.layers import Dropout from keras.layers import Flatten from keras.layers.c...
mit
paragguruji/fintechontwitter
fintechontwitter/core.py
1
3476
# -*- coding: utf-8 -*- """ Created on Fri Apr 07 04:00:28 2017 @author: Parag """ from collections import Counter from itertools import chain from fintechontwitter.preprocess import load_frame from matplotlib import pyplot import pandas as pd import logging import mpld3 logger = logging.getLogger('fintechontwitter'...
gpl-3.0
luturonunca/LAGOmaps
SitiosAlturas/plotalturas2.py
1
3768
#pylab inline from pandas import read_csv from matplotlib.pyplot import * import sys,os ########################################################################## ignore=[0,0,0] for j in range(0,len(sys.argv)): if sys.argv[j]=='-on': ignore[0]=1 if sys.argv[j]=='-soon': ignore[1]=1 if sys.argv[j]=='-uc'...
cc0-1.0
samuel1208/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
timcera/tsgettoolbox
tsgettoolbox/functions/modis.py
1
30089
# -*- coding: utf-8 -*- import datetime import mando try: from mando.rst_text_formatter import RSTHelpFormatter as HelpFormatter except ImportError: from argparse import RawTextHelpFormatter as HelpFormatter import numpy as np import pandas as pd from requests import Session from tstoolbox import tsutils fro...
bsd-3-clause
btrzecia/AliPhysics
PWGPP/FieldParam/fitsol.py
39
8343
#!/usr/bin/env python debug = True # enable trace def trace(x): global debug if debug: print(x) trace("loading...") from itertools import combinations, combinations_with_replacement from glob import glob from math import * import operator from os.path import basename import matplotlib.pyplot as plt import numpy as...
bsd-3-clause
JamesWo/cs194-16-data_manatees
precision_recall_split.py
2
2630
import matplotlib.pyplot as plt import numpy as np import sklearn from sklearn import svm, datasets from sklearn.metrics import precision_recall_curve from sklearn.metrics import average_precision_score from sklearn.cross_validation import train_test_split from sklearn.preprocessing import label_binarize from sklearn.m...
apache-2.0
icdishb/scikit-learn
sklearn/mixture/gmm.py
9
27514
""" 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
bigaidream-projects/drmad
cpu_ver/hypergrad/omniglot.py
1
7055
import scipy.io import numpy as np import pickle import os import numpy.random as npr from hypergrad.util import dictslice, RandomState NUM_CHARS = 55 NUM_ALPHABETS = 50 NUM_EXAMPLES = 15 CURATED_ALPHABETS = [6, 10, 23, 38, 39, 8, 9, 21, 22, 41] ROTATED_ALPHABETS = [6, 10, 23, 38, 39] FLIPPED_ALPHABETS = [6, 10, 23, 38...
mit
tdhopper/scikit-learn
examples/calibration/plot_calibration_curve.py
225
5903
""" ============================== Probability Calibration curves ============================== When performing classification one often wants to predict not only the class label, but also the associated probability. This probability gives some kind of confidence on the prediction. This example demonstrates how to di...
bsd-3-clause
nhejazi/scikit-learn
examples/cluster/plot_segmentation_toy.py
33
3442
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
bsd-3-clause
allanino/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/artist.py
69
33042
from __future__ import division import re, warnings import matplotlib import matplotlib.cbook as cbook from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath from path import Path ## Note, matplotlib artists use the doc strings for set and get # methods to enable the introspection methods of ...
agpl-3.0
stevenzhang18/Indeed-Flask
lib/pandas/io/ga.py
9
16202
""" 1. Goto https://code.google.com/apis/console 2. Create new project 3. Goto APIs and register for OAuth2.0 for installed applications 4. Download JSON secret file and move into same directory as this file """ from datetime import datetime import re from pandas import compat import numpy as np from pandas import Data...
apache-2.0
simon-pepin/scikit-learn
examples/bicluster/plot_spectral_coclustering.py
276
1736
""" ============================================== A demo of the Spectral Co-Clustering algorithm ============================================== This example demonstrates how to generate a dataset and bicluster it using the the Spectral Co-Clustering algorithm. The dataset is generated using the ``make_biclusters`` f...
bsd-3-clause
zak-k/cartopy
lib/cartopy/io/img_tiles.py
1
16018
# (C) British Crown Copyright 2011 - 2016, Met Office # # This file is part of cartopy. # # cartopy 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 of the License, or # (at your option)...
lgpl-3.0
abhishekgahlot/scikit-learn
sklearn/linear_model/ransac.py
16
13870
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from .base import ...
bsd-3-clause
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/interpolate/_fitpack_impl.py
1
46657
#!/usr/bin/env python """ fitpack (dierckx in netlib) --- A Python-C wrapper to FITPACK (by P. Dierckx). FITPACK is a collection of FORTRAN programs for curve and surface fitting with splines and tensor product splines. See http://www.cs.kuleuven.ac.be/cwis/research/nalag/research/topics/fitpack.html ...
mit
theoryno3/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
14
8137
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import (assert_array_almost_equal, assert_less, assert_equal, assert_not_equal, assert_raises) from sklearn.decomposition import PCA, KernelPCA from sklearn.datasets import mak...
bsd-3-clause