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 |
|---|---|---|---|---|---|
abhishekgahlot/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 10 | 9541 | 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 |
ibmsoe/tensorflow | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 153 | 6723 | # 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 |
ClinicalGraphics/scikit-image | doc/examples/transform/plot_swirl.py | 6 | 2647 | """
=====
Swirl
=====
Image swirling is a non-linear image deformation that creates a whirlpool
effect. This example describes the implementation of this transform in
``skimage``, as well as the underlying warp mechanism.
Image warping
-------------
When applying a geometric transformation on an image, we typically ... | bsd-3-clause |
belltailjp/scikit-learn | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
mfjb/scikit-learn | examples/mixture/plot_gmm.py | 248 | 2817 | """
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians with EM
and variational Dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... | bsd-3-clause |
iskandr/immuno | Jan28.py | 1 | 2473 | import numpy as np
import sklearn
import sklearn.cross_validation
import sklearn.ensemble
import sklearn.linear_model
import data
import amino_acid
import iedb
import reduced_alphabet
def run_classifiers(X,Y):
lr = sklearn.linear_model.LogisticRegression()
print "LR Accuracy", np.mean(sklearn.cross_validatio... | gpl-2.0 |
jorik041/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 230 | 4762 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
jrversteegh/softsailor | deps/numpy-1.6.1/numpy/core/function_base.py | 82 | 5474 | __all__ = ['logspace', 'linspace']
import numeric as _nx
from numeric import array
def linspace(start, stop, num=50, endpoint=True, retstep=False):
"""
Return evenly spaced numbers over a specified interval.
Returns `num` evenly spaced samples, calculated over the
interval [`start`, `stop` ].
Th... | gpl-3.0 |
ywcui1990/nupic.research | projects/capybara/anomaly_detection/run_models.py | 6 | 4879 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
verdurin/bcbio-nextgen | bcbio/variation/validateplot.py | 3 | 10483 | """Plot validation results from variant calling comparisons.
Handles data normalization and plotting, emphasizing comparisons on methodology
differences.
"""
import collections
import os
import numpy as np
import pandas as pd
try:
import matplotlib as mpl
mpl.use('Agg', force=True)
import matplotlib.pypl... | mit |
xavierwu/scikit-learn | examples/svm/plot_svm_nonlinear.py | 268 | 1091 | """
==============
Non-linear SVM
==============
Perform binary classification using non-linear SVC
with RBF kernel. The target to predict is a XOR of the
inputs.
The color map illustrates the decision function learned by the SVC.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn imp... | bsd-3-clause |
MoonRaker/pvlib-python | pvlib/tmy.py | 2 | 27655 | """
Import functions for TMY2 and TMY3 data files.
"""
import logging
pvl_logger = logging.getLogger('pvlib')
import re
import datetime
import dateutil
import io
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
import pandas as pd
import numpy as np
from pvlib import t... | bsd-3-clause |
rrohan/scikit-learn | examples/linear_model/plot_lasso_and_elasticnet.py | 249 | 1982 | """
========================================
Lasso and Elastic Net for Sparse Signals
========================================
Estimates Lasso and Elastic-Net regression models on a manually generated
sparse signal corrupted with an additive noise. Estimated coefficients are
compared with the ground-truth.
"""
print(... | bsd-3-clause |
fbagirov/scikit-learn | sklearn/manifold/tests/test_spectral_embedding.py | 216 | 8091 | from nose.tools import assert_true
from nose.tools import assert_equal
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_raises
from nose.plugins.skip import SkipTest
from sk... | bsd-3-clause |
GarmanGroup/RABDAM | rabdam/Subroutines/checkDependencies.py | 1 | 4041 |
# RABDAM
# Copyright (C) 2020 Garman Group, University of Oxford
# This file is part of RABDAM.
# RABDAM 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... | lgpl-3.0 |
specdb/specdb | specdb/tests/test_scripts.py | 1 | 1499 | # Module to run tests on scripts
import matplotlib
matplotlib.use('agg') # For Travis
# TEST_UNICODE_LITERALS
import pytest
import os
from astropy.table import Table
from ..scripts import grab_meta
from ..scripts import plot_specdb
from ..scripts import sdss_spec
#version = 'v01'
version = 'v02'
def data_path(... | gpl-3.0 |
exa-analytics/exatomic | exatomic/formula.py | 2 | 2582 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2020, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Simple Formula
##################
"""
import numpy as np
import pandas as pd
from .core.error import StringFormulaError
from exatomic.base import isotopes, sym2mass
... | apache-2.0 |
amolkahat/pandas | asv_bench/benchmarks/pandas_vb_common.py | 4 | 1122 | import os
from importlib import import_module
import numpy as np
# Compatibility import for lib
for imp in ['pandas._libs.lib', 'pandas.lib']:
try:
lib = import_module(imp)
break
except (ImportError, TypeError, ValueError):
pass
numeric_dtypes = [np.int64, np.int32, np.uint32, np.uint... | bsd-3-clause |
rs2/pandas | pandas/tests/test_aggregation.py | 4 | 2772 | import numpy as np
import pytest
from pandas.core.aggregation import _make_unique_kwarg_list, maybe_mangle_lambdas
def test_maybe_mangle_lambdas_passthrough():
assert maybe_mangle_lambdas("mean") == "mean"
assert maybe_mangle_lambdas(lambda x: x).__name__ == "<lambda>"
# don't mangel single lambda.
a... | bsd-3-clause |
stiphyMT/plantcv | plantcv/plantcv/__init__.py | 1 | 6188 | import os
import matplotlib
from plantcv.plantcv.fatal_error import fatal_error
from plantcv.plantcv.classes import Params
from plantcv.plantcv.classes import Outputs
from plantcv.plantcv.classes import Spectral_data
# Initialize an instance of the Params and Outputs class with default values
# params and outputs are a... | mit |
kazemakase/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 |
lorenzo-desantis/mne-python | examples/visualization/plot_clickable_image.py | 6 | 2324 | """
================================================================
Demonstration of how to use ClickableImage / generate_2d_layout.
================================================================
In this example, we open an image file, then use ClickableImage to
return 2D locations of mouse clicks (or load a file a... | bsd-3-clause |
pypot/scikit-learn | examples/decomposition/plot_sparse_coding.py | 247 | 3846 | """
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... | bsd-3-clause |
mczerwinski/elephant | setup.py | 3 | 1274 | # -*- coding: utf-8 -*-
from setuptools import setup
long_description = open("README.rst").read()
install_requires = ['neo>0.3.3',
'numpy>=1.6.2',
'quantities>=0.9.0',
'scipy>=0.11.0']
extras_require = {'pandas': ['pandas>=0.14.0'],
'docs':... | bsd-3-clause |
ssaeger/scikit-learn | benchmarks/bench_plot_parallel_pairwise.py | 297 | 1247 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import time
import pylab as pl
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
def plot(func):
random_state = check_random_state(0)
... | bsd-3-clause |
aajtodd/zipline | zipline/modelling/engine.py | 7 | 15401 | """
Compute Engine for FFC API
"""
from abc import (
ABCMeta,
abstractmethod,
)
from operator import and_
from six import (
iteritems,
itervalues,
with_metaclass,
)
from six.moves import (
reduce,
zip_longest,
)
from numpy import (
add,
empty_like,
)
from pandas import (
DataFra... | apache-2.0 |
moutai/scikit-learn | sklearn/datasets/svmlight_format.py | 19 | 16759 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
davidgbe/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
oceanzus/ooi-ui-services | ooiservices/app/uframe/plotting.py | 2 | 15564 | #!/usr/bin/env python
'''
ooiservices/app/main/plotting.py
Support for generating svg plots
'''
from flask import request
from netCDF4 import num2date
from ooiservices.app.uframe.plot_tools import OOIPlots
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import io
import numpy as np
import prettyplotl... | apache-2.0 |
victorbergelin/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
MartinSavc/scikit-learn | sklearn/grid_search.py | 32 | 36586 | """
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... | bsd-3-clause |
NigelCleland/vSPUD | docs/conf.py | 1 | 9164 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# au... | bsd-3-clause |
lobnek/pyutil | test/test_mongo/test_engine/test_symbol.py | 1 | 2124 | import pytest
import pandas.testing as pt
import pandas as pd
from pyutil.mongo.engine.symbol import Symbol, Group
from test.config import *
@pytest.fixture()
def group():
Group.objects.delete()
return Group(name="US Equity").save()
@pytest.fixture()
def symbol(group):
Symbol.objects.delete()
symb... | mit |
gwaygenomics/pancancer | scripts/initialize/process_sample_freeze.py | 1 | 4486 | """
Gregory Way 2017
PanCancer Classifier
scripts/initialize/process_sample_freeze.py
Takes in sample freeze data that was determined by TCGA PanCancer Atlas
consortium along with raw RNAseq and mutation data. The script will process
the datasets and subset each according to the frozen samples. The frozen
samples were... | bsd-3-clause |
oemof/examples | oemof_examples/oemof.solph/v0.2.x/basic_example/basic_example.py | 2 | 8501 | # -*- coding: utf-8 -*-
"""
General description
-------------------
A basic example to show how to model a simple energy system with oemof.solph.
The following energy system is modeled:
input/output bgas bel
| | | |
| | ... | gpl-3.0 |
Achuth17/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
lancezlin/ml_template_py | lib/python2.7/site-packages/pandas/io/tests/parser/quoting.py | 7 | 5796 | # -*- coding: utf-8 -*-
"""
Tests that quoting specifications are properly handled
during parsing for all of the parsers defined in parsers.py
"""
import csv
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.compat import PY3, StringIO, u
class QuotingTests(object):
def test_bad_quote_... | mit |
pizzathief/scipy | scipy/signal/_arraytools.py | 21 | 7489 | """
Functions for acting on a axis of an array.
"""
import numpy as np
def axis_slice(a, start=None, stop=None, step=None, axis=-1):
"""Take a slice along axis 'axis' from 'a'.
Parameters
----------
a : numpy.ndarray
The array to be sliced.
start, stop, step : int or None
The slic... | bsd-3-clause |
ywcui1990/nupic.research | projects/nlp/run_tm_learning.py | 11 | 5601 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | agpl-3.0 |
poryfly/scikit-learn | examples/ensemble/plot_gradient_boosting_regression.py | 227 | 2520 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the Boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... | bsd-3-clause |
ClimbsRocks/scikit-learn | examples/text/document_clustering.py | 42 | 8335 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
JayKickliter/gr-ieee802-15-4 | apps/sensor_gui/sensor_window.py | 5 | 4552 | import time
import numpy as np
from types import *
import signal
import gtk, gobject
import gtk.glade
gtk.gdk.threads_init()
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.path as path
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as Figure... | gpl-3.0 |
466152112/scikit-learn | sklearn/linear_model/tests/test_perceptron.py | 378 | 1815 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_raises
from sklearn.utils import check_random_state
from sklearn.datasets import load_iris
from sklearn.linear_model import Pe... | bsd-3-clause |
yanlend/scikit-learn | sklearn/ensemble/__init__.py | 217 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
flaviovdf/tribeflow | scripts/bipartite-it.py | 2 | 1698 | #-*- coding: utf8
from __future__ import division, print_function
from statsmodels.distributions.empirical_distribution import ECDF
import matplotlib
#matplotlib.use('Agg')
import sys
import argparse
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def main():
parser = argparse.ArgumentPar... | bsd-3-clause |
adrinjalali/Network-Classifier | run.py | 1 | 13694 | from sklearn import cross_validation as cv
import sklearn.metrics
import sklearn.ensemble
import sklearn.tree
import uuid
import Raccoon.core.raccoon
import RatBoost.ratboost
import graph_tool as gt
import pickle
from collections import defaultdict
import os
import pandas
from misc import *
from rat import *
def add... | gpl-3.0 |
arjoly/scikit-learn | examples/ensemble/plot_feature_transformation.py | 9 | 4327 | """
===============================================
Feature transformations with ensembles of trees
===============================================
Transform your features into a higher dimensional, sparse space. Then
train a linear model on these features.
First fit an ensemble of trees (totally random trees, a rand... | bsd-3-clause |
larrybradley/astropy | astropy/modeling/utils.py | 5 | 28585 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides utility functions for the models package.
"""
# pylint: disable=invalid-name
from collections import deque, UserDict
from collections.abc import MutableMapping
from inspect import signature
import numpy as np
import warnings
from... | bsd-3-clause |
jenshnielsen/basemap | examples/plotmap.py | 4 | 2043 | # make plot of etopo bathymetry/topography data on
# lambert conformal conic map projection, drawing coastlines, state and
# country boundaries, and parallels/meridians.
# the data is interpolated to the native projection grid.
from mpl_toolkits.basemap import Basemap, shiftgrid
import numpy as np
import matplotlib.p... | gpl-2.0 |
neuroidss/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_pdf.py | 69 | 71773 | # -*- coding: iso-8859-1 -*-
"""
A PDF matplotlib backend (not yet complete)
Author: Jouni K Seppänen <jks@iki.fi>
"""
from __future__ import division
import os
import re
import sys
import time
import warnings
import zlib
import numpy as npy
from cStringIO import StringIO
from datetime import datetime
from math impo... | agpl-3.0 |
alphaBenj/zipline | zipline/pipeline/loaders/utils.py | 5 | 15156 | import datetime
import numpy as np
import pandas as pd
from zipline.pipeline.common import TS_FIELD_NAME, SID_FIELD_NAME
from zipline.utils.numpy_utils import categorical_dtype
from zipline.utils.pandas_utils import mask_between_time
def is_sorted_ascending(a):
"""Check if a numpy array is sorted."""
return ... | apache-2.0 |
tosolveit/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 |
lbishal/scikit-learn | sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | bsd-3-clause |
arcoslab/llars | depth_calc/tests/LIDAR.py | 1 | 4677 | #!/usr/bin/python
from PIL import Image
import os
import matplotlib.pyplot as plt
import sys
from PyQt4 import QtGui,QtCore
import datetime
#try:
# import RPi.GPIO as GPIO
#except:
# print "Try running as sudo... for GPIO library"
def write2file(hola, nombre):
if type(hola) == list:
f = open( nombre +".txt", ... | gpl-3.0 |
valentinmetraux/hierophis | hierophis/plot/colors/defined.py | 1 | 13310 | #!/usr/bin/env python
# -*- coding: utf 8 -*-
"""
Initialize the library.
:copyright: 2015 - Geo2X - VM
:license: Apache 2.0
"""
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
def viridis():
# Used to reconstruct the colormap in pycam02ucs.cm.viscm
parameters = {'xp': [22.67... | apache-2.0 |
hainm/scikit-learn | sklearn/cluster/tests/test_k_means.py | 132 | 25860 | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | bsd-3-clause |
evgchz/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 |
airbnb/superset | superset/examples/random_time_series.py | 3 | 2925 | # 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 |
cosmicBboy/Urbanscape | underDev/update.py | 1 | 5862 | '''
Module defining update state for the UrbanScape class
'''
import numpy as np
#==============================
# |
# UrbanScape Update Methods |
# |
#==============================
#------------------------------------------------
# Methods for updating agents in the UrbanScape |
#----... | mit |
procoder317/scikit-learn | examples/model_selection/plot_roc.py | 96 | 4487 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
GeoODK/onadata | onadata/apps/viewer/tests/test_pandas_mongo_bridge.py | 3 | 29754 | import csv
import os
from tempfile import NamedTemporaryFile
from django.utils.dateparse import parse_datetime
from django.core.urlresolvers import reverse
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.logger.models.xform import XForm
from onadata.apps.logger.xform_instance_parser import xf... | bsd-2-clause |
nrz/ylikuutio | external/bullet3/examples/pybullet/examples/testrender.py | 2 | 5973 | #testrender.py is a bit slower than testrender_np.py: pixels are copied from C to Python one by one
import matplotlib.pyplot as plt
import pybullet
import pybullet as p
import time
import numpy as np #to reshape for matplotlib
plt.ion()
img = [[1, 2, 3] * 50] * 100 #np.random.rand(200, 320)
#img = [tandard_normal(... | agpl-3.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/factorization/python/ops/gmm_test.py | 44 | 8747 | # 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... | mit |
spbguru/repo1 | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py | 70 | 4184 | """
Render to gtk from agg
"""
from __future__ import division
import os
import matplotlib
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
show, draw_if_interactive,\
error_ms... | gpl-3.0 |
macks22/scikit-learn | sklearn/linear_model/omp.py | 127 | 30417 | """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 |
linegpe/FYS3150 | Project4/plot_accepted.py | 1 | 1926 | import numpy as np
import matplotlib.pyplot as plt
data1 = np.loadtxt("accepted_random_T1.dat")
#data1 = np.loadtxt("accepted.dat")
data2 = np.loadtxt("accepted_ordered_T1.dat")
data3 = np.loadtxt("accepted_random_T2_4.dat")
data4 = np.loadtxt("accepted_ordered_T2_4.dat")
randomT1 = data1[0::5]
orederedT1 = data2[0::... | gpl-3.0 |
hackrflov/BilibiliCrawler | analyst/video.py | 1 | 4384 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
File Name: video.py
Date: 08/18/2017
Author: hackrflov
Email: hackrflov@gmail.com
Python Version: 2.7
"""
import sys
from datetime import datetime as dt
import numpy as np
from pymongo import UpdateOne
from sklearn import linear_model, svm
import matpl... | mit |
thp44/delphin_6_automation | delphin_6_automation/sampling/sim_time_prediction.py | 1 | 10260 | __author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import copy
import pandas as pd
import numpy as np
import typing
from sklearn.model_selection import ShuffleSplit, cross_... | mit |
louispotok/pandas | pandas/compat/numpy/__init__.py | 5 | 2336 | """ support numpy compatiblitiy across versions """
import re
import numpy as np
from distutils.version import LooseVersion
from pandas.compat import string_types, string_and_binary_types
# numpy versioning
_np_version = np.__version__
_nlv = LooseVersion(_np_version)
_np_version_under1p10 = _nlv < LooseVersion('1.1... | bsd-3-clause |
devanshdalal/scikit-learn | sklearn/linear_model/tests/test_huber.py | 54 | 7619 | # Authors: Manoj Kumar mks542@nyu.edu
# License: BSD 3 clause
import numpy as np
from scipy import optimize, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_a... | bsd-3-clause |
SeverTopan/AdjSim | examples/comparative_advantage/simulation.py | 1 | 12067 | """Comparative Advantage Simulation
Illustrates the phenomenon of Ricardian Comparative Advantage in a free market trading environment.
See https://en.wikipedia.org/wiki/Comparative_advantage.
"""
# Standard.
import sys
import os
import copy
import math
# Third party.
import numpy as np
from adjsim import analysis, ... | gpl-3.0 |
RPGOne/Skynet | scikit-learn-0.18.1/sklearn/utils/tests/test_murmurhash.py | 79 | 2849 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from sklearn.utils.testing import ... | bsd-3-clause |
ryfeus/lambda-packs | LightGBM_sklearn_scipy_numpy/source/sklearn/tests/test_calibration.py | 64 | 12999 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
from __future__ import division
import numpy as np
from scipy import sparse
from sklearn.model_selection import LeaveOneOut
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
... | mit |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/pandas/compat/__init__.py | 9 | 24832 | """
compat
======
Cross-compatible functions for Python 2 and 3.
Key items to import for 2/3 compatible code:
* iterators: range(), map(), zip(), filter(), reduce()
* lists: lrange(), lmap(), lzip(), lfilter()
* unicode: u() [u"" is a syntax error in Python 3.0-3.2]
* longs: long (int in Python 3)
* callable
* iterab... | artistic-2.0 |
DSLituiev/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
dilawar/moose-full | moose-examples/snippets/IntegrateFireZoo.py | 2 | 9349 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#/**********************************************************************
#** This program is part of 'MOOSE', the
#** Messaging Object Oriented Simulation Environment.
#** Copyright (C) 2003-2014 Upinder S. Bhalla. and NCBS
#** It is made available under the terms... | gpl-2.0 |
asimshankar/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 15 | 77825 | # 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 |
huzq/scikit-learn | sklearn/datasets/_base.py | 4 | 40708 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import shutil
from collections import namedtuple... | bsd-3-clause |
superphy/backend | app/middleware/modellers.py | 1 | 2252 | # We try to keep all model creation in this file so it's easier to reference.
import pandas as pd
from middleware.graphers.turtle_utils import actual_filename
def model_serotype(pi, pl, output_file):
"""
Creates a list from ECTYper's serotyping output.
"""
# Read the vanilla output_file from ECTyper.
... | apache-2.0 |
ahoyosid/scikit-learn | examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py | 252 | 3490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
==============================================================================
Gaussian Processes classification example: exploiting the probabilistic output
==============================================================================
A two-dimensional regression exerci... | bsd-3-clause |
ai-se/Transfer-Learning | src/RQ1_3.py | 1 | 4195 | """
Compare XTREE with other threshold based learners.
"""
from __future__ import print_function, division
import os
import sys
# Update path
root = os.path.join(os.getcwd().split('src')[0], 'src')
if root not in sys.path:
sys.path.append(root)
from planners.XTREE import xtree
from planners.alves import alves
f... | unlicense |
ibm-cds-labs/pixiedust | pixiedust/display/chart/renderers/matplotlib/scatterPlotDisplay.py | 1 | 1789 | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | apache-2.0 |
MohammedWasim/scikit-learn | sklearn/discriminant_analysis.py | 32 | 27308 | """
Linear Discriminant Analysis and Quadratic Discriminant Analysis
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
from __future__ import print_function
import warnings
import numpy as np
from scipy import linalg
from .extern... | bsd-3-clause |
sogis/Quantum-GIS | python/plugins/processing/algs/qgis/BarPlot.py | 12 | 3018 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BarPlot.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | gpl-2.0 |
nguyentu1602/statsmodels | examples/python/tsa_filters.py | 34 | 4559 |
## Time Series Filters
from __future__ import print_function
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
dta = sm.datasets.macrodata.load_pandas().data
index = pd.Index(sm.tsa.datetools.dates_from_range('1959Q1', '2009Q3'))
print(index)
dta.index = index
del dta['year']
del... | bsd-3-clause |
0x0all/scikit-learn | sklearn/metrics/cluster/unsupervised.py | 10 | 8105 | """ Unsupervised evaluation metrics. """
# Authors: Robert Layton <robertlayton@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ..pairwise import pairwise_distances
def silhouette_score(X, labels, metric='euclidean', sample_size=None,
random... | bsd-3-clause |
Eomys/MoSQITo | mosqito/validations/loudness_zwicker/validation_loudness_zwicker_stationary.py | 1 | 7038 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 15:17:12 2020
@author: wantysal
"""
# Third party imports
import numpy as np
import matplotlib.pyplot as plt
# Local application imports
from mosqito.functions.loudness_zwicker.comp_loudness import comp_loudness
from mosqito.functions.loudness_zwicker.loudness_zwick... | apache-2.0 |
zifeo/nest-simulator | testsuite/manualtests/test_tsodyks_depr_fac.py | 13 | 1136 | # -*- coding: utf-8 -*-
#
# test_tsodyks_depr_fac.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the L... | gpl-2.0 |
zorroblue/scikit-learn | sklearn/tests/test_learning_curve.py | 33 | 12840 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
mohazahran/Detecting-anomalies-in-user-trajectories | scripts/view_topics.py | 1 | 2151 | #-*- coding: utf8
from __future__ import division, print_function
from statsmodels.distributions.empirical_distribution import ECDF
import matplotlib
#matplotlib.use('Agg')
import argparse
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def main():
#parser = argparse.ArgumentParser()
... | bsd-3-clause |
wdurhamh/statsmodels | statsmodels/tsa/descriptivestats.py | 33 | 2304 | # -*- coding: utf-8 -*-
"""Descriptive Statistics for Time Series
Created on Sat Oct 30 14:24:08 2010
Author: josef-pktd
License: BSD(3clause)
"""
import numpy as np
from . import stattools as stt
#todo: check subclassing for descriptive stats classes
class TsaDescriptive(object):
'''collection of descriptive ... | bsd-3-clause |
taknevski/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 153 | 6723 | # 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 |
rasilab/ferrin_elife_2017 | scripts/customize_matplotlib.py | 1 | 1273 | '''Custom matplotlib functions'''
fontsize = {'paper': 8, 'presentation': 12}
def clean_axis(ax, spineoffset=['left', 'bottom']):
'''Clean current matplotlib axis
* Remove top and right lines
* Offset left and bottom spines by 5pt
ax: handle to axis
keyword arguments:
spineoffset: Either ['lef... | gpl-3.0 |
soylentdeen/cuddly-weasel | MCTesting/model.py | 5 | 4896 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import emcee
import triangle
import numpy as np
import matplotlib.pyplot as pl
import george
from george import kernels
def model(params, t):
amp, loc, sig2 = params
return amp * np.exp(-0.5 * (t - loc) ** 2 / sig... | mit |
nelango/ViralityAnalysis | model/lib/pandas/sandbox/qtpandas.py | 13 | 4347 | '''
Easy integration of DataFrame into pyqt framework
@author: Jev Kuznetsov
'''
# GH9615
import warnings
warnings.warn("The pandas.sandbox.qtpandas module is deprecated and will be "
"removed in a future version. We refer users to the external package "
"here: https://github.com/datalyze... | mit |
nikitasingh981/scikit-learn | sklearn/preprocessing/tests/test_imputation.py | 51 | 12300 |
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_false
from sklearn.preprocessing.imputation import Imputer
from sklearn.pipeline imp... | bsd-3-clause |
TaikiGoto/master | ch06/hyperparameter_optimization.py | 3 | 2750 | # coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
import matplotlib.pyplot as plt
from dataset.mnist import load_mnist
from common.multi_layer_net import MultiLayerNet
from common.util import shuffle_dataset
from common.trainer import Trainer
(x_train, t_train), ... | mit |
evanbiederstedt/RRBSfun | epiphen/normalCll4.py | 2 | 10731 | import glob
import pandas as pd
import numpy as np
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
pcell = glob.glob("binary_position_RRBS_NormalBCD19pCD27pcell*")
print(len(pcell))
cw154cell = glob.glob("binary_position_RRBS_cw154*")
print(len(cw154cell))
totalfiles = pc... | mit |
equialgo/scikit-learn | examples/ensemble/plot_gradient_boosting_quantile.py | 392 | 2114 | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
import matplotlib.pyplot as plt
from skle... | bsd-3-clause |
YinongLong/scikit-learn | examples/svm/plot_svm_scale_c.py | 19 | 5409 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.