repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/numpy/doc/creation.py | 52 | 5507 | """
==============
Array Creation
==============
Introduction
============
There are 5 general mechanisms for creating arrays:
1) Conversion from other Python structures (e.g., lists, tuples)
2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros,
etc.)
3) Reading arrays from disk, either from... | bsd-3-clause |
bsipocz/seaborn | seaborn/tests/test_axisgrid.py | 11 | 41072 | import warnings
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib as mpl
import matplotlib.pyplot as plt
from distutils.version import LooseVersion
import nose.tools as nt
import numpy.testing as npt
from numpy.testing.decorators import skipif
import pandas.util.testing as tm
from . im... | bsd-3-clause |
PrashntS/scikit-learn | sklearn/datasets/svmlight_format.py | 79 | 15976 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
patvarilly/units_and_physics | docs/sphinxext/numpydoc/tests/test_docscrape.py | 2 | 15295 | # -*- encoding:utf-8 -*-
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
from docscrape_sphinx import SphinxDocString, SphinxClassDoc
from nose.tools import *
doc_txt = '''\
numpy.multivariate_normal(mean, cov, shape=None, sp... | gpl-3.0 |
nhejazi/scikit-learn | examples/classification/plot_lda_qda.py | 32 | 5476 | """
====================================================================
Linear and Quadratic Discriminant Analysis with covariance ellipsoid
====================================================================
This example plots the covariance ellipsoids of each class and
decision boundary learned by LDA and QDA. The... | bsd-3-clause |
jmanday/Master | TFM/scripts/matching-FlannBased.py | 1 | 4521 | # -*- coding: utf-8 -*-
#########################################################################
### Jesus Garcia Manday
### matching-FlannBased.py
### @Descripcion: script para calcular el matching entre dos conjuntos de
### de descriptores de dos imágenes usando el algoritmo
### Flann en el... | apache-2.0 |
saiwing-yeung/scikit-learn | setup.py | 25 | 11732 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
import subprocess
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distut... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/extension/base/interface.py | 2 | 2982 | import numpy as np
from pandas.core.dtypes.common import is_extension_array_dtype
from pandas.core.dtypes.dtypes import ExtensionDtype
import pandas as pd
import pandas._testing as tm
from .base import BaseExtensionTests
class BaseInterfaceTests(BaseExtensionTests):
"""Tests that the basic interface is satisfi... | bsd-3-clause |
huzq/scikit-learn | sklearn/metrics/_plot/tests/test_plot_roc_curve.py | 3 | 7954 | import pytest
import numpy as np
from numpy.testing import assert_allclose
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import plot_roc_curve
from sklearn.metrics import RocCurveDisplay
from sklearn.metrics import roc_curve
from sklearn.metrics import auc
from sklearn.datasets import load_iris
... | bsd-3-clause |
drewdru/AOI | controllers/segmentationController.py | 1 | 18817 | """
@package segmentationController
Controller for qml Segmentation
"""
import sys
import os
import numpy
import matplotlib.pyplot as plt
import random
import time
import math
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
from imageProcessor import colorModel, histogramService, im... | gpl-3.0 |
jkarnows/scikit-learn | examples/cluster/plot_lena_segmentation.py | 271 | 2444 | """
=========================================
Segmenting the picture of Lena in regions
=========================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous regions.
This procedure (spe... | bsd-3-clause |
siliconsmiley/QGIS | python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py | 5 | 9868 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QGISAlgorithmProvider.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... | gpl-2.0 |
lucabaldini/ximpol | ximpol/examples/grs1915.py | 1 | 5202 | #!/usr/bin/env python
#
# Copyright (C) 2016, the ximpol team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Thi... | gpl-3.0 |
samzhang111/scikit-learn | sklearn/utils/tests/test_seq_dataset.py | 93 | 2471 | # Author: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.seq_dataset import ArrayDataset, CSRDataset
from sklearn.datasets import load_iris
from numpy.testing import assert_array_equal
from nose.tools import assert_equal
iris =... | bsd-3-clause |
rohanp/scikit-learn | sklearn/metrics/cluster/tests/test_unsupervised.py | 230 | 2823 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn.metrics.cluster.unsupervised import silhouette_score
from sklearn.metrics import pairwise_distances
from sklearn.utils.testing import assert_false, assert_almost_equal
from sklearn.utils.testing import assert_raises_regexp... | bsd-3-clause |
dimkastan/PyTorch-Spectral-clustering | FiedlerVectorLaplacian.py | 1 | 2627 | """
% -------------------------------------------------------------
% Matlab code
% -------------------------------------------------------------
% grpah partition using the eigenvector corresponding to the second
% smallest eigenvalue
% grpah partition using the eigenvector c... | mit |
Garrett-R/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 16 | 10538 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
cwu2011/scikit-learn | examples/classification/plot_lda_qda.py | 164 | 4806 | """
====================================================================
Linear and Quadratic Discriminant Analysis with confidence ellipsoid
====================================================================
Plot the confidence ellipsoids of each class and decision boundary
"""
print(__doc__)
from scipy import lin... | bsd-3-clause |
schets/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
srowen/spark | python/pyspark/pandas/data_type_ops/num_ops.py | 5 | 19156 | #
# 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 |
rsivapr/scikit-learn | sklearn/datasets/species_distributions.py | 10 | 7844 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
costypetrisor/scikit-learn | sklearn/preprocessing/data.py | 2 | 51228 | # 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 |
LaurenLuoYun/losslessh264 | plot_prior_misses.py | 40 | 1124 | # Run h264dec on a single file compiled with PRIOR_STATS and then run this script
# Outputs timeseries plot at /tmp/misses.pdf
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import os
def temporal_misses(key):
values = data[key]
numbins = 100
binsize = len(values) // n... | bsd-2-clause |
mph-/lcapy | lcapy/circuitgraph.py | 1 | 12275 | """
This module provides a class to represent circuits as graphs.
This is primarily for loop analysis but is also used for nodal analysis.
Copyright 2019--2021 Michael Hayes, UCECE
"""
from matplotlib.pyplot import subplots, savefig
import networkx as nx
# V1 1 0 {u(t)}; down
# R1 1 2; right=2
# L1 2 3; down=2
# W... | lgpl-2.1 |
idlead/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 160 | 6028 | # 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 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/dask/array/tests/test_slicing.py | 1 | 19010 | import pytest
pytest.importorskip('numpy')
import itertools
from operator import getitem
from dask.compatibility import skip
import dask.array as da
from dask.array.slicing import (slice_array, _slice_1d, take, new_blockdim,
sanitize_index)
from dask.array.utils import assert_eq
import... | mit |
JPFrancoia/scikit-learn | sklearn/model_selection/tests/test_split.py | 7 | 41116 | """Test the split module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from scipy import stats
from scipy.misc import comb
from itertools import combinations
from sklearn.utils.fixes import combinations_with_replacement
from sklearn.u... | bsd-3-clause |
chenyyx/scikit-learn-doc-zh | examples/en/applications/plot_prediction_latency.py | 13 | 11475 | """
==================
Prediction Latency
==================
This is an example showing the prediction latency of various scikit-learn
estimators.
The goal is to measure the latency one can expect when doing predictions
either in bulk or atomic (i.e. one by one) mode.
The plots represent the distribution of the pred... | gpl-3.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/sandbox/km_class.py | 5 | 11704 | #a class for the Kaplan-Meier estimator
import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
class KAPLAN_MEIER(object):
def __init__(self, data, timesIn, groupIn, censoringIn):
raise RuntimeError('Newer version of Kaplan-Meier class available in survival2.py')
#store the inputs... | apache-2.0 |
AlexanderFabisch/scikit-learn | benchmarks/bench_isotonic.py | 268 | 3046 | """
Benchmarks of isotonic regression performance.
We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.
The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.
This alows the scaling of the algorith... | bsd-3-clause |
CforED/Machine-Learning | examples/linear_model/plot_ols_3d.py | 350 | 2040 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Sparsity Example: Fitting only features 1 and 2
=========================================================
Features 1 and 2 of the diabetes-dataset are fitted and
plotted below. It illustrates that although feature... | bsd-3-clause |
karvenka/sp17-i524 | project/S17-IO-3012/code/bin/benchmark_replicas_mapreduce.py | 19 | 5506 | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
"""retrieves mandatory parameter to program
@param: none
@type: n/a
"""
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
"""... | apache-2.0 |
Averroes/statsmodels | statsmodels/examples/run_all.py | 34 | 1984 | '''run all examples to make sure we don't get an exception
Note:
If an example contaings plt.show(), then all plot windows have to be closed
manually, at least in my setup.
uncomment plt.show() to show all plot windows
'''
from __future__ import print_function
from statsmodels.compat.python import lzip, input
import... | bsd-3-clause |
bikong2/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 57 | 8062 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | bsd-3-clause |
TickSmith/tickvault-python-api | setup.py | 1 | 1907 | # ----------------------------------------------------------------------
# setup.py -- tksapi setup script
#
# Copyright (C) 2017, TickSmith Corp.
# ----------------------------------------------------------------------
from setuptools import find_packages, setup
from codecs import open
from os import path
here = p... | mit |
SKIRT/PTS | core/basics/colour.py | 1 | 13317 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | agpl-3.0 |
arahuja/scikit-learn | examples/mixture/plot_gmm_sin.py | 248 | 2747 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
phoebe-project/phoebe2 | tests/nosetests/test_dynamics/test_dynamics_grid.py | 1 | 9061 | """
"""
import phoebe
from phoebe import u
import numpy as np
import matplotlib.pyplot as plt
def _keplerian_v_nbody(b, ltte, period, plot=False):
"""
test a single bundle for the phoebe backend's kepler vs nbody dynamics methods
"""
# TODO: loop over ltte=True,False (once keplerian dynamics support... | gpl-3.0 |
dpaiton/OpenPV | pv-core/analysis/python/plot_time_stability_all_patches.py | 1 | 10838 | """
Plots the time stability
"""
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.cm as cm
import PVReadWeights as rw
import PVConversions as conv
import scipy.cluster.vq as sp
import math
if len(sys.argv) < 5:
print "usage: time_stability file... | epl-1.0 |
gimli-org/gimli | pygimli/physics/sNMR/mrs.py | 1 | 30988 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Magnetic resonance sounding module."""
# general modules to import according to standards
import time
import numpy as np
import matplotlib.pyplot as plt
import pygimli as pg
from pygimli.utils import iterateBounds
from pygimli.utils.base import gmat2numpy
from pygimli... | apache-2.0 |
bmazin/ARCONS-pipeline | legacy/arcons_control/lib/pulses_v1.py | 1 | 21557 |
# encoding: utf-8
"""
pulses.py
Created by Ben Mazin on 2011-05-04.
Copyright (c) 2011 . All rights reserved.
"""
import numpy as np
import time
import os
from tables import *
import matplotlib
import scipy as sp
import scipy.signal
from matplotlib.pyplot import plot, figure, show, rc, grid
import m... | gpl-2.0 |
KasperPRasmussen/bokeh | examples/plotting/file/clustering.py | 6 | 2136 | """ Example inspired by an example from the scikit-learn project:
http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html
"""
import numpy as np
try:
from sklearn import cluster, datasets
from sklearn.preprocessing import StandardScaler
except ImportError:
raise ImportError('This... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/matplotlib/tests/test_artist.py | 6 | 6247 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import warnings
from matplotlib.externals import six
import io
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
import matplotlib.path... | apache-2.0 |
lazywei/scikit-learn | examples/ensemble/plot_forest_importances.py | 241 | 1761 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
raymondxyang/tensorflow | tensorflow/examples/learn/wide_n_deep_tutorial.py | 18 | 8111 | # 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 |
Thomsen22/MissingMoney | Premium - 24 Bus/premium_function.py | 1 | 18638 | # Python standard modules
import numpy as np
import pandas as pd
from collections import defaultdict
import optimization as results
def premiumfunction(timeperiod, bidtype, newpremium, reservemargin):
df_price0, zones, gens_for_zones, df_zonalconsumption, df_zonalwindproduction, df_zonalsolarproduction,... | gpl-3.0 |
chemelnucfin/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_test.py | 6 | 60842 | # 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 |
JosmanPS/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 264 | 1804 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
maxlikely/scikit-learn | sklearn/neighbors/nearest_centroid.py | 4 | 5895 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD Style.
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..externals.six.moves i... | bsd-3-clause |
kadrlica/obztak | obztak/scratch/dither.py | 1 | 7433 | import os
import numpy as np
import pylab
import matplotlib.path
from matplotlib.collections import PolyCollection
import obztak.utils.projector
import obztak.utils.fileio as fileio
import obztak.utils.constants
pylab.ion()
############################################################
params = {
#'backend': 'eps... | mit |
neale/CS-program | 434-MachineLearning/final_project/linearClassifier/sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | unlicense |
smartscheduling/scikit-learn-categorical-tree | sklearn/mixture/tests/test_gmm.py | 1 | 15738 | import unittest
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_matrix
from sklearn.utils... | bsd-3-clause |
TuKo/brainiak | tests/fcma/test_mvpa_voxel_selection.py | 5 | 1917 | # Copyright 2016 Intel Corporation
#
# 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... | apache-2.0 |
ashwinvis/sthlm-bostad-vis | sssb.py | 1 | 4096 | import os
from io import StringIO
from lxml import html, etree
import pandas as pd
from itertools import chain, islice
import matplotlib.pyplot as plt
from datetime import date
from base import ParserBase
try:
from requests_selenium import Render
except ImportError:
from requests_webkit import Render
def ic... | gpl-3.0 |
rhennigan/code | python/forwardEuler.py | 1 | 1208 | # QUIZ
#
# Modify the for loop below to
# set the values of the t, x, and v
# arrays to implement the Forward
# Euler Method for num_steps many steps.
# To see plots on your own computer, uncomment the two lines below...
import numpy
import matplotlib.pyplot
# from udacityplots import * # ...and comment... | gpl-2.0 |
zmlabe/IceVarFigs | Scripts/SeaIce/plot_sit_PIOMAS_monthly_v2.py | 1 | 8177 | """
Author : Zachary M. Labe
Date : 23 August 2016
"""
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
import datetime
import calendar as cal
import matplotlib.colors as c
import cmocean
### Define constants
### Directory and time
directo... | mit |
sagarjauhari/BCIpy | cleanup/debug.py | 1 | 1128 | # Copyright 2013, 2014 Justis Grant Peters and Sagar Jauhari
# This file is part of BCIpy.
#
# BCIpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
xavierwu/scikit-learn | sklearn/neighbors/tests/test_approximate.py | 71 | 18815 | """
Testing for the approximate neighbor search using
Locality Sensitive Hashing Forest module
(sklearn.neighbors.LSHForest).
"""
# Author: Maheshakya Wijewardena, Joel Nothman
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
clemkoa/scikit-learn | sklearn/exceptions.py | 50 | 5276 | """
The :mod:`sklearn.exceptions` module includes all custom warnings and error
classes used across scikit-learn.
"""
__all__ = ['NotFittedError',
'ChangedBehaviorWarning',
'ConvergenceWarning',
'DataConversionWarning',
'DataDimensionalityWarning',
'EfficiencyWarn... | bsd-3-clause |
pnisarg/ABSA | src/acd_acs_rule.py | 1 | 10304 | import pandas as pd
from sklearn.model_selection import train_test_split
import codecs
from collections import OrderedDict
import pickle
import json,ast
import sys
from sklearn.metrics import f1_score
def loadCategoryData(categoryDataPath):
"""
Module to load the aspect category dataset
Args:
... | mit |
peterfpeterson/mantid | qt/python/mantidqt/project/plotssaver.py | 3 | 14097 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
benschmaus/catapult | third_party/google-endpoints/future/utils/__init__.py | 36 | 20238 | """
A selection of cross-compatible functions for Python 2 and 3.
This module exports useful functions for 2/3 compatible code:
* bind_method: binds functions to classes
* ``native_str_to_bytes`` and ``bytes_to_native_str``
* ``native_str``: always equal to the native platform string object (because
... | bsd-3-clause |
mattcaldwell/zipline | tests/utils/test_factory.py | 34 | 2175 | #
# Copyright 2013 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 |
Aasmi/scikit-learn | sklearn/feature_selection/tests/test_rfe.py | 209 | 11733 | """
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris,... | bsd-3-clause |
EntilZha/PyFunctional | functional/test/test_functional.py | 1 | 36609 | # pylint: skip-file
import unittest
import array
from collections import namedtuple
from itertools import product
from functional.pipeline import Sequence, is_iterable, _wrap, extend
from functional.transformations import name
from functional import seq, pseq
Data = namedtuple("Data", "x y")
def pandas_is_installed... | mit |
JohanComparat/nbody-npt-functions | bin/bin_SMHMr/plot_slice_simulation.py | 1 | 4452 | import StellarMass
import XrayLuminosity
import numpy as n
from scipy.stats import norm
from scipy.integrate import quad
from scipy.interpolate import interp1d
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as p
import glob
import astropy.io.fits as fits
import os
import time
import numpy as n
impor... | cc0-1.0 |
russel1237/scikit-learn | sklearn/utils/tests/test_validation.py | 79 | 18547 | """Tests for input validation functions"""
import warnings
from tempfile import NamedTemporaryFile
from itertools import product
import numpy as np
from numpy.testing import assert_array_equal
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from sklearn.utils.... | bsd-3-clause |
yaukwankiu/armor | tests/modifiedMexicanHatTest15_march2014_sigmaPreprocessing16.py | 1 | 7833 | # modified mexican hat wavelet test.py
# spectral analysis for RADAR and WRF patterns
# NO plotting - just saving the results: LOG-response spectra for each sigma and max-LOG response numerical spectra
# pre-convolved with a gaussian filter of sigma=10
import os, shutil
import time, datetime
import pickle
imp... | cc0-1.0 |
awalls-cx18/gnuradio | gr-filter/examples/interpolate.py | 7 | 8811 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
vybstat/scikit-learn | examples/cluster/plot_adjusted_for_chance_measures.py | 286 | 4353 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... | bsd-3-clause |
rupakc/Kaggle-Compendium | San Francisco Salaries/salary-baseline.py | 1 | 2919 | import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import BaggingRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.ensemble import AdaBoostRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.ensemble import RandomTreesEmbedding
fr... | mit |
MikeDT/CNN_2_BBN | Synthetic_Data_Creator.py | 1 | 12328 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 11 13:31:40 2017
@author: Mike
# create datasets
# tune complexity
# have a variety of methods/types
# then create in bulk
# save in a single df
# pickle the edges and the df
# adjust the trainer to split out from that style input (importPrepX from CNN_2_BBN.py)
#
# then... | apache-2.0 |
wkfwkf/statsmodels | statsmodels/datasets/cpunish/data.py | 25 | 2597 | """US Capital Punishment dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = __doc__
SOURCE = """
Jeff Gill's `Generalized Linear Models: A Unified Approach`
http://jgill.wustl.edu/research/books.html
"""... | bsd-3-clause |
tawsifkhan/scikit-learn | sklearn/tree/export.py | 53 | 15772 | """
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Trevor... | bsd-3-clause |
antoinebrl/practice-ML | rbf.py | 1 | 3759 | # Author : Antoine Broyelle
# Licence : MIT
# inspired by : KTH - DD2432 : Artificial Neural Networks and Other Learning Systems
# https://www.kth.se/student/kurser/kurs/DD2432?l=en
import numpy as np
from kmeans import Kmeans
from pcn import PCN
from utils.distances import euclidianDist
class RBF:
'''Radial Basi... | mit |
gchrupala/reimaginet | imaginet/simple_data.py | 2 | 7498 | import numpy
import cPickle as pickle
import gzip
import os
import copy
import funktional.util as util
from funktional.util import autoassign
from sklearn.preprocessing import StandardScaler
import string
import random
# Types of tokenization
def words(sentence):
return sentence['tokens']
def characters(sentence... | mit |
cicwi/tomo_box | tomobox.py | 1 | 90395 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 15:39:33 2017
@author: kostenko & der sarkissian
*********** Pilot for the new tomobox *************
"""
#%% Initialization
import matplotlib.pyplot as plt
from scipy import misc # Reading BMPs
import os
import numpy
import re
import t... | gpl-3.0 |
ahnqirage/spark | python/setup.py | 4 | 10245 | #!/usr/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 "Li... | apache-2.0 |
arcyfelix/Courses | 17-06-05-Machine-Learning-For-Trading/40_portfolio_optimization.py | 1 | 4642 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
''' Read: http://pandas.pydata.org/pandas-docs/stable/api.html#api-dataframe-stats '''
def symbol_to_path(symbol, base_dir = 'data'):
return os.path.join(base_dir, "{}.csv".format(str(symbol)))
def dates_crea... | apache-2.0 |
gyoto/Gyoto | python/example.py | 1 | 8032 | #/bin/env python
# -*- coding: utf-8 -*-
# Example file for gyoto
#
# Copyright 2014-2018 Thibaut Paumard
#
# This file is part of Gyoto.
#
# Gyoto 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 versio... | gpl-3.0 |
richardwolny/sms-tools | lectures/09-Sound-description/plots-code/spectralFlux-onsetFunction.py | 25 | 1330 | import numpy as np
import matplotlib.pyplot as plt
import essentia.standard as ess
M = 1024
N = 1024
H = 512
fs = 44100
spectrum = ess.Spectrum(size=N)
window = ess.Windowing(size=M, type='hann')
flux = ess.Flux()
onsetDetection = ess.OnsetDetection(method='hfc')
x = ess.MonoLoader(filename = '../../../sounds/speech-m... | agpl-3.0 |
dwettstein/pattern-recognition-2016 | mlp/neural_network/exceptions.py | 35 | 4329 | """
The :mod:`sklearn.exceptions` module includes all custom warnings and error
classes used across scikit-learn.
"""
__all__ = ['NotFittedError',
'ChangedBehaviorWarning',
'ConvergenceWarning',
'DataConversionWarning',
'DataDimensionalityWarning',
'EfficiencyWarn... | mit |
AstroFloyd/LearningPython | 3D_plotting/sphere.py | 1 | 2168 | #!/bin/env python3
# https://stackoverflow.com/a/32427177/1386750
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Define constants:
r2d = 180 / np.pi
d2r = np.pi / 180
# Choose projection:
vpAlt = 10.0 * d2r
vpAz = 80.0 * d2r
# Setup plot:
fig = plt.figure()
ax = fig... | gpl-3.0 |
guoxiaolongzte/spark | dev/sparktestsupport/modules.py | 6 | 15623 | #
# 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 |
rafaelmds/fatiando | cookbook/seismic_wavefd_scalar.py | 7 | 2067 | """
Seismic: 2D finite difference simulation of scalar wave propagation.
Difraction example in cylindrical wedge model. Based on:
R. M. Alford, K. R. Kelly and D. M. Boore -
Accuracy of finite-difference modeling of the acoustic wave equation.
Geophysics 1974
"""
import numpy as np
from matplotlib import animation
fr... | bsd-3-clause |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/pandas/tests/test_internals.py | 9 | 45145 | # -*- coding: utf-8 -*-
# pylint: disable=W0102
from datetime import datetime, date
import nose
import numpy as np
import re
import itertools
from pandas import Index, MultiIndex, DataFrame, DatetimeIndex, Series, Categorical
from pandas.compat import OrderedDict, lrange
from pandas.sparse.array import SparseArray
f... | artistic-2.0 |
ishanic/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
mjudsp/Tsallis | examples/svm/plot_weighted_samples.py | 95 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
dsm054/pandas | pandas/util/_test_decorators.py | 2 | 6935 | """
This module provides decorator functions which can be applied to test objects
in order to skip those objects when certain conditions occur. A sample use case
is to detect if the platform is missing ``matplotlib``. If so, any test objects
which require ``matplotlib`` and decorated with ``@td.skip_if_no_mpl`` will be... | bsd-3-clause |
joequant/zipline | zipline/data/ffc/loaders/us_equity_pricing.py | 16 | 21283 | # 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 |
cdeil/rootpy | setup.py | 1 | 4900 | #!/usr/bin/env python
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from glob import glob
import os
from os.path import join
import sys
local_path = os.path.dirname(os.path.abspath(__file__))
# setup.py can be called from outside the rootpy directory
os.chdi... | gpl-3.0 |
scikit-hep/uproot | uproot3/pandas.py | 1 | 1165 | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot3/blob/master/LICENSE
"""Top-level functions for Pandas."""
from __future__ import absolute_import
import uproot3.tree
from uproot3.source.memmap import MemmapSource
from uproot3.source.xrootd import XRootDSource
from uproot3.sourc... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/pandas/core/series.py | 1 | 134982 | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import division
# pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
import types
import warnings
from textwrap import dedent
import numpy as np
import numpy.ma as ma
from pandas.core.accessor import Cac... | mit |
ibis-project/ibis | ibis/backends/pandas/execution/window.py | 1 | 16879 | """Code for computing window functions with ibis and pandas."""
import functools
import operator
import re
from typing import Any, List, NoReturn, Optional, Union
import pandas as pd
import toolz
from pandas.core.groupby import SeriesGroupBy
import ibis.common.exceptions as com
import ibis.expr.operations as ops
imp... | apache-2.0 |
JPFrancoia/scikit-learn | sklearn/covariance/tests/test_covariance.py | 79 | 12193 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
pap/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qtagg.py | 73 | 4972 | """
Render to qt from agg
"""
from __future__ import division
import os, sys
import matplotlib
from matplotlib import verbose
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backend_version, \
... | agpl-3.0 |
Knight13/Exploring-Deep-Neural-Decision-Trees | Otto/NNDT_RF.py | 1 | 2651 | import numpy as np
import tensorflow as tf
import random
from neural_network_decision_tree import nn_decision_tree
from joblib import Parallel, delayed
"""train_data and test_data are list containg the X_train, y_train and X_test, y_test
obatined after splitting the data set using sklearn.model_selection.train_tes... | unlicense |
bavardage/statsmodels | statsmodels/examples/ex_emplike_1.py | 3 | 3620 | """
This is a basic tutorial on how to conduct basic empirical likelihood
inference for descriptive statistics. If matplotlib is installed
it also generates plots.
"""
import numpy as np
import statsmodels.api as sm
print 'Welcome to El'
np.random.seed(634) # No significance of the seed.
# Let's first generate some ... | bsd-3-clause |
oche-jay/vEQ-benchmark | vEQ_ssim/vEQ_ssim.py | 1 | 17701 | '''
Created on 1 Jul 2015
@author: oche
'''
from __future__ import unicode_literals
import sys
import argparse
import os
import logging
import traceback
from util import validURLMatch, validYoutubeURLMatch
import subprocess
from subprocess import Popen
import re
from os.path import expanduser
from youtube_dl.utils im... | gpl-2.0 |
jturney/psi4 | psi4/driver/qcdb/mpl.py | 7 | 54234 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.