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 |
|---|---|---|---|---|---|
amaurywalbert/twitter | graphs/n2/n2_creating_network_with_ego_v1.2.py | 1 | 12416 | # -*- coding: latin1 -*-
################################################################################################
#
#
import datetime, sys, time, json, os, os.path, shutil, time, struct, random
import networkx as nx
import matplotlib.pyplot as plt
import pylab
reload(sys)
sys.setdefaultencoding('utf-8')
###... | gpl-3.0 |
zfrenchee/pandas | pandas/io/formats/console.py | 5 | 2733 | """
Internal module for console introspection
"""
import sys
import locale
from pandas.io.formats.terminal import get_terminal_size
# -----------------------------------------------------------------------------
# Global formatting options
_initial_defencoding = None
def detect_console_encoding():
"""
Try t... | bsd-3-clause |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_backend_bases.py | 2 | 3042 | from matplotlib.backend_bases import FigureCanvasBase
from matplotlib.backend_bases import RendererBase
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import matplotlib.path as path
import numpy as np
import os
import shutil
import... | mit |
eickenberg/scikit-learn | sklearn/semi_supervised/label_propagation.py | 1 | 14906 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/pandas/tseries/tests/test_daterange.py | 9 | 26349 | from datetime import datetime
from pandas.compat import range
import nose
import numpy as np
from pandas.core.index import Index
from pandas.tseries.index import DatetimeIndex
from pandas import Timestamp
from pandas.tseries.offsets import generate_range
from pandas.tseries.index import cdate_range, bdate_range, date... | gpl-2.0 |
xhochy/arrow | python/pyarrow/tests/test_dataset.py | 1 | 86386 | # 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 |
jitsi/jitsi-meet-torture | scripts/bwe-benchmark.py | 1 | 2681 | #!/usr/bin/env python2.7
#
# Copyright @ 2018 Atlassian Pty 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 appli... | apache-2.0 |
harisbal/pandas | pandas/core/arrays/period.py | 1 | 36577 | # -*- coding: utf-8 -*-
from datetime import timedelta
import operator
import numpy as np
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas._libs.tslib import NaT, iNaT
from pandas._libs.tslibs.period import (
Period, IncompatibleFrequency, DIFFERENT_FREQ_INDEX,
get_period_f... | bsd-3-clause |
SusanJL/iris | lib/iris/tests/test_analysis.py | 5 | 46721 | # (C) British Crown Copyright 2010 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
Lx37/seaborn | seaborn/distributions.py | 21 | 28328 | """Plotting functions for visualizing distributions."""
from __future__ import division
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
from six import string_types
try:
import statsmodels.nonparametric.api as smnp
_has_st... | bsd-3-clause |
wzbozon/statsmodels | statsmodels/datasets/fertility/data.py | 26 | 2511 | #! /usr/bin/env python
"""World Bank Fertility Data."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This data is distributed according to the World Bank terms of use. See SOURCE."""
TITLE = """World Bank Fertility Data"""
SOURCE = """
This data has been acquired from
The World Bank: Fertility rat... | bsd-3-clause |
meduz/scikit-learn | examples/covariance/plot_mahalanobis_distances.py | 348 | 6232 | r"""
================================================================
Robust covariance estimation and Mahalanobis distances relevance
================================================================
An example to show covariance estimation with the Mahalanobis
distances on Gaussian distributed data.
For Gaussian dis... | bsd-3-clause |
SusanJL/iris | lib/iris/tests/unit/plot/test_points.py | 11 | 3049 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
deepchem/deepchem | examples/uv/UV_correlations.py | 4 | 1362 | """
Script that computes correlations of UV tasks.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import tempfile
import shutil
import deepchem as dc
import pandas as pd
import matplotlib
# Force matplotlib to not use any ... | mit |
leonardbinet/Transilien-Api | api_etl/regressor_train.py | 2 | 13135 | """
This module contains functions and classes to train regressors and save them into SQL database.
"""
import logging
from os import path
from glob import glob
import pickle
from datetime import datetime
import codecs
import numpy as np
import pandas as pd
import sklearn
from sklearn.preprocessing import Polynomial... | mit |
walterreade/scikit-learn | examples/svm/plot_svm_scale_c.py | 44 | 5405 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... | bsd-3-clause |
mjudsp/Tsallis | sklearn/ensemble/gradient_boosting.py | 25 | 71089 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
reinoslav/DeepLearningTrackingDemo | bouncing_balls.py | 1 | 1910 | import matplotlib.pyplot as plt
import matplotlib.animation as animation
from dltracking.data.BouncingBallsDataset import BouncingBallsDataset
if __name__ == '__main__':
dataset = BouncingBallsDataset(
number_of_videos = 4,
number_of_frames = 200,
image_resolution = 50)
fig = plt.figu... | mit |
radjkarl/imgProcessor | imgProcessor/camera/LensDistortion.py | 1 | 16072 | #!/usr/bin/env python
# coding=utf-8
from __future__ import division
from __future__ import print_function
import numpy as np
import cv2
from collections import OrderedDict
# own
import imgProcessor
from imgProcessor.imgIO import imread
from imgProcessor.exceptions import NothingFound, EnoughImages
c... | gpl-3.0 |
jochym/Elastic | examples/example3.py | 1 | 3222 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2011 by Paweł T. Jochym <pawel.jochym@ifj.edu.pl>
#
# This file is part of Elastic.
# Elastic 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... | gpl-3.0 |
teonlamont/mne-python | examples/visualization/plot_ssp_projs_sensitivity_map.py | 11 | 1268 | """
==================================
Sensitivity map of SSP projections
==================================
This example shows the sources that have a forward field
similar to the first SSP vector correcting for ECG.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause... | bsd-3-clause |
yyjiang/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 |
mikebenfield/scipy | scipy/spatial/_plotutils.py | 33 | 5483 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.decorator import decorator as _decorator
__all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d']
@_decorator
def _held_figure(func, obj, ax=None, **kw):
import matplotlib.pyplot as plt
if ax... | bsd-3-clause |
ashhher3/scikit-learn | sklearn/cross_decomposition/cca_.py | 23 | 3087 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Parameters
----------
n_components : int, (default 2).
number of components to keep.
scale : boolean, (default True)
... | bsd-3-clause |
gotomypc/scikit-learn | sklearn/utils/testing.py | 84 | 24860 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import sys
import re
import platf... | bsd-3-clause |
vigilv/scikit-learn | sklearn/datasets/lfw.py | 141 | 19372 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
mayblue9/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 278 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
meppe/ros-ort | src/frcnn/src/frcnn/kalman_tracker.py | 1 | 16068 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import rospy
from ort_msgs.msg import Object_bb_list
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from sklearn.cluster import AffinityPropagation
from filterpy.kalman import KalmanFilter
from sklearn.utils.lin... | gpl-3.0 |
andaag/scikit-learn | sklearn/utils/tests/test_testing.py | 144 | 4121 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... | bsd-3-clause |
janelia-idf/elf | tests/filter.py | 4 | 1137 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def update_line(num, data, line):
line.set_data(data[...,:num])
return line,
fig1 = plt.figure()
data = np.random.rand(2, 25)
l, = plt.plot([], [... | bsd-3-clause |
vortex-exoplanet/VIP | vip_hci/var/shapes.py | 2 | 27456 | #! /usr/bin/env python
"""
Module with various functions to create shapes, annuli and segments.
"""
__author__ = 'Carlos Alberto Gomez Gonzalez'
__all__ = ['dist',
'dist_matrix',
'frame_center',
'get_square',
'get_circle',
'get_ellipse',
'get_annulus_s... | mit |
bert9bert/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 |
yanboliang/spark | python/pyspark/sql/types.py | 2 | 67075 | #
# 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 |
jmargeta/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 4 | 2022 | #!/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 |
IshankGulati/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 |
udacity/ggplot | ggplot/themes/theme.py | 12 | 5935 | """
Theme elements:
* element_line
* element_rect
* element_text
* element_title
These elements define what operations can be performed. The specific targets,
eg. line, rect, text, title and their derivatives axis_title or axis_title_x
specify the scope of the theme application.
"""
from copy import deepcopy
from .... | bsd-2-clause |
mihaelacr/pydeeplearn | code/emotions.py | 1 | 51791 | """ The aim of this file is to contain all the functions
and the main which have to do with emotion recognition, especially
with the Kanade and Multi PiE databases. Note that the versions of both databases I used
the faces were already aligned. Those databases are not publicly available. """
__author__ = "Mihaela Rosc... | bsd-3-clause |
wanghaven/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wx.py | 69 | 77038 | from __future__ import division
"""
backend_wx.py
A wxPython backend for matplotlib, based (very heavily) on
backend_template.py and backend_gtk.py
Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)
Derived from original copyright work by John Hunter
(jdhunter@ace.bsd.uchicago.edu)
Copyright (C) Jeremy O'Don... | agpl-3.0 |
xamgeis/project_vulcan | evaluation/lfw-classification.py | 6 | 15449 | #!/usr/bin/env python2
#
# Copyright 2015-2016 Carnegie Mellon University
#
# 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 require... | apache-2.0 |
ibis-inria/wellFARE | wellfare/ILM/onestep_estimators.py | 1 | 6203 | """
This module implements fast estimators for the time-profiles of
growth rate, promoter activity, and protein concentrations.
These estimators rely on a simple model in which gene expression
is modeled as a one-step process. This enables to compute the
observation matrix directly using an ad-hoc formulaes.
As a co... | lgpl-3.0 |
cbertinato/pandas | pandas/tests/reshape/test_cut.py | 1 | 16084 | import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical, DataFrame, DatetimeIndex, Index, Interval, IntervalIndex,
Series, TimedeltaIndex, Timestamp, cut, date_range, isna, qcut,
timedelta_range, to_datetime)
from pandas.api.types import CategoricalDtype as CDT
import pandas.c... | bsd-3-clause |
qbilius/streams | streams/models/feature_selection.py | 1 | 3169 | from __future__ import absolute_import, division, print_function
import copy
from collections import OrderedDict
import tqdm
import h5py
import numpy as np
import skimage.transform
import sklearn.decomposition
class FeatureSelector(object):
def __call__(self, feats):
raise NotImplementedError
class P... | gpl-3.0 |
anntzer/scikit-learn | examples/ensemble/plot_gradient_boosting_categorical.py | 7 | 9222 | """
================================================
Categorical Feature Support in Gradient Boosting
================================================
.. currentmodule:: sklearn
In this example, we will compare the training times and prediction
performances of :class:`~ensemble.HistGradientBoostingRegressor` with
dif... | bsd-3-clause |
mpharrigan/mixtape | msmbuilder/decomposition/__init__.py | 7 | 1228 | from __future__ import absolute_import
from sklearn import decomposition as _decomposition
from .base import MultiSequenceDecompositionMixin
from .ktica import KernelTICA
from .pca import PCA, SparsePCA, MiniBatchSparsePCA
from .sparsetica import SparseTICA
from .ksparsetica import KSparseTICA
from .tica import tICA
... | lgpl-2.1 |
AntonelliLab/seqcap_processor | src/plot_exon_contig_yield.py | 1 | 1799 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 23 11:40:16 2017
@author: tobias
"""
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Read the input data
input_file = '/Users/tobias/GitHub/seqcap_processor/data/processed/target_contigs/match_table.txt'
workdir ... | mit |
matthew-tucker/mne-python | mne/io/fiff/tests/test_raw.py | 3 | 39114 | from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import glob
from copy import deepcopy
import warnings
import itertools as itt
import numpy as np
... | bsd-3-clause |
ctools/ctools | examples/show_pull_histogram.py | 1 | 4671 | #! /usr/bin/env python
# ==========================================================================
# Shows the pull histogram
#
# Copyright (C) 2011-2021 Juergen Knoedlseder
#
# 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
#... | gpl-3.0 |
bigdataelephants/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
ndingwall/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 16 | 5431 | import pytest
import numpy as np
from scipy import sparse
from sklearn.preprocessing import FunctionTransformer
from sklearn.utils._testing import (assert_array_equal,
assert_allclose_dense_sparse)
from sklearn.utils._testing import assert_warns_message, assert_no_warnings
def _mak... | bsd-3-clause |
FiryZeplin/deep-learning | weight-initialization/helper.py | 153 | 3649 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, ... | mit |
kjung/scikit-learn | sklearn/tests/test_kernel_approximation.py | 78 | 7586 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
dsm054/pandas | pandas/tests/generic/test_series.py | 4 | 8241 | # -*- coding: utf-8 -*-
# pylint: disable-msg=E1101,W0612
from operator import methodcaller
import pytest
import numpy as np
import pandas as pd
from distutils.version import LooseVersion
from pandas import Series, date_range, MultiIndex
from pandas.compat import range
from pandas.util.testing import (assert_series... | bsd-3-clause |
kwinkunks/geopandas | tests/util.py | 8 | 7135 | import io
import os.path
from six.moves.urllib.request import urlopen
from geopandas import GeoDataFrame, GeoSeries
# Compatibility layer for Python 2.6: try loading unittest2
import sys
if sys.version_info[:2] == (2, 6):
try:
import unittest2 as unittest
except ImportError:
import unittest
e... | bsd-3-clause |
pypot/scikit-learn | examples/calibration/plot_calibration.py | 225 | 4795 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
zorojean/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 |
brandon-edwards/incubator-spot | spot-setup/migration/migrate_old_proxy_data.py | 7 | 11314 | #!/bin/env python
#
# 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 "Licens... | apache-2.0 |
vortex-ape/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 7 | 17343 | from __future__ import division
from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import scipy.sparse as sp
import os
import shutil
from tempfile import NamedTemporaryFile
import pytest
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.t... | bsd-3-clause |
nelsonag/openmc | examples/pincell_depletion/run_depletion.py | 8 | 5021 | from math import pi
import openmc
import openmc.deplete
import matplotlib.pyplot as plt
###############################################################################
# Define materials
###############################################################################
# Instantiate some Ma... | mit |
hms-dbmi/higlass | scripts/plot_grid.py | 2 | 1196 | #!/usr/bin/python
import json
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import sys
import argparse
plt.switch_backend('Qt5Agg')
def main():
parser = argparse.ArgumentParser(description="""
python plot_grid.py grid.json
""")
parser.add_argument('grid_filename')
#parser... | mit |
pkruskal/scikit-learn | examples/cluster/plot_digits_agglomeration.py | 377 | 1694 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Feature agglomeration
=========================================================
These images how similar features are merged together using
feature agglomeration.
"""
print(__doc__)
# Code source: Gaël Varoquaux
#... | bsd-3-clause |
bundgus/python-playground | matplotlib-playground/examples/pylab_examples/spine_placement_demo.py | 4 | 2813 | import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
x = np.linspace(-np.pi, np.pi, 100)
y = 2*np.sin(x)
ax = fig.add_subplot(2, 2, 1)
ax.set_title('centered spines')
ax.plot(x, y)
ax.spines['left'].set_position('center')
ax.spines['right'].set_color('none')
ax.spines['bottom'].set_position('center'... | mit |
3manuek/scikit-learn | examples/decomposition/plot_faces_decomposition.py | 204 | 4452 | """
============================
Faces dataset decompositions
============================
This example applies to :ref:`olivetti_faces` different unsupervised
matrix decomposition (dimension reduction) methods from the module
:py:mod:`sklearn.decomposition` (see the documentation chapter
:ref:`decompositions`) .
"""... | bsd-3-clause |
analogdevicesinc/gnuradio | gr-fec/python/fec/polar/channel_construction.py | 17 | 4537 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# 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 option)
# any later version.
#
# GNU Radio is... | gpl-3.0 |
UDST/activitysim | activitysim/abm/test/run_mp.py | 2 | 3034 | # ActivitySim
# See full license in LICENSE.txt.
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402
import os
import pandas as pd
import pandas.util.testing as pdt
from activitysim.core import tracing
from activity... | bsd-3-clause |
mdeger/nest-simulator | examples/nest/Potjans_2014/spike_analysis.py | 15 | 6288 | # -*- coding: utf-8 -*-
#
# spike_analysis.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,... | gpl-2.0 |
buntyke/GPy | GPy/util/pca.py | 8 | 4762 | '''
Created on 10 Sep 2012
@author: Max Zwiessele
@copyright: Max Zwiessele 2012
'''
import numpy
try:
import pylab
import matplotlib
except:
pass
from numpy.linalg.linalg import LinAlgError
from operator import setitem
import itertools
from functools import reduce
class PCA(object):
"""
PCA modul... | mit |
nettrom/importance | python/wikiproject/quality-analysis.py | 1 | 8674 | #!/usr/env/python
# -*- coding: utf-8 -*-
'''
Script to read in datasets for a WikiProject and run analysis of how
article quality and importance correlates.
Copyright (c) 2017 Morten Wang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files ... | mit |
hayd/SimpleCV | SimpleCV/MachineLearning/TestTemporalColorTracker.py | 12 | 1136 | from SimpleCV import Camera, Image, Color, TemporalColorTracker, ROI, Display
import matplotlib.pyplot as plt
cam = Camera(1)
tct = TemporalColorTracker()
img = cam.getImage()
roi = ROI(img.width*0.45,img.height*0.45,img.width*0.1,img.height*0.1,img)
tct.train(cam,roi=roi,maxFrames=250,pkWndw=20)
# Matplot Lib exampl... | bsd-3-clause |
NelisVerhoef/scikit-learn | sklearn/feature_extraction/tests/test_feature_hasher.py | 258 | 2861 | from __future__ import unicode_literals
import numpy as np
from sklearn.feature_extraction import FeatureHasher
from nose.tools import assert_raises, assert_true
from numpy.testing import assert_array_equal, assert_equal
def test_feature_hasher_dicts():
h = FeatureHasher(n_features=16)
assert_equal("dict",... | bsd-3-clause |
ChanChiChoi/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 142 | 5990 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
ashhher3/scikit-learn | doc/sphinxext/gen_rst.py | 16 | 39657 | """
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 __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
lamblin/pylearn2 | pylearn2/scripts/papers/jia_huang_wkshp_11/evaluate.py | 44 | 3208 | from __future__ import print_function
from optparse import OptionParser
import warnings
try:
from sklearn.metrics import classification_report
except ImportError:
classification_report = None
warnings.warn("couldn't find sklearn.metrics.classification_report")
try:
from sklearn.metrics import confusion... | bsd-3-clause |
AstroVPK/kali | tests/test_smooth.py | 2 | 1628 | import math
import numpy as np
import copy
import unittest
import random
import psutil
import sys
import pdb
import matplotlib.pyplot as plt
import matplotlib.cm as colormap
try:
import kali.carma
except ImportError:
print 'Cannot import kali.carma! kali is not setup. Setup kali by sourcing bin/setup.sh'
... | gpl-2.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/matplotlib/tests/test_streamplot.py | 7 | 2093 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import numpy as np
from numpy.testing import assert_array_almost_equal
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison, cleanup
i... | mit |
fyffyt/scikit-learn | examples/manifold/plot_manifold_sphere.py | 258 | 5101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
hilaskis/UAV_MissionPlanner | Lib/site-packages/scipy/signal/ltisys.py | 53 | 23848 | """
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
#
from filter_design import tf2zpk, zpk2tf, normalize
import numpy
from numpy import product, zeros, array, dot, tra... | gpl-2.0 |
Pymatteo/QtNMR | build/exe.win32-3.4/scipy/optimize/nonlin.py | 12 | 46461 | r"""
.. module:: scipy.optimize.nonlin
=================
Nonlinear solvers
=================
.. currentmodule:: scipy.optimize
This is a collection of general-purpose nonlinear multidimensional
solvers. These solvers find *x* for which *F(x) = 0*. Both *x*
and *F* can be multidimensional.
Routines
========
Large-... | gpl-3.0 |
wkfwkf/statsmodels | statsmodels/sandbox/examples/example_nbin.py | 33 | 13139 | # -*- coding: utf-8 -*-
'''
Author: Vincent Arel-Bundock <varel@umich.edu>
Date: 2012-08-25
This example file implements 5 variations of the negative binomial regression
model for count data: NB-P, NB-1, NB-2, geometric and left-truncated.
The NBin class inherits from the GenericMaximumLikelihood statsmodels class
wh... | bsd-3-clause |
ds283/splinter | python/examples/bspline.py | 2 | 1721 | # This file is part of the SPLINTER library.
# Copyright (C) 2012 Bjarne Grimstad (bjarne.grimstad@gmail.com).
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Add t... | mpl-2.0 |
yask123/scikit-learn | sklearn/__init__.py | 59 | 3038 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
bemxgm/Radon-Monitor | Code/PC dataloggher/PC dataloggher.py | 1 | 2686 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 05 17:10:19 2017
@author: Luca
"""
import sys
import serial # import Serial Library
import drawnow as drawnow
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
x_eval = np.linspace(0, 1024, 1024)
def Connect(cha... | gpl-3.0 |
YinongLong/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 73 | 2264 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
Martinfx/yodaqa | data/ml/fbpath/test_classifier.py | 3 | 3215 | #!/usr/bin/python
#
# Usage: fbpath_train_logistic.py TRAIN.JSON VAL.JSON [print]
#
# Trains and validate classifier for branched paths. The optional print parameter tells whether
# to print question text, predicted paths and gold standard for branched paths or not.
# The last line of output contains information about ... | apache-2.0 |
fabianp/scikit-learn | sklearn/neighbors/nearest_centroid.py | 199 | 7249 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
sekikn/incubator-airflow | docs/exts/docs_build/third_party_inventories.py | 5 | 3261 | # 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 |
mhostetter/gnuradio | gr-fec/python/fec/polar/channel_construction_awgn.py | 24 | 8560 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# 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 option)
# any later version.
#
# GNU Radio is... | gpl-3.0 |
qkitgroup/qkit | qkit/gui/plot/plot.py | 1 | 22840 | #-*- coding: utf-8 -*-
from subprocess import Popen, PIPE
import os
import numpy as np
import logging
import json
from numpy.core.multiarray import ndarray
logging.basicConfig(level=logging.INFO)
import qkit
from qkit.storage import store
from qkit.storage.hdf_constants import ds_types
try:
if qkit.module_avail... | gpl-2.0 |
pompiduskus/scikit-learn | sklearn/linear_model/ransac.py | 191 | 14261 | # coding: utf-8
# Author: Johannes Schönberger
#
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone
from ..utils import check_random_state, check_array, check_consistent_length
from ..utils.random import sample_without_replacement
from ..utils.valid... | bsd-3-clause |
uhjish/seaborn | seaborn/categorical.py | 19 | 102299 | from __future__ import division
from textwrap import dedent
import colorsys
import numpy as np
from scipy import stats
import pandas as pd
from pandas.core.series import remove_na
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
from .external.six import string_types
from .external.six.moves im... | bsd-3-clause |
CognitiveRobotics/rpg_svo | svo_analysis/src/svo_analysis/analyse_depth.py | 17 | 2697 | #!/usr/bin/python
import os
import argparse
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Cardo']})
rc('text', usetex=True)
def precision_plot(ax, errors, max_error, color, linestyle):
number_of_error_ranges = 500
error_step = max_error /... | gpl-3.0 |
mblondel/scikit-learn | examples/svm/plot_custom_kernel.py | 115 | 1546 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
# import some data... | bsd-3-clause |
beiko-lab/gengis | bin/Lib/site-packages/matplotlib/scale.py | 3 | 15951 | from __future__ import print_function
import numpy as np
from numpy import ma
from matplotlib.cbook import dedent
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
LogFormatterMathtext)
from matplotlib.ticker import (NullLocator, LogLocator, AutoLocator,
... | gpl-3.0 |
gsnbng/erpnext | erpnext/regional/report/datev/datev.py | 1 | 12719 | # coding: utf-8
"""
Provide a report and downloadable CSV according to the German DATEV format.
- Query report showing only the columns that contain data, formatted nicely for
dispay to the user.
- CSV download functionality `download_datev_csv` that provides a CSV file with
all required columns. Used to import th... | agpl-3.0 |
Griger/Intel-CervicalCancer-KaggleCompetition | script.py | 1 | 3535 | import glob
import pandas as pd
from PIL import ImageFilter, ImageStat, Image, ImageDraw
from multiprocessing import Pool, cpu_count
import cv2
import numpy as np
from sklearn.preprocessing import LabelEncoder
def im_multi(path):
try:
im_stats_im_ = Image.open(path)
return [path, {'size'... | gpl-3.0 |
kod3r/vigra | vigranumpy/examples/non_local_mean_2d_color.py | 10 | 1407 | import vigra
from vigra import numpy
from matplotlib import pylab
from time import time
import multiprocessing
path = "69015.jpg"
#path = "12074.jpg"
path = "100075.jpg"
path = "12003.jpg"
data = vigra.impex.readImage(path).astype(numpy.float32)
cpus = multiprocessing.cpu_count()
print "nCpus",cpus
t0 =time()
#fo... | mit |
tmadlener/phys_utils | python/MiscUtils/runwiseFitter.py | 1 | 5430 | #!/usr/bin/env python
import ROOT as ROOT
import os
from utils.miscHelpers import createRandomString, condMkDirFile
from utils.dimuon_fitting import JpsiModel, PsiPrimeModel, UpsilonModel, PhiModel
charm_trigger_selection = {
'HLT_Dimuon10_PsiPrime_Barrel_Seagulls': 1,
'HLT_Dimuon20_Jpsi_Barrel_Seagulls': 2,... | gpl-3.0 |
drewdru/AOI | roadLaneFinding/detectRoadLane.py | 1 | 7679 | import glob
import pickle
import matplotlib.image as mpimg
import numpy as np
from .image_gen import *
from PIL import Image
#--------------------------------------------------------------------
#PROCESSING FUNCTIONS
def undistort(image):
#undistort
calibration = pickle.load( open("./roadLaneFinding/calibrat... | gpl-3.0 |
alheinecke/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/tests/dataframe/arithmetic_transform_test.py | 62 | 2343 | # 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 |
petosegan/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 |
danialjahed/IDS-KDDcup | PrepareData/2.FeatureReduction/FeatureReduction.py | 1 | 1619 | import pandas as pd
import matplotlib.pyplot as plt
# import seaborn
Train_Data = pd.read_csv("../ProducedData/Train_Data_categorized.csv",header=None)
Test_Data = pd.read_csv("../ProducedData/Test_Data_categorized.csv",header=None)
# print(Train_Data.shape)
deleted_Features = []
l = len(Train_Data.iloc[0][:])
for i... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.