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 |
|---|---|---|---|---|---|
fabioticconi/scikit-learn | sklearn/utils/graph.py | 289 | 6239 | """
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD 3 clause
impo... | bsd-3-clause |
fclesio/learning-space | Python/ims24/oldfolders/airflow/dags/module/visualize.py | 2 | 3799 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import psycopg2
import os
import logging
import time
import seaborn as sns; sns.set(color_codes=True)
import matplotlib.pyplot as plt
from sqlalchemy import text
from sqlalchemy import create_engine
# Get environment variables
host = os.environ['IMS_HOSTNAME'... | gpl-2.0 |
joernhees/scikit-learn | benchmarks/bench_plot_lasso_path.py | 84 | 4005 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
voxlol/scikit-learn | examples/svm/plot_separating_hyperplane_unbalanced.py | 329 | 1850 | """
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... | bsd-3-clause |
elijah513/scikit-learn | sklearn/feature_selection/tests/test_base.py | 170 | 3666 | import numpy as np
from scipy import sparse as sp
from nose.tools import assert_raises, assert_equal
from numpy.testing import assert_array_equal
from sklearn.base import BaseEstimator
from sklearn.feature_selection.base import SelectorMixin
from sklearn.utils import check_array
class StepSelector(SelectorMixin, Ba... | bsd-3-clause |
rs2/pandas | pandas/tests/frame/methods/test_asof.py | 2 | 5767 | import numpy as np
import pytest
from pandas._libs.tslibs import IncompatibleFrequency
from pandas import (
DataFrame,
Period,
Series,
Timestamp,
date_range,
period_range,
to_datetime,
)
import pandas._testing as tm
@pytest.fixture
def date_range_frame():
"""
Fixture for DataFram... | bsd-3-clause |
treycausey/scikit-learn | examples/plot_classifier_comparison.py | 8 | 4681 | #!/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 |
billy-inn/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
tosolveit/scikit-learn | examples/gaussian_process/gp_diabetes_dataset.py | 223 | 1976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
========================================================================
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
========================================================================
In this example, we fit a Gaussian Process model onto... | bsd-3-clause |
djgagne/scikit-learn | sklearn/naive_bayes.py | 70 | 28476 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | bsd-3-clause |
aminert/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
kl0u/flink | flink-python/pyflink/table/tests/test_pandas_udf.py | 2 | 16974 | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | apache-2.0 |
466152112/scikit-learn | benchmarks/bench_sparsify.py | 323 | 3372 | """
Benchmark SGD prediction time with dense/sparse coefficients.
Invoke with
-----------
$ kernprof.py -l sparsity_benchmark.py
$ python -m line_profiler sparsity_benchmark.py.lprof
Typical output
--------------
input data sparsity: 0.050000
true coef sparsity: 0.000100
test data sparsity: 0.027400
model sparsity:... | bsd-3-clause |
bgris/ODL_bgris | lib/python3.5/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_kernel_config.py | 24 | 15358 | # Configuration file for ipython-kernel.
c = get_config()
#------------------------------------------------------------------------------
# IPKernelApp configuration
#------------------------------------------------------------------------------
# IPython: an enhanced interactive Python shell.
# IPKernelApp will in... | gpl-3.0 |
staneyffer/cnsoft_image | app/img/download_info.py | 1 | 1038 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from app.models import User, R_Img_Label, R_User_Img, R_User_Img_Label, Img, Label
import numpy as np
import pandas as pd
import openpyxl
from threading import Thread
import os
from .image import oss_imgage
basedir = os.path.abspath(os.path.dirname(__file__))
file_url = b... | mit |
timmie/cartopy | lib/cartopy/tests/mpl/test_web_services.py | 3 | 1651 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of cartopy.
#
# cartopy 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)... | gpl-3.0 |
onaclovtech/SimpleCV | scripts/install/win/OpenKinect/freenect-examples/demo_mp_async.py | 15 | 1082 | #!/usr/bin/env python
import freenect
import matplotlib.pyplot as mp
import signal
import frame_convert
mp.ion()
image_rgb = None
image_depth = None
keep_running = True
def display_depth(dev, data, timestamp):
global image_depth
data = frame_convert.pretty_depth(data)
mp.gray()
mp.fig... | bsd-3-clause |
lbdreyer/cartopy | lib/cartopy/examples/geostationary.py | 5 | 1931 | """
Reprojecting images from a Geostationary projection
---------------------------------------------------
This example demonstrates Cartopy's ability to project images into the desired
projection on-the-fly. The image itself is retrieved from a URL and is loaded
directly into memory without storing it intermediately... | lgpl-3.0 |
Fireblend/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 |
dennisobrien/bokeh | bokeh/plotting/helpers.py | 3 | 30431 | from __future__ import absolute_import
from collections import Iterable, OrderedDict, Sequence
import difflib
import itertools
import re
import textwrap
import warnings
import numpy as np
import sys
from six import string_types, reraise
from ..models import (
BoxSelectTool, BoxZoomTool, CategoricalAxis, Mercator... | bsd-3-clause |
rseubert/scikit-learn | examples/applications/plot_model_complexity_influence.py | 25 | 6378 | """
==========================
Model Complexity Influence
==========================
Demonstrate how model complexity influences both prediction accuracy and
computational performance.
The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for
regression (resp. classification).
For each class of models we m... | bsd-3-clause |
rvbelefonte/Rockfish2 | rockfish2/database/tests/test_database.py | 1 | 5852 | """
Test suite for the rockfish2.database module
"""
import os
import doctest
import unittest
import pandas as pd
from rockfish2.database import database
class databaseTestCase(unittest.TestCase):
"""
Tests for the database.utils module
"""
def test_init(self):
"""
Should initialize a ... | gpl-2.0 |
sonnyhu/scikit-learn | sklearn/feature_extraction/image.py | 263 | 17600 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | bsd-3-clause |
jaidevd/scikit-learn | sklearn/__init__.py | 28 | 3073 | """
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 |
maheshakya/scikit-learn | examples/cluster/plot_lena_compress.py | 271 | 2229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Vector Quantization Example
=========================================================
The classic image processing example, Lena, an 8-bit grayscale
bit-depth, 512 x 512 sized image, is used here to illustrate
how ... | bsd-3-clause |
tjhei/burnman_old2 | example_comparewithdepth.py | 2 | 5897 | # BurnMan - a lower mantle toolkit
# Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
# Released under GPL v2 or later.
"""
This example script is intended for absolute beginners to BurnMan.
We cover importing BurnMan modules, creating a composite material,
and calculating its seismic pro... | gpl-2.0 |
Ambrosys/climatelearn | climatelearn/learning/classify.py | 1 | 1446 | import classification.weka_class_MP as weka
def classification_train(method, params, train_data):
"""
It is called to perform a single training with random validation set. The model trained until the default stopping
condition is met, is then returned,
config: dictionary
It contains all t... | gpl-2.0 |
its-izhar/Emotion-Recognition-Using-SVMs | source/Train Classifier and Test Video Feed.py | 1 | 8009 | """
The MIT License (MIT)
Copyright (c) 2016 Izhar Shaikh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | mit |
JeanKossaifi/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 |
jacksu/machine-learning | src/ml/recommend.py | 1 | 1945 | import numpy as np
import pandas as pd
header = ['user_id', 'item_id', 'rating', 'timestamp']
df = pd.read_csv('ml-100k/u.data', sep='\t', names=header)
n_users = df.user_id.unique().shape[0]
n_items = df.item_id.unique().shape[0]
print('Number of users = ' + str(n_users) + ' | Number of movies = ' + str(n_items))
#你... | mit |
chris-allan/openmicroscopy | components/tools/OmeroPy/src/flim-omero.py | 4 | 31381 | """
components/tools/OmeroPy/scripts/omero/analysis_scripts/FLIM.py
-----------------------------------------------------------------------------
Copyright (C) 2006-2010 University of Dundee. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GN... | gpl-2.0 |
YuepengGuo/zipline | tests/test_batchtransform.py | 12 | 10257 | #
# 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 |
schackv/shapewarp | shapewarp/warp.py | 1 | 4324 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 19 14:22:40 2014
@author: schackv
"""
import numpy as np
import scipy.spatial
from matplotlib.path import Path
import scipy.ndimage as ndimage
class Warper:
def __init__(self, shape, scale=1):
"""
Initalize a Warper with a reference shape with coor... | mit |
tectronics/ioapps | ioprofiler/grapher.py | 2 | 8805 | #IOApps, IO profiler and IO traces replayer
#
# Copyright (C) 2010 Jiri Horky <jiri.horky@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... | gpl-2.0 |
Cophy08/ggplot | ggplot/stats/stat_bin2d.py | 8 | 2679 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import defaultdict
import pandas as pd
import numpy as np
from ggplot.utils import make_iterable_ntimes
from .stat import stat
_MSG_STATUS = """stat_bin2d is still under construction.
The re... | bsd-2-clause |
brajagopalcse/SAIL_CodeMixed-ICON-2017 | randomBaseline.py | 1 | 3220 |
#!/usr/bin/env python3
"""
Script to calculate different metrices from the labelled test dataset using the gold dataset for the SAIL (Codemixed) 2017 shared task @ICON-2017.
This script requires the gold annotated file provided by the organizers.
If your system is unable to predict sentiment of a sentence, then tag... | mit |
MatthieuBizien/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 21 | 47783 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
SunilMahendrakar/pagmo | PyGMO/examples/racing.py | 8 | 9989 | from PyGMO import *
import random
import numpy as np
import matplotlib.pyplot as plt
import copy
def brute_force_average_f(pop_noisy, num_winner, eval_budget):
"""
Allocate evenly the evaluation budget to all the individuals.
The winners will be determined by the averaged objective values.
(Note: Only... | gpl-3.0 |
wadetb/tinynumpy | docs/ext/docscrape_sphinx.py | 9 | 7751 | import re
import inspect
import textwrap
import pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring,... | mit |
asensar/python-opendaq | opendaq/DAQControl.py | 1 | 34229 | '''
Created on 01/03/2012
@author: Adrian
'''
import os
import sys
import wx
from daq import *
import threading
import time
from wx.lib.agw.floatspin import FloatSpin
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.bac... | lgpl-3.0 |
jonnyhuck/shed-earth | shedcalc/schmidt.py | 1 | 4882 | # -*- coding: utf-8 -*-
from django import http
from scipy.stats import t
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from numpy import zeros, ones, array, sqrt, log10
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
'''
# If it whinges about matplotlib, do this:
# ... | gpl-3.0 |
holwech/pysa | main.py | 1 | 2087 | import numpy as np
import matplotlib.pylab as plt
import pysa.emd as emddev
import pysa.eemd as eemdev
import pysa.visualization as plotter
import pysa.utils as utils
if __name__ == '__main__':
max_modes = 15
ensembles = 100
ensembles_per_process = 10
max_siftings = 200
end_time = 1
sample_fre... | mit |
mxjl620/scikit-learn | sklearn/metrics/cluster/bicluster.py | 359 | 2797 | from __future__ import division
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from sklearn.utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shap... | bsd-3-clause |
mojoboss/scikit-learn | benchmarks/bench_plot_fastkmeans.py | 294 | 4676 | from __future__ import print_function
from collections import defaultdict
from time import time
import numpy as np
from numpy import random as nr
from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans
def compute_bench(samples_range, features_range):
it = 0
results = defaultdict(lambda: [])
chun... | bsd-3-clause |
bmazin/ARCONS-pipeline | astrometry/calculateCR.py | 1 | 2904 | #!/bin/python
'''
Author: Paul Szypryt Date: April 30, 2013
Based on CircleFit.java (September 22, 2011 Jennifer Milburn, Original Implementation).
Takes a list of x and y positions on the array and calculates the location of a circle center that
would fit those points.
'''
import numpy as np
import matplotlib as ... | gpl-2.0 |
yanlend/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 103 | 22297 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
harshaneelhg/scikit-learn | sklearn/cluster/bicluster.py | 211 | 19443 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
nmayorov/scikit-learn | sklearn/manifold/setup.py | 99 | 1243 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
shikhardb/scikit-learn | sklearn/neighbors/tests/test_dist_metrics.py | 48 | 4949 | import itertools
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from nose import SkipTest
def cmp_version(version1, version2):
version1 = tuple(map(int, version1.split('.')[:2]... | bsd-3-clause |
cwu2011/scikit-learn | examples/classification/plot_digits_classification.py | 289 | 2397 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
herilalaina/scikit-learn | examples/gaussian_process/plot_compare_gpr_krr.py | 84 | 5205 | """
==========================================================
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 |
zimuxin/AliMusicPrediction | 阿里音乐流行趋势预测项目_Group13/AliMusicPrediction/music_prediction-master/pic/stestFinal.py | 1 | 7414 | # -*- coding: utf-8 -*-
# @Author : leeYandong,CaoWenqiang
import time
import numpy as np
import csv
import matplotlib.pyplot as plt
from matplotlib.legend_handler import HandlerLine2D
#--------stable-------------------
import os,sys
from numpy import fmax
path = os.getcwd()
parent_path = os.path.dirname(path)
... | mit |
TNick/pylearn2 | pylearn2/train_extensions/roc_auc.py | 30 | 4854 | """
TrainExtension subclass for calculating ROC AUC scores on monitoring
dataset(s), reported via monitor channels.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
import numpy as np
try:
from sklearn.metrics import roc_auc_score
except ImportEr... | bsd-3-clause |
jseabold/statsmodels | statsmodels/tsa/statespace/tests/test_univariate.py | 5 | 27186 | """
Tests for univariate treatment of multivariate models
TODO skips the tests for measurement disturbance and measurement disturbance
covariance, which do not pass. The univariate smoother *appears* to be
correctly implemented against Durbin and Koopman (2012) chapter 6, yet still
gives a different answer from the co... | bsd-3-clause |
Ldpe2G/mxnet | example/ssd/detect/detector.py | 16 | 6261 | from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.testdb import TestDB
from dataset.iterator import DetIter
class Detector(object):
"""
SSD detector which hold a detection network and wraps detection API
Parameters:
-----... | apache-2.0 |
waterponey/scikit-learn | benchmarks/bench_plot_lasso_path.py | 84 | 4005 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
justinfinkle/pydiffexp | pydiffexp/plot.py | 1 | 36502 | import itertools
import warnings
from collections import Counter
import matplotlib as mpl
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
import palettable.colorbrewer as cbrewer
import pandas as pd
import seaborn as sns
from cycler import cycler
from matplotlib.lines import Lin... | gpl-3.0 |
natj/bender | runs/out2/plot_carter.py | 1 | 9067 | #!/usr/bin/python
from __future__ import division
import sys
import os
import h5py
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_grid1 import ImageGrid
from matplotlib.patches import Ellipse
from matplotlib.colors import LogNorm
... | mit |
lavakyan/mstm-spectrum | mstm_studio/diel_size_correction.py | 1 | 4280 | import numpy as np
from mstm_studio.mstm_spectrum import Material
from mstm_studio.contributions import MieSingleSphere
size_correction_gold = {'omp': 8.6, 'gbulk': 0.07, 'vF': 1.4, 'A': 0.3}
class SizeCorrectedMaterial(Material):
def __init__(self, file_name, wls=None, nk=None, eps=None, sizecor=None):
... | gpl-3.0 |
laszlocsomor/tensorflow | tensorflow/python/keras/_impl/keras/engine/training.py | 5 | 98431 | # Copyright 2015 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 |
bloyl/mne-python | mne/io/array/tests/test_array.py | 4 | 6460 | # Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_equal)
import pytest
import matplotlib.pyplot as plt
from mne import find_events, Epochs, pick_t... | bsd-3-clause |
ratnania/pigasus | tests/test_dirichlet_2d.py | 1 | 2184 | # -*- coding: UTF-8 -*-
#! /usr/bin/python
from pigasus.utils.manager import context
# ...
try:
from matplotlib import pyplot as plt
PLOT=True
except ImportError:
PLOT=False
# ...
import numpy as np
from pigasus.fem.basicPDE import *
import sys
import inspect
filename = inspect.getfile(inspe... | mit |
Titan-C/scikit-learn | examples/calibration/plot_calibration.py | 1 | 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 |
jucares/lisn_utils | lisn_utils/plotter.py | 1 | 32708 | # -*- coding: utf-8 -*-
'''
Utilities to plot gps data
@author: Juan C. Espinoza
@contact: jucar.espinoza@gmail.com
'''
__version__ = 1.0
import os, time
import numpy as np
from StringIO import StringIO
from pkg_resources import resource_string
import utility as utl
import gps
from gpsdatetime import GPSDateTime, t... | gpl-3.0 |
magnusax/ml-meta-wrapper | gazer/classifiers/adaboost.py | 1 | 3489 | from scipy.stats import randint
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from ..base import EnsembleBaseClassifier
from ..utils.stats import _uniform
class MetaAdaBoostClassifier(EnsembleBaseClassifier):
... | mit |
manashmndl/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 44 | 17033 | import tempfile
import shutil
import os.path as op
import warnings
from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.externals import joblib
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.t... | bsd-3-clause |
manashmndl/scikit-learn | sklearn/tests/test_naive_bayes.py | 142 | 17496 | import pickle
from io import BytesIO
import numpy as np
import scipy.sparse
from sklearn.datasets import load_digits, load_iris
from sklearn.cross_validation import cross_val_score, train_test_split
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.te... | bsd-3-clause |
sonnyhu/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 159 | 10196 | import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dis... | bsd-3-clause |
davidpvilaca/TEP | aula4/classifica_separado.py | 1 | 3285 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 24 11:42:40 2017
@author: davidpvilaca
"""
import matplotlib.pyplot as plt
import numpy as np
import cv2
pathImages = {
'Globin Town': [
'Goblin_town1.jpg',
'Goblin_town2.jpg',
'Goblin_town3.jpg',
'Goblin_town4.... | mit |
hdmetor/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 |
popgenmethods/smcpp | setup.py | 1 | 2172 | from __future__ import print_function
from setuptools import setup, Extension, find_packages, dist
import os
import os.path
import glob
import sys
import tempfile
import subprocess
import shutil
import warnings
from Cython.Build import cythonize
import numpy as np
if True:
extra_compile_args = [
"-O2",
... | gpl-3.0 |
whn09/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py | 71 | 12923 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
juliusbierk/scikit-image | doc/examples/plot_regional_maxima.py | 18 | 3316 | """
=========================
Filtering regional maxima
=========================
Here, we use morphological reconstruction to create a background image, which
we can subtract from the original image to isolate bright features (regional
maxima).
First we try reconstruction by dilation starting at the edges of the ima... | bsd-3-clause |
Erotemic/utool | utool/util_numpy.py | 1 | 12795 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import six
import itertools
import random
try:
import numpy as np
except ImportError as ex:
pass
from utool import util_inject
print, rrr, profile = util_inject.inject2(__name__)
def tiled_range(range_, cols):
return ... | apache-2.0 |
antoan2/incubator-mxnet | example/kaggle-ndsb1/submission_dsb.py | 52 | 5048 | # 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 |
dilawar/moose-full | moose-examples/tutorials/ChemicalBistables/mapkFB.py | 2 | 3118 | #########################################################################
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2014 Upinder S. Bhalla. and NCBS
## It is made available under the terms of the
## GNU Lesser General Public License version 2... | gpl-2.0 |
LohithBlaze/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 130 | 6059 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
pickus91/HRV | poincare.py | 1 | 7508 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 18 19:19:25 2017
@author: Sarah Pickus
Poincare plots are an important visualization technique for quantifying the non-linear
characteristics of the RR interval time series. They are generated via plotting
each RR interval (RR[n]) against the subsequent RR inter... | mit |
aewhatley/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 341 | 2620 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... | bsd-3-clause |
gustfrontar/LETKF_WRF | scale_breeding/python/plot_bvamp_timeseries.py | 1 | 6686 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 1 18:45:15 2016
@author:
"""
# LECTURA Y GRAFICADO RADAR (Formato binario GVAR-SMN)
import numpy as np
import matplotlib as plt
import datetime as dt
import binary_io as bio
import bred_vector_functions as bvf
import os
basedir='/home/jruiz/share/exp/'
expname = '/b... | gpl-3.0 |
automl/paramsklearn | ParamSklearn/components/classification/multinomial_nb.py | 1 | 4383 | import numpy as np
import sklearn.naive_bayes
import scipy.sparse
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \
CategoricalHyperparameter
from ParamSklearn.components.base import ParamSklearnClassificationAlgorithm
... | bsd-3-clause |
scikit-hep/scikit-hep | skhep/visual/fill_between_steps.py | 1 | 3346 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license, see LICENSE.
from __future__ import absolute_import
import numpy as np
import numpy.ma as ma
import collections
import matplotlib
def fill_between_steps(ax, x, y1, y2=0, step_where="pre", **kwargs):
"""Fill between for a step plot histogram.
... | bsd-3-clause |
beepee14/scikit-learn | examples/covariance/plot_covariance_estimation.py | 250 | 5070 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | bsd-3-clause |
paalge/scikit-image | skimage/future/graph/rag.py | 1 | 19598 | import networkx as nx
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy import ndimage as ndi
from scipy import sparse
import math
from ... import measure, segmentation, util, color
from matplotlib import colors, cm
from matplotlib import pyplot as plt
from matplotlib.collections import LineC... | bsd-3-clause |
mulvrova/StagPy | stagpy/time_series.py | 1 | 4837 | """Plots time series."""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from . import conf, misc
from .error import InvalidTimeFractionError
from .stagyydata import StagyyData
def _collect_marks(sdat):
"""Concatenate mark* config variable."""
times = set(conf.time.marktimes.replace('... | gpl-2.0 |
stineb/sofun | submitjobs_sofun.py | 1 | 5890 | import pandas
import os
import os.path
from subprocess import call
##--------------------------------------------------------------------
## Simulation suite
## - "swissface"
## - "fluxnet"
## - "fluxnet2015"
## - "fluxnet_cnmodel"
## - "gcme"
## - "campi"
## - "campi_cmodel"
## - "fluxnet_fixalloc"
## - "atkin"
## - ... | lgpl-2.1 |
cpcloud/blaze | blaze/expr/reductions.py | 2 | 9222 | from __future__ import absolute_import, division, print_function
import datashape
from datashape import Record, DataShape, dshape, TimeDelta, Decimal, Option
from datashape import coretypes as ct
from datashape.predicates import iscollection, isboolean, isnumeric, isdatelike
from numpy import inf
from odo.utils import... | bsd-3-clause |
wanghaven/nupic | src/nupic/research/monitor_mixin/monitor_mixin_base.py | 27 | 5512 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
xya/sms-tools | lectures/05-Sinusoidal-model/plots-code/sineModelAnal-flute.py | 24 | 1179 | import numpy as np
import matplotlib.pyplot as plt
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi... | agpl-3.0 |
ZebTech/geneticExperiment | GA/ga.py | 1 | 6308 | # -*- coding: utf-8 -*-
import math
import copy
import random
import numpy as np
import matplotlib.pyplot as plt
from random import shuffle, randint
from ThreadPool.threadpool import ThreadPool
from threading import Lock
GOAL = 0.90
INDIVIDUAL_SIZE = 784
POPULATION_SIZE = 150
class GeneticAlgorithm():
def __ini... | apache-2.0 |
dsm054/pandas | asv_bench/benchmarks/join_merge.py | 3 | 12240 | import warnings
import string
import numpy as np
import pandas.util.testing as tm
from pandas import (DataFrame, Series, Panel, MultiIndex,
date_range, concat, merge, merge_asof)
try:
from pandas import merge_ordered
except ImportError:
from pandas import ordered_merge as merge_ordered
c... | bsd-3-clause |
imaculate/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 74 | 8472 | 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 |
iismd17/scikit-learn | benchmarks/bench_sparsify.py | 323 | 3372 | """
Benchmark SGD prediction time with dense/sparse coefficients.
Invoke with
-----------
$ kernprof.py -l sparsity_benchmark.py
$ python -m line_profiler sparsity_benchmark.py.lprof
Typical output
--------------
input data sparsity: 0.050000
true coef sparsity: 0.000100
test data sparsity: 0.027400
model sparsity:... | bsd-3-clause |
MartinDelzant/scikit-learn | sklearn/cluster/tests/test_k_means.py | 63 | 26190 | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | bsd-3-clause |
ChinaQuants/Finance-Python | PyFin/tests/Analysis/testSecurityValueHolders.py | 2 | 48213 | # -*- coding: utf-8 -*-
u"""
Created on 2015-8-12
@author: cheng.li
"""
import unittest
import copy
import pickle
import tempfile
import os
import numpy as np
import pandas as pd
from PyFin.Enums import Factors
from PyFin.Analysis.SeriesValues import SeriesValues
from PyFin.Analysis.SecurityValueHolders import Filter... | mit |
sequana/sequana | sequana/pacbio_amplicon.py | 1 | 9958 | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with this s... | bsd-3-clause |
edawine/fatools | fatools/lib/fautil/binsutil.py | 2 | 6556 | import pandas, attr, yaml
import numpy as np
from fatools.lib.fautil.mixin import BinMixIn
from fatools.lib.utils import cout, cerr
from collections import defaultdict
from IPython import embed
def do_binsutil(args):
if args.optimize:
do_optimize(args)
elif args.summarize:
do_summarize(args)... | lgpl-3.0 |
gfyoung/pandas | pandas/tests/series/indexing/test_where.py | 1 | 13484 | import numpy as np
import pytest
from pandas.core.dtypes.common import is_integer
import pandas as pd
from pandas import Series, Timestamp, date_range, isna
import pandas._testing as tm
def test_where_unsafe_int(sint_dtype):
s = Series(np.arange(10), dtype=sint_dtype)
mask = s < 5
s[mask] = range(2, 7)... | bsd-3-clause |
nseifert/spec_tools | spec_tools_OLD.py | 1 | 30025 | # ======================== SPEC TOOLS =========================== \
# A PYTHON LIBRARY FOR ROTATIONAL SPECTROSCOPY |
# Developed by, and for, chirped-pulse rotational spectroscopists |
# ----------------------------------------------------------------\
# MAINTAINER: Nathan Seifert ... | mit |
MatthieuBizien/scikit-learn | sklearn/mixture/tests/test_gaussian_mixture.py | 7 | 36087 | import sys
import warnings
import numpy as np
from scipy import stats, linalg
from sklearn.covariance import EmpiricalCovariance
from sklearn.datasets.samples_generator import make_spd_matrix
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.metrics.cluster import adjusted_rand_score
from sk... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.