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
imaculate/scikit-learn
sklearn/datasets/tests/test_mldata.py
384
5221
"""Test functionality of mldata fetching utilities.""" import os import shutil import tempfile import scipy as sp from sklearn import datasets from sklearn.datasets import mldata_filename, fetch_mldata from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_not_in from sklearn.utils.test...
bsd-3-clause
bzero/statsmodels
docs/source/plots/graphics_gofplots_qqplot.py
38
1911
# -*- coding: utf-8 -*- """ Created on Sun May 06 05:32:15 2012 Author: Josef Perktold editted by: Paul Hobson (2012-08-19) """ from scipy import stats from matplotlib import pyplot as plt import statsmodels.api as sm #example from docstring data = sm.datasets.longley.load() data.exog = sm.add_constant(data.exog, pre...
bsd-3-clause
cauchycui/scikit-learn
sklearn/linear_model/bayes.py
220
15248
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
Diego-debian/FREE_POPS_1.0
free_pops/bin/g_Estadi.py
1
3586
#!/usr/bin/python # *-* coding:utf-8 *-* # Este script es sofware libre. Puede redistribuirlo y/o modificarlo bajo # los terminos de la licencia pública general de GNU, según es publicada # por la free software fundation bien la versión 3 de la misma licencia # o de cualquier versión posterior. (según su elección )....
gpl-3.0
kevinlee9/cnn-text-classification-tf
text_cnn.py
1
4784
import tensorflow as tf import numpy as np from gensim.models.keyedvectors import KeyedVectors import sklearn as sk class TextCNN(object): """ A CNN for text classification. Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer. """ def __init__( self, sequence_l...
apache-2.0
mwaskom/seaborn
examples/kde_ridgeplot.py
2
1279
""" Overlapping densities ('ridge plot') ==================================== """ import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set_theme(style="white", rc={"axes.facecolor": (0, 0, 0, 0)}) # Create the data rs = np.random.RandomState(1979) x = rs.randn(500) g = np....
bsd-3-clause
cauchycui/scikit-learn
examples/cluster/plot_lena_compress.py
271
2229
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Vector Quantization Example ========================================================= The classic image processing example, Lena, an 8-bit grayscale bit-depth, 512 x 512 sized image, is used here to illustrate how ...
bsd-3-clause
ConeyLiu/spark
python/pyspark/sql/pandas/typehints.py
8
6323
# # 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
gregcaporaso/qiime
setup.py
6
15094
#!/usr/bin/env python # File created on 17 Feb 2010 from __future__ import division import re import sys from setuptools import setup from stat import S_IEXEC from os import (chdir, getcwd, listdir, chmod, walk, rename, remove, chmod, stat, devnull, environ) from os.path import join, abspath from subpr...
gpl-2.0
neurodroid/stimfit
src/stimfit/py/embedded_mpl.py
4
4111
#=========================================================================== # embedded_mpl.py # 2011.02.05 # Don't modify this file unless you know what you are doing!!! #=========================================================================== """ embedded_mpl.py starting code to embed a matplotlib wx figure into ...
gpl-2.0
MohammedWasim/scikit-learn
sklearn/decomposition/tests/test_factor_analysis.py
222
3055
# Author: Christian Osendorfer <osendorf@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Licence: BSD3 import numpy as np from sklearn.utils.testing import assert_warns from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing im...
bsd-3-clause
shikhardb/scikit-learn
examples/mixture/plot_gmm_selection.py
248
3223
""" ================================= Gaussian Mixture Model Selection ================================= This example shows that model selection can be performed with Gaussian Mixture Models using information-theoretic criteria (BIC). Model selection concerns both the covariance type and the number of components in th...
bsd-3-clause
kevin-intel/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
39
1968
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
cedadev/jasmin_cis
cis/plotting/formatter.py
3
1607
from matplotlib.ticker import LogFormatter, is_close_to_int, nearest_long from matplotlib import rcParams import math class LogFormatterMathtextSpecial(LogFormatter): """ Special formatter for color log axis, using notation such as 2.3 x 10 ^ 4. This is a modified version of LogFormatterMathtext supplied ...
gpl-3.0
lukeiwanski/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/__init__.py
42
2656
# 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
nesterione/scikit-learn
examples/gaussian_process/plot_gp_regression.py
253
4054
#!/usr/bin/python # -*- coding: utf-8 -*- r""" ========================================================= Gaussian Processes regression: basic introductory example ========================================================= A simple one-dimensional regression exercise computed in two different ways: 1. A noise-free cas...
bsd-3-clause
xavierwu/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
tongwang01/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py
2
45785
# 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
project-asap/IReS-Platform
asap-platform/asap-server/asapLibrary/operators/lr_classify_spark/imr_tools.py
5
5668
#!/usr/bin/env python # -*- coding: utf-8 -*- """ tools for imr datasets @author: Chris Mantas @contact: the1pro@gmail.com @since: Created on 2016-02-12 @todo: custom formats, break up big lines @license: http://www.apache.org/licenses/LICENSE-2.0 Apache License """ from ast import literal_eval from collections impor...
apache-2.0
JesseLivezey/sklearn-theano
examples/plot_overfeat_layer1_filters.py
9
1724
""" ==================================== Visualization of first layer filters ==================================== The first layers of convolutional neural networks often have very "human interpretable" values, as seen in these example plots. Visually, these filters are similar to other filters used in computer vision...
bsd-3-clause
tawsifkhan/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
xguse/ggplot
ggplot/stats/stat_function.py
12
4439
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd from ggplot.utils import make_iterable_ntimes from ggplot.utils.exceptions import GgplotError from .stat import stat class stat_function(stat): """ Superimpose a...
bsd-2-clause
tongwang01/tensorflow
tensorflow/contrib/learn/python/learn/estimators/multioutput_test.py
15
1675
# 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
youprofit/scikit-image
doc/examples/plot_seam_carving.py
13
2351
""" ============ Seam Carving ============ This example demonstrates how images can be resized using seam carving [1]_. Resizing to a new aspect ratio distorts image contents. Seam carving attempts to resize *without* distortion, by removing regions of an image which are less important. In this example we are using th...
bsd-3-clause
ddemidov/vexcl
docs/conf.py
1
9667
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # VexCL documentation build configuration file, created by # sphinx-quickstart on Fri Mar 11 13:53:31 2016. # # 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 # auto...
mit
joshbohde/scikit-learn
sklearn/externals/joblib/__init__.py
2
4050
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
yanlend/scikit-learn
examples/ensemble/plot_adaboost_multiclass.py
354
4124
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
bsd-3-clause
mikaem/spectralDNS
tests/OrrSommerfeldr.py
4
8316
"""Orr-Sommerfeld""" import warnings from numpy import real, pi, exp, zeros, imag, sqrt, log10 from spectralDNS import config, get_solver, solve from spectralDNS.utilities import dx #from spectralDNS.utilities import reset_profile from OrrSommerfeld_shen import OrrSommerfeld try: import matplotlib.pyplot as plt ...
gpl-3.0
rlowrance/mlpack
delessandro_utilities.py
1
5720
import numpy as np import pandas as pd import matplotlib.pyplot as plt import sklearn import math from sklearn.metrics import roc_curve, auc import pickle def evenSplit(dat,fld): ''' Evenly splits the data on a given binary field, returns a shuffled dataframe ''' pos=dat[(dat[fld]==1)] neg=dat[(dat...
mit
voxlol/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
JT5D/scikit-learn
sklearn/manifold/tests/test_locally_linear.py
4
4824
from itertools import product import numpy as np from nose.tools import assert_true from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import neighbors, manifold from sklearn.manifold.locally_linear import barycenter_kneighbors_graph from sklearn.utils.testing import assert_less from...
bsd-3-clause
SummaLabs/DLS
app/backend/core/datasets/dbbuilder.py
1
9245
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ar' import os import sys import glob import fnmatch import numpy as np import json import lmdb import matplotlib.pyplot as plt from datetime import datetime import copy import shutil import skimage.io as skio from dbhelpers import DBImageImportReader, DBImage...
mit
subhacom/moose-core
python/moose/genesis/writeKkit.py
1
29153
""" Chemical Signalling model loaded into moose can be save into Genesis-Kkit format """ __author__ = "Harsha Rani" __copyright__ = "Copyright 2017, Harsha Rani and NCBS Bangalore" __credits__ = ["NCBS Bangalore"] __license__ = "GNU GPL" __version__ = "1.0.0" __maintainer__ ...
gpl-3.0
zorroblue/scikit-learn
examples/ensemble/plot_ensemble_oob.py
29
3266
""" ============================= 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
Tong-Chen/scikit-learn
sklearn/feature_extraction/dict_vectorizer.py
7
10162
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause from array import array from collections import Mapping from operator import itemgetter import numpy as np import scipy.sparse as sp from ..base import BaseEstimator, TransformerMixin from ..externals import six from ..externals.six.moves import x...
bsd-3-clause
PROSIC/prosic-evaluation
scripts/plot-allelefreq-estimation.py
1
2979
from itertools import product import math import matplotlib matplotlib.use("agg") from matplotlib import pyplot as plt import seaborn as sns import pandas as pd import common import numpy as np MIN_CALLS = 10 vartype = snakemake.wildcards.vartype colors = common.get_colors(snakemake.config) truth = common.load_vari...
mit
rsignell-usgs/notebook
UGRID/NECOFS_wave_levels.py
1
4737
# coding: utf-8 # # Extract NECOFS data using NetCDF4-Python and analyze/visualize with Pandas # In[1]: # Plot forecast water levels from NECOFS model from list of lon,lat locations # (uses the nearest point, no interpolation) import netCDF4 import datetime as dt import pandas as pd import numpy as np import matplo...
mit
jniediek/mne-python
tutorials/plot_stats_cluster_methods.py
6
8607
# doc:slow-example """ .. _tut_stats_cluster_methods: ====================================================== Permutation t-test on toy data with spatial clustering ====================================================== Following the illustrative example of Ridgway et al. 2012, this demonstrates some basic ideas behin...
bsd-3-clause
cpcloud/dask
dask/dataframe/hashing.py
1
6179
from __future__ import absolute_import, division, print_function import numpy as np import pandas as pd from pandas.types.common import (is_categorical_dtype, is_numeric_dtype, is_datetime64_dtype, is_timedelta64_dtype) from pandas.lib import is_bool_array from .utils import PANDAS_V...
bsd-3-clause
potash/scikit-learn
sklearn/cross_decomposition/pls_.py
35
30767
""" The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Author: Edouard Duchesnay <edouard.duchesnay@cea.fr> # License: BSD 3 clause from distutils.version import LooseVersion from sklearn.utils.extmath import svd_flip from ..base import BaseEstimator, RegressorMixin, TransformerMixin from ..u...
bsd-3-clause
jreback/pandas
pandas/tests/series/methods/test_fillna.py
1
27814
from datetime import datetime, timedelta import numpy as np import pytest import pytz from pandas import ( Categorical, DataFrame, DatetimeIndex, NaT, Period, Series, Timedelta, Timestamp, isna, ) import pandas._testing as tm class TestSeriesFillNA: def test_fillna_nat(self):...
bsd-3-clause
AndreiBarsan/visualqa
visualqa/evaluateMLP.py
1
5309
""" Evaluates a model trained by `trainMLP`. TODO(andrei): Integrate with training script for convenience. """ try: # Keep this import on top! from spacy.en import English except: # Shit, son. raise import click from os.path import join as pjoin import argparse from keras.models import model_from_json...
apache-2.0
DougBurke/astropy
astropy/visualization/wcsaxes/transforms.py
2
9202
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Note: This file incldues code dervived from pywcsgrid2 # # This file contains Matplotlib transformation objects (e.g. from pixel to world # coordinates, but also world-to-world). import abc import numpy as np from matplotlib.path import Path from ma...
bsd-3-clause
ThomasMiconi/htmresearch
projects/l2_pooling/multi_column_synapse_sampling.py
2
18276
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, 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 program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
GuessWhoSamFoo/pandas
pandas/tests/scalar/timestamp/test_arithmetic.py
2
4035
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import numpy as np import pytest from pandas.compat import long from pandas import Timedelta, Timestamp import pandas.util.testing as tm from pandas.tseries import offsets from pandas.tseries.frequencies import to_offset class TestTimestampArithmeti...
bsd-3-clause
scottstanie/scottstanie.github.io
scripts/paths.py
1
5798
import numpy as np from queue import PriorityQueue from collections import defaultdict import matplotlib.pyplot as plt import matplotlib.animation def dijkstra(graph, src, dest): """Find shortest path from src to dest graph: dict[list[(int, int)]]: {node: [adj_node1, adj_node2,...]} src (int)...
mit
liberatorqjw/scikit-learn
sklearn/decomposition/__init__.py
99
1331
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF from .pca import PCA, RandomizedPCA from .incrementa...
bsd-3-clause
tony810430/flink
flink-python/pyflink/fn_execution/coder_impl_slow.py
6
25554
################################################################################ # 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...
apache-2.0
cauchycui/scikit-learn
sklearn/linear_model/tests/test_ransac.py
216
13290
import numpy as np from numpy.testing import assert_equal, assert_raises from numpy.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises_regexp from scipy import sparse from sklearn.utils.testing import assert_less from sklearn.linear_model import LinearRegression, RANSACRegressor f...
bsd-3-clause
kjung/scikit-learn
sklearn/linear_model/setup.py
146
1713
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('linear_model', parent_package, top_path) cblas_libs, blas_info = get_blas_info...
bsd-3-clause
eranroz/dnase
src/data_provider/SeqLoader.py
1
18864
""" General utility class for accessing pickle data files and for simple transformations Generally data is stored as dict of arrays, as dumped and compressed file. using pytables is probably the best approach but we may have problems with portability (or easy installation in different environments) so here we use simp...
mit
ilayn/scipy
scipy/integrate/_bvp.py
16
41051
"""Boundary value problem solver.""" from warnings import warn import numpy as np from numpy.linalg import pinv from scipy.sparse import coo_matrix, csc_matrix from scipy.sparse.linalg import splu from scipy.optimize import OptimizeResult EPS = np.finfo(float).eps def estimate_fun_jac(fun, x, y, p, f0=None): ...
bsd-3-clause
cedar10b/travelapp
airports.py
1
10650
# -*- coding: utf-8 -*- import urllib2 import numpy as np import pandas as pd from bs4 import BeautifulSoup from sql_functions import * df = read_table('cities') # collect airport codes # first, find the closest airport to each city # also check: http://www.closestairportto.com/cities/ airports = pd.DataFrame([], co...
mit
epitron/youtube-dl
youtube_dl/extractor/wsj.py
30
4694
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, unified_strdate, ) class WSJIE(InfoExtractor): _VALID_URL = r'''(?x) (?: https?://video-api\.wsj\.com/api-vid...
unlicense
adamgreenhall/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
mugizico/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
dreuven/SampleSparse
SampleSparse/scripts/PersonalPlotting.py
3
9713
import matplotlib.pyplot as plt import numpy as np import matplotlib.cm as cm class PPlotting: root_directory = None def __init__(self, directory): # try: # str(directory) # except: # print("Cannot convert input to string. Put in a name!") self.root_directory = st...
gpl-3.0
zguangyu/rts2
scripts/u_point/u_select.py
1
7976
#!/usr/bin/env python3 # (C) 2016, Markus Wildi, wildi.markus@bluewin.ch # # 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 2, or (at your option) # any later version. # # ...
gpl-2.0
djgagne/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
sepehr125/pybrain
pybrain/tools/plotting/multiline.py
25
7884
# $Id$ __author__ = 'Martin Felder and Frank Sehnke' import math, imp from matplotlib.lines import Line2D from pylab import clf, plot, axes, show, xlabel, ylabel, savefig, ioff, draw_if_interactive class MultilinePlotter: """ Basic plotting class build on pylab Implementing by instancing the class with the nu...
bsd-3-clause
kayarre/Tools
hist/process_case.py
1
8337
# import pickle # import pyvips import os import pandas as pd # import numpy as np import SimpleITK as sitk import networkx as nx import pickle import copy # import itk import matplotlib.pyplot as plt # from ipywidgets import interact, fixed # from IPython.display import clear_output import logging logging.basicCo...
bsd-2-clause
vagonbar/GNUnetwork
gwn/blocks/libio/gnuradio/new/.grc_gnuradio/read_files_plot.py
1
3351
# -*- coding: utf-8 -*- """ Created on Sun Nov 23 08:54:25 2014 @author: belza """ import scipy from gnuradio import gr from gnuradio import blocks import matplotlib.pyplot as plt def frombitstohex(bits): vbytes = [] for b in range(len(bits) / 8): byte = bits[b*8:(b+1)*8] i=0 res=0 ...
gpl-3.0
onyxfish/fever
agatecharts/table.py
2
5012
#!/usr/bin/env python from matplotlib import pyplot from agatecharts.charts import Bars, Columns, Lines, Scatter from agatecharts.utils import round_limits #: Default rendered chart size in inches DEFAULT_SIZE = (8, 8) #: Default rendered chart dpi DEFAULT_DPI = 72 class TableCharts(object): def bar_chart(self...
mit
btel/svg_utils
docs/source/tutorials/scripts/anscombe.py
1
1998
#!/usr/bin/env python3 """ Edward Tufte uses this example from Anscombe to show 4 datasets of x and y that have the same mean, standard deviation, and regression line, but which are qualitatively different. matplotlib fun for a rainy day Downloaded from: http://matplotlib.sourceforge.net/examples/pylab_examples/ansc...
mit
devanshdalal/scikit-learn
sklearn/neighbors/tests/test_kd_tree.py
26
7800
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics import Dista...
bsd-3-clause
etkirsch/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
alphaBenj/zipline
tests/test_fetcher.py
5
20667
# # Copyright 2015 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
tcheehow/MissionPlanner
Lib/site-packages/numpy/lib/polynomial.py
58
35930
""" Functions to operate on polynomials. """ __all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd', 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d', 'polyfit', 'RankWarning'] import re import warnings import numpy.core.numeric as NX from numpy.core import isscalar, abs, finfo, atleas...
gpl-3.0
Mistobaan/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
92
4535
# 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
bjodah/fastinverse
examples/invnewton_main.py
1
2866
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import logging import os import time import sys import argh import numpy as np import sympy from sympy.parsing.sympy_parser import ( parse_expr, standard_transformations, implicit_...
bsd-2-clause
pypot/scikit-learn
examples/text/mlcomp_sparse_document_classification.py
292
4498
""" ======================================================== Classification of text documents: using a MLComp dataset ======================================================== This is an example showing how the scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a s...
bsd-3-clause
chongyangma/python-machine-learning-book
code/optional-py-scripts/ch03.py
4
12944
# Sebastian Raschka, 2015 (http://sebastianraschka.com) # Python Machine Learning - Code Examples # # Chapter 3 - A Tour of Machine Learning Classifiers Using Scikit-Learn # # S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015. # GitHub Repo: https://github.com/rasbt/python-machine-learning-book # # Licen...
mit
raymak/contextualfeaturerecommender
phase2/analysis/cross_user_analysis.py
1
17225
#!/usr/bin/env python """ Recursively searches through the jsonl files in the given root directory (or the current directory by default) and extracts variables of interest for each user. It then generates, prints, and saves cross-user data reports and data frames. input: [implicit] current working directory...
mpl-2.0
alexcpsec/coursera-compinvesting1-hw
HW4/analyse.py
2
1966
## Computational Investing I ## HW 3 - analyse.py ## ## Author: alexcpsec import pandas as pd import pandas.io.parsers as pd_par import numpy as np import math import copy import QSTK.qstkutil.qsdateutil as du import datetime as dt import QSTK.qstkutil.DataAccess as da import QSTK.qstkutil.tsutil as tsu NUM_TRADING_D...
mit
CrazyGuo/bokeh
bokeh/session.py
42
20253
''' The session module provides the Session class, which encapsulates a connection to a Document that resides on a Bokeh server. The Session class provides methods for creating, loading and storing documents and objects, as well as methods for user-authentication. These are useful when the server is run in multi-user ...
bsd-3-clause
mcm326/programingworkshop
Python/pandas_and_parallel/meso_surface.py
8
2237
import pandas as pd import os import datetime as dt import numpy as np import mesonet_calculations from plotting import sfc_plot ''' For reading in and creating surface plots of mesonet data in a given time interval saved in folders in the current working directory for each variable plotted ''' variables = {'temp...
mit
jhamman/xarray
xarray/tests/test_sparse.py
1
27235
import pickle from textwrap import dedent import numpy as np import pandas as pd import pytest import xarray as xr import xarray.ufuncs as xu from xarray import DataArray, Variable from xarray.core.npcompat import IS_NEP18_ACTIVE from xarray.core.pycompat import sparse_array_type from . import assert_equal, assert_i...
apache-2.0
vipul1409/zeppelin
interpreter/lib/python/backend_zinline.py
61
11831
# 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 use ...
apache-2.0
craigcitro/pydatalab
solutionbox/image_classification/mltoolbox/image/classification/_util.py
6
9918
# 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 a...
apache-2.0
Basil-M/AMGEN-Summer-Project-2017
python/code/Random walker/test_niifti.py
1
2531
import numpy as np import niipy as nii import matplotlib.pyplot as plt from skimage.segmentation import random_walker from skimage.data import binary_blobs from skimage.exposure import rescale_intensity import skimage FOLDER_PATH= "/scratch/python/datasets/ACDC/ACDC_challenge_20170617/" patient = 1 frame = 1 debug = 0...
mit
mjgrav2001/scikit-learn
examples/linear_model/plot_lasso_model_selection.py
311
5431
""" =================================================== Lasso model selection: Cross-Validation / AIC / BIC =================================================== Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-validation to select an optimal value of the regularization paramet...
bsd-3-clause
unsiloai/syntaxnet-ops-hack
tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py
71
12923
# 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
cbertinato/pandas
pandas/tseries/holiday.py
1
16245
from datetime import datetime, timedelta from typing import List import warnings from dateutil.relativedelta import FR, MO, SA, SU, TH, TU, WE # noqa import numpy as np from pandas.errors import PerformanceWarning from pandas import DateOffset, Series, Timestamp, date_range from pandas.tseries.offsets import Day, ...
bsd-3-clause
pratapvardhan/pandas
pandas/io/sas/sasreader.py
14
2558
""" Read SAS sas7bdat or xport files. """ from pandas import compat from pandas.io.common import _stringify_path def read_sas(filepath_or_buffer, format=None, index=None, encoding=None, chunksize=None, iterator=False): """ Read SAS files stored as either XPORT or SAS7BDAT format files. Param...
bsd-3-clause
umuzungu/zipline
zipline/assets/assets.py
3
36849
# Copyright 2015 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 writ...
apache-2.0
numenta/nupic.research
projects/visual_recognition_grid_cells/SDR_decoder.py
3
7700
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, 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 program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
nomadcube/scikit-learn
examples/plot_multioutput_face_completion.py
330
3019
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
bsd-3-clause
yunfeilu/scikit-learn
sklearn/manifold/setup.py
99
1243
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
tansey/vsmrfs
vsmrfs/run_node_learning.py
2
13217
import matplotlib matplotlib.use('Agg') from matplotlib import cm, colors import matplotlib.pyplot as plt import numpy as np import scipy.sparse as sps import argparse import csv import sys from node_learning import * from exponential_families import * from utils import * FIG_FONTSIZE = 18 FIG_TITLE_FONTSIZE = 28 FIG...
mit
BigDataforYou/movie_recommendation_workshop_1
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/computation/scope.py
24
9002
"""Module for scope operations """ import sys import struct import inspect import datetime import itertools import pprint import numpy as np import pandas as pd from pandas.compat import DeepChainMap, map, StringIO from pandas.core.base import StringMixin import pandas.computation as compu def _ensure_scope(level,...
mit
rbiswas4/simlib
tests/test_summarize.py
1
6310
""" Tests for the code in `opsimsummary/opsim_out.py` """ from __future__ import print_function, division, absolute_import import os import pytest import numpy as np import pandas as pd import opsimsummary as oss from opsimsummary import (OpSimOutput, SynOpSim, PointingTree) import healpy as hp from numpy.testing impor...
mit
shamidreza/Festival-features
festival_features.py
1
5694
import os import logging import numpy as np import struct from matplotlib import pyplot as pp festival_path = '/Users/hamid/Code/festival/festival/' class Festival_features(): def __init__(self, lname, feats_file=None): self._read_list(lname) if feats_file: self._read_list_header(hnam...
gpl-2.0
e-koch/FilFinder
fil_finder/length.py
1
28484
# Licensed under an MIT open source license - see LICENSE from .utilities import * from .pixel_ident import * import numpy as np import scipy.ndimage as nd import networkx as nx import operator import string import copy # Create 4 to 8-connected elements to use with binary hit-or-miss struct1 = np.array([[1, 0, 0],...
mit
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/numpy/lib/function_base.py
19
164441
from __future__ import division, absolute_import, print_function import collections import operator import re import sys import warnings import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d, transpose from numpy.core.numeric import ( ones, zeros, arange, conc...
agpl-3.0
stscieisenhamer/glue
glue/viewers/scatter/qt/tests/test_data_viewer.py
1
17632
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103 from __future__ import absolute_import, division, print_function import os from collections import Counter import pytest from numpy.testing import assert_allclose from glue.config import colormaps from glue.core.message import SubsetUpdateMessage from glue.core...
bsd-3-clause
OSSHealth/ghdata
tests/test_metrics/test_pull_request_metrics.py
1
1388
#SPDX-License-Identifier: MIT import pytest import pandas as pd def test_pull_requests_merge_contributor_new(metrics): # repo id assert metrics.pull_requests_merge_contributor_new(10, repo_id=25430, period='year').isin( [pd.Timestamp('2019-01-01 00:00:00', tz='UTC')]).any().any() # repo_group_id ...
mit
seismology-RUB/ASKI
py/plot_ASKI_data_spectrum.py
1
3433
#!/usr/bin/env python # #---------------------------------------------------------------------------- # Copyright 2016 Florian Schumacher (Ruhr-Universitaet Bochum, Germany) # # This file is part of ASKI version 1.2. # # ASKI version 1.2 is free software: you can redistribute it and/or modify # it under the ter...
gpl-2.0
talbrecht/pism_pik07
test/vnreport.py
1
8840
#!/usr/bin/env python from pylab import close, figure, clf, hold, plot, xlabel, ylabel, xticks, yticks, axis, legend, title, grid, show, savefig from numpy import array, polyfit, polyval, log10, floor, ceil, unique import sys try: from netCDF4 import Dataset as NC except: print "netCDF4 is not installed!" ...
gpl-3.0
theoryno3/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
14
15763
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_raises, assert_rais...
bsd-3-clause
GoogleCloudPlatform/datacatalog-connectors
google-datacatalog-connectors-commons-test/src/google/datacatalog_connectors/commons_test/utils/utils.py
1
12637
#!/usr/bin/python # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0