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 |
|---|---|---|---|---|---|
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/matplotlib/tests/test_path.py | 3 | 5638 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
import six
import numpy as np
from numpy.testing import assert_array_equal
from matplotlib.path import Path
from matplotlib.patches import Polygon
from nose.tools import assert_raises, assert_equ... | apache-2.0 |
nmayorov/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 267 | 6813 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... | bsd-3-clause |
vkuznet/rep | rep/estimators/tmva.py | 1 | 15640 | """
These classes are wrappers for physics machine learning library TMVA used .root format files (c++ library).
Now you can simply use it in python. TMVA contains classification and regression algorithms, including neural networks.
See `TMVA guide <http://mirror.yandex.ru/gentoo-distfiles/distfiles/TMVAUsersGuide-v4.03... | apache-2.0 |
vadimcn/vscode-lldb | debuggee/debugvis.py | 1 | 1118 | import io
import lldb
import debugger
import base64
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
def show():
image_bytes = io.BytesIO()
plt.savefig(image_bytes, format='png', bbox_inches='tight')
document = '<html><img src="data:image/png;base64,%s"></html>' % ... | mit |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/numpy/core/tests/test_multiarray.py | 2 | 220131 | from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decimal import Decimal
import numpy as... | gpl-2.0 |
JosmanPS/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 |
bigfootproject/OSMEF | data_processing/graphs/vm2vm_distance.py | 1 | 1825 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import json
data = json.load(open("../../osmef/data.json"))
N = 3
MS = 10 # markersize
xpoints = (0, 2, 4)
fig = plt.figure()
ax = fig.add_subplot(111)
lines = []
btc_data = []
btc_data.append(data["vm_to_vm_1"]["c=1"]["rx.rate_MBps"]["avg"])
bt... | apache-2.0 |
aajtodd/zipline | zipline/sources/data_frame_source.py | 26 | 5253 | #
# 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 |
toastedcornflakes/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 93 | 3243 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
mwv/scikit-learn | sklearn/metrics/cluster/tests/test_supervised.py | 206 | 7643 | import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import homogeneity_score
from sklearn.metrics.cluster import completeness_score
from sklearn.metrics.cluster import v_measure_score
from sklearn.metrics.cluster import homogeneity_completeness_v_measure
from sklearn... | bsd-3-clause |
heli522/scikit-learn | sklearn/feature_selection/__init__.py | 244 | 1088 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
xdnian/pyml | code/optional-py-scripts/ch11.py | 4 | 11413 | # Sebastian Raschka, 2015 (http://sebastianraschka.com)
# Python Machine Learning - Code Examples
#
# Chapter 11 - Working with Unlabeled Data – Clustering Analysis
#
# S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015.
# GitHub Repo: https://github.com/rasbt/python-machine-learning-book
#
# License: MIT... | mit |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/test_multilevel.py | 7 | 92692 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101,W0141
import datetime
import itertools
import nose
from numpy.random import randn
import numpy as np
from pandas.core.index import Index, MultiIndex
from pandas import Panel, DataFrame, Series, notnull, isnull, Timestamp
from pandas.types.common import is_flo... | mit |
dongjoon-hyun/spark | python/pyspark/sql/dataframe.py | 9 | 102339 | #
# 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 |
cbertinato/pandas | pandas/tests/frame/test_reshape.py | 1 | 39296 | from datetime import datetime
import itertools
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame, Index, MultiIndex, Period, Series, Timedelta, date_range)
from pandas.tests.frame.common import TestData
import pandas.util.testing as tm
from pandas.util.testing import assert_frame... | bsd-3-clause |
LohithBlaze/scikit-learn | examples/classification/plot_classifier_comparison.py | 181 | 4699 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=====================
Classifier comparison
=====================
A comparison of a several classifiers in scikit-learn on synthetic datasets.
The point of this example is to illustrate the nature of decision boundaries
of different classifiers.
This should be taken with ... | bsd-3-clause |
deisi/SFG2D | sfg2d/fig.py | 1 | 27972 | #!/usr/bin.env python
# coding: utf-8
"""Module for figure function."""
import os
import numpy as np
import matplotlib.pyplot as plt
import sfg2d
import logging
from .plot import fit_model
def ioff(func):
"""Decorator to make plotting non interactive temporally ."""
def make_ioff(*args, **kwargs):
p... | mit |
CellModels/tyssue | tests/geometry/test_bulkgeometry.py | 2 | 3672 | import pandas as pd
from tyssue import config
from tyssue.core import Epithelium
from tyssue.generation import three_faces_sheet, extrude
from tyssue.geometry.bulk_geometry import BulkGeometry
def test_bulk_update_vol():
datasets_2d, _ = three_faces_sheet(zaxis=True)
datasets = extrude(datasets_2d, method=... | gpl-2.0 |
jakobworldpeace/scikit-learn | examples/text/document_clustering.py | 32 | 8526 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
jereze/scikit-learn | sklearn/datasets/samples_generator.py | 103 | 56423 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... | bsd-3-clause |
dblalock/bolt | experiments/python/datasets/imagenet.py | 1 | 18539 | #!/bin/env python
from __future__ import absolute_import, division, print_function
import numpy as np
import os
import PIL
import pickle
import psutil # pip install psutil
import shutil
import sys # just for stderr for warnings
# import warnings
from PIL import Image
from python import files
from python import im... | mpl-2.0 |
Clyde-fare/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
RTHMaK/RPGOne | scipy-2017-sklearn-master/notebooks/figures/plot_scaling.py | 5 | 3240 | import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.preprocessing import StandardScaler, MinMaxScaler, Normalizer, RobustScaler
from sklearn.model_selection import train_test_split
from .plot_helpers import cm2
def plot_scaling():
X, y = make_blobs(n_samples=50,... | apache-2.0 |
jenfly/atmos-tools | testing/testing-variables-potential_temp.py | 1 | 1557 | # Standard scientific modules:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from mpl_toolkits.basemap import Basemap
import xray
from datetime import datetime
# My modules:
import atmos.utils as utils
import atmos.plots as ap
import atmos.data as dat
import atmos.variables as av
from atmos.ut... | mit |
aselle/tensorflow | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 24 | 6776 | # 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 |
jaeilepp/eggie | mne/stats/tests/test_cluster_level.py | 1 | 19602 | import numpy as np
from numpy.testing import (assert_equal, assert_array_equal,
assert_array_almost_equal)
from nose.tools import assert_true, assert_raises
from scipy import sparse, linalg, stats
from mne.fixes import partial
import warnings
from mne.parallel import _force_serial
from mne.st... | bsd-2-clause |
subutai/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_cairo.py | 69 | 16706 | """
A Cairo backend for matplotlib
Author: Steve Chaplin
Cairo is a vector graphics library with cross-device output support.
Features of Cairo:
* anti-aliasing
* alpha channel
* saves image files as PNG, PostScript, PDF
http://cairographics.org
Requires (in order, all available from Cairo website):
cairo, pyc... | agpl-3.0 |
wangmiao1981/spark | python/pyspark/pandas/tests/test_typedef.py | 15 | 16852 | #
# 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 |
trankmichael/scikit-learn | sklearn/metrics/cluster/unsupervised.py | 230 | 8281 | """ Unsupervised evaluation metrics. """
# Authors: Robert Layton <robertlayton@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ..pairwise import pairwise_distances
def silhouette_score(X, labels, metric='euclidean', sample_size=None,
random... | bsd-3-clause |
sandeepgupta2k4/tensorflow | tensorflow/examples/learn/wide_n_deep_tutorial.py | 29 | 8985 | # 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 |
evgchz/scikit-learn | sklearn/decomposition/pca.py | 14 | 22688 | """ 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>
# Michael Eickenberg <michael.eickenberg@inria.fr>
#
# Lice... | bsd-3-clause |
markstoehr/phoneclassification | local/load_compare_phone_sets_msc_kernel.py | 1 | 4439 | import numpy as np
from sklearn import cross_validation, svm
from sklearn.grid_search import GridSearchCV
from sklearn.svm import SVC
import argparse
parser = argparse.ArgumentParser("""Code to use cross-validation to assess the performance of kernel svms on pairwise-comparisons
""")
parser.add_argument('--phn_set1',t... | gpl-3.0 |
harisbal/pandas | pandas/tests/io/test_stata.py | 2 | 64716 | # -*- coding: utf-8 -*-
# pylint: disable=E1101
import datetime as dt
import io
import gzip
import os
import struct
import warnings
from collections import OrderedDict
from datetime import datetime
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
import pandas.compat as compat
fr... | bsd-3-clause |
giorgiop/scikit-learn | examples/linear_model/plot_lasso_and_elasticnet.py | 73 | 2074 | """
========================================
Lasso and Elastic Net for Sparse Signals
========================================
Estimates Lasso and Elastic-Net regression models on a manually generated
sparse signal corrupted with an additive noise. Estimated coefficients are
compared with the ground-truth.
"""
print(... | bsd-3-clause |
Obus/scikit-learn | sklearn/datasets/__init__.py | 176 | 3671 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... | bsd-3-clause |
ttm/gmaneLegacy | setup.py | 1 | 4479 | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as... | unlicense |
itsvetkov/pyqtgraph | pyqtgraph/widgets/MatplotlibWidget.py | 12 | 1213 | from ..Qt import QtGui, QtCore, USE_PYSIDE
import matplotlib
if USE_PYSIDE:
matplotlib.rcParams['backend.qt4']='PySide'
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
from matplotlib.figu... | mit |
matthewjwoodruff/moeasensitivity | controlmaps/hv_bestworst.py | 1 | 2463 | """
Copyright (C) 2013 Matthew Woodruff
This script 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 later version.
This script is distributed in th... | lgpl-3.0 |
xiaoxq/apollo | modules/tools/plot_control/plot_control.py | 3 | 3578 | #!/usr/bin/env python3
###############################################################################
# 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 |
Eric89GXL/mne-python | mne/io/fieldtrip/tests/test_fieldtrip.py | 6 | 13664 | # -*- coding: UTF-8 -*-
# Authors: Thomas Hartmann <thomas.hartmann@th-ht.de>
# Dirk Gütlin <dirk.guetlin@stud.sbg.ac.at>
#
# License: BSD (3-clause)
import mne
import os.path
import pytest
import copy
import itertools
import numpy as np
from mne.datasets import testing
from mne.io.fieldtrip.utils import NOIN... | bsd-3-clause |
nikitasingh981/scikit-learn | examples/preprocessing/plot_robust_scaling.py | 85 | 2698 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Robust Scaling on Toy Data
=========================================================
Making sure that each Feature has approximately the same scale can be a
crucial preprocessing step. However, when data contains o... | bsd-3-clause |
lodemo/CATANA | src/face_recognition/facenet/tmp/deepdream.py | 4 | 10431 | # boilerplate code
import numpy as np
from functools import partial
import PIL.Image
import tensorflow as tf
import matplotlib.pyplot as plt
import urllib2
import os
import zipfile
def main():
# download pre-trained model by running the command below in a shell
# wget https://storage.googleapis.com/download.... | mit |
garbersc/keras-galaxies | try_dense_only_keras_try_fullFit_maxout.py | 1 | 16421 | import theano.sandbox.cuda.basic_ops as sbcuda
import numpy as np
# import pandas as pd
import keras.backend as T
import load_data
import realtime_augmentation as ra
import time
import csv
import os
import cPickle as pickle
from datetime import datetime, timedelta
from keras.models import Sequential, Model
from keras.... | bsd-3-clause |
canast02/microsoft-malware-classification-challenge | solution6.py | 1 | 2564 | import os
from csv import writer
from sklearn.ensemble import ExtraTreesClassifier, AdaBoostClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn import cross_validation
import six
import utilities
# Decide read/write mode based on python version
read_mode, write_mode = ('r', 'w') if six.PY2 els... | apache-2.0 |
glennq/scikit-learn | sklearn/utils/tests/test_multiclass.py | 58 | 14316 |
from __future__ import division
import numpy as np
import scipy.sparse as sp
from itertools import product
from sklearn.externals.six.moves import xrange
from sklearn.externals.six import iteritems
from scipy.sparse import issparse
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sp... | bsd-3-clause |
arnaud-reveillere/SAMBA | Examples/SAMBA_User_Guide_Example_1.py | 1 | 5204 | # Progamm is running on Windows 7 32 bits with python-2.7.1 + numpy-1.6.0 + scipy-0.9.0 + matplotlib-1.0.1
# contact: Arnaud Reveillere a.reveillere@brgm.fr / arnaud.reveillere@gmail.com
# Import some matplotlib function (only required for the plots)
from pylab import figure, xlabel, ylabel, plot, legend, subplot, sav... | gpl-3.0 |
lail3344/sms-tools | lectures/08-Sound-transformations/plots-code/FFT-filtering.py | 21 | 1723 | import math
import matplotlib.pyplot as plt
import numpy as np
import time, os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
import utilFunctions as UF
(fs, x) = UF.wavread('../../../sounds/orchestra.wav')
N = 2048
start = 1.0*fs
... | agpl-3.0 |
glennq/scikit-learn | examples/gaussian_process/plot_compare_gpr_krr.py | 67 | 5191 | """
==========================================================
Comparison of kernel ridge and Gaussian process regression
==========================================================
Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn
a target function by employing internally the "kernel trick... | bsd-3-clause |
blue-yonder/pyscaffold | docs/conf.py | 1 | 9484 | # This file is execfile()d with the current directory set to its containing dir.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# All configuration values have a default; values that are comme... | mit |
AIML/scikit-learn | sklearn/linear_model/omp.py | 127 | 30417 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... | bsd-3-clause |
deepesch/scikit-learn | sklearn/__init__.py | 154 | 3014 | """
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 |
qe-team/marmot | marmot/experiment/run_experiment_ngram.py | 1 | 19765 | from __future__ import print_function, division
from argparse import ArgumentParser
import yaml
import logging
import os
import sys
import time
from subprocess import call
from marmot.experiment.import_utils import build_objects, build_object, call_for_each_element, import_class
from marmot.experiment.preprocessing_u... | isc |
toobaz/pandas | pandas/core/dtypes/inference.py | 2 | 8731 | """ basic inference routines """
from collections import abc
from numbers import Number
import re
from typing import Pattern
import numpy as np
from pandas._libs import lib
is_bool = lib.is_bool
is_integer = lib.is_integer
is_float = lib.is_float
is_complex = lib.is_complex
is_scalar = lib.is_scalar
is_decimal... | bsd-3-clause |
wdurhamh/statsmodels | statsmodels/sandbox/distributions/examples/ex_transf2.py | 31 | 13582 | # -*- coding: utf-8 -*-
"""
Created on Sun May 09 22:23:22 2010
Author: josef-pktd
Licese: BSD
"""
from __future__ import print_function
import numpy as np
from numpy.testing import assert_almost_equal
from scipy import stats
from statsmodels.sandbox.distributions.extras import (
ExpTransf_gen, LogTransf_gen,
... | bsd-3-clause |
arjoly/scikit-learn | sklearn/utils/testing.py | 6 | 26573 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# Giorgio Patrini
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import... | bsd-3-clause |
dhruv13J/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
juliantaylor/scipy | scipy/interpolate/tests/test_rbf.py | 4 | 4162 | #!/usr/bin/env python
# Created by John Travers, Robert Hetland, 2007
""" Test functions for rbf module """
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (assert_, assert_array_almost_equal,
assert_almost_equal, run_module_suit... | bsd-3-clause |
ravindrapanda/tensorflow | tensorflow/examples/learn/iris_run_config.py | 76 | 2565 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
zxjzxj9/tools | bandplot2.py | 1 | 6945 | """
Written by zxj, 2016/6/26
Plot the band structure read from vasprun.xml
Version 0.2
Requirements:
lxml, for xml file reading
matplotlib, for plotting
scipy, for interpolation
ConfigParser, to parse ini files
Further extensions:
PySide, add a gui tool
"""
#! /usr/bin/env python
import os
import sys
import Con... | gpl-2.0 |
androguard/androguard | androguard/cli/main.py | 1 | 19384 | # core modules
import os
import re
import shutil
import sys
# 3rd party modules
from lxml import etree
# internal modules
from androguard.core import androconf
from androguard.core.bytecodes import apk
from androguard.core.bytecodes.axml import AXMLPrinter
from androguard.util import read
from pygments import highli... | apache-2.0 |
schreiberx/sweet | benchmarks_plane/nonlinear_interaction/pp_plot_kineticenergy_spectrum_single.py | 2 | 2873 | #! /usr/bin/env python3
import sys
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.ticker as ticker
from mule.postprocessing.JobsData import *
if len(sys.argv) >= 3:
#return d['plane_data_kinetic_energy.spectrum']
m... | mit |
yl565/statsmodels | examples/incomplete/wls_extended.py | 33 | 16137 | """
Weighted Least Squares
example is extended to look at the meaning of rsquared in WLS,
at outliers, compares with RLM and a short bootstrap
"""
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
data = sm.datasets.ccard.load()
data.exog = sm.add_c... | bsd-3-clause |
grantstephens/pyluno | setup.py | 1 | 1485 | from setuptools import setup, find_packages
with open('pyluno/meta.py') as f:
exec(f.read())
setup(
name='pyluno',
version=__version__,
packages=find_packages(exclude=['tests']),
description='A Luno API for Python',
author='Cayle Sharrock/Grant Stephens',
author_email='grant@stephens.co.za'... | mit |
lancezlin/ml_template_py | lib/python2.7/site-packages/IPython/sphinxext/ipython_directive.py | 3 | 42645 | # -*- coding: utf-8 -*-
"""
Sphinx directive to support embedded IPython code.
This directive allows pasting of entire interactive IPython sessions, prompts
and all, and their code will actually get re-executed at doc build time, with
all prompts renumbered sequentially. It also allows you to input code as a pure
pyth... | mit |
jadhavhninad/-CSE_515_MWD_Analytics- | Phase 2/DEMO/Phase 2 submissions/Phase 2 Submission/Code/MWDBProject/mwd_proj/mwd_proj/scripts_p2/Ninad/user_movie_matrix.py | 2 | 7837 | '''
Generating a user-genre matrix.
Ranking the genres of a movie based on
sum of movies rankings of a genre * year_wt of a movie (assumptiom : movies watched recently shows the latest choices of a user )
Based on the ranking of genres,
recommend 5 unwatched movies total starting from the genres that are higher... | gpl-3.0 |
tchakravarty/pmtk3 | python/demos/linregDemo1.py | 26 | 1104 | #!/usr/bin/python2.4
import numpy
import scipy.stats
import matplotlib.pyplot as plt
def main():
# true parameters
w = 2
w0 = 3
sigma = 2
# make data
numpy.random.seed(1)
Ntrain = 20
xtrain = numpy.linspace(0,10,Ntrain)
ytrain = w*xtrain + w0 + numpy.random.random(Ntrain)*sigma
... | mit |
prheenan/Research | Perkins/Scratch/5_15_2016_Gaussian_Sampling/Main_Gaussian_Sampling.py | 1 | 1501 | # 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
from scipy.stats.distributions import norm
def run():
"""
<Description>
Args:
... | gpl-3.0 |
chrsrds/scikit-learn | examples/linear_model/plot_lasso_dense_vs_sparse_data.py | 54 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
sfepy/sfepy | examples/linear_elasticity/elastic_contact_sphere.py | 5 | 2718 | r"""
Elastic contact sphere simulating an indentation test.
Find :math:`\ul{u}` such that:
.. math::
\int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u})
+ \int_{\Gamma} \ul{v} \cdot f(d(\ul{u})) \ul{n}(\ul{u})
= 0 \;,
where
.. math::
D_{ijkl} = \mu (\delta_{ik} \delta_{jl} + \delta_{il} \delta_{jk... | bsd-3-clause |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/examples/pylab_examples/hexbin_demo2.py | 3 | 1189 | """
hexbin is an axes method or pyplot function that is essentially a
pcolor of a 2-D histogram with hexagonal cells.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
delta = 0.025
x = y = np.arange(-3.0, 3.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, ... | gpl-2.0 |
rezoo/chainer | examples/vae/train_vae_custom_loop.py | 3 | 5429 | #!/usr/bin/env python
"""Chainer example: train a VAE on MNIST
"""
import argparse
import os
import chainer
from chainer.dataset import convert
import numpy as np
import net
def main():
parser = argparse.ArgumentParser(description='Chainer example: VAE')
parser.add_argument('--initmodel', '-m', default='',
... | mit |
jreback/pandas | pandas/tests/indexes/timedeltas/test_indexing.py | 2 | 10043 | from datetime import datetime, timedelta
import re
import numpy as np
import pytest
import pandas as pd
from pandas import Index, Timedelta, TimedeltaIndex, notna, timedelta_range
import pandas._testing as tm
class TestGetItem:
def test_ellipsis(self):
# GH#21282
idx = timedelta_range("1 day", "... | bsd-3-clause |
theoryno3/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 254 | 2253 | """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 |
jmetzen/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
zfrenchee/pandas | pandas/tests/io/test_pytables.py | 1 | 216877 | import pytest
import os
import tempfile
from contextlib import contextmanager
from warnings import catch_warnings
from distutils.version import LooseVersion
import datetime
from datetime import timedelta
import numpy as np
import pandas as pd
from pandas import (Series, DataFrame, Panel, Panel4D, MultiIndex, Int64In... | bsd-3-clause |
PinPinIre/Final-Year-Project | src/graph_sim.py | 1 | 2081 | import dateutil.parser
import time
import argparse
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from os.path import isdir, join
from datetime import datetime
minute = 60
hour = 3600
corpus_model = "%s.%s"
sizes = [10000, 20000, 30000, 40000, 50000]
knn_sizes = sizes[:3]
def plt_3(figure, d1,... | mit |
hamogu/COStools | eventlists.py | 1 | 19517 | '''collect all functions that deal directly with event lists for e.g.::
- Timing
'''
import numpy as np
import scipy
import scipy.stats
import matplotlib as mpl
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from PyAstronomy.pyTiming import pyPeriod
from astropy.table import Table
import glob
import... | gpl-2.0 |
victorbergelin/scikit-learn | examples/linear_model/plot_ard.py | 248 | 2622 | """
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with Bayesian Ridge Regression.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary l... | bsd-3-clause |
PhdDone/AD3 | python/example.py | 3 | 2817 | import matplotlib.pyplot as plt
import numpy as np
from ad3 import simple_grid, general_graph
def example_binary():
# generate trivial data
x = np.ones((10, 10))
x[:, 5:] = -1
x_noisy = x + np.random.normal(0, 0.8, size=x.shape)
x_thresh = x_noisy > .0
# create unaries
unaries = x_noisy
... | lgpl-3.0 |
lkovanen/TMFinder | python/motif_selector.py | 1 | 21049 | """Common command line interface for reading motifs.
"""
import os
import sys
import motif as mf
import operator
import argparse
import collections
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class FileError(Error):
"""Something wrong with reading input file.
Attribu... | gpl-3.0 |
tongwang01/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | 1 | 25833 | # 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 |
anddam/trading-with-python | lib/widgets.py | 78 | 3012 | # -*- coding: utf-8 -*-
"""
A collection of widgets for gui building
Copyright: Jev Kuznetsov
License: BSD
"""
from __future__ import division
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Figur... | bsd-3-clause |
glouppe/scikit-learn | examples/feature_stacker.py | 50 | 1910 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | bsd-3-clause |
TsmileAssassin/stock_discover | stock_main.py | 2 | 12612 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
from guoren_api import GuorenApi
from tonghuashui_api import TonghuashuiApi
from xueqiu_data import XueqiuStockList
from xueqiu_strategy import XueqiuStrategies
plt.style.use('ggplot')
def generate_data_by_code_using_guoren(c... | apache-2.0 |
hbhzwj/GAD | gad/Detector/SVMDetector.py | 1 | 13253 | """
This file is the flow by flow svm detector
"""
from __future__ import print_function, division, absolute_import
import os
SVM_FOLDER = os.environ.get('SVM_FOLDER')
import subprocess
import argparse
from .mod_util import plot_points
from .Base import BaseDetector
from ..util import save_csv, plt
from ..util import... | gpl-3.0 |
deepesch/scikit-learn | sklearn/tests/test_cross_validation.py | 19 | 44125 | """Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse import csr_matrix
from scipy import stats
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.test... | bsd-3-clause |
madjelan/scikit-learn | sklearn/decomposition/base.py | 313 | 5647 | """Principal Component Analysis Base Classes"""
# 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>
# Kyle Kastner <kastnerkyle@gmail.com>
#
# Licen... | bsd-3-clause |
davidshepherd7/oomph-lib-micromagnetics | control_scripts/parse.py | 1 | 52488 | #!/usr/bin/env python3
# Future proofing
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Imports from main libraries
import subprocess as subp
from multiprocessing import Pool
import multiprocessing
import sys
import argparse
import os
import os.path
impo... | gpl-2.0 |
pratapvardhan/scikit-image | doc/examples/segmentation/plot_marked_watershed.py | 8 | 1999 | """
===============================
Markers for watershed transform
===============================
The watershed is a classical algorithm used for **segmentation**, that
is, for separating different objects in an image.
Here a marker image is built from the region of low gradient inside the image.
In a gradient imag... | bsd-3-clause |
zhuango/python | sklearnLearning/statisticalAndSupervisedLearning/OOB_on_rf.py | 2 | 2340 | import matplotlib.pyplot as plt
from collections import OrderedDict
from sklearn.datasets import make_classification
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier
# Author: Kian Ho <hui.kian.ho@gmail.com>
# Gilles Louppe <g.louppe@gmail.com>
# Andreas Mueller <amueller@ais.... | gpl-2.0 |
joelgrus/posterization-pyladies | posterization.py | 2 | 7006 | from __future__ import division
from matplotlib.image import imread
import matplotlib.pyplot as plt
import numpy as np
import random
def rescale_pixel(rgb_pixel):
"""given a rgb pixel (red, green, blue), where each color
is a number between 0 and 255, return the rescaled pixel
with values between 0.0 and 1... | unlicense |
numenta-ci/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/pyplot.py | 69 | 77521 | import sys
import matplotlib
from matplotlib import _pylab_helpers, interactive
from matplotlib.cbook import dedent, silent_list, is_string_like, is_numlike
from matplotlib.figure import Figure, figaspect
from matplotlib.backend_bases import FigureCanvasBase
from matplotlib.image import imread as _imread
from matplotl... | agpl-3.0 |
drammock/mne-python | mne/tests/test_source_space.py | 4 | 43303 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from shutil import copytree
import pytest
import scipy
import numpy as np
from numpy.testing import (assert_array_equal, assert_allclose... | bsd-3-clause |
bokeh/bokeh | bokeh/core/property/bases.py | 1 | 18492 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
maybedy/MLDLStudy | week1/JY/train_neuralnet2.py | 1 | 1270 | import sys, os
sys.path.append(os.pardir)
import numpy as np
from dataset.mnist import load_mnist
from two_layer_net import TwoLayerNet
from optimizers import *
import matplotlib.pyplot as plt
(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, one_hot_label=True)
network = TwoLayerNet(input_size=784, ... | mit |
larsoner/mne-python | tutorials/intro/plot_40_sensor_locations.py | 5 | 14471 | """
.. _tut-sensor-locations:
Working with sensor locations
=============================
This tutorial describes how to read and plot sensor locations, and how
the physical location of sensors is handled in MNE-Python.
.. contents:: Page contents
:local:
:depth: 2
As usual we'll start by importing the module... | bsd-3-clause |
ibm-cds-labs/pixiedust | pixiedust/display/chart/renderers/matplotlib/barChartDisplay.py | 1 | 4647 | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | apache-2.0 |
itdxer/neupy | examples/cnn/mnist_cnn.py | 1 | 2654 | import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn import metrics, datasets
from neupy.layers import *
from neupy import algorithms
def load_data():
X, y = datasets.fetch_openml('mnist_784', version=1, return_X_y=True)
X = X.re... | mit |
plotly/plotly.py | packages/python/plotly/plotly/matplotlylib/mplexporter/renderers/vincent_renderer.py | 1 | 1864 | import warnings
from .base import Renderer
from ..exporter import Exporter
class VincentRenderer(Renderer):
def open_figure(self, fig, props):
self.chart = None
self.figwidth = int(props["figwidth"] * props["dpi"])
self.figheight = int(props["figheight"] * props["dpi"])
def draw_line(... | mit |
huobaowangxi/scikit-learn | sklearn/preprocessing/data.py | 113 | 56747 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# License: BSD 3 clause
from itertools import chain, combina... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.