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 |
|---|---|---|---|---|---|
vybstat/scikit-learn | examples/model_selection/plot_roc_crossval.py | 247 | 3253 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... | bsd-3-clause |
ocefpaf/cartopy | lib/cartopy/mpl/feature_artist.py | 1 | 8451 | # (C) British Crown Copyright 2011 - 2019, 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 |
alvarofierroclavero/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 162 | 9771 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises_regexp
... | bsd-3-clause |
trankmichael/scikit-learn | sklearn/linear_model/tests/test_sparse_coordinate_descent.py | 244 | 9986 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | bsd-3-clause |
yuanagain/seniorthesis | venv/lib/python2.7/site-packages/scipy/cluster/hierarchy.py | 18 | 95902 | """
========================================================
Hierarchical clustering (:mod:`scipy.cluster.hierarchy`)
========================================================
.. currentmodule:: scipy.cluster.hierarchy
These functions cut hierarchical clusterings into flat clusterings
or find the roots of the forest f... | mit |
ChanderG/scikit-learn | sklearn/utils/validation.py | 66 | 23629 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals i... | bsd-3-clause |
jmetzen/scikit-learn | examples/plot_isotonic_regression.py | 303 | 1767 | """
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data. The
isotonic regression finds a non-decreasing approximation of a function
while minimizing the mean squared error on the training data. The benefit
of such a model is that it does not assume a... | bsd-3-clause |
snario/geopandas | geopandas/tools/overlay.py | 9 | 5713 | from shapely.ops import unary_union, polygonize
from shapely.geometry import MultiLineString
import pandas as pd
from geopandas import GeoDataFrame, GeoSeries
def _uniquify(columns):
ucols = []
for col in columns:
inc = 1
newcol = col
while newcol in ucols:
inc += 1
... | bsd-3-clause |
mohamed--abdel-maksoud/chromium.src | 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 |
spallavolu/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 72 | 25573 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
ephes/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 |
mmottahedi/neuralnilm_prototype | scripts/e184.py | 4 | 6808 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy, mse... | mit |
pandegroup/osprey | osprey/execute_currentbest.py | 3 | 1935 | from __future__ import print_function
import numpy as np
from .config import Config
from .trials import Trial
from sklearn.pipeline import Pipeline
def execute(args, parser):
config = Config(args.config, verbose=False)
session = config.trials()
items = [curr.to_dict() for curr in session.query(Trial).a... | apache-2.0 |
FRBs/FRB | frb/tests/test_finder.py | 2 | 1536 | # TESTS FOR FINDER CHARTS
import pytest
import numpy as np
import os
import matplotlib
from distutils.spawn import find_executable
from astropy.coordinates import SkyCoord
from astropy import units
from astropy.wcs import WCS
from astropy.io import fits
from frb.figures import finder
remote_data = pytest.mark.rem... | bsd-3-clause |
endolith/scikit-image | skimage/viewer/canvastools/recttool.py | 43 | 8886 | from matplotlib.widgets import RectangleSelector
from ...viewer.canvastools.base import CanvasToolBase
from ...viewer.canvastools.base import ToolHandles
__all__ = ['RectangleTool']
class RectangleTool(CanvasToolBase, RectangleSelector):
"""Widget for selecting a rectangular region in a plot.
After making ... | bsd-3-clause |
burakbayramli/classnotes | tser/tser_100_macro/get_data.py | 2 | 2470 | import pandas as pd, datetime, os
from pandas_datareader import data
#####
start=datetime.datetime(1970, 1, 1)
end=datetime.datetime(2018, 5, 1)
df = data.DataReader(['CRDQUSAPABIS','REALLN','CRDQJPAPABIS','JPNRGDPEXP','GDPC1','EXJPUS','MYAGM2USM052S','MYAGM2USM052S'], 'fred', start, end)
df.columns = ['nonfinloanus',... | gpl-3.0 |
bonus85/csv-analytics | simple.py | 1 | 1557 | # -*- coding: utf-8 -*-
import process_data
from matplotlib import pyplot as plt
file_name = 'test.csv' # Pass på å bruke riktig datasett
analyzer = process_data.PowerConsumptionAnalyzer(file_name)
# analyzer.write_max('test_worksheet')
# analyzer.close_wb()
month = analyzer.get_month(2013, 2)
sorted_month = mont... | gpl-3.0 |
mehdidc/scikit-learn | examples/linear_model/plot_lasso_model_selection.py | 311 | 5431 | """
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... | bsd-3-clause |
akionakamura/scikit-learn | examples/applications/svm_gui.py | 287 | 11161 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
ElDeveloper/scikit-learn | sklearn/tests/test_pipeline.py | 29 | 15239 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn... | bsd-3-clause |
huongttlan/statsmodels | statsmodels/examples/ex_emplike_1.py | 34 | 3682 | """
This is a basic tutorial on how to conduct basic empirical likelihood
inference for descriptive statistics. If matplotlib is installed
it also generates plots.
"""
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
print('Welcome to El')
np.random.seed(634) # No significance o... | bsd-3-clause |
jpfairbanks/Matfacgrf | examples/caida.py | 1 | 1420 | #caida.py: this program converts pcap data from CAIDA into a sparse matrix COO format
# it can also write the transformed_pcap data to stdout
#Author: James Fairbanks
#Date: 2014-04-04 16:54
import scipy as sp
import scipy.io as spio
import pandas as pd
import numpy as np
from sys import stdin
from sys import stdout
... | bsd-2-clause |
bsipocz/bokeh | examples/app/stock_applet/stock_app.py | 42 | 7786 | """
This file demonstrates a bokeh applet, which can either be viewed
directly on a bokeh-server, or embedded into a flask application.
See the README.md file in this directory for instructions on running.
"""
import logging
logging.basicConfig(level=logging.DEBUG)
from os import listdir
from os.path import dirname,... | bsd-3-clause |
adamgreenhall/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
kunalj101/scipy2015-blaze-bokeh | viz2.py | 12 | 4846 | # -*- coding: utf-8 -*-
import math
from collections import OrderedDict
import numpy as np
import pandas as pd
import netCDF4
from bokeh.plotting import figure, show, output_notebook
from bokeh.models import DatetimeTickFormatter, ColumnDataSource, HoverTool, Plot, Range1d
from bokeh.palettes import RdBu11
from bokeh... | mit |
rocio/rethinkdb | bench/format/plot.py | 6 | 30777 | # Copyright 2010-2012 RethinkDB, all rights reserved.
import os, sys
import numpy as np
import matplotlib as mpl
mpl.use('Agg') # can't use tk since we don't have X11
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.font_manager as fm
import matplotlib.gridspec as gridspec
from matplotli... | agpl-3.0 |
mojolab/LivingData | lib/livdatcube.py | 1 | 13850 | import os,sys,pandas
sys.path.append("/opt/SoMA/python/lib")
from libsoma import *
import pygsheets
from bs4 import BeautifulSoup
from tabulate import tabulate
def get_worksheet_names(ssheet):
sheetnames=[]
for ws in ssheet.worksheets():
sheetnames.append(ws.title)
return sheetnames
def get_as_dict(df):
i... | apache-2.0 |
IssamLaradji/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
raghavrv/scikit-learn | benchmarks/bench_covertype.py | 30 | 7393 | """
===========================
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 |
Achuth17/scikit-learn | examples/cluster/plot_lena_ward_segmentation.py | 271 | 1998 | """
===============================================================
A demo of structured Ward hierarchical clustering on Lena image
===============================================================
Compute the segmentation of a 2D image with Ward hierarchical
clustering. The clustering is spatially constrained in order
... | bsd-3-clause |
loli/semisupervisedforests | sklearn/linear_model/bayes.py | 23 | 15086 | """
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 |
LUTAN/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_functions.py | 26 | 1490 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
AntoineRiaud/Tweezer_design | Tweezer_design/geometry1.py | 1 | 23720 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 15 12:25:02 2016
@author[code]: Antoine Riaud
@coauthors: Michael Baudoin, Jean-Louis Thomas, Olivier Bou Matar
IEMN - Institut d'Electronique, Microelectronique et Nanotechnologies
INSP - Institut des Nanosciences de Paris
"""
#function summary
# Default_pro... | gpl-3.0 |
lfairchild/PmagPy | setup.py | 1 | 7846 | import sys
if sys.version_info < (3,):
raise Exception("""
You are running Python {}.
This version of pmagpy is only compatible with Python 3.
Make sure you have pip ≥ 9.0 to avoid this kind of issue,
as well as setuptools ≥ 24.2:
$ pip install pip setuptools --upgrade
Then you should be able to download the cor... | bsd-3-clause |
yask123/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gram... | bsd-3-clause |
alexis-jacq/Mutual_Modelling | tools/cowriter_simu.py | 1 | 10099 | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import random
from mutualModelling import model,agent
import matplotlib.pyplot as plt
import copy
def child(name,all_names):
percepts = ["convergence","tablet","robot_head","noise","look_tablet","look_child_head","look_noise"]
actions = ["demo","punish"... | isc |
ANNarchy/ANNarchy | examples/pyNN/AEIF_cond_exp.py | 2 | 1644 | # ANNarchy - AEIF_cond_exp
#
# Adaptive exponential integrate-and-fire model.
#
# http://www.scholarpedia.org/article/Adaptive_exponential_integrate-and-fire_model
#
# Introduced in
#
# Brette R. and Gerstner W. (2005), Adaptive Exponential Integrate-and-Fire Model as an Effective Description of Neuronal Activi... | gpl-2.0 |
OrganicDreamer/gillespie-translation-asRNA | partial-queue-sweep/plot-inf-sweep.py | 1 | 11800 | import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
# array to store steady state queue length over each iteration:
plot_queue_len = np.array([])
# store average flux of ribosomes in/out of queue at steady state:
plot_ribo_flux = np.array([])
# store deterministic prediction of... | gpl-3.0 |
intel-analytics/analytics-zoo | pyzoo/zoo/orca/learn/pytorch/pytorch_ray_estimator.py | 1 | 17478 | #
# Copyright 2018 Analytics Zoo 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... | apache-2.0 |
FluVigilanciaBR/fludashboard | fludashboard/libs/calc_flu_alert.py | 2 | 4410 | """
"""
# local
from .migration import dataset_id as dataset_id_list
from .flu_data import FluDB
import numpy as np
import pandas as pd
contingency_name_from_id = {
1: 'Nível basal',
2: 'Nível 0',
3: 'Nível 1',
4: 'Nível 2',
}
db = FluDB()
def get_season_level(se):
"""
:param se: pd.Seri... | gpl-3.0 |
bmcfee/crema | training/chords/03-evaluate.py | 1 | 2151 | #!/usr/bin/env python
'''CREMA structured chord model'''
import argparse
import sys
import os
import pandas as pd
from tqdm import tqdm
from joblib import Parallel, delayed
import jams
import crema
import crema.utils
OUTPUT_PATH = 'resources'
def process_arguments(args):
parser = argparse.ArgumentParser(des... | bsd-2-clause |
driver-pete/driver-pete-python-sandbox | driver_pete_python_sandbox/process.py | 1 | 2968 |
import os
import cv2
from driver_pete_python_sandbox.filter_gps import extract_delta_time, compute_velocities, \
extract_delta_dist, delta_float_time
from driver_pete_python_sandbox.gmaps import get_static_google_map, \
trajectory_point_to_str, show_path
from driver_pete_python_sandbox.trajectory_reader impo... | apache-2.0 |
GBTAmmoniaSurvey/GAS | ah_bootstrap.py | 31 | 36163 | """
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | mit |
xzh86/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
anthrotype/freetype-py | examples/glyph-metrics.py | 4 | 7724 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# ----------------------------------------------------------... | bsd-3-clause |
draperjames/qtpandas | qtpandas/views/CSVDialogs.py | 1 | 24711 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import super
from builtins import map
from builtins import str
from future import standard_library
standard_library.install_aliases()... | mit |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/sklearn/feature_extraction/image.py | 21 | 17610 | """
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... | mit |
BiaDarkia/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 10 | 9453 | """
Test the fastica algorithm.
"""
import itertools
import warnings
import numpy as np
from scipy import stats
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
... | bsd-3-clause |
treycausey/scikit-learn | examples/applications/plot_model_complexity_influence.py | 1 | 6361 | """
==========================
Model Complexity Influence
==========================
Demonstrate how model complexity influences both prediction accuracy and
computational performance.
The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for
regression (resp. classification).
For each class of models we m... | bsd-3-clause |
yw374cornell/e-mission-server | emission/analysis/intake/segmentation/trip_segmentation_methods/dwell_segmentation_time_filter.py | 1 | 14163 | # Standard imports
import logging
import attrdict as ad
import numpy as np
import pandas as pd
import datetime as pydt
# Our imports
import emission.analysis.point_features as pf
import emission.analysis.intake.segmentation.trip_segmentation as eaist
import emission.core.wrapper.location as ecwl
class DwellSegmentati... | bsd-3-clause |
socolofs/tamoc | bin/ambient/profile_append.py | 1 | 6072 | """
Append data to an existing CTD Profile dataset
==============================================
Use the TAMOC ambient module to append data to a CTD Profile object that has
already been created as in the other examples in this ./bin director. This
file demonstrates working with the data from the R/V Brooks McCall at... | mit |
pxzhang94/GAN | GAN/conditional_gan/cgan_tensorflow.py | 1 | 3786 | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True)
mb_size = 64
Z_dim = 100
X_dim = mnist.train.images.shape[1]
y_dim ... | apache-2.0 |
SGenheden/Scripts | Projects/Solvation/plot_correlations.py | 1 | 6070 | # Author: Samuel Genheden samuel.genheden@gmail.com
"""
Program to plot the correlation between calculated and experimental free energies
Examples:
plot_correlations.py -xls raw.xlsx -solvents hexane octane nonane hexanol octanol nonanol water
"""
import argparse
import os
import openpyxl as xl
import numpy as np... | mit |
wdurhamh/statsmodels | statsmodels/sandbox/nonparametric/tests/ex_gam_am_new.py | 34 | 2606 | # -*- coding: utf-8 -*-
"""Example for gam.AdditiveModel and PolynomialSmoother
This example was written as a test case.
The data generating process is chosen so the parameters are well identified
and estimated.
Created on Fri Nov 04 13:45:43 2011
Author: Josef Perktold
"""
from __future__ import print_function
fro... | bsd-3-clause |
taohaoge/vincent | examples/map_examples.py | 11 | 6721 | # -*- coding: utf-8 -*-
"""
Vincent Map Examples
"""
#Build a map from scratch
from vincent import *
world_topo = r'world-countries.topo.json'
state_topo = r'us_states.topo.json'
lake_topo = r'lakes_50m.topo.json'
county_geo = r'us_counties.geo.json'
county_topo = r'us_counties.topo.json'
or_topo = r'or_counties.t... | mit |
GoogleCloudPlatform/professional-services-data-validator | tests/unit/result_handlers/test_text.py | 1 | 1315 | # Copyright 2020 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 |
TomAugspurger/pandas | pandas/tests/test_errors.py | 2 | 1678 | import pytest
from pandas.errors import AbstractMethodError
import pandas as pd # noqa
@pytest.mark.parametrize(
"exc",
[
"UnsupportedFunctionCall",
"UnsortedIndexError",
"OutOfBoundsDatetime",
"ParserError",
"PerformanceWarning",
"DtypeWarning",
"Emp... | bsd-3-clause |
schets/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
paladin74/neural-network-animation | matplotlib/tests/test_backend_qt4.py | 10 | 4092 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six import unichr
from matplotlib import pyplot as plt
from matplotlib.testing.decorators import cleanup
from matplotlib.testing.decorators import knownfailureif
from matplotlib._pylab_helpers i... | mit |
rbalda/neural_ocr | env/lib/python2.7/site-packages/scipy/interpolate/fitpack2.py | 39 | 61117 | """
fitpack --- curve and surface fitting with splines
fitpack is based on a collection of Fortran routines DIERCKX
by P. Dierckx (see http://www.netlib.org/dierckx/) transformed
to double routines by Pearu Peterson.
"""
# Created by Pearu Peterson, June,August 2003
from __future__ import division, print_function, abs... | mit |
rohanp/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py | 65 | 5529 | """
Testing for the gradient boosting loss functions and initial estimators.
"""
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.utils import check_random_state
from ... | bsd-3-clause |
markgw/pimlico | src/python/pimlico/modules/sklearn/logistic_regression/info.py | 1 | 1912 | # This file is part of Pimlico
# Copyright (C) 2020 Mark Granroth-Wilding
# Licensed under the GNU LGPL v3.0 - https://www.gnu.org/licenses/lgpl-3.0.en.html
"""
Provides an interface to `Scikit-Learn's <http://scikit-learn.org/stable/>`_ simple
`logistic regression <scikit-learn.org/stable/modules/generated/sklearn.li... | gpl-3.0 |
cainiaocome/scikit-learn | doc/datasets/mldata_fixture.py | 367 | 1183 | """Fixture module to skip the datasets loading when offline
Mock urllib2 access to mldata.org and create a temporary data folder.
"""
from os import makedirs
from os.path import join
import numpy as np
import tempfile
import shutil
from sklearn import datasets
from sklearn.utils.testing import install_mldata_mock
fr... | bsd-3-clause |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/indexes/multi.py | 7 | 83666 |
# pylint: disable=E1101,E1103,W0232
import datetime
import warnings
from functools import partial
from sys import getsizeof
import numpy as np
import pandas.lib as lib
import pandas.index as _index
from pandas.lib import Timestamp
from pandas.compat import range, zip, lrange, lzip, map
from pandas.compat.numpy impor... | apache-2.0 |
mmottahedi/neuralnilm_prototype | scripts/e424.py | 2 | 7035 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
grlurton/hiv_retention_metrics | src/models/data_cohort_description.py | 1 | 3138 | import pandas as pd
import src.models.cohort_analysis_function as caf
import matplotlib.pyplot as plt
import numpy as np
from datetime import timedelta
import ipyparallel
import subprocess
import os
%matplotlib inline
data = pd.read_csv('data/processed/complete_data.csv')
facilities_list = list(data.facility.unique()... | mit |
sivu22/nltk-on-gae | GAE/nltk/probability.py | 5 | 80992 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Probability and Statistics
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (additions)
# Trevor Cohn <tacohn@cs.mu.oz.au> (additions)
# Peter Ljunglöf <pete... | apache-2.0 |
dandanvidi/in-vivo-enzyme-kinetics | scripts/kapp_by_gr.py | 3 | 3355 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 18 17:00:01 2015
@author: dan
"""
import sys, os
sys.path.append(os.path.expanduser('~/git/kvivo_max/scripts/'))
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
import sys, os
from collections import defaultdict
... | mit |
Sentient07/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 63 | 6459 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
Achuth17/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
bmazin/ARCONS-pipeline | examples/Pal2014_landoltPhot/plot3DImage.py | 1 | 2014 | import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from sdssgaussfitter import twodgaussian
#rawfile = '/home/srmeeker/scratch/standards/Landolt9542_raw_0.npz'
#rawfile = '/home/srmeeker/scratch/standards/pg0220a_raw_0.npz'
rawfile = '/home/srmeeker/s... | gpl-2.0 |
annashcherbina/FASTQSim | FASTQsim_2.0_OLD/src/plotSpiked.py | 2 | 12005 | #code to plot background dataset statistics, linear regression curves, and spiked read statistics.
#stores data to be plotted, while code is executing.
#When code execution is complete, generates plot of background data,
#curve fit, and in silico-generated spiked reads.
import matplotlib.pyplot as plt;
class ... | gpl-3.0 |
Cortexelus/librosa | librosa/display.py | 1 | 22801 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Display
=======
.. autosummary::
:toctree: generated/
specshow
waveplot
cmap
TimeFormatter
NoteFormatter
ChromaFormatter
"""
import warnings
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import Formatter, Fixed... | isc |
UQ-UQx/edx-platform_lti | docs/en_us/platform_api/source/conf.py | 12 | 6815 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# pylint: disable=redefined-builtin
# pylint: disable=protected-access
# pylint: disable=unused-argument
import os
from path import path
import sys
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append('../../../../')
from docs.shared.conf impo... | agpl-3.0 |
bbfrederick/rapidtide | rapidtide/disabledtests/xtest_spectrogram.py | 1 | 9711 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2016-2019 Blaise Frederick
#
# 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/LICEN... | apache-2.0 |
mhdella/scikit-learn | examples/cluster/plot_digits_agglomeration.py | 377 | 1694 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Feature agglomeration
=========================================================
These images how similar features are merged together using
feature agglomeration.
"""
print(__doc__)
# Code source: Gaël Varoquaux
#... | bsd-3-clause |
jasonbunk/NBodyGalaxySimulation | run_two_plummer_collision.py | 1 | 2238 | import os
import math
import numpy as np
from PlummerGalaxy import PlummerGalaxy
from InitialConditions import InitialConditions
import imp
try:
imp.find_module('matplotlib')
matplotlibAvailable = True
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
except ImportError:
matplo... | gpl-3.0 |
erikness/AlephOne | zipline/transforms/ta.py | 6 | 8006 | #
# Copyright 2013 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 |
wanglei828/apollo | modules/tools/plot_planning/imu_acc.py | 1 | 4004 | #!/usr/bin/env python
###############################################################################
# Copyright 2019 The Apollo 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 ... | apache-2.0 |
Titan-C/scikit-learn | doc/conf.py | 10 | 9807 | # -*- 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 |
tomlof/scikit-learn | benchmarks/bench_mnist.py | 5 | 6793 | """
=======================
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 |
lixun910/pysal | pysal/explore/esda/join_counts.py | 1 | 7019 | """
Spatial autocorrelation for binary attributes
"""
__author__ = "Sergio J. Rey <srey@asu.edu> , Luc Anselin <luc.anselin@asu.edu>"
from pysal.lib.weights.spatial_lag import lag_spatial
from .tabular import _univariate_handler
import numpy as np
__all__ = ['Join_Counts']
PERMUTATIONS = 999
class Join_Counts(obj... | bsd-3-clause |
ShawnMurd/MetPy | examples/gridding/Wind_SLP_Interpolation.py | 8 | 4425 | # Copyright (c) 2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Wind and Sea Level Pressure Interpolation
=========================================
Interpolate sea level pressure, as well as wind component data,
to make a consistent loo... | bsd-3-clause |
rubikloud/scikit-learn | sklearn/covariance/robust_covariance.py | 105 | 29653 | """
Robust location and covariance estimators.
Here are implemented estimators that are resistant to outliers.
"""
# Author: Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import linalg
from scipy.stats import chi2
from . import empir... | bsd-3-clause |
TiedNets/TiedNets | geo_com_map_parser.py | 1 | 3652 | __author__ = 'Agostino Sturaro'
import os
import json
import networkx as nx
import matplotlib.pyplot as plt
try:
import Queue as Q # ver. < 3.0
except ImportError:
import queue as Q
subs_G = nx.Graph()
final_G = nx.Graph()
lines_by_id = dict()
point_to_id = dict()
com_lines_fpath = os.path.normpath('temp/d... | gpl-3.0 |
navrasio/mxnet | example/gluon/dcgan.py | 7 | 8812 | # 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 |
btabibian/scikit-learn | examples/gaussian_process/plot_gpr_noisy_targets.py | 64 | 3706 | """
=========================================================
Gaussian Processes regression: basic introductory example
=========================================================
A simple one-dimensional regression example computed in two different ways:
1. A noise-free case
2. A noisy case with known noise-level per ... | bsd-3-clause |
ephes/scikit-learn | sklearn/svm/classes.py | 126 | 40114 | import warnings
import numpy as np
from .base import _fit_liblinear, BaseSVC, BaseLibSVM
from ..base import BaseEstimator, RegressorMixin
from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \
LinearModel
from ..feature_selection.from_model import _LearntSelectorMixin
from ..utils import check_X... | bsd-3-clause |
K-Mike/fish_data_processing | fish_recognition.py | 1 | 2307 | import os
import imageio
from tqdm import tqdm
import shutil
import pandas as pd
import glob
from .utils import train_dir, test_dir
translate_dict = {'species_fourspot': 0,
'species_grey sole': 1,
'species_other': 2,
'species_plaice': 3,
'specie... | mit |
fhellander/digit-recognition-SVHN | SVHN_preprocessing.py | 1 | 5243 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 16 13:15:54 2017
@author: fhellander
"""
import numpy as np
import random
import matplotlib.pyplot as plt
import h5py
import cPickle as pickle
from scipy import misc, ndimage
from PIL import Image
import os
#FUNCTIONS
#Function to read digitstr... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/signal/windows/windows.py | 2 | 73495 | """The suite of window functions."""
from __future__ import division, print_function, absolute_import
import operator
import warnings
import numpy as np
from scipy import fftpack, linalg, special
from scipy._lib.six import string_types
__all__ = ['boxcar', 'triang', 'parzen', 'bohman', 'blackman', 'nuttall',
... | gpl-3.0 |
nelson-liu/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 43 | 10272 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
lihui7115/ChromiumGStreamerBackend | chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py | 39 | 11336 | #!/usr/bin/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.
"""Do all the steps required to build and test against nacl."""
import optparse
import os.path
import re
import shutil
import subproc... | bsd-3-clause |
rsignell-usgs/notebook | WMS/sciwms_ncwms_comparison.py | 1 | 3407 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# Performance of sci-wms and ncwms for curvilinear grid data
# <codecell>
%matplotlib inline
from IPython.core.display import Image
# <headingcell level=3>
# Let's see if we can get ncwms and sci-wms maps that look the same from COAWST out... | mit |
vivekmishra1991/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 |
garywu/pypedream | performance_tests/__init__.py | 1 | 4490 | from matplotlib.pyplot import *
import _foo_bar_baz
import _line_numbering
import _min
import _csv_corr_prune
import _col_mean
import _binary_corr
import _binary_corr_trunc
import _binary_corr_prune
import _csv_mean
class _Plotter(object):
def __init__(self, xlabel_, ylabel_):
clf()
xlabel(xlabel... | bsd-3-clause |
tardis-sn/tardis | tardis/io/config_reader.py | 1 | 16981 | import os
import logging
import copy
import pprint
import yaml
import pandas as pd
from astropy import units as u
import tardis
from tardis.io import config_validator
from tardis.io.util import YAMLLoader, yaml_load_file, HDFWriterMixin
from tardis.io.parsers.csvy import load_yaml_from_csvy
pp = pprint.PrettyPrinter(... | bsd-3-clause |
ChrisBeaumont/brut | scripts/calc_corr.py | 2 | 29259 | #================================================================================
# Title: Angular correlation and auto-correlation function for bubbles and YSOs
# Authors: S. Kendrew, Max Planck Institute for Astronomy, Heidelberg, 2012
#================================================================================
... | mit |
LindaLS/Sausage_Biscuits | architecture/tests/3_test/train.py | 1 | 6062 | # Example implementing 5 layer encoder
# Original code taken from
# https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/autoencoder.py
# The model trained here is restored in load.py
from __future__ import division, print_function, absolute_import
# Import MNIST data
# from tens... | gpl-3.0 |
rcrowder/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/colors.py | 69 | 31676 | """
A module for converting numbers or color arguments to *RGB* or *RGBA*
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
range 0-1.
This module includes functions and classes for color specification
conversions, and for mapping numbers to colors in a 1-D array of
colors called a colormap. Color... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.