repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
andaag/scikit-learn
sklearn/metrics/pairwise.py
104
42995
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
jcasner/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/ticker.py
69
37420
""" Tick locating and formatting ============================ This module contains classes to support completely configurable tick locating and formatting. Although the locators know nothing about major or minor ticks, they are used by the Axis class to support major and minor tick locating and formatting. Generic t...
agpl-3.0
louispotok/pandas
pandas/tests/test_multilevel.py
1
107731
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101,W0141 from warnings import catch_warnings import datetime import itertools import pytest import pytz from numpy.random import randn import numpy as np from pandas.core.index import Index, MultiIndex from pandas import Panel, DataFrame, Series, notna, isna, Tim...
bsd-3-clause
SSJohns/osf.io
scripts/analytics/addons.py
18
2173
# -*- coding: utf-8 -*- import os import re import matplotlib.pyplot as plt from framework.mongo import database from website import settings from website.app import init_app from .utils import plot_dates, oid_to_datetime, mkdirp log_collection = database['nodelog'] FIG_PATH = os.path.join(settings.ANALYTICS_PATH...
apache-2.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sklearn/tests/test_preprocessing.py
2
18316
import numpy as np import numpy.linalg as la import scipy.sparse as sp from numpy.testing import assert_almost_equal from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from numpy.testing import assert_equal from nose.tools import assert_raises, assert_true, assert_false ...
agpl-3.0
wegamekinglc/Finance-Python
PyFin/tests/Math/Accumulators/testAccumulatorsArithmetic.py
2
31296
# -*- coding: utf-8 -*- u""" Created on 2015-7-27 @author: cheng.li """ import unittest import copy import tempfile import pickle import os import math import numpy as np import pandas as pd from scipy.stats import norm from PyFin.Math.Accumulators.IAccumulators import Identity from PyFin.Math.Accumulators.IAccumulat...
mit
bobmyhill/burnman
examples/example_seismic.py
2
6866
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU # GPL v2 or later. """ example_seismic --------------- Shows the various ways to input seismic models (:math:`V_s, V_p, V_{\\phi}, \\...
gpl-2.0
azvoleff/pyabm
pyabm/rcsetup.py
1
29166
# Copyright 2009-2013 Alex Zvoleff # # This file is part of the pyabm agent-based modeling toolkit. # # pyabm is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your optio...
gpl-3.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/IPython/lib/tests/test_latextools.py
4
3811
# encoding: utf-8 """Tests for IPython.utils.path.py""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from unittest.mock import patch import nose.tools as nt from IPython.lib import latextools from IPython.testing.decorators import onlyif_cmds_exist, skipif_not_m...
bsd-2-clause
meetshah1995/pytorch-semseg
ptsemseg/loader/camvid_loader.py
1
4256
import os import collections import torch import numpy as np import scipy.misc as m import matplotlib.pyplot as plt from torch.utils import data from ptsemseg.augmentations import Compose, RandomHorizontallyFlip, RandomRotate class camvidLoader(data.Dataset): def __init__( self, root, spl...
mit
uber-common/deck.gl
bindings/pydeck/examples/icon_layer.py
1
1113
""" IconLayer ========= Location of biergartens in Germany listed on OpenStreetMap as of early 2020. """ import pydeck as pdk import pandas as pd # Data from OpenStreetMap, accessed via osmpy DATA_URL = "https://raw.githubusercontent.com/ajduberstein/geo_datasets/master/biergartens.json" ICON_URL = "https://upload....
mit
DR08/mxnet
example/speech_recognition/stt_utils.py
44
5892
# 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
evelynmitchell/smc
src/smc_sagews/smc_sagews/graphics.py
4
25186
############################################################################### # # SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal. # # Copyright (C) 2014, William Stein # # This program is free software: you can redistribute it and/or modify # it under the terms of...
gpl-3.0
gofortargets/CNN_brandsafety
knx/text/kte/extract.py
1
98594
#!/usr/bin/python # -*- coding: UTF-8 -*- import matplotlib matplotlib.use('Agg') import logging import argparse import cPickle as pickle import gc from itertools import combinations import json import math # import matplotlib.pyplot as plt import multiprocessing as mp import numpy as np import os import re import sci...
apache-2.0
okadate/romspy
romspy/tplot/tplot_station.py
1
2385
# coding: utf-8 # (c) 2015-11-28 Teruhisa Okada import netCDF4 import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter import numpy as np import pandas as pd import romspy def resample(date, var, **kw): rule = kw.pop('resample', 'D') if rule == 'H': loffset = '-30min' elif rule...
mit
python-visualization/folium
tests/plugins/test_fast_marker_cluster.py
2
2514
# -*- coding: utf-8 -*- """ Test FastMarkerCluster ---------------------- """ import folium from folium.plugins import FastMarkerCluster from folium.utilities import normalize from jinja2 import Template import numpy as np import pandas as pd import pytest def test_fast_marker_cluster(): n = 100 np.rand...
mit
sasdelli/lc_predictor
lc_predictor/savgol.py
1
3104
import numpy as np # This is Thomas Haslwanter's implementation at: # http://wiki.scipy.org/Cookbook/SavitzkyGolay def savitzky_golay(y, window_size, order, deriv=0): r"""Smooth (and optionally differentiate) data with a Savitzky-Golay filter. The Savitzky-Golay filter removes high frequency noise from data. ...
gpl-3.0
Clyde-fare/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
anurag313/scikit-learn
examples/cluster/plot_lena_segmentation.py
271
2444
""" ========================================= Segmenting the picture of Lena in regions ========================================= This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous regions. This procedure (spe...
bsd-3-clause
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/backends/backend_gtk3agg.py
6
3144
import cairo import numpy as np import sys import warnings import backend_agg import backend_gtk3 from matplotlib.figure import Figure from matplotlib import transforms if sys.version_info[0] >= 3: warnings.warn("The Gtk3Agg backend is not known to work on Python 3.x.") class FigureCanvasGTK3Agg(backend_gtk3.Fi...
mit
kashif/scikit-learn
examples/calibration/plot_compare_calibration.py
82
5012
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/pandas/indexes/category.py
7
22750
import numpy as np import pandas.index as _index from pandas import compat from pandas.compat.numpy import function as nv from pandas.types.generic import ABCCategorical, ABCSeries from pandas.types.common import (is_categorical_dtype, _ensure_platform_int, ...
apache-2.0
vaishaksuresh/udacity_data_analyst
P2/ProblemSets_2_to_4/P4_01.py
1
1593
from pandas import * from ggplot import * def plot_weather_data(turnstile_weather): ''' You are passed in a dataframe called turnstile_weather. Use turnstile_weather along with ggplot to make a data visualization focused on the MTA and weather data we used in assignment #3. You should feel free ...
gpl-2.0
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Coupled_Contact/Steady_State_Single_Foundation_Sysytem_Under_Compression/CoupledHardContact_NonLinHardSoftShear/n_1/Plot_Results.py
15
3553
#!/usr/bin/env python #!/usr/bin/python import h5py from matplotlib import pylab import matplotlib.pylab as plt import sys from matplotlib.font_manager import FontProperties import math import numpy as np #!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as ...
cc0-1.0
vibhorag/scikit-learn
examples/neighbors/plot_classification.py
287
1790
""" ================================ Nearest Neighbors Classification ================================ Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColorm...
bsd-3-clause
has2k1/plotnine
plotnine/positions/position_stack.py
1
2953
from warnings import warn import numpy as np import pandas as pd from ..exceptions import PlotnineWarning from ..utils import remove_missing from .position import position class position_stack(position): """ Stack plotted objects on top of each other The objects to stack are those that have an over...
gpl-2.0
FYP-DES5/deepscan-core
plot.py
1
6984
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np import cv2, sys class EdgeImprover: def __init__(self, voxels, gridsize, minX, minY, maxX, maxY): self.voxels = voxels self.gridsize = gridsize self.mask = np.zeros((3 + maxX - minX, 3 + maxY - minY), dtype=np.uint8) se...
mit
catalyst-cooperative/pudl
src/pudl/extract/epacems.py
1
8422
""" Retrieve data from EPA CEMS hourly zipped CSVs. This modules pulls data from EPA's published CSV files. """ import logging from pathlib import Path from typing import NamedTuple from zipfile import ZipFile import pandas as pd from pudl.workspace.datastore import Datastore logger = logging.getLogger(__name__) #...
mit
mwmuni/LIGGGHTS_GUI
networkx/drawing/nx_pylab.py
10
30226
""" ********** Matplotlib ********** Draw networks with matplotlib. See Also -------- matplotlib: http://matplotlib.org/ pygraphviz: http://pygraphviz.github.io/ """ # Author: Aric Hagberg (hagberg@lanl.gov) # Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colg...
gpl-3.0
Becksteinlab/PDB_Ion_Survey
src/pdbionsurvey/bulkcoord.py
1
6385
m __future__ import division import MDAnalysis as mda import datreant as dtr from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np import pandas as pd import pdbionsurvey.coordination import json import seaborn as sb import scipy import mmtf import pdbionsurvey.collection from matp...
gpl-3.0
davidgbe/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
249
1095
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
Galithil/status
status/clusters_per_lane.py
2
2547
import tornado.web import json import cStringIO import matplotlib.gridspec as gridspec from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg from status.util import SafeHandler class ClustersPerLaneHandler(SafeHandler): """ Serves a page with a plot of distribution of l...
mit
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/lines_bars_and_markers/fill_betweenx_demo.py
1
2297
""" ================== Fill Betweenx Demo ================== Using ``fill_betweenx`` to color between two horizontal curves. """ import matplotlib.pyplot as plt import numpy as np # nodebox section if __name__ == '__builtin__': # were in nodebox import os import tempfile W = 800 inset = 20 siz...
mit
sinamoeini/mapp4py
doc/src/conf.py
1
3581
from __future__ import division, absolute_import, print_function import sys, os, re, numpydoc import sphinx if sphinx.__version__ < "1.0.1": raise RuntimeError("Sphinx 1.0.1 or newer required") needs_sphinx = '1.0' # ----------------------------------------------------------------------------- # General configu...
mit
jiafeimaowudi/KnowlegeableCNN
structureTestOnMonster2ShareHighLevelOnlyLogistic.py
1
10737
from theano import tensor as T, printing import theano import numpy from mlp import HiddenLayer from logistic_sgd_lazy import LogisticRegression from DocEmbeddingNN import DocEmbeddingNN # from DocEmbeddingNNPadding import DocEmbeddingNN from knoweagebleClassifyFlattenedLazy import CorpusReader import cPickle import os...
gpl-2.0
workflo/dxf2gcode
python_examples/Kegelstump_Abwicklung_2dxf.py
1
12174
#!/usr/bin/python # -*- coding: cp1252 -*- # #Kegelstump_Abwicklung_2dxf.py #Programmer: Christian Kohlöffel #E-mail: n/A # #Copyright 2008 Christian Kohlöffel # #Distributed under the terms of the GPL (GNU Public License) # #dxf2gcode is free software; you can redistribute it and/or modify #it under the terms of t...
gpl-3.0
kntem/webdeposit
modules/bibauthorid/lib/bibauthorid_tortoise.py
3
15730
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
gpl-2.0
ngvozdiev/ctr-base
python/plot_link_paths.py
1
3124
from collections import defaultdict from scipy import interpolate import numpy as np import matplotlib.pylab as plt import parser_wrapper import glob import itertools import matplotlib.patches as mpatches import argparse import matplotlib matplotlib.rcParams.update({'font.size': 14}) parser = argparse.ArgumentParser(...
mit
vybstat/scikit-learn
examples/svm/plot_svm_regression.py
249
1451
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
JT5D/scikit-learn
examples/ensemble/plot_forest_importances.py
7
1742
""" ========================================= 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
rspavel/spack
var/spack/repos/builtin/packages/lbann/package.py
1
11820
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import sys from spack import * class Lbann(CMakePackage, CudaPackage): """LBANN: Livermore Big Artificial ...
lgpl-2.1
ernfrid/skll
skll/data/featureset.py
1
15821
# License: BSD 3 clause """ Classes related to storing/merging feature sets. :author: Dan Blanchard (dblanchard@ets.org) :organization: ETS """ from __future__ import absolute_import, print_function, unicode_literals from copy import deepcopy import numpy as np import scipy.sparse as sp from six import iteritems fr...
bsd-3-clause
yueranyuan/vector_edu
wavelet_analysis.py
1
4265
import numpy as np import matplotlib.pyplot as plt from learntools.emotiv.data import segment_raw_data, gen_wavelet_features from learntools.emotiv.filter import filter_data from learntools.libs.wavelet import signal_to_wavelet def show_raw_wave(eeg): for channel in xrange(14): plt.plot(eeg[:, channel]) ...
mit
nelson-liu/scikit-learn
sklearn/feature_extraction/image.py
19
17614
""" The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to extract features from images. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Olivier Grisel # Vlad Niculae # License: BSD 3 clause fro...
bsd-3-clause
mpld3/mpld3_rewrite
test_plots/test_plot_w_html_tooltips.py
1
1286
"""Plot to test HTML tooltip plugin As a data explorer, I want to add rich information to each point in a scatter plot, as details-on-demand""" import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np, pandas as pd from mpld3_rewrite import plugins css = """ table { border-collapse...
bsd-3-clause
shusenl/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
zangsir/sms-tools
lectures/04-STFT/plots-code/sine-spectrum.py
24
1563
import matplotlib.pyplot as plt import numpy as np from scipy.fftpack import fft, ifft N = 256 M = 63 f0 = 1000 fs = 10000 A0 = .8 hN = N/2 hM = (M+1)/2 fftbuffer = np.zeros(N) X1 = np.zeros(N, dtype='complex') X2 = np.zeros(N, dtype='complex') x = A0 * np.cos(2*np.pi*f0/fs*np.arange(-hM+1,hM)) plt.figure(1, figsi...
agpl-3.0
herilalaina/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
365
6996
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
micksi/datamining_exam
omer/content_base_filtering.py
1
2632
import sys import numpy as np import pandas as pd from sklearn import preprocessing from sklearn.neighbors import NearestNeighbors pd.set_option('display.max_colwidth', 300) file_name = "anime.csv" file_name_rating = 'rating.csv' def normalize(df_user_profiles): x = df_user_profiles.iloc[:,1:].values #returns a n...
gpl-2.0
xiaoxiamii/scikit-learn
sklearn/utils/fixes.py
133
12882
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
lgarren/spack
var/spack/repos/builtin/packages/julia/package.py
3
9966
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
JaviMerino/trappy
trappy/stats/Aggregator.py
1
5544
# Copyright 2015-2016 ARM Limited # # 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 w...
apache-2.0
rahuldhote/scikit-learn
sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
DANA-Laboratory/CoolProp
wrappers/Python/CoolProp/tests/test_plots.py
4
4608
import numpy as np import matplotlib.pyplot as plt def test_back_compatibility(): fluid_ref = 'R290' def Ts_plot_tests(): from CoolProp.Plots import Ts Ts(fluid_ref, show=False) from matplotlib import pyplot fig = pyplot.figure(2) ax = fig.gca() Ts(fluid_ref, s...
mit
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/cluster/dbscan_.py
1
12153
# -*- coding: utf-8 -*- """ DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Author: Robert Layton <robertlayton@gmail.com> # Joel Nothman <joel.nothman@gmail.com> # Lars Buitinck # # License: BSD 3 clause import numpy as np from scipy import sparse from ._dbscan_inner import ...
mit
mkukielka/oddt
docs/conf.py
1
12238
# -*- coding: utf-8 -*- # # ODDT documentation build configuration file, created by # sphinx-quickstart on Mon Aug 25 13:49:30 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
bsd-3-clause
MJuddBooth/pandas
pandas/tests/io/formats/test_to_excel.py
3
10955
"""Tests formatting as writer-agnostic ExcelCells ExcelFormatter is tested implicitly in pandas/tests/io/test_excel.py """ import pytest import pandas.util.testing as tm from pandas.io.formats.css import CSSWarning from pandas.io.formats.excel import CSSToExcelConverter @pytest.mark.parametrize('css,expected', [ ...
bsd-3-clause
fyffyt/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
248
6359
r""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, it would be better to use a robust estimator of covariance to guar...
bsd-3-clause
dmargala/lyabao
bin/inspect_deltas.py
1
9353
#!/usr/bin/env python import argparse from itertools import chain import numpy as np import numpy.ma as ma import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from scipy.optimize import minimize import h5py from tqdm import tqdm from uniform_grid import get_fiducial_pixel_index_offset from unifor...
mit
joernhees/scikit-learn
examples/svm/plot_iris.py
65
3742
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
xavierwu/scikit-learn
examples/gaussian_process/gp_diabetes_dataset.py
223
1976
#!/usr/bin/python # -*- coding: utf-8 -*- """ ======================================================================== Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset ======================================================================== In this example, we fit a Gaussian Process model onto...
bsd-3-clause
asford/depth
bin/binding_site_prediction_app.py
1
8481
# This is part of DEPTH. # DEPTH (Version: 2.0) computes the closest distance of a residue/atom to bulk solvent and predicts small molecule binding site of a protein. # Copyright (C) 2013, Kuan Pern Tan, Nguyen Thanh Binh, Raghavan Varadarajan and M.S. Madhusudhan # # DEPTH is free software: you can redistribute it a...
gpl-3.0
bikong2/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
alexeyum/scikit-learn
sklearn/tests/test_metaestimators.py
57
4958
"""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
alextag/Twitter-Sentiment-Analysis
parse_dataset.py
2
5576
import sys import string import numpy as np from pandas import read_csv from sklearn.utils import shuffle from sklearn.cross_validation import train_test_split STOP_WORDS = np.array([]) FILENAME = 'training_data.csv' # the training data csv RANDOM_SEED = 1337 def load_stopwords(): """Loads the stopwords.txt file int...
gpl-3.0
nlholdem/icodoom
.venv/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
88
31139
# 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...
gpl-3.0
ChangLab/FAST-iCLIP
bin/oldscripts/fastclip.py
2
65904
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import os import cmath import math import sys import numpy as np import glob import subprocess import re from matplotlib_venn import venn2 import pandas as pd from collections import defaultdict from operator import itemgetter import matplotlib as mpl i...
gpl-2.0
sniemi/SamPy
resolve/misc/findslits.py
1
25091
''' Fits slit image to a direct image to find x and y positions. Currently the script uses a slit image. In the future however we probably want to use the spectrum itself because there is no guarantee that a slit confirmation image has always been taken. :todo: try to do the minimalization with scipy.optmize or some ...
bsd-2-clause
jdmcbr/blaze
blaze/server/tests/test_server.py
3
13833
from __future__ import absolute_import, division, print_function import pytest pytest.importorskip('flask') from base64 import b64encode import datashape import numpy as np from datetime import datetime from pandas import DataFrame from toolz import pipe from odo import odo from blaze.utils import example from blaz...
bsd-3-clause
poeticcapybara/pythalesians
pythalesians-examples/plotly_examples.py
1
4222
__author__ = 'saeedamen' import datetime from pythalesians.market.loaders.lighttimeseriesfactory import LightTimeSeriesFactory from pythalesians.market.requests.timeseriesrequest import TimeSeriesRequest from pythalesians.timeseries.calcs.timeseriescalcs import TimeSeriesCalcs from pythalesians.graphics.graphs.plotfa...
apache-2.0
rneher/FitnessInference
toydata/figure_scripts/Fig3_polarizer.py
1
6419
import glob,sys import numpy as np sys.path.append('../../flu/src') import test_flu_prediction as test_flu import matplotlib.pyplot as plt from matplotlib import cm import analysis_utils_toy_data as AU file_formats = ['.svg', '.pdf'] plt.rcParams.update(test_flu.mpl_params) line_styles = ['-', '--', '-.'] cols = ['b...
mit
xdnian/pyml
code/optional-py-scripts/ch10.py
2
14374
# Sebastian Raschka, 2015 (http://sebastianraschka.com) # Python Machine Learning - Code Examples # # Chapter 10 - Predicting Continuous Target Variables with Regression Analysis # # S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015. # GitHub Repo: https://github.com/rasbt/python-machine-learning-book # ...
mit
maxlikely/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
4
2826
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/utils/deprecation.py
1
2418
import warnings __all__ = ["deprecated", ] class deprecated(object): """Decorator to mark a function or class as deprecated. Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argument will be appended to the deprecation mes...
mit
DonBeo/scikit-learn
sklearn/neighbors/tests/test_kde.py
13
5622
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
BBN-Q/Auspex
utils/auspex-plot-client.py
1
28017
#!/usr/bin/env python # auspex-specific implementation by Graham Rowlands # (C) 2019 Raytheon BBN Technologies # Original File: # embedding_in_qt5.py --- Simple Qt5 application embedding matplotlib canvases # # Copyright (C) 2005 Florent Rougon # 2006 Darren Dale # 2015 Jens H Nielsen # # T...
apache-2.0
JosmanPS/scikit-learn
benchmarks/bench_lasso.py
297
3305
""" Benchmarks of Lasso vs LassoLars First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of the training set. Then we plot the computation time as function of the number o...
bsd-3-clause
krez13/scikit-learn
examples/bicluster/bicluster_newsgroups.py
142
7183
""" ================================================================ Biclustering documents with the Spectral Co-clustering algorithm ================================================================ This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset. The 'comp.os.ms-windows...
bsd-3-clause
RyanChinSang/ECNG3020-ORSS4SCVI
Stable/v01/models/VideoStream.py
2
3245
import cv2 from threading import Thread class VideoStream(object): def __init__(self, src=0, height=None, width=None, ratio=None): cv2.setUseOptimized(True) self.stream = cv2.VideoCapture(src) self.config(dim=None, height=height, width=width, ratio=ratio) (self.grabbed, self.frame)...
gpl-3.0
rodrigokuroda/recominer
recominer-extractor/src/main/resources/scripts/classification.py
1
2460
porco1 = [1, 1, 0] porco2 = [1, 1, 0] porco3 = [1, 1, 0] cachorro4 = [1, 1, 1] cachorro5 = [0, 1, 1] cachorro6 = [0, 1, 1] dados = [porco1, porco2, porco3, cachorro4, cachorro5, cachorro6] marcacoes = [1, 1, 1, -1, -1, -1] import numpy as np f = open("filename.txt") f.readline() # skip the header tr...
apache-2.0
vadimtk/chrome4sdp
chrome/test/nacl_test_injection/buildbot_nacl_integration.py
94
3083
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import subprocess import sys def Main(args): pwd = os.environ.get('PWD', '') is_integration_bot = 'nacl-chrome' in ...
bsd-3-clause
lewisc/spark-tk
regression-tests/sparktkregtests/testcases/graph/graph_connected_test.py
11
2429
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
eramirem/astroML
book_figures/chapter5/fig_poisson_likelihood.py
3
4970
""" Binned Regression: Poisson vs Gaussian -------------------------------------- Figure 5.15 The left panels show data sets with 50 points, binned in 5 bins (upper panels) and 40 bins (lower panels). The curves show the input distribution (solid), the Poisson solution (dashed), and the Gaussian solution (dotted). The...
bsd-2-clause
atantet/QG4
plot/plotFP.py
1
5774
import numpy as np import matplotlib.pyplot as plt import pylibconfig2 fs_latex = 'xx-large' fs_xticklabels = 'large' fs_yticklabels = fs_xticklabels configFile = '../cfg/QG4.cfg' cfg = pylibconfig2.Config() cfg.read_file(configFile) dim = cfg.model.dim L = cfg.simulation.LCut + cfg.simulation.spinup printStepNum = ...
gpl-3.0
anurag313/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
nwillemse/nctrader
examples/rsi2.py
1
8242
#!/usr/bin/env python """ RSI2.py Standard trading system trading the 2-period RSI on SPY Created on Mon Aug 15 19:20:57 2016 @author: nwillemse """ import click import csv import pandas as pd import numpy as np from datetime import datetime from os import path, remove from collections import OrderedDict from nctr...
mit
IshankGulati/scikit-learn
sklearn/externals/joblib/__init__.py
23
5101
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
google/flax
setup.py
1
2665
# Copyright 2020 The Flax Authors. # # 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 wri...
apache-2.0
ctogle/dilapidator
src/dilap/core/qtgui.py
1
24408
#import modular4.base as mb import dilap.geometry.tools as gtl import dilap.core.base as mb import dilap.core.plotting as dtl import os,sys,numpy,matplotlib,six,multiprocessing matplotlib.rcParams['backend.qt4'] = 'PySide' matplotlib.rcParams['pdf.fonttype'] = 42 #matplotlib.use('Qt4Agg') from matplotlib.backends.back...
mit
Barmaley-exe/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
37
2901
""" 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
anewmark/galaxy_dark_matter
call2_age_lum.py
1
10505
import astropy.table as table import numpy as np from defcuts import * from defflags import * from halflight_first import * from def_get_mags import * from def_halflight_math import * from def_ages import * ty='mean' stax=True if stax==False: tag='' else: tag='uplim' txtdist= '' txtslope='' outdir='/Users/amand...
mit
rvraghav93/scikit-learn
examples/applications/plot_outlier_detection_housing.py
110
5681
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
bsd-3-clause
campagnola/acq4
acq4/analysis/tools/Fitting.py
3
36863
#!/usr/bin/env python from __future__ import print_function """ Python class wrapper for data fitting. Includes the following external methods: getFunctions returns the list of function names (dictionary keys) FitRegion performs the fitting Note that FitRegion will plot on top of the current data using MPlots routines...
mit
cogmission/nupic.research
projects/sequence_prediction/continuous_sequence/nupic_output.py
13
6732
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-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
Fireblend/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
loli/sklearn-ensembletrees
examples/plot_learning_curve.py
250
4171
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
bsd-3-clause
vortex-ape/scikit-learn
doc/conf.py
5
10156
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # 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
drericstrong/pyedna
examples/examples.py
1
1220
# -*- coding: utf-8 -*- import pandas as pd import pyedna.ezdna as dna # The following code will pull snap data from TESTPNT1 over a 30-second interval: tag = "TESTSITE.TESTSERVICE.TESTPNT1" # format site.service.tag start = "12/01/16 01:01:01" # format mm/dd/yy hh:mm:ss end = "01/03/17 01:01:01...
agpl-3.0
juhuntenburg/pipelines
src/mindwandering/resting_state_volume_analysis_group_level.py
2
27788
import nipype.pipeline.engine as pe import nipype.interfaces.io as nio import nipype.interfaces.utility as util import nipype.interfaces.fsl as fsl import os import pandas as pd from CPAC.group_analysis.group_analysis import create_group_analysis dropbox_root = "/scr/adenauer1/PowerFolder/Dropbox" regressors_file = dr...
mit
oesteban/mriqc
mriqc/classifier/sklearn/_split.py
1
4547
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # @Author: oesteban # @Date: 2017-06-14 12:47:30 import numpy as np from sklearn.utils import indexable from sklearn.model_selection import (LeavePGroupsOut,...
bsd-3-clause