repo_name stringlengths 7 79 | path stringlengths 4 179 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 959 798k | license stringclasses 15
values |
|---|---|---|---|---|---|
glorizen/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/transforms.py | 69 | 75638 | """
matplotlib includes a framework for arbitrary geometric
transformations that is used determine the final position of all
elements drawn on the canvas.
Transforms are composed into trees of :class:`TransformNode` objects
whose actual value depends on their children. When the contents of
children change, their pare... | agpl-3.0 |
agartland/utils | ics/.ipynb_checkpoints/plotting-checkpoint.py | 1 | 12289 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import palettable
import itertools
from hclusterplot import plotHCluster
import re
from myboxplot import myboxplot
import networkx as nx
import seaborn as sns
sns.set(style='darkgrid', palette='muted', font_scale=1.5)
__all__ = ['icsTicks',
... | mit |
HolgerPeters/scikit-learn | examples/ensemble/plot_forest_iris.py | 335 | 6271 | """
====================================================================
Plot the decision surfaces of ensembles of trees on the iris dataset
====================================================================
Plot the decision surfaces of forests of randomized trees trained on pairs of
features of the iris dataset.
... | bsd-3-clause |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/pandas/core/series.py | 9 | 95521 | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import division
# pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
import types
import warnings
from numpy import nan, ndarray
import numpy as np
import numpy.ma as ma
from pandas.core.common import (i... | gpl-2.0 |
Limags/MissionPlanner | Lib/site-packages/numpy/lib/twodim_base.py | 70 | 23431 | """ Basic functions for manipulating 2d arrays
"""
__all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu',
'tril','vander','histogram2d','mask_indices',
'tril_indices','tril_indices_from','triu_indices','triu_indices_from',
]
from numpy.core.numeric import asanyarr... | gpl-3.0 |
dsm054/pandas | pandas/tests/arrays/categorical/test_repr.py | 2 | 25897 | # -*- coding: utf-8 -*-
import numpy as np
from pandas.compat import PY3, u
from pandas import (
Categorical, CategoricalIndex, Series, date_range, period_range,
timedelta_range)
from pandas.core.config import option_context
from pandas.tests.arrays.categorical.common import TestCategorical
class TestCateg... | bsd-3-clause |
dopplershift/MetPy | examples/gridding/Point_Interpolation.py | 6 | 5187 | # Copyright (c) 2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Point Interpolation
===================
Compares different point interpolation approaches.
"""
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from matplotlib.col... | bsd-3-clause |
lenovor/scikit-learn | sklearn/calibration.py | 137 | 18876 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
MJJoyce/climate | mccsearch/code/mainProgTemplate.py | 5 | 4713 | #
# 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 n... | apache-2.0 |
samehuman/fast-rcnn | lib/roi_data_layer/minibatch.py | 44 | 7337 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
impor... | mit |
rhyolight/nupic.research | projects/lateral_pooler/src/run_experiment.py | 4 | 11174 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
msaffarm/DeepRetina | util/readImages.py | 1 | 9874 | # A helper function to read and manipulate retianl images
# import tensorflow as tf
import numpy as np
import random
import os
import sys
from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
# wrap_counting
from wrap_counting import sampler
UNET_PATH = os.getcwd() + "/../"
sys.path.append... | gpl-3.0 |
h2oai/h2o-3 | h2o-py/tests/testdir_algos/kmeans/pyunit_iris_h2o_vs_sciKmeans.py | 8 | 1469 | from __future__ import print_function
from builtins import zip
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import numpy as np
from sklearn.cluster import KMeans
from h2o.estimators.kmeans import H2OKMeansEstimator
def iris_h2o_vs_sciKmeans():
# Con... | apache-2.0 |
victorbergelin/scikit-learn | sklearn/kernel_approximation.py | 258 | 17973 | """
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps base on Fourier transforms.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import svd
from .base im... | bsd-3-clause |
ZENGXH/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
nkhuyu/FTRLp | FTRLp.py | 1 | 31158 | from __future__ import division
from __future__ import print_function
"""
------------ Follow The Regularized Leader - Proximal ------------
FTRL-P is an online classification algorithm that combines both L1 and L2
norms, particularly suited for large data sets with extremely high dimensionality.
This implementatio... | mit |
Garrett-R/scikit-learn | sklearn/decomposition/tests/test_dict_learning.py | 40 | 7535 | import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises
... | bsd-3-clause |
dingocuster/scikit-learn | sklearn/neural_network/rbm.py | 206 | 12292 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
nutils/nutils | tests/test_docs.py | 2 | 3723 | import doctest as _doctest, unittest, importlib, os, tempfile, pathlib, functools, warnings, subprocess, sys, treelog
import nutils.testing
_doctestlog = treelog.FilterLog(treelog.StdoutLog(), minlevel=1)
class DocTestCase(nutils.testing.ContextTestCase, _doctest.DocTestCase):
def __init__(self, test, *, requires=... | mit |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/scipy/stats/_distn_infrastructure.py | 7 | 119504 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy._lib.six import string_types, exec_, PY3
from scipy._lib._util import getargspec_no_self as _getargspec
import sys
import keyword
import r... | apache-2.0 |
TheWeiTheTruthAndTheLight/senior-design | src/spark/ml.py | 1 | 2970 | import pickle
import warnings
from copy import deepcopy
from datetime import datetime
from itertools import islice, tee
from os import listdir
from random import shuffle
import numpy as np
from nlp import *
from sklearn.ensemble import VotingClassifier
from sklearn.feature_extraction import DictVectorizer
from sklearn... | mit |
ashtonwebster/tl_algs | tests/test_tnb_paperexample.py | 1 | 1149 | # coding: utf-8
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
import random
from tl_algs import tnb
RAND_SEED = 2016
random.seed(RAND_SEED) # change this to see new random data!
"""
This example is taken from the paper [1]. Not all results are the same
due to arithmetic e... | mit |
solin319/incubator-mxnet | docs/conf.py | 23 | 6968 | # 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 |
robcarver17/pysystemtrade | sysobjects/production/timed_storage.py | 1 | 8184 | from copy import copy
import datetime
import pandas as pd
from syscore.objects import success, arg_not_supplied, missing_data
DATE_KEY_NAME= 'date'
class timedEntry(object):
"""
These four functions normally overriden by an inheriting class
"""
@property
def required_argument_names(self) -> lis... | gpl-3.0 |
ianlini/feagen | feagen/tests/lifetime_feature_generator.py | 1 | 3903 | from __future__ import unicode_literals
from io import StringIO
import feagen as fg
from feagen.decorators import (
require,
will_generate,
)
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from sklearn.model_selection import train_test_split
class LifetimeFeatureGenerator(fg.Featu... | bsd-2-clause |
sarahgrogan/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 |
linuxlizard/q60 | debezel.py | 1 | 2104 | #!python
# Q&D remove bezel (black along top/left). Untuned firmware can capture parts
# of the plastic bezel holding the glass.
#
# davep
import sys
import numpy as np
#import matplotlib.pyplot as plt
import scipy.ndimage.filters
import imtools
from basename import get_basename
import rgbtogray
def find_bezel( nd... | apache-2.0 |
tsbischof/photon_correlation | python/photon_correlation/FLID.py | 1 | 2022 | #!/usr/bin/env python
import sys
import csv
import bz2
import matplotlib.pyplot as plt
import numpy
def force_aspect(ax,aspect=1):
im = ax.get_images()
extent = im[0].get_extent()
ax.set_aspect(abs((extent[1]-extent[0])/(extent[3]-extent[2]))/aspect)
class FLID(object):
def __init__(self, filename=... | bsd-3-clause |
JT5D/scikit-learn | examples/plot_learning_curve.py | 1 | 2253 | """
========================
Plotting Learning Curves
========================
A learning curve shows the validation and training score of a learning
algorithm for varying numbers of training samples. It is a tool to
find out how much we benefit from adding more training data. If both
the validation score and the trai... | bsd-3-clause |
aflaxman/scikit-learn | sklearn/datasets/mldata.py | 32 | 8031 | """Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: BSD 3 clause
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# Pyt... | bsd-3-clause |
lekshmideepu/nest-simulator | pynest/examples/spatial/conncomp.py | 20 | 3879 | # -*- coding: utf-8 -*-
#
# conncomp.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 License, or
# ... | gpl-2.0 |
tapomayukh/projects_in_python | sandbox_tapo/src/skin_related/AI_Surface_Recognition/src/hmm_crossvalidation_force_1_states.py | 1 | 14805 | # Hidden Markov Model Implementation
import pylab as pyl
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy as scp
import scipy.ndimage as ni
import scipy.io
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
#import hrl_lib.mayavi2_util as mu
imp... | mit |
xiaoxiamii/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 |
jnez71/demos | signals/all_pole_modeling.py | 1 | 2452 | #!/usr/bin/env python2
"""
Tunes a linear IIR filter to have any specified impulse response.
The desired impulse response is specified over some finite time window.
Then the matched IIR filter can be said to "predict" the rest of this
function at times outside the window by simple simulation.
Since this tuning is not f... | mit |
tensorflow/datasets | tensorflow_datasets/core/utils/benchmark.py | 1 | 4240 | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... | apache-2.0 |
blondegeek/pymatgen | pymatgen/io/abinit/works.py | 2 | 74708 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Works for Abinit
"""
import os
import shutil
import time
import abc
import collections
import numpy as np
import copy
from monty.collections import AttrDict
from monty.itertools import chunks
from monty.fu... | mit |
ldirer/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 |
wanglei828/apollo | modules/tools/mapshow/libs/subplot_traj_path.py | 3 | 2931 | #!/usr/bin/env python
###############################################################################
# Copyright 2017 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 |
ahmadia/bokeh | sphinx/source/docs/tutorials/exercises/stocks.py | 23 | 2098 | ###
### NOTE: This exercise requires a network connection
###
import numpy as np
import pandas as pd
from bokeh.plotting import figure, output_file, show, VBox
# Here is some code to read in some stock data from the Yahoo Finance API
AAPL = pd.read_csv(
"http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000&d=... | bsd-3-clause |
bsautermeister/machine-learning-examples | one_shot_learning/keras/siamese_cifar100.py | 1 | 15282 | """
Trains a Siamese MLP on pairs of digits from the CIFAR100 small dataset.
"""
from __future__ import absolute_import
from __future__ import print_function
import argparse
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tqdm import tqdm
DISTANCE_THRESHOLD = 0.50
NUM_CLASSES = 100
SEE... | mit |
zrhans/pythonanywhere | pyscripts/ply_CH4.py | 1 | 9135 | """
DATA,Chuva,Chuva_min,Chuva_max,VVE,VVE_min,VVE_max,DVE,DVE_min,DVE_max,
Temp.,Temp._min,Temp._max,Umidade,Umidade_min,Umidade_max,Rad.,Rad._min,Rad._max,
Pres.Atm.,Pres.Atm._min,Pres.Atm._max,
Temp.Int.,Temp.Int._min,Temp.Int._max,
CH4,CH4_min,CH4_max,HCnM,HCnM_min,HCnM_max,HCT,HCT_min,HCT_max,
SO2,SO2_min,SO2_max,... | apache-2.0 |
andaag/scikit-learn | sklearn/manifold/isomap.py | 229 | 7169 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
luis-rr/nest-simulator | pynest/examples/intrinsic_currents_spiking.py | 13 | 5954 | # -*- coding: utf-8 -*-
#
# intrinsic_currents_spiking.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 ... | gpl-2.0 |
jblackburne/scikit-learn | sklearn/neighbors/tests/test_dist_metrics.py | 38 | 6118 | import itertools
import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from nose import SkipTest
def dist_func(x1, x2, p):
return np.sum((x1 - x2) ** p) ** (1. / p)
de... | bsd-3-clause |
exepulveda/swfc | python/plot_fig11-15.py | 1 | 3458 | import numpy as np
import math
from collections import Counter
import matplotlib as mpl
mpl.use('agg')
from case_study_bm import attributes,setup_case_study_ore,setup_distances
import matplotlib.pyplot as plt
from cluster_utils import relabel
if __name__ == "__main__":
NC = 3
kmeans = np.int32(np.loa... | gpl-3.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/pandas/io/tests/test_excel.py | 7 | 87414 | # pylint: disable=E1101
from pandas.compat import u, range, map, openpyxl_compat, BytesIO, iteritems
from datetime import datetime, date, time
import sys
import os
from distutils.version import LooseVersion
import warnings
import operator
import functools
import nose
from numpy import nan
import numpy as np
import ... | mit |
madphysicist/numpy | numpy/lib/tests/test_type_check.py | 17 | 15119 | import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises
)
from numpy.lib.type_check import (
common_type, mintypecode, isreal, iscomplex, isposinf, isneginf,
nan_to_num, isrealobj, iscomplexobj, asfarray, real_if_close
)
def assert_all(x):
assert... | bsd-3-clause |
quaquel/EMAworkbench | docs/source/pyplots/basicMultiplotDensity.py | 1 | 1058 | import numpy as np
import matplotlib.pyplot as plt
from analysis.pairs_plotting import pairs_scatter, pairs_density, pairs_lines
from expWorkbench.util import load_results
#load the data
experiments, results = load_results(r'../../../src/analysis/1000 flu cases.cPickle', zipped=False)
#transform the results to the r... | bsd-3-clause |
saskartt/P4UL | pyRaster/extractDomainFromTile.py | 1 | 7475 | #!/usr/bin/env python
import sys
import argparse
import numpy as np
from mapTools import *
from utilities import filesFromList, writeLog
from plotTools import addImagePlot, addContourf, addScatterPlot
import matplotlib.pyplot as plt
'''
Description:
Author: Mikko Auvinen
mikko.auvinen@helsinki.fi
Univ... | mit |
raymondxyang/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py | 137 | 2219 | # encoding: utf-8
# 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 r... | apache-2.0 |
jseabold/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
eickenberg/scikit-learn | sklearn/tests/test_lda.py | 22 | 1521 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from .. import lda
# Data is just 6 separable points in the plane
X = np.array([[-2, -1], [-... | bsd-3-clause |
yyjiang/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
vshtanko/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 |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFactor/fetcher.py | 2 | 42360 | # /usr/bin/env python3
"""
网络查询接口:
1. 个股查询
- QA_fetch_get_individual_financial: 查询个股指定时间段指定财务报表指定报告类型数据
2. 截面查询
- QA_fetch_get_crosssection_financial: 查询指定报告期指定报表指定报告类型数据
本地查询接口:
1. 截面查询
- QA_fetch_crosssection_financial
2. 高级查询
- QA_fetch_financial_adv
"""
import datetime
import time
from typing impor... | mit |
peastman/msmbuilder | msmbuilder/lumping/pcca.py | 6 | 4084 | from __future__ import print_function, division, absolute_import
import numpy as np
from ..msm import MarkovStateModel
class PCCA(MarkovStateModel):
"""Perron Cluster Cluster Analysis (PCCA) for coarse-graining (lumping)
microstates into macrostates.
Parameters
----------
n_macrostates : int
... | lgpl-2.1 |
sorgerlab/indra | indra/sources/trrust/processor.py | 4 | 2252 | from copy import deepcopy
from indra.databases import hgnc_client
from indra.statements import Agent, IncreaseAmount, DecreaseAmount, Evidence
class TrrustProcessor(object):
"""Processor to extract INDRA Statements from Trrust data frame.
Attributes
----------
df : pandas.DataFrame
The Trrust... | bsd-2-clause |
kastnerkyle/sklearn-theano | sklearn_theano/utils/ports.py | 9 | 5242 | import warnings
from sklearn.cross_validation import ShuffleSplit
from itertools import chain
from sklearn.utils import safe_indexing
import numpy as np
import scipy.sparse as sp
# A port of sklearn 0.16 utilities
# to avoid validation issues in older sklearn
def check_consistent_length(*arrays):
"""Check that al... | bsd-3-clause |
giorgiop/scikit-learn | examples/cluster/plot_dbscan.py | 346 | 2479 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... | bsd-3-clause |
armada-ai/esp-idf | tools/tiny-test-fw/Utility/LineChart.py | 3 | 1681 | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# 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 ... | apache-2.0 |
r-mart/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
bnaul/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 4 | 23219 | import pytest
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from numpy.random import RandomState
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
... | bsd-3-clause |
johnmgregoire/NanoCalorimetry | plotacanalysis_lia_1kHz.py | 1 | 5551 | import numpy, h5py, pylab, copy
from PnSC_h5io import *
from PnSC_math import *
from matplotlib.ticker import FuncFormatter
def myexpformat(x, pos):
for ndigs in range(5):
lab=(('%.'+'%d' %ndigs+'e') %x).replace('e+0','e').replace('e+','e').replace('e0','').replace('e-0','e-')
if eval(lab)==x:
... | bsd-3-clause |
ueshin/apache-spark | python/pyspark/pandas/plot/matplotlib.py | 14 | 30172 | #
# 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 |
zyhhhhhhh/cs446-machine-learning | hw3/hw3-code/python/exp4.py | 1 | 1600 | import gen
import algorithms
import numpy as np
import matplotlib.pyplot as plt
def adagrad(y,x,r):
w = np.zeros(len(x[0])+1)
G = np.ones(len(x[0])+1)
error = []
errcount = 0
Q = []
q = 0
for i in range(len(x)):
if y[i]*(np.inner(w[0:-1],x[i])+w[-1]) <= 1:
errcount += 1... | mit |
google/active-qa | px/environments/docqa.py | 1 | 13115 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
gronostajo/droogle | base.py | 1 | 5821 | from collections import Counter
import gzip
from operator import itemgetter
from os import listdir, path
import re
import cPickle as pickle
import json
from math import log, sqrt
from scipy.sparse import csr_matrix, lil_matrix, coo_matrix
import numpy as np
from sklearn.preprocessing import normalize
import unicodedat... | gpl-2.0 |
kjung/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 81 | 5461 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
0asa/scikit-learn | sklearn/datasets/species_distributions.py | 19 | 7870 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
aray/spark | python/pyspark/worker.py | 2 | 9636 | #
# 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 |
brightchen/h2o-3 | h2o-py/h2o/h2o.py | 1 | 78121 | import warnings
warnings.simplefilter('always', DeprecationWarning)
import os
import itertools
import functools
import os.path
import re
import urllib
import urllib2
import imp
import tabulate
from connection import H2OConnection
from job import H2OJob
from expr import ExprNode
from frame import H2OFrame, _py_tmp_key, ... | apache-2.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/pandas/compat/pickle_compat.py | 15 | 2829 | """ support pre 0.12 series pickle compatibility """
import sys
import numpy as np
import pandas
import copy
import pickle as pkl
from pandas import compat, Index
from pandas.compat import u, string_types
def load_reduce(self):
stack = self.stack
args = stack.pop()
func = stack[-1]
if type(args[0]) i... | mit |
kit-cel/wt | wt/uebung/u5_2D_gaussian.py | 1 | 5356 | #!/usr/bin/env python3
"""
Simulation einer 2D Normalverteilung. Gezeigt werden neben zuf.
Realisierungen auch die Höhenlinie der Dichte für K=9.
"""
from functools import partial
import numpy as np
import matplotlib as mp
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from PyQt5 import QtWidgets, Q... | gpl-2.0 |
walterreade/scikit-learn | examples/svm/plot_oneclass.py | 80 | 2338 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | bsd-3-clause |
cpcloud/ibis | ibis/pandas/execution/generic.py | 1 | 33772 | """Execution rules for generic ibis operations."""
import collections
import datetime
import decimal
import functools
import math
import numbers
import operator
from collections.abc import Sized
import numpy as np
import pandas as pd
import toolz
from pandas.core.groupby import DataFrameGroupBy, SeriesGroupBy
import... | apache-2.0 |
aerospaceresearch/SiqNAL | Modules/fourier.py | 2 | 2245 | """
**Author :** *Jay Krishna*
This module computes the fourier transform, fourier transform power & inverse
fourier transform of the signal.
"""
import numpy as np
from scipy.fftpack import fft, fftshift, ifft
import matplotlib.pyplot as plt
def CalcFourier(signal):
"""
This function calcul... | mit |
vamsirajendra/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/image.py | 69 | 28764 | """
The image module supports basic image loading, rescaling and display
operations.
"""
from __future__ import division
import os, warnings
import numpy as np
from numpy import ma
from matplotlib import rcParams
from matplotlib import artist as martist
from matplotlib import colors as mcolors
from matplotlib import... | agpl-3.0 |
ssaeger/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
raghavrv/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 |
prheenan/Research | Personal/EventDetection/Util/InputOutput.py | 1 | 15554 | # force floating point division. Can still use integer with //
from __future__ import division
# This file is used for importing the common utilities classes.
import numpy as np
import matplotlib.pyplot as plt
import sys,os
from scipy import interpolate
from Research.Perkins.AnalysisUtil.ForceExtensionAnalysis import F... | gpl-3.0 |
birdsarah/bokeh | bokeh/sampledata/periodic_table.py | 45 | 1542 | '''
This module provides the periodic table as a data set. It exposes an attribute 'elements'
which is a pandas dataframe with the following fields
elements['atomic Number'] (units: g/cm^3)
elements['symbol']
elements['name']
elements['atomic mass'] (units: amu)
elements['CPK'] ... | bsd-3-clause |
giorgiop/scikit-learn | sklearn/manifold/tests/test_isomap.py | 121 | 4301 | from itertools import product
import numpy as np
from numpy.testing import (assert_almost_equal, assert_array_almost_equal,
assert_equal)
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
fro... | bsd-3-clause |
ChanderG/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
apologist/eoddata-client | setup.py | 1 | 1736 | import os
import re
from setuptools import setup
try:
from pypandoc import convert
if os.name == 'nt':
os.environ.setdefault('PYPANDOC_PANDOC',
'c:\\Program Files (x86)\\Pandoc\\psandoc.exe')
def read_md(f):
try:
return convert(f, 'rst', format=... | unlicense |
shikhardb/scikit-learn | sklearn/gaussian_process/gaussian_process.py | 18 | 34542 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | bsd-3-clause |
Schwittleymani/ECO | src/python/nlp/original_2d_export.py | 2 | 3090 | import argparse
import pprint
import glob
import sys
import gensim
import util
import numpy
import json
import os
from sklearn.manifold import TSNE
def process_arguments(args):
parser = argparse.ArgumentParser(description='configure Word2Vec model building')
parser.add_argument('--model_path', action='store', ... | apache-2.0 |
bestwpw/BDA_py_demos | demos_ch5/demo5_1.py | 19 | 5055 | """Bayesian Data Analysis, 3rd ed
Chapter 5, demo 1
Hierarchical model for Rats experiment (BDA3, p. 102).
"""
from __future__ import division
import numpy as np
from scipy.stats import beta
from scipy.special import gammaln
import matplotlib.pyplot as plt
# Edit default plot settings (colours from colorbrewer2.org... | gpl-3.0 |
superbobry/hyperopt-sklearn | hpsklearn/vkmeans.py | 6 | 2032 | import numpy as np
from sklearn.cluster import KMeans
class ColumnKMeans(object):
def __init__(self,
n_clusters,
init='k-means++',
n_init=10,
max_iter=300,
tol=1e-4,
precompute_distances=True,
verbose=0,
random_state=None,
copy_x=True,
... | bsd-3-clause |
rhyolight/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/font_manager.py | 69 | 42655 | """
A module for finding, managing, and using fonts across platforms.
This module provides a single :class:`FontManager` instance that can
be shared across backends and platforms. The :func:`findfont`
function returns the best TrueType (TTF) font file in the local or
system font path that matches the specified :class... | agpl-3.0 |
opengeostat/pygslib | sandbox/vmodel.py | 1 | 6603 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
# using naming on http://www.gslib.com/gslib_help/programs.html
import subprocess
import copy
import pandas as pd
import pygslib
import numpy as np
import os
import matplotlib.pyplot as plt
__vmodel_par = \
""" Parameters for VMODEL
****... | mit |
google-research/google-research | rllim/main_rllim_on_real_data.py | 1 | 6988 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
John-Keating/ThinkStats2 | code/thinkstats2.py | 68 | 68825 | """This file contains code for use with "Think Stats" and
"Think Bayes", both by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
"""This file contains class definitions for:
H... | gpl-3.0 |
Eomys/MoSQITo | mosqito/validations/sharpness/validation_sharpness_din.py | 1 | 8440 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 15 16:36:37 2020
@author: wantysal
"""
# Third party imports
import numpy as np
import matplotlib.pyplot as plt
# Local application imports
from mosqito.functions.sharpness.comp_sharpness import comp_sharpness
from mosqito.functions.shared.load import load
# Signals an... | apache-2.0 |
cpcloud/arrow | python/pyarrow/tests/test_array.py | 1 | 30472 | # 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 |
james-jz-zheng/jjzz | ml_test.py | 1 | 4779 | import yahoo_finance as yhf
from sklearn import *
import os.path, os
import pickle
import numpy as np
import datetime as dt
import pandas as pd
def next_biz_day(d):
nd = d+dt.timedelta(days=1)
return nd if nd.weekday() in range(5) else next_biz_day(nd)
def prev_biz_day(d):
pd = d-dt.timedelta(days=1)
... | gpl-3.0 |
tum-camp/survival-support-vector-machine | survival/io/arffread.py | 1 | 1824 | # This program 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,
# bu... | gpl-3.0 |
aleksandr-bakanov/astropy | astropy/visualization/wcsaxes/core.py | 2 | 30823 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from functools import partial
from collections import defaultdict
import numpy as np
from matplotlib import rcParams
from matplotlib.artist import Artist
from matplotlib.axes import Axes, subplot_class_factory
from matplotlib.transforms import Affine2D,... | bsd-3-clause |
Eric89GXL/scikit-learn | sklearn/decomposition/pca.py | 4 | 25539 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
#
# License: BSD 3 clause
from math import log, sqrt
import warnin... | bsd-3-clause |
peterfpeterson/mantid | Framework/PythonInterface/mantid/plots/scales.py | 3 | 5597 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
pompiduskus/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.