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
hdmetor/scikit-learn
sklearn/metrics/metrics.py
233
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
iled/gsimcli
GSIMCLI/parsers/spreadsheet.py
1
8776
# -*- coding: utf-8 -*- """ This module handles different spreadsheet-like files (e.g., CSV, TSV, XLS) and parses them into other needed formats (e.g., GSLIB, COST-HOME). Created on 5 de Nov de 2013 @author: julio """ import os import numpy as np import pandas as pd import tools.grid as grd import tools.utils as ut...
gpl-3.0
jiangdaniel/sentence-autocomp
scikit/test.py
1
1976
from sklearn.feature_extraction.text import CountVectorizer from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn.preprocessing import StandardScaler import numpy as np import re # min_df sets the number of times a ngram must repeat to be inclduded in info vector # With 1, all ngrams are included...
mit
ywang007/odo
odo/backends/sql.py
1
22308
from __future__ import absolute_import, division, print_function from operator import attrgetter import os import re import subprocess from itertools import chain from collections import Iterator from datetime import datetime, date from distutils.spawn import find_executable import pandas as pd import sqlalchemy as ...
bsd-3-clause
jiajunshen/partsNet
scripts/visualizeWheretoCodeParts.py
1
7169
from __future__ import division, print_function,absolute_import import pylab as plt import amitgroup.plot as gr import numpy as np import amitgroup as ag import os import pnet import matplotlib.pylab as plot from pnet.cyfuncs import index_map_pooling from queue import Queue def extract(ims,allLayers): #print(allLay...
bsd-3-clause
thePetrMarek/SequenceOfDigitsRecognition
prepare_svhn_dataset.py
1
4327
import h5py import scipy.misc import tqdm import json import os from PIL import Image import matplotlib.pyplot as plt from matplotlib import patches def get_box_data(index, hdf5_data): """ get `left, top, width, height` of each picture :param index: :param hdf5_data: :return: """ meta_data...
mit
lukauskas/dgw
dgw/dtw/visualisation.py
2
7161
from matplotlib.patches import ConnectionPatch from dgw.util.plotting import pyplot as plt import matplotlib.cm as cm from matplotlib.ticker import NullFormatter import numpy as np from dgw.dtw import reverse_sequence from distance import dtw_std, dtw_path_is_reversed def plot_dtw_cost_and_path(cost_matrix, path, ax...
gpl-3.0
jwiggins/scikit-image
skimage/util/colormap.py
25
12423
from matplotlib.colors import LinearSegmentedColormap viridis_data = [[ 0.26700401, 0.00487433, 0.32941519], [ 0.26851048, 0.00960483, 0.33542652], [ 0.26994384, 0.01462494, 0.34137895], [ 0.27130489, 0.01994186, 0.34726862], [ 0.27259384, 0.02556309, 0.35309303], [ 0.27380...
bsd-3-clause
vighneshbirodkar/scikit-image
skimage/viewer/plugins/overlayplugin.py
40
3615
from warnings import warn from ...util.dtype import dtype_range from .base import Plugin from ..utils import ClearColormap, update_axes_image import six from ..._shared.version_requirements import is_installed __all__ = ['OverlayPlugin'] class OverlayPlugin(Plugin): """Plugin for ImageViewer that displays an ...
bsd-3-clause
IssamLaradji/scikit-learn
examples/linear_model/plot_sgd_comparison.py
167
1659
""" ================================== Comparing various online solvers ================================== An example showing how different online solvers perform on the hand-written digits dataset. """ # Author: Rob Zinkov <rob at zinkov dot com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot a...
bsd-3-clause
maxlikely/scikit-learn
examples/manifold/plot_swissroll.py
4
1416
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD, (C) INRIA 2011 print(__doc__) import pylab as pl # This impor...
bsd-3-clause
mne-tools/mne-tools.github.io
0.21/_downloads/0a4e2c3b03ded4058c947e4638e591aa/plot_70_fnirs_processing.py
2
14122
""" .. _tut-fnirs-processing: Preprocessing functional near-infrared spectroscopy (fNIRS) data ================================================================ This tutorial covers how to convert functional near-infrared spectroscopy (fNIRS) data from raw measurements to relative oxyhaemoglobin (HbO) and deoxyhaemogl...
bsd-3-clause
kastnerkyle/pylearn2
pylearn2/cross_validation/tests/test_dataset_iterators.py
49
6535
""" Test cross-validation dataset iterators. """ from pylearn2.config import yaml_parse from pylearn2.testing.skip import skip_if_no_sklearn def test_dataset_k_fold(): """Test DatasetKFold.""" skip_if_no_sklearn() mapping = {'dataset_iterator': 'DatasetKFold'} test_yaml = test_yaml_dataset_iterator % ...
bsd-3-clause
great-expectations/great_expectations
tests/core/test_batch_related_objects.py
1
4097
import pandas as pd import pytest from great_expectations.core.batch import ( Batch, BatchDefinition, BatchMarkers, BatchRequest, BatchSpec, IDDict, ) from great_expectations.core.batch_spec import RuntimeDataBatchSpec from great_expectations.exceptions import InvalidBatchSpecError def test_b...
apache-2.0
goldner-lab/photon-tools
blink_removal.py
1
13247
#!/usr/bin/python """ Implementation of Bayesian blink removal algorithm. Ben Gamari, 2010 This follows the work of Taylor, et al. (Biophysical Journal, Vol 98, January 2010, pp. 164-173) """ import logging from math import pi, exp, log import random import numpy as np from numpy import mean, array from numpy.lib.r...
gpl-3.0
Myasuka/scikit-learn
sklearn/neighbors/classification.py
106
13987
"""Nearest Neighbor Classification""" # 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 ...
bsd-3-clause
DVegaCapital/zipline
tests/modelling/test_engine.py
8
15874
""" Tests for SimpleFFCEngine """ from __future__ import division from unittest import TestCase from itertools import product from numpy import ( full, isnan, nan, ) from numpy.testing import assert_array_equal from pandas import ( DataFrame, date_range, Int64Index, MultiIndex, rolling_...
apache-2.0
OshynSong/scikit-learn
benchmarks/bench_mnist.py
76
6136
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
aminert/scikit-learn
sklearn/ensemble/tests/test_forest.py
48
35412
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import product import numpy as np from scipy.sparse import csr_...
bsd-3-clause
rs2/pandas
pandas/tests/indexes/timedeltas/test_insert.py
2
4022
from datetime import timedelta import numpy as np import pytest import pandas as pd from pandas import Index, Timedelta, TimedeltaIndex, timedelta_range import pandas._testing as tm class TestTimedeltaIndexInsert: def test_insert(self): idx = TimedeltaIndex(["4day", "1day", "2day"], name="idx") ...
bsd-3-clause
warmspringwinds/scikit-image
doc/examples/plot_denoise.py
17
2078
""" ==================== Denoising a picture ==================== In this example, we denoise a noisy version of the picture of the astronaut Eileen Collins using the total variation and bilateral denoising filter. These algorithms typically produce "posterized" images with flat domains separated by sharp edges. It i...
bsd-3-clause
OTWillems/GEO1005
SpatialDecision/external/networkx/drawing/nx_pylab.py
20
30247
""" ********** Matplotlib ********** Draw networks with matplotlib. See Also -------- matplotlib: http://matplotlib.org/ pygraphviz: http://pygraphviz.github.io/ """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov>...
gpl-2.0
alongwithyou/auto-sklearn
source/conf.py
5
8715
# -*- coding: utf-8 -*- # # AutoSklearn documentation build configuration file, created by # sphinx-quickstart on Thu May 21 13:40:42 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
bsd-3-clause
LeeKamentsky/CellProfiler
cellprofiler/settings.py
1
143936
""" Setting.py - represents a module setting CellProfiler is distributed under the GNU General Public License. See the accompanying file LICENSE for details. Copyright (c) 2003-2009 Massachusetts Institute of Technology Copyright (c) 2009-2015 Broad Institute All rights reserved. Please see the AUTHORS file for cred...
gpl-2.0
algorithmic-music-exploration/amen
docs/conf.py
1
10386
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # AMEN documentation build configuration file, created by # sphinx-quickstart on Sat May 21 16:07:22 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autog...
bsd-2-clause
PhE/dask
dask/dataframe/tests/test_io.py
1
20905
import gzip import pandas as pd import numpy as np import pandas.util.testing as tm import os import dask from operator import getitem import pytest from toolz import valmap import tempfile import shutil from time import sleep import dask.array as da import dask.dataframe as dd from dask.dataframe.io import (read_csv,...
bsd-3-clause
bluescarni/hyperion
hyperion/dust/optical_properties.py
2
21253
from __future__ import print_function, division import hashlib import numpy as np from astropy.table import Table, Column from ..util.integrate import integrate_loglog, integrate_linlog_subset from ..util.interpolate import interp1d_fast, interp1d_fast_loglog, \ interp1d_fast_li...
bsd-2-clause
cbertinato/pandas
pandas/tests/io/parser/test_multi_thread.py
1
3541
""" Tests multithreading behaviour for reading and parsing files for each parser defined in parsers.py """ from io import BytesIO from multiprocessing.pool import ThreadPool import numpy as np import pandas as pd from pandas import DataFrame import pandas.util.testing as tm def _construct_dataframe(num_rows): "...
bsd-3-clause
frank-tancf/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
43
39945
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from itertools import product from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix from scipy.sparse import coo_matrix from sklearn import datasets from sklearn.base import clo...
bsd-3-clause
rajat1994/scikit-learn
sklearn/utils/tests/test_random.py
230
7344
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
datapythonista/pandas
pandas/tests/frame/methods/test_rename_axis.py
4
4091
import numpy as np import pytest from pandas import ( DataFrame, Index, MultiIndex, ) import pandas._testing as tm class TestDataFrameRenameAxis: def test_rename_axis_inplace(self, float_frame): # GH#15704 expected = float_frame.rename_axis("foo") result = float_frame.copy() ...
bsd-3-clause
flightgong/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
prasunroypr/digit-recognizer
source/make.py
1
5849
################################################################################ """ Multi-Class Classifier for Digit Recognition Created on Wed Jun 01 00:00:00 2016 @author: Prasun Roy @e-mail: prasunroy.pr@gmail.com """ ################################################################################ # import modu...
gpl-3.0
timqian/sms-tools
lectures/7-Sinusoidal-plus-residual-model/plots-code/envelope-approx.py
22
2887
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, triang, blackmanharris, resample import math import sys, os, time from scipy.fftpack import fft, ifft sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import utilFunction...
agpl-3.0
shikhardb/scikit-learn
benchmarks/bench_covertype.py
154
7296
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
ClimbsRocks/scikit-learn
sklearn/decomposition/tests/test_truncated_svd.py
73
6086
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
bsd-3-clause
ky822/scikit-learn
sklearn/linear_model/omp.py
10
30440
"""Orthogonal matching pursuit algorithms """ # Author: Vlad Niculae # # License: BSD 3 clause import warnings from distutils.version import LooseVersion import numpy as np from scipy import linalg from scipy.linalg.lapack import get_lapack_funcs from .base import LinearModel, _pre_fit from ..base import RegressorM...
bsd-3-clause
philipan/paparazzi
sw/tools/tcp_aircraft_server/phoenix/__init__.py
86
4470
#Copyright 2014, Antoine Drouin """ Phoenix is a Python library for interacting with Paparazzi """ import math """ Unit convertions """ def rad_of_deg(d): return d/180.*math.pi def deg_of_rad(r): return r*180./math.pi def rps_of_rpm(r): return r*2.*math.pi/60. def rpm_of_rps(r): return r/2./math.pi*60. def m_of_i...
gpl-2.0
mattyowl/sourcery
sourcery/sourceBrowser.py
1
174086
""" Copyright 2014-2018 Matt Hilton (matt.hilton@mykolab.com) This file is part of Sourcery. Sourcery 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 ...
gpl-3.0
samuel1208/scikit-learn
sklearn/utils/tests/test_random.py
230
7344
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
devinplatt/extraction_worker
lib/create_examples.py
1
4560
# This module contains functions to join/split mel spectrum features into # input examples for a model. import numpy as np import librosa import sklearn import sklearn.cluster import sklearn.pipeline import csv from collections import defaultdict import random import joblib import os from extraction_worker.lib.core i...
mit
josenavas/american-gut-web
amgut/lib/locale_data/british_gut.py
1
152839
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division from amgut.lib.config_manager import AMGUT_CONFIG # ----------------------------------------------------------------------------- # Copyright (c) 2014--, The American Gut Project Development Team. # # Distributed under the terms of the BSD 3...
bsd-3-clause
mojoboss/scikit-learn
examples/exercises/plot_cv_digits.py
232
1206
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
deapplegate/wtgpipeline
cutout_bpz_backup.py
1
26030
import math, re, sys import pylab # matplotlib #def mkstellarcolorplot(): def filt_num(x): filter_order = ['u','B','g','V','r','R','i','I','z','Z','J','H','K'] x = x.replace('SUBARU','').replac...
mit
mikebenfield/scikit-learn
sklearn/setup.py
69
3201
import os from os.path import join import warnings from sklearn._build_utils import maybe_cythonize_extensions def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError import numpy lib...
bsd-3-clause
tommyjasmin/polar2grid
py/polar2grid/setup.py
1
2649
#!/usr/bin/env python # encoding: utf-8 """Script for installing the polar2grid package. See http://packages.python.org/distribute/ for use details. Copyright (C) 2013 Space Science and Engineering Center (SSEC), University of Wisconsin-Madison. This program is free software: you can redistribute it and/or modif...
gpl-3.0
waterponey/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
sunchaoatmo/cplot
cseof.py
1
4345
#!/usr/bin/env python from __future__ import division import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np from matplotlib.backends.backend_pdf import PdfPages import seaborn as sns from constant import * from collections import namedtuple from cstoolkit import cwrfplot from plotse...
gpl-3.0
davidastephens/pandas-accounting
pandas_accounting/core/financials.py
1
2004
""" Financial statements """ from pandas_accounting.core.account import Account class BaseStatement(object): def __init__(self, periods, data = None): self.periods = periods if data: self._data = data else: self._data = {} def __getitem__(self, key): ret...
mit
fmacias64/spyre
examples/d3_example.py
3
2432
# requires d3py library # only tested with python 2.7 from spyre import server import numpy as np import pandas as pd import d3py import matplotlib.pyplot as plt class FruitInventoryApp(server.App): title = "Spyre Example With d3" inputs = [{ "input_type":'dropdown', "label": 'Type', "options" : [ {"label...
mit
cybernet14/scikit-learn
examples/classification/plot_digits_classification.py
289
2397
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
akrherz/iem
scripts/ingestors/soilm_ingest.py
1
22328
""" LEGACY ISU SOIL MOISTURE INGEST! Run from RUN_10_AFTER.sh """ # stdlib import datetime import os import sys import subprocess import tempfile import io # Third party import psycopg2 import pytz import numpy as np import pandas as pd from metpy.units import units from metpy.calc import dewpoint_from_relative_...
mit
seakers/daphne_brain
EDL/data/model.py
1
15851
from sqlalchemy import create_engine, Column, Integer, Float, String, DateTime, Time, Enum, ForeignKey, Table, \ CheckConstraint, ARRAY from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.engine.url import URL import daphne_brain.settings as settings # ...
mit
r-mart/scikit-learn
examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py
227
5170
""" ================================================= Hyper-parameters of Approximate Nearest Neighbors ================================================= This example demonstrates the behaviour of the accuracy of the nearest neighbor queries of Locality Sensitive Hashing Forest as the number of candidates and the numb...
bsd-3-clause
mlperf/training_results_v0.7
Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/oneoffs/training_curve.py
8
5964
# Copyright 2018 Google 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 agreed to in writing, ...
apache-2.0
great-expectations/great_expectations
great_expectations/expectations/core/expect_column_min_to_be_between.py
1
9139
from typing import Dict, List, Optional, Union import numpy as np import pandas as pd from great_expectations.core.batch import Batch from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import ExecutionEngine, PandasExecutionEngine from great...
apache-2.0
huaxz1986/git_book
chapters/PreProcessing/standardize.py
1
1797
# -*- coding: utf-8 -*- """ 数据预处理 ~~~~~~~~~~~~~~~~ 数据标准化 :copyright: (c) 2016 by the huaxz1986. :license: lgpl-3.0, see LICENSE for more details. """ from sklearn.preprocessing import MinMaxScaler,MaxAbsScaler,StandardScaler def test_MinMaxScaler(): ''' 测试 MinMaxScaler 的用法 :return: ...
gpl-3.0
mutirri/bokeh
bokeh/cli/utils.py
42
8119
from __future__ import absolute_import, print_function from collections import OrderedDict from six.moves.urllib import request as urllib2 import io import pandas as pd from .. import charts from . import help_messages as hm def keep_source_input_sync(filepath, callback, start=0): """ Monitor file at filepath ch...
bsd-3-clause
fatcloud/PyCV-time
experiments/undistort/common.py
23
6299
#!/usr/bin/env python ''' This module contais some common routines used by other samples. ''' import numpy as np import cv2 import os from contextlib import contextmanager import itertools as it image_extensions = ['.bmp', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.pbm', '.pgm', '.ppm'] class Bunch(object): de...
mit
cl4rke/scikit-learn
examples/plot_kernel_ridge_regression.py
230
6222
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
EconomicSL/housing-model
src/main/resources/calibration/code/bak/temp.py
4
3241
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import pandas as pd import matplotlib.pyplot as plt ###################################################################### class QuarterlyTable(pd.Series): 'Representation of a column of numbers at quarterly time intervals' offset ...
mit
bhargav/scikit-learn
benchmarks/bench_plot_neighbors.py
287
6433
""" Plot the scaling of the nearest neighbors algorithms with k, D, and N """ from time import time import numpy as np import pylab as pl from matplotlib import ticker from sklearn import neighbors, datasets def get_data(N, D, dataset='dense'): if dataset == 'dense': np.random.seed(0) return np....
bsd-3-clause
ngoix/OCRF
sklearn/linear_model/bayes.py
50
16145
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
pulinagrawal/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_svg.py
69
23593
from __future__ import division import os, codecs, base64, tempfile, urllib, gzip, cStringIO try: from hashlib import md5 except ImportError: from md5 import md5 #Deprecated in 2.5 from matplotlib import verbose, __version__, rcParams from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ ...
agpl-3.0
NunoEdgarGub1/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
joshloyal/scikit-learn
sklearn/utils/tests/test_class_weight.py
55
9891
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
berkeley-stat159/project-alpha
final/image_scripts/parameter_selection_plots.py
1
9362
""" Parameter selection for Benjamini Hochberg Analysis and T analysis. """ from __future__ import absolute_import, division, print_function import numpy as np import matplotlib.pyplot as plt import sys import itertools import nibabel as nib import os name="sub001" #set up paths project_path = "../../" pa...
bsd-3-clause
btallman/incubator-airflow
airflow/hooks/hive_hooks.py
22
27917
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
dpace1/caterpillar-tube-pricing
utils_xgb.py
1
3698
from utils import * from hyperopt import hp from hyperopt import fmin, tpe, hp, STATUS_OK, Trials import xgboost as xgb from sklearn import cross_validation def split_formatter(folds, train, labels, missing = 0.0): """Returns a list of train-val tuples for a given folds iterator""" out = [] for ind_train, ind_val...
mit
changhiskhan/poseidon
poseidon/ssh.py
1
9107
from __future__ import print_function import os import getpass from cStringIO import StringIO try: import paramiko except ImportError: print("Please install paramiko to use SSH connection") raise # make these optional so not everyone has to build C binaries try: import pandas as pd if pd.__version...
mit
wasit7/cs426
code/week07_textPrediction/parallel_forest/sctree.py
1
3539
""" GNU GENERAL PUBLIC LICENSE Version 2 Created on Thu Oct 16 17:33:47 2014 @author: Wasit """ from scmaster import mnode import numpy as np class tree(mnode): def settree(self,root=mnode(0,0,0)): self.theta=root.theta #vector array self.tau=root.tau #scalar self.H=root.H #scalar ...
mit
schaunwheeler/military_stat_scraper
Python/scraper_military_times_citations.py
1
4215
# -*- coding: utf-8 -*- #-----------------------------------------------------------------------------# # Pull Military Times Citation/Awards Data #-----------------------------------------------------------------------------# # import modules and define custom functions import pandas import scrapy.selector import url...
mit
alvaroing12/CADL
session-3/libs/utils.py
4
21361
"""Utilities used in the Kadenze Academy Course on Deep Learning w/ Tensorflow. Creative Applications of Deep Learning w/ Tensorflow. Kadenze, Inc. Parag K. Mital Copyright Parag K. Mital, June 2016. """ from __future__ import print_function import matplotlib.pyplot as plt import tensorflow as tf import urllib import...
apache-2.0
nuclear-wizard/moose
python/peacock/tests/postprocessor_tab/test_VectorPostprocessorSelectPlugin.py
12
4345
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
vshtanko/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
hunse/deepnet
deepnet/autoencoder/autoencoder.py
1
11030
import collections import os import re import subprocess import sys import time import numpy as np import numpy.random as npr import scipy as sp import matplotlib.pyplot as plt import theano import theano.tensor as T import theano.sandbox.rng_mrg from ..base import CacheObject from ..functions.functions import Log...
mit
stczhc/neupy
examples/gd/gd_algorithms_visualization.py
1
3630
from functools import partial import theano.tensor as T import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from neupy import algorithms, layers, environment from plots import draw_countour, weight_quiver environment.reproducible() input_data = np.array([ [0.9, 0.3], [0...
mit
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/user_interfaces/embedding_in_qt4.py
3
4052
#!/usr/bin/env python # embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases # # Copyright (C) 2005 Florent Rougon # 2006 Darren Dale # # This file is an example program for matplotlib. It may be used and # modified with no restriction; raw copies as well as modified versions # ma...
gpl-2.0
shyamalschandra/scikit-learn
examples/ensemble/plot_forest_importances.py
168
1793
""" ========================================= Feature importances with forests of trees ========================================= This examples shows the use of forests of trees to evaluate the importance of features on an artificial classification task. The red bars are the feature importances of the forest, along wi...
bsd-3-clause
PyOCL/pyopencl-examples
4-3-expand/clustering.py
1
5629
#!/usr/bin/python3 import os import time import random import numpy import pyopencl as cl import pyopencl.array def plot_grouping_result(point_cids, group_ids, point_info): assert len(point_cids) != 0 import matplotlib.pyplot as plt markers = ['p', '*', '+', 'x', 'd', 'o', 'v', 's', 'h'] colors = [(ran...
mit
khkaminska/scikit-learn
examples/preprocessing/plot_function_transformer.py
161
1949
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
bsd-3-clause
louispotok/pandas
pandas/conftest.py
1
6143
import pytest import numpy as np import pandas as pd from pandas.compat import PY3 import pandas.util._test_decorators as td def pytest_addoption(parser): parser.addoption("--skip-slow", action="store_true", help="skip slow tests") parser.addoption("--skip-network", action="store_true", ...
bsd-3-clause
nipy/PySurfer
examples/plot_label.py
2
1518
""" Display ROI Labels ================== Using PySurfer you can plot Freesurfer cortical labels on the surface with a large amount of control over the visual representation. """ import os from surfer import Brain print(__doc__) subject_id = "fsaverage" hemi = "lh" surf = "smoothwm" brain = Brain(subject_id, hemi, ...
bsd-3-clause
ndingwall/scikit-learn
sklearn/ensemble/_gb.py
2
72022
"""Gradient Boosted Regression Trees. This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressi...
bsd-3-clause
MalloyPower/python-compliance
esem-paper-apr-2017/analysis-code/promise_versions.py
1
3275
# These are the Qualitas system versions as used in the Promise paper. # In most cases I got these from the spreadsheet, but for some (noted below) # this was blank, and I had to get them from Fig 1 of the APSEC 2015 paper. # In some cases the tag was slightly incorrect, so I edited it. import os import sys # Uses G...
mit
LiaoPan/scikit-learn
sklearn/linear_model/tests/test_base.py
120
10082
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model....
bsd-3-clause
dungvtdev/upsbayescpm
bayespy/demos/lssm_sd.py
5
10707
################################################################################ # Copyright (C) 2014 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ """ Demonstrate the linear state-space model with switching dynamics. ...
mit
jayflo/scikit-learn
examples/linear_model/plot_ridge_path.py
254
1655
""" =========================================================== Plot Ridge coefficients as a function of the regularization =========================================================== Shows the effect of collinearity in the coefficients of an estimator. .. currentmodule:: sklearn.linear_model :class:`Ridge` Regressi...
bsd-3-clause
ua-snap/downscale
snap_scripts/OLD_SCRIPTS/model_diffs_metrics_epscor_se_TESTNEW_cru.py
1
12552
# maybe read in the baseline # then loop through reads of all models... # perform the diff # then groupby month and compute means / stdev def sort_files( files, split_on='_', elem_month=-2, elem_year=-1 ): ''' sort a list of files properly using the month and year parsed from the filename. This is useful with SNAP...
mit
wangqingbaidu/aliMusic
analysis/tempPlot.py
1
1243
# -*- coding: UTF-8 -*- ''' Authorized by vlon Jang Created on Jun 13, 2016 Email:zhangzhiwei@ict.ac.cn From Institute of Computing Technology All Rights Reserved. ''' import pandas as pd import numpy as np import pymysql import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression ...
gpl-3.0
Gabriel-p/photpy
tasks/fitstats.py
2
17680
import read_pars_file as rpf import os from os.path import exists, join, isfile from pathlib2 import Path import sys # from operator import itemgetter import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import matplotlib.gridspec as gridspec from matplotlib.ticker import NullForm...
gpl-3.0
Gillu13/scipy
scipy/integrate/odepack.py
62
9420
# Author: Travis Oliphant from __future__ import division, print_function, absolute_import __all__ = ['odeint'] from . import _odepack from copy import copy import warnings class ODEintWarning(Warning): pass _msgs = {2: "Integration successful.", 1: "Nothing was done; the integration time was 0.", ...
bsd-3-clause
jmschrei/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
260
1219
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
abidrahmank/MyRoughWork
scikit_roughworks/hist_backprojection_implementation.py
1
1110
import cv2 import numpy as np from matplotlib import pyplot as plt #roi is the object or region of object we need to find roi = cv2.imread('rose_red.png') hsv = cv2.cvtColor(roi,cv2.COLOR_BGR2HSV) #target is the image we search in target = cv2.imread('rose.png') hsvt = cv2.cvtColor(target,cv2.COLOR_BGR2HSV) M = cv2....
mit
gfyoung/pandas
pandas/tests/io/parser/conftest.py
1
4997
import os from typing import List, Optional import pytest from pandas import read_csv, read_table class BaseParser: engine: Optional[str] = None low_memory = True float_precision_choices: List[Optional[str]] = [] def update_kwargs(self, kwargs): kwargs = kwargs.copy() kwargs.update(...
bsd-3-clause
mvdroest/RTLSDR-Scanner
src/dialogs_tools.py
1
18475
# # rtlsdr_scan # # http://eartoearoak.com/software/rtlsdr-scanner # # Copyright 2012 - 2015 Al Brown # # A frequency scanning GUI for the OsmoSDR rtl-sdr library at # http://sdr.osmocom.org/trac/wiki/rtl-sdr # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
ocefpaf/cartopy
lib/cartopy/examples/logo.py
6
1535
""" Cartopy Logo ------------ The actual code to produce cartopy's logo. """ import cartopy.crs as ccrs import matplotlib.pyplot as plt import matplotlib.textpath import matplotlib.patches from matplotlib.font_manager import FontProperties import numpy as np def main(): fig = plt.figure(figsize=[12, 6]) ax ...
lgpl-3.0
roystgnr/libmesh
doc/statistics/libmesh_citations_monthly.py
2
4602
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np from matplotlib import rcParams import datetime from matplotlib.dates import date2num, num2date rcParams['font.family'] = 'DejaVu Sans' rcParams['font.size'] = 13 rcParams['font.serif'] = ['Computer Modern Roman'] rcParams['text.usetex'] = True ...
lgpl-2.1
mehdidc/scikit-learn
sklearn/feature_selection/tests/test_chi2.py
5
2418
""" Tests for chi2, currently the only feature selection function designed specifically to work with sparse matrices. """ import numpy as np from scipy.sparse import coo_matrix, csr_matrix import scipy.stats from sklearn.feature_selection import SelectKBest, chi2 from sklearn.feature_selection.univariate_selection im...
bsd-3-clause
rosswhitfield/mantid
qt/applications/workbench/workbench/plotting/test/test_utility.py
3
4292
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2017 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