repo_name stringlengths 7 92 | path stringlengths 5 149 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 911 693k | license stringclasses 15
values |
|---|---|---|---|---|---|
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactbroker/test_update_historical_duns.py | 1 | 27488 | import os
import pandas as pd
from dataactbroker.scripts import update_historical_duns
from dataactcore.config import CONFIG_BROKER
from dataactcore.utils.duns import DUNS_COLUMNS, EXCLUDE_FROM_API
from dataactcore.models.domainModels import DUNS, HistoricDUNS
def test_remove_existing_duns(database):
""" Testing... | cc0-1.0 |
pingpan2013/sensor-box-project | sensor_project/genGraphs.py | 1 | 4044 | #!/usr/bin/python
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
import pandas as pd # used to convert datetime64 to datetime
import csv
import sys
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
class Gen_Graph:
def __init__(self, _... | gpl-3.0 |
LiaoPan/scikit-learn | sklearn/preprocessing/label.py | 36 | 28728 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... | bsd-3-clause |
liberatorqjw/scikit-learn | sklearn/decomposition/tests/test_pca.py | 25 | 11108 | 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_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
Open-Power-System-Data/conventional_power_plants | download_and_process_DE_functions.py | 1 | 14757 | # -*- coding: utf-8 -*-
import urllib.parse
import urllib.request
import posixpath
import datetime
import os
import logging
import filecmp
import difflib
import json
import sqlite3
import hashlib
import yaml
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
#from bokeh.io import output_notebook
# ... | mit |
q1ang/seaborn | seaborn/tests/test_distributions.py | 14 | 8102 | import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import nose.tools as nt
import numpy.testing as npt
from numpy.testing.decorators import skipif
from . import PlotTestCase
from .. import distributions as dist
try:
import statsmodels.nonparametric.api
assert stat... | bsd-3-clause |
tuanvu216/udacity-course | intro_to_machine_learning/lesson/lesson_4_choose_your_own_algorithm/your_algorithm.py | 1 | 2628 | #!/usr/bin/python
import matplotlib.pyplot as plt
from prep_terrain_data import makeTerrainData
from class_vis import prettyPicture
from time import time
features_train, labels_train, features_test, labels_test = makeTerrainData()
### the training data (features_train, labels_train) have both "fast" and "slow" point... | mit |
jzt5132/scikit-learn | setup.py | 76 | 9370 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean ... | bsd-3-clause |
LumPenPacK/NetworkExtractionFromImages | osx_build/nefi2_osx_amd64_xcode_2015/site-packages/numpy_1.11/numpy/lib/npyio.py | 35 | 71412 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core.multiarray import packbits, unpackbits
from ._ioto... | bsd-2-clause |
seckcoder/lang-learn | python/sklearn/examples/cluster/plot_kmeans_digits.py | 3 | 4523 | """
===========================================================
A demo of K-Means clustering on the handwritten digits data
===========================================================
In this example with compare the various initialization strategies for
K-means in terms of runtime and quality of the results.
As the ... | unlicense |
amozie/amozie | studzie/keras_gym/mountain_car_v0.py | 1 | 2577 | import numpy as np
import matplotlib.pyplot as plt
import gym
import time
import copy
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Flatten, Lambda, Input, Reshape, concatenate, Merge
from keras.optimizers import Adam, RMSprop
from keras.callbacks import History
from keras imp... | apache-2.0 |
depet/scikit-learn | examples/plot_digits_classification.py | 7 | 2231 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
anntzer/scikit-learn | sklearn/linear_model/_least_angle.py | 3 | 71554 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 clause
from math import log
import sys... | bsd-3-clause |
jeffersonfparil/GTWAS_POOL_RADseq_SIM | BACKUP_SCRIPTS_20170930/assignPheno.py | 1 | 4355 | #!/usr/bin/env python
import os, subprocess, sys, math
import numpy as np
import matplotlib.pyplot as plt
work_DIR = sys.argv[1]
genoFile = sys.argv[2]
nQTL = int(sys.argv[3])
heritability = float(sys.argv[4])
model = int(sys.argv[5])
os.chdir(work_DIR)
if model == 1:
################################################... | gpl-3.0 |
suyashbire1/pyhton_scripts_mom6 | plot_twapv_budget_complete.py | 1 | 18150 | import sys
import readParams_moreoptions as rdp1
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from mom_plot1 import m6plot, xdegtokm
import numpy as np
from netCDF4 import MFDataset as mfdset, Dataset as dset
import time
from plot_twamomx_budget_complete_direct_newest import extr... | gpl-3.0 |
alexeyum/scikit-learn | sklearn/manifold/setup.py | 24 | 1279 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
doutib/lobpredict | lobpredictrst/jupyter/simple_model/create_simple_model_predict.py | 1 | 6870 |
# coding: utf-8
# # The best model parameters are given by
# ```
# author : SHAMINDRA
# data_source_dir : SC_shuffle
# test_type : validation
# model_type : RF
# RF:
# n_estimators : 100
# criterion : 'gini'
# max_features : 'auto'
# max_depth : 20
# n_jobs : 1
# SVM:
# kernel : 'rbf'
# de... | isc |
rfoxfa/python-utils | utils/plotting.py | 1 | 1798 | """
Plotting functions.
"""
from __future__ import absolute_import
import matplotlib.pyplot as plt
import numpy as np
def hhist(items, title=None, axislabel=None, color=None, height=None, width=None, reverse=False):
"""
Plots a horizontal histogram of values and frequencies.
Arguments:
items (it... | gpl-2.0 |
ClimbsRocks/scikit-learn | sklearn/utils/tests/test_validation.py | 8 | 18964 | """Tests for input validation functions"""
import warnings
from tempfile import NamedTemporaryFile
from itertools import product
import numpy as np
from numpy.testing import assert_array_equal
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from sklearn.utils.... | bsd-3-clause |
rexshihaoren/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py | 230 | 2649 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... | bsd-3-clause |
wlamond/scikit-learn | sklearn/cluster/setup.py | 79 | 1855 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
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
cblas_libs, blas_info = ... | bsd-3-clause |
levelrf/level_basestation | gr-filter/examples/fir_filter_ccc.py | 13 | 3154 | #!/usr/bin/env python
from gnuradio import gr, filter
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
try:
import scipy
except ImportError:
print "Error: could not import scipy (http://www.scipy.org/)"
sys.exit(1)
try:
import pylab
except... | gpl-3.0 |
etkirsch/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 |
Unidata/MetPy | v0.9/_downloads/8591910a2b42dadcf3b05658ddd9c600/isentropic_example.py | 2 | 7222 | # Copyright (c) 2017,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
===================
Isentropic Analysis
===================
The MetPy function `mpcalc.isentropic_interpolation` allows for isentropic analysis from model
analysis data in ... | bsd-3-clause |
del680202/MachineLearning-memo | src/tensorflow/autocoder.py | 1 | 6809 | # View more python learning tutorial on my Youtube and Youku channel!!!
# My tutorial website: https://morvanzhou.github.io/tutorials/
from __future__ import division, print_function, absolute_import
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Import MNIST data
from tensorflow.examp... | apache-2.0 |
liangz0707/scikit-learn | sklearn/feature_selection/variance_threshold.py | 238 | 2594 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstim... | bsd-3-clause |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/IPython/html/notebookapp.py | 5 | 34560 | # coding: utf-8
"""A tornado based IPython notebook server.
Authors:
* Brian Granger
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The fu... | mit |
Eric89GXL/scikit-learn | doc/sphinxext/gen_rst.py | 1 | 39133 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from time import time
import os
import re
import shutil
import traceback
import glob
import sys
from StringIO import StringIO
import ... | bsd-3-clause |
yunfeilu/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 57 | 8062 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | bsd-3-clause |
davidgbe/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
minhlongdo/scipy | scipy/integrate/odepack.py | 62 | 9420 | # Author: Travis Oliphant
from __future__ import division, print_function, absolute_import
__all__ = ['odeint']
from . import _odepack
from copy import copy
import warnings
class ODEintWarning(Warning):
pass
_msgs = {2: "Integration successful.",
1: "Nothing was done; the integration time was 0.",
... | bsd-3-clause |
lcy-seso/Paddle | python/paddle/dataset/uci_housing.py | 1 | 3748 | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 |
mindriot101/bokeh | bokeh/document/events.py | 3 | 28467 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
nkhuyu/blaze | blaze/server/server.py | 10 | 11382 | from __future__ import absolute_import, division, print_function
import socket
import functools
import re
import flask
from flask import Blueprint, Flask, request, Response
try:
from bokeh.server.crossdomain import crossdomain
except ImportError:
def crossdomain(*args, **kwargs):
def wrapper(f):
... | bsd-3-clause |
massmutual/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 103 | 22297 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
maximus009/kaggle-galaxies | try_convnet_cc_multirotflip_3x69r45_maxout2048_extradense_dup3.py | 7 | 17439 | import numpy as np
# import pandas as pd
import theano
import theano.tensor as T
import layers
import cc_layers
import custom
import load_data
import realtime_augmentation as ra
import time
import csv
import os
import cPickle as pickle
from datetime import datetime, timedelta
# import matplotlib.pyplot as plt
# plt.i... | bsd-3-clause |
shusenl/scikit-learn | sklearn/utils/extmath.py | 70 | 21951 | """
Extended math utilities.
"""
# Authors: Gael Varoquaux
# Alexandre Gramfort
# Alexandre T. Passos
# Olivier Grisel
# Lars Buitinck
# Stefan van der Walt
# Kyle Kastner
# License: BSD 3 clause
from __future__ import division
from functools import partial
import ... | bsd-3-clause |
aubreyli/hmmlearn | hmmlearn/base.py | 1 | 23398 | from __future__ import print_function
import string
import sys
from collections import deque
import numpy as np
from scipy.misc import logsumexp
from sklearn.base import BaseEstimator, _pprint
from sklearn.utils import check_array, check_random_state
from sklearn.utils.validation import check_is_fitted
from . import... | bsd-3-clause |
kyleam/seaborn | seaborn/miscplot.py | 34 | 1498 | from __future__ import division
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
def palplot(pal, size=1):
"""Plot the values in a color palette as a horizontal array.
Parameters
----------
pal : sequence of matplotlib colors
colors, i.e. as returned by seaborn.colo... | bsd-3-clause |
jas02/easybuild-easyblocks | easybuild/easyblocks/x/xmipp.py | 10 | 8904 | ##
# Copyright 2015-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
CDSFinance/zipline | zipline/utils/cli.py | 10 | 8343 | #
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
liyu1990/sklearn | sklearn/svm/classes.py | 7 | 40216 | 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 |
alexeyum/scikit-learn | sklearn/neighbors/tests/test_neighbors.py | 3 | 46375 | from itertools import product
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn import metrics
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.... | bsd-3-clause |
hsiaoyi0504/scikit-learn | doc/conf.py | 210 | 8446 | # -*- 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 |
jmschrei/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 |
xiaoxiamii/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
00krishna-research/py_university_gender_dynamics_pkg | tests/test_pyugend.py | 1 | 8479 | import pytest
from models.Models import Base_model
from models.Basic_stochastic_model import Basic_stochastic_model
from models.Stochastic_model_with_promotion import Stochastic_model_with_promotion
from models.Replication_model import Replication_model
from models.Stochastic_model_with_promotion_and_first_hiring impor... | mit |
thomasaarholt/hyperspy | hyperspy/drawing/signal.py | 4 | 4534 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
NunoEdgarGub1/scikit-learn | sklearn/kernel_ridge.py | 155 | 6545 | """Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression."""
# Authors: Mathieu Blondel <mathieu@mblondel.org>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
import numpy as np
from .base import BaseEstimator, RegressorMixin
from .metrics.pairwise import pairwise... | bsd-3-clause |
iemejia/incubator-beam | sdks/python/apache_beam/dataframe/convert_test.py | 1 | 2180 | #
# 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 us... | apache-2.0 |
gotomypc/scikit-learn | sklearn/neighbors/base.py | 115 | 29783 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | bsd-3-clause |
RegulatoryGenomicsUPF/pyicoteo | pyicoteolib/enrichment.py | 1 | 40209 | """
Pyicoteo 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 option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY... | gpl-3.0 |
tardis-sn/tardis | tardis/plasma/properties/nlte.py | 1 | 10502 | import logging
import os
import numpy as np
import pandas as pd
from tardis.plasma.properties.base import (
PreviousIterationProperty,
ProcessingPlasmaProperty,
)
from tardis.plasma.properties.ion_population import PhiSahaNebular
__all__ = [
"PreviousElectronDensities",
"PreviousBetaSobolev",
"He... | bsd-3-clause |
bionet/ted.python | demos/iaf_delay_demo.py | 1 | 3443 | #!/usr/bin/env python
"""
Demos of MIMO time encoding and decoding algorithms that use IAF
neurons with delays.
"""
# Copyright (c) 2009-2015, Lev Givon
# All rights reserved.
# Distributed under the terms of the BSD license:
# http://www.opensource.org/licenses/bsd-license
import numpy as np
# Set matplotlib backe... | bsd-3-clause |
rahuldhote/scikit-learn | sklearn/feature_extraction/hashing.py | 183 | 6155 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: BSD 3 clause
import numbers
import numpy as np
import scipy.sparse as sp
from . import _hashing
from ..base import BaseEstimator, TransformerMixin
def _iteritems(d):
"""Like d.iteritems, but accepts any collections.Mapping."""
return d.iteritems() if... | bsd-3-clause |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Static_Normal_Contact/Normal_Behviour/SoftContact_NonLinHardSoftShear/plot.py | 1 | 1585 | #!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import sys
import numpy as np;
################ Node # 2 Displacement #############################
#######################################
## Analytical Solution
#######################################
finput = h5py.File('Analytical_Solution.feioutput')
... | cc0-1.0 |
CVML/scikit-learn | sklearn/feature_extraction/tests/test_image.py | 205 | 10378 | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn... | bsd-3-clause |
hakujyo/chessplaying_robot | matchpicture.py | 1 | 1381 |
import cv2
import numpy as np
import time
from matplotlib import pyplot as plt
x = 0
y = 0
def makematchpicture(Grayurl):
img = cv2.imread(Grayurl, 0)
img2 = img.copy()
template = cv2.imread('test.png', 0)
w, h = template.shape[::-1]
methods = ['cv2.TM_SQDIFF']
for me... | gpl-3.0 |
GoogleCloudPlatform/ml-on-gcp | tutorials/sklearn/hpsearch/gke_parallel.py | 1 | 16248 | # Copyright 2017, Google Inc. 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 applicable law or ... | apache-2.0 |
jjx02230808/project0223 | examples/decomposition/plot_ica_vs_pca.py | 306 | 3329 | """
==========================
FastICA on 2D point clouds
==========================
This example illustrates visually in the feature space a comparison by
results using two different component analysis techniques.
:ref:`ICA` vs :ref:`PCA`.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA... | bsd-3-clause |
ishank08/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | 394 | 1770 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal, assert_almost_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([T... | bsd-3-clause |
phobson/seaborn | seaborn/algorithms.py | 3 | 4233 | """Algorithms to support fitting routines in seaborn plotting functions."""
from __future__ import division
import numpy as np
from scipy import stats
import warnings
from .external.six import string_types
from .external.six.moves import range
def bootstrap(*args, **kwargs):
"""Resample one or more arrays with re... | bsd-3-clause |
emdodds/LCAversions | timing.py | 1 | 3230 | #This file will time various versions of LCA
from __future__ import division
import numpy as np
import sklearn.preprocessing as skp
from timeit import default_timer as timer
from LCAnumpy import lca as lcan
from LCAfortran import lca as lcaf
from LCAnumbaprog import lca as lcag
def main():
"""Profiles various ver... | mit |
simon-pepin/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
bikong2/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 259 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
wathen/PhD | MHD/FEniCS/MHD/Stabilised/Precond/MHDstabtest.py | 1 | 11477 | #!/usr/bin/python
# interpolate scalar gradient onto nedelec space
from dolfin import *
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
Print = PETSc.Sys.Print
# from MatrixOperations import *
import numpy as np
#import matplotlib.pylab as plt
import PETScIO as IO
import common
import ... | mit |
anmolshkl/oppia-ml | decision_tree.py | 1 | 1354 | from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import metrics
from sklearn import tree
import numpy as np
import os
import random
import timeit
import yaml
import load_data
import utilities
def main():
# Load data
X_train,... | apache-2.0 |
jadhavhninad/-CSE_515_MWD_Analytics- | Phase 3/Phase3_code/matrix_factorization_recommender.py | 2 | 3728 | from mysqlConn import DbConnect
import argparse
from numpy import *
import operator
import pandas as pd
#DB connector and curosor
db = DbConnect()
db_conn = db.get_connection()
cur2 = db_conn.cursor();
#Argument parser
parser = argparse.ArgumentParser()
parser.add_argument("USER")
args = parser.parse_args()
#====... | gpl-3.0 |
ml31415/numpy-groupies | numpy_groupies/benchmarks/simple.py | 1 | 4248 | #!/usr/bin/python -B
# -*- coding: utf-8 -*-
from __future__ import print_function
import timeit
import numpy as np
from numpy_groupies.utils import aliasing
from numpy_groupies import aggregate_py, aggregate_np, aggregate_ufunc
from numpy_groupies.aggregate_pandas import aggregate as aggregate_pd
def aggregate_gr... | bsd-2-clause |
NunoEdgarGub1/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/finance.py | 69 | 20558 | """
A collection of modules for collecting, analyzing and plotting
financial data. User contributions welcome!
"""
#from __future__ import division
import os, time, warnings
from urllib import urlopen
try:
from hashlib import md5
except ImportError:
from md5 import md5 #Deprecated in 2.5
try: import dateti... | gpl-3.0 |
IndraVikas/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 |
aavanian/bokeh | sphinx/source/docs/user_guide/examples/categorical_heatmap_unemployment.py | 11 | 1638 | import pandas as pd
from bokeh.io import output_file, show
from bokeh.models import BasicTicker, ColorBar, ColumnDataSource, LinearColorMapper, PrintfTickFormatter
from bokeh.plotting import figure
from bokeh.sampledata.unemployment1948 import data
from bokeh.transform import transform
output_file("unemploymemt.html"... | bsd-3-clause |
aarora79/sb_study | common/utils.py | 1 | 12780 | # -*- coding: utf-8 -*-
import os
import string
import json
import pandas as pd
import numpy as np
from scipy.stats.stats import pearsonr
from dateutil.parser import parse
from common import globals as glob
SPECIAL_CHARS = string.punctuation.replace("_", "")
SPECIAL_CHARS = string.punctuation.replace("-", "")
SPECIAL_... | mit |
Merinorus/adaisawesome | Homework/02 - Data from the Web/Question 2.py | 1 | 14839 |
# coding: utf-8
# Obtain all the data for the Master students, starting from 2007. Compute how many months it took each master student to complete their master, for those that completed it. Partition the data between male and female students, and compute the average -- is the difference in average statistically signi... | gpl-3.0 |
cowlicks/odo | odo/backends/tests/test_ssh.py | 5 | 5764 | from __future__ import absolute_import, division, print_function
import pytest
paramiko = pytest.importorskip('paramiko')
import pandas as pd
import numpy as np
import re
import os
import sys
from odo.utils import tmpfile, filetext
from odo.directory import _Directory, Directory
from odo.backends.ssh import SSH, res... | bsd-3-clause |
shyamalschandra/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
Erotemic/hotspotter | _scripts/k_reciprocal_nearest_neighbors.py | 2 | 4308 | import sys
import os
import pyflann
import params
import numpy as np
import draw_func2 as df2
import helpers
np.random.seed(5)
# Parameters
tdim = 2; # Target viewing dimensions
dim = 2; # Calculation dimension
if len(sys.argv) == 2:
tdim = int(sys.argv[1])
dim = int(sys.argv[1])
K = 4;
checks ... | apache-2.0 |
krez13/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
DougFirErickson/neon | examples/conv_autoencoder.py | 3 | 2945 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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
#
# ... | apache-2.0 |
neutrons/Licorne-Py | UI-playground/layerplot.py | 1 | 2806 | from __future__ import (absolute_import, division, print_function)
from PyQt5 import QtCore, QtWidgets
import sys
import numpy as np
from layer import Layer, MSLD
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
import... | gpl-3.0 |
gameduell/dask | dask/utils.py | 1 | 30745 | from __future__ import absolute_import, division, print_function
import codecs
import functools
import inspect
import io
import math
import os
import re
import shutil
import struct
import sys
import tempfile
from errno import ENOENT
from collections import Iterator
from contextlib import contextmanager
from importlib ... | bsd-3-clause |
benoitsteiner/tensorflow | tensorflow/examples/learn/text_classification.py | 39 | 5106 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
ashhher3/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
aetilley/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py | 230 | 2649 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... | bsd-3-clause |
andyh616/mne-python | mne/viz/tests/test_ica.py | 7 | 6812 | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
import os.path as op
import warnings
from numpy.testing import assert_raises
from mne import io, read_events, Epochs, read_cov
from mne import pick_types
from mne.u... | bsd-3-clause |
mattilyra/scikit-learn | sklearn/tests/test_pipeline.py | 23 | 15392 | """
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
from sklearn.utils.testing import assert_raises_regex
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert... | bsd-3-clause |
mcdeaton13/dynamic | Data/Calibration/Firm Calibration/parameters/depreciation/processing/read_inventories.py | 4 | 4135 | '''
-------------------------------------------------------------------------------
Last updated 5/26/2015
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Packages
---------------------------------------... | mit |
niketanpansare/systemml | scripts/perftest/python/google_docs/stats.py | 15 | 3540 | #!/usr/bin/env python3
# -------------------------------------------------------------
#
# 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 ... | apache-2.0 |
cuttlefishh/emp | code/01-metadata/metadata_template_generator.py | 1 | 4911 | #!/usr/bin/env python
import click
import pandas as pd
import re
# Hard-coded variables
investigation_type = 'metagenome'
# Function: return dataframe of environmental package-specific metadata items
# A single environmental package (soil) or list can be provided (soil,water).
def show_items_of_env_pkg(df_env_pkg, l... | bsd-3-clause |
srinathv/vispy | examples/basics/plotting/mpl_plot.py | 14 | 1579 | # -*- coding: utf-8 -*-
# vispy: testskip
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ----------------------------------------------------------------------------... | bsd-3-clause |
ChinaQuants/bokeh | bokeh/compat/bokeh_renderer.py | 2 | 17762 | "Supporting objects and functions to convert Matplotlib objects into Bokeh."
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.t... | bsd-3-clause |
stganser/polyite | src/polyite/fitness/scikit_learn/init.py | 1 | 2788 | from enum import Enum
import csv
import math
from sklearn import tree
from sklearn.ensemble import RandomForestClassifier
class LearningAlgorithms(Enum):
cart = 0,
random_forest = 1
class RandomForestsConfig:
def __init__(self, n_tree, max_features):
self.n_tree = n_tree
self.max_feature... | mit |
gfyoung/pandas | pandas/tests/io/test_clipboard.py | 2 | 8079 | from textwrap import dedent
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, get_option, read_clipboard
import pandas._testing as tm
from pandas.io.clipboard import clipboard_get, clipboard_set
def build_kwargs(sep, excel):
kwargs = {}
if excel != "default":
kwargs... | bsd-3-clause |
hurdlea/SimpleCV | SimpleCV/Shell/Shell.py | 10 | 7838 | #!/usr/bin/python
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# SimpleCV
# a kinder, gentler machine vision python library
#-----------------------------------------------------------------------
# SimpleCV is an interface for Open Source machine
# vision libraries in Python.
# It provides... | bsd-3-clause |
huobaowangxi/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
datalyze-solutions/pandas-qt | doc/source/conf.py | 4 | 9477 | # -*- coding: utf-8 -*-
#
# pandas-qt documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 14 15:32:14 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.
#
#... | mit |
SANDAG/pandana | pandana/loaders/tests/test_osm.py | 3 | 6664 | import numpy.testing as npt
import pandas.util.testing as pdt
import pytest
import pandana
from pandana.loaders import osm
from pandana.testing import skipiftravis
@pytest.fixture(scope='module')
def bbox1():
# Intersection of Telegraph and Haste in Berkeley
# Sample query: http://overpass-turbo.eu/s/6AK
... | agpl-3.0 |
jandom/rdkit | rdkit/Chem/Draw/UnitTestSimilarityMaps.py | 1 | 7019 | # $Id$
#
# Copyright (c) 2013, Novartis Institutes for BioMedical Research Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above c... | bsd-3-clause |
fengzhe29888/gnuradio-old | gr-digital/examples/example_costas.py | 49 | 5316 | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... | gpl-3.0 |
bnaul/scikit-learn | examples/preprocessing/plot_all_scaling.py | 14 | 13721 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============================================================
Compare the effect of different scalers on data with outliers
=============================================================
Feature 0 (median income in a block) and feature 5 (number of households) of
the :... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.