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 |
|---|---|---|---|---|---|
ofgulban/scikit-image | skimage/viewer/tests/test_viewer.py | 35 | 2165 |
from skimage import data
from skimage.viewer.qt import QtGui, QtCore, has_qt
from skimage.viewer import ImageViewer, CollectionViewer
from skimage.viewer.plugins import OverlayPlugin
from skimage.transform import pyramid_gaussian
from skimage.filters import sobel
from numpy.testing import assert_equal
from numpy.tes... | bsd-3-clause |
grain2011/vislab | vislab/dataset_stats.py | 4 | 1814 | """
Code for analyzing datasets.
"""
import pandas as pd
import numpy as np
def get_joint_occurrence_df(df, row_column, col_column, top_k=10):
"""
Form a DataFrame where:
- index is composed of top_k top values in row_column.
- columns are composed of top_k top values in col_column.
- cell values ... | bsd-2-clause |
ai-se/XTREE | src/Planners/XTREE/methods1.py | 1 | 2615 | #! /Users/rkrsn/anaconda/bin/python
from pdb import set_trace
from os import environ, getcwd
from os import walk
from os.path import expanduser
from pdb import set_trace
import sys
# Update PYTHONPATH
HOME = expanduser('~')
axe = HOME + '/git/axe/axe/' # AXE
pystat = HOME + '/git/pystats/' # PySTAT
cwd = getcwd() #... | mit |
nicproulx/mne-python | mne/parallel.py | 2 | 5051 | """Parallel util function."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
from .externals.six import string_types
import logging
import os
from . import get_config
from .utils import logger, verbose, warn
from .fixes import _get_args
if 'MNE_FORCE_SERIAL' in os... | bsd-3-clause |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/lib/matplotlib/backends/backend_qt4.py | 1 | 25556 | from __future__ import division
import math
import os
import sys
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, IdleEvent, \
... | gpl-2.0 |
mahajrod/MACE | scripts/draw_coverage.py | 1 | 10865 | #!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import os
import argparse
import pandas as pd
from RouToolPa.Collections.General import SynDict, IdList
from MACE.Routines import Visualization, StatsVCF
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", action="store", dest="input", required... | apache-2.0 |
arokem/nipy | nipy/labs/viz_tools/cm.py | 3 | 10289 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Matplotlib colormaps useful for neuroimaging.
"""
import numpy as _np
from nipy.utils.skip_test import skip_if_running_nose
try:
from matplotlib import cm as _cm
from matplotlib import colors ... | bsd-3-clause |
ashhher3/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 23 | 8317 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
dilawar/moose-full | moose-core/python/libmumbl/test/adaptor.py | 3 | 4454 | #!/usr/bin/env python
"""adaptor.py:
This file is a minimal example on how to setup two compartment and pass
message from one to other.
Last modified: Mon Jan 06, 2014 04:11PM
"""
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2013, NCBS Bangalore"
__credits__ = ["N... | gpl-2.0 |
Jozhogg/iris | lib/iris/experimental/animate.py | 1 | 4772 | # (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
PatrickChrist/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 127 | 7477 | r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected i... | bsd-3-clause |
abhishekkrthakur/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 |
arhik/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/rcsetup.py | 69 | 23344 | """
The rcsetup module contains the default values and the validation code for
customization using matplotlib's rc settings.
Each rc setting is assigned a default value and a function used to validate any
attempted changes to that setting. The default values and validation functions
are defined in the rcsetup module, ... | agpl-3.0 |
jaeilepp/mne-python | examples/stats/plot_cluster_stats_evoked.py | 21 | 3000 | """
=======================================================
Permutation F-test on sensor data with 1D cluster level
=======================================================
One tests if the evoked response is significantly different
between conditions. Multiple comparison problem is addressed
with cluster level permuta... | bsd-3-clause |
tensorflow/privacy | tensorflow_privacy/privacy/logistic_regression/datasets.py | 1 | 5011 | # Copyright 2021, The TensorFlow Authors.
#
# 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 t... | apache-2.0 |
jkozerski/meteo | meteo_lcd/chart_gen_test.py | 1 | 3729 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import re #regular expression
from shutil import move
from os import remove
from math import sqrt, floor
import datetime # datetime and timedelta structures
from matplotlib.ticker import MultipleLocator
# Mosquito (data passing/sharing)... | apache-2.0 |
jreback/pandas | pandas/tests/indexes/ranges/test_range.py | 2 | 16167 | import numpy as np
import pytest
from pandas.core.dtypes.common import ensure_platform_int
import pandas as pd
from pandas import Float64Index, Index, Int64Index, RangeIndex
import pandas._testing as tm
from ..test_numeric import Numeric
# aliases to make some tests easier to read
RI = RangeIndex
I64 = Int64Index
F... | bsd-3-clause |
mrshu/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 2 | 2730 | """
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | bsd-3-clause |
jenshnielsen/basemap | examples/fcstmaps_axesgrid.py | 3 | 3120 | from __future__ import print_function
from __future__ import unicode_literals
# this example reads today's numerical weather forecasts
# from the NOAA OpenDAP servers and makes a multi-panel plot.
# This version demonstrates the use of the AxesGrid toolkit.
import numpy as np
import matplotlib.pyplot as plt
import sys
... | gpl-2.0 |
manns/pyspread | pyspread/share/templates/matplotlib/chart_bar_1_3.py | 1 | 1883 | fig = Figure()
ax = fig.add_axes([.2,.05, .7, .7])
category_names = ['Strongly disagree', 'Disagree',
'Neither agree nor disagree', 'Agree', 'Strongly agree']
results = {
'Question 1': [10, 15, 17, 32, 26],
'Question 2': [26, 22, 29, 10, 13],
'Question 3': [35, 37, 7, 2, 19],
'Questio... | gpl-3.0 |
jreback/pandas | pandas/tests/arrays/boolean/test_arithmetic.py | 6 | 3586 | import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.arrays import FloatingArray
@pytest.fixture
def data():
return pd.array(
[True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False],
dtype="boolean",
)
@pytest.fi... | bsd-3-clause |
musically-ut/statsmodels | statsmodels/examples/ex_kernel_regression_sigtest.py | 34 | 3177 | # -*- coding: utf-8 -*-
"""Kernel Regression and Significance Test
Warning: SLOW, 11 minutes on my computer
Created on Thu Jan 03 20:20:47 2013
Author: Josef Perktold
results - this version
----------------------
>>> exec(open('ex_kernel_regression_censored1.py').read())
bw
[ 0.3987821 0.50933458]
[0.39878209999... | bsd-3-clause |
oknuutti/visnav-py | visnav/algo/image.py | 1 | 16219 | from functools import lru_cache
import math
from scipy import optimize, stats, integrate
import numpy as np
import quaternion # adds to numpy # noqa # pylint: disable=unused-import
import cv2
from scipy.optimize import leastsq
from visnav.settings import *
class ImageProc:
latest_opt = None
show_fit = No... | mit |
sriki18/scipy | scipy/stats/_discrete_distns.py | 3 | 21702 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy import special
from scipy.special import entr, gammaln as gamln
from scipy.misc import logsumexp
from scipy._lib._numpy_compat import broad... | bsd-3-clause |
chrisburr/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_scalability.py | 85 | 5728 | """
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... | bsd-3-clause |
ual/urbansim | setup.py | 2 | 1300 | # Install setuptools if not installed.
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
with open('README.rst', 'r') as f:
long_description = f.read()
setup(
name='urb... | bsd-3-clause |
ilyes14/scikit-learn | sklearn/linear_model/setup.py | 146 | 1713 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | bsd-3-clause |
liyu1990/sklearn | examples/text/hashing_vs_dict_vectorizer.py | 284 | 3265 | """
===========================================
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 |
anoopkunchukuttan/transliterator | src/cfilt/transliteration/supervised.py | 1 | 17053 | #Copyright Anoop Kunchukuttan 2015 - present
#
#This file is part of the IITB Unsupervised Transliterator
#
#IITB Unsupervised Transliterator 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... | gpl-3.0 |
nan86150/ImageFusion | lib/python2.7/site-packages/matplotlib/animation.py | 10 | 44129 | # TODO:
# * Loop Delay is broken on GTKAgg. This is because source_remove() is not
# working as we want. PyGTK bug?
# * Documentation -- this will need a new section of the User's Guide.
# Both for Animations and just timers.
# - Also need to update http://www.scipy.org/Cookbook/Matplotlib/Animations
# * Blit
... | mit |
maxlikely/scikit-learn | examples/linear_model/plot_multi_task_lasso_support.py | 4 | 2177 | #!/usr/bin/env python
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same accross
tasks. This example simulate... | bsd-3-clause |
nguyenti/213-twitter-trend-cloud | cloud_maker.py | 1 | 1480 | import matplotlib.pyplot as plt
from wordcloud import WordCloud
from time import sleep
fn = "output/clouds.txt"
if __name__ == '__main__':
# map of the form trend : map of word:counts
trend_clouds = {}
with open(fn, "r") as fp:
trend = fp.readline()
while(trend):
# read correla... | lgpl-3.0 |
mira67/TakeoutDataAnalysis | python/userLocationDetect.py | 1 | 18165 | #Detection of customer dining locations
#Author: Qi Liu
#Email: qliu.hit@gmail.com
import ctypes
import sys
import time
if getattr(sys, 'frozen', False):
# Override dll search path.
ctypes.windll.kernel32.SetDllDirectoryW('C:/Users/ngj/AppData/Local/Continuum/Anaconda3/Library/bin/')
# Init code to load externa... | gpl-3.0 |
RPGOne/Skynet | scikit-learn-0.18.1/sklearn/neural_network/rbm.py | 46 | 12291 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/learn/__init__.py | 25 | 2458 | # 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 |
amarack/python-rl | pyrl/agents/models/batch_model.py | 2 | 25680 |
# Author: Will Dabney
import numpy
from sklearn import neighbors
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.svm import SVR, NuSVR, SVC, OneClassSVM
from sklearn.gaussian_process import GaussianProcess
from model import ModelLearner
class BatchModel(ModelLearner):
"""... | gpl-3.0 |
edusegzy/pychemqt | UI/bombaCurva.py | 1 | 14851 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import cPickle
from functools import partial
from PyQt4 import QtCore, QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
#import matplotlib.gridspec as gridspec #necesita matplotlib >=1.0
from pylab import Figure
from numpy import transpose
from lib.unid... | gpl-3.0 |
maniteja123/numdifftools | numdifftools/run_benchmark.py | 1 | 6055 | from __future__ import print_function
import numpy as np
import timeit
import numdifftools as nd
import numdifftools.nd_algopy as nda
from algopy import dot
# from numpy import dot
from collections import OrderedDict
from numdifftools.core import MinStepGenerator, MaxStepGenerator
import matplotlib.pyplot as plt
cla... | bsd-3-clause |
JiaMingLin/de-identification | common/base.py | 1 | 3606 | import logging
import rpy2.robjects as robjects
from logging.handlers import TimedRotatingFileHandler
import ast
import collections
import os
import common.constant as c
r = robjects.r
r.source(c.INIT_LIB_R_FILE)
class Base(object):
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s \t %(leveln... | apache-2.0 |
pylayers/pylayers | pylayers/antprop/examples/ex_antenna4.py | 3 | 1119 | from pylayers.antprop.antenna import *
from pylayers.antprop.antvsh import *
import matplotlib.pylab as plt
from numpy import *
import pdb
"""
This test :
1 : loads a measured antenna
2 : applies an electrical delay obtained from data with getdelay method
3 : evaluate the antenna vsh coefficient with a d... | mit |
pianomania/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 14 | 2640 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
dmnfarrell/mirnaseq | smallrnaseq/base.py | 2 | 27538 | #!/usr/bin/env python
# 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.
#
# This program is distributed in the hope that ... | gpl-3.0 |
jadecastro/slugs | tools/pyGameRobotDynamicsVisualizer.py | 1 | 32895 | #!/usr/bin/python
#
# Animates a robot according to a continuous-state robot model driven by a slugs synthesized gr(1) controller
#
#
# REQUIREMENTS FOR PROPER Operation:
# - The slugsin file has the state bits in inverse order. This is necessary to solve the problem that Pessoa's abstract are most-significant-bit firs... | bsd-3-clause |
open-craft/edx-analytics-pipeline | edx/analytics/tasks/tests/acceptance/test_internal_reporting_user.py | 2 | 2665 | """
End to end test of the internal reporting user table loading task.
"""
import os
import logging
import datetime
import pandas
from luigi.date_interval import Date
from edx.analytics.tasks.tests.acceptance import AcceptanceTestCase
from edx.analytics.tasks.url import url_path_join
log = logging.getLogger(__nam... | agpl-3.0 |
antiface/mne-python | mne/io/edf/tests/test_edf.py | 6 | 10037 | """Data Equivalence Tests"""
from __future__ import print_function
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Martin Billinger <martin.billinger@tugraz.at>
# Alan Leggitt <alan.leggitt@ucsf.edu>
# Alexandre Barachant <alexandre.barachant@gmail.com>
#
# License: BSD (3-clause)
import o... | bsd-3-clause |
andretadeu/jhu-immuno | code/logRegrPropImportance.py | 1 | 2462 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 22 13:49:37 2015
@author: brian
"""
import pandas as pd
props = pd.read_csv('../data/peptide_9_props.csv')
immun = pd.read_excel('../input/journal.pcbi.1003266.s001-2.XLS')
# understanding the apply method
immun['length'] = immun.Peptide.apply(len)
immun = immun[imm... | mit |
musically-ut/statsmodels | statsmodels/examples/example_functional_plots.py | 33 | 1367 | '''Functional boxplots and rainbow plots
see docstrings for an explanation
Author: Ralf Gommers
'''
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
#Load the El Nino dataset. Consists of 60 years worth of Pacific Ocean sea
#surface temperature... | bsd-3-clause |
kostajaitachi/shogun | examples/undocumented/python_modular/graphical/so_multiclass_director_BMRM.py | 16 | 4362 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from modshogun import RealFeatures
from modshogun import MulticlassModel, MulticlassSOLabels, RealNumber, DualLibQPBMSOSVM, DirectorStructuredModel
from modshogun import BMRM, PPBMRM, P3BMRM, ResultSet, RealVector
from modshogun import Structure... | gpl-3.0 |
ioam/holoviews | holoviews/plotting/mpl/tabular.py | 2 | 5605 | from __future__ import absolute_import, division, unicode_literals
from collections import defaultdict
import param
from matplotlib.font_manager import FontProperties
from matplotlib.table import Table as mpl_Table
from .element import ElementPlot
from .plot import mpl_rc_context
class TablePlot(ElementPlot):
... | bsd-3-clause |
vinodkc/spark | python/pyspark/pandas/tests/test_repr.py | 15 | 7832 | #
# 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 |
pylada/pylada-light | src/pylada/vasp/nlep/plotbs.py | 1 | 6923 | ###############################
# This file is part of PyLaDa.
#
# Copyright (C) 2013 National Renewable Energy Lab
#
# PyLaDa is a high throughput computational platform for Physics. It aims to make it easier to submit
# large numbers of jobs on supercomputers. It provides a python interface to physical input, suc... | gpl-3.0 |
joernhees/scikit-learn | examples/plot_kernel_ridge_regression.py | 26 | 6289 | """
=============================================
Comparison of kernel ridge regression and SVR
=============================================
Both kernel ridge regression (KRR) and SVR learn a non-linear function by
employing the kernel trick, i.e., they learn a linear function in the space
induced by the respective k... | bsd-3-clause |
edublancas/python-ds-tools | examples/pipeline/basic/.ipynb_checkpoints/pipeline-checkpoint.py | 2 | 4339 | # This example shows the most basic usage of the `dstools.pipeline` module.
#
# Note: run this using `ipython` or in a Jupyter notebook (it won't run using `python`).
# +
from pathlib import Path
import tempfile
import pandas as pd
from IPython.display import Image, display
from dstools.pipeline import DAG
from dsto... | mit |
andrewnc/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 |
ishank08/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 39 | 36062 | from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fe... | bsd-3-clause |
mapazarr/astropy_scripts | astropy_scripts/test_histograms.py | 1 | 11331 | from __future__ import (absolute_import, division, print_function,
unicode_literals) # python 2 as python 3
import numpy as np
from astropy.table import Table
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import LogNorm
from pylab import *
im... | gpl-2.0 |
jashwanth9/Expert-recommendation-system | code/generate_for_visual.py | 1 | 2851 | import json
import numpy as np
import cPickle as pickle
from collections import Counter
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.feature_extraction.text import TfidfTransformer
''' reads file and create a dictonary that maps an id with
the related fields '''
def read_files(file_name):
... | apache-2.0 |
etkirsch/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
jaidevd/scikit-learn | sklearn/ensemble/tests/test_base.py | 33 | 5168 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from numpy.testing import assert_equal
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_tr... | bsd-3-clause |
mr3bn/DAT210x | Module5/assignment2.py | 1 | 6365 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
from sklearn.cluster import KMeans
matplotlib.style.use('ggplot') # Look Pretty
def showandtell(title=None):
if title != None: plt.savefig(title + ".png", bbox_inches='tight', dpi=300)
plt.show()
# exit()
#
# INFO: This dataset has call ... | mit |
dmargala/tpcorr | setup.py | 1 | 1971 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
# Run pre-built py.tests as described at
# https://pytest.org/latest/goodpractises.html#integrating-with-distutils-python-setup-py-test
class PyTest(Command):... | mit |
pianomania/scikit-learn | examples/linear_model/plot_ard.py | 32 | 3912 | """
==================================================
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 |
detrout/debian-statsmodels | statsmodels/sandbox/examples/ex_cusum.py | 33 | 3219 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 02 11:41:25 2010
Author: josef-pktd
"""
import numpy as np
from scipy import stats
from numpy.testing import assert_almost_equal
import statsmodels.api as sm
from statsmodels.sandbox.regression.onewaygls import OneWayLS
from statsmodels.stats.diagnostic import recursive... | bsd-3-clause |
nikitasingh981/scikit-learn | sklearn/neighbors/lof.py | 33 | 12186 | # Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
from warnings import warn
from scipy.stats import scoreatpercentile
from .base import NeighborsBase
from .base import KNeighborsMixin
from .bas... | bsd-3-clause |
nickgentoo/scikit-learn-graph | skgraph/feature_extraction/graph/WLVectorizer.py | 1 | 2452 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 20 17:40:07 2015
Copyright 2015 Nicolo' Navarin
This file is part of scikit-learn-graph.
scikit-learn-graph 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 ... | gpl-3.0 |
SuLab/scheduled-bots | scheduled_bots/disease_ontology/robot/post_curation_omim.py | 1 | 2060 | ## we have a list of rows, some need to be deleted
from tqdm import tqdm
from scheduled_bots import PROPS
from wikidataintegrator import wdi_core, wdi_helpers, wdi_login
from scheduled_bots.local import WDUSER, WDPASS
import pandas as pd
# the following is for omim
# df gotten from: https://docs.google.com/spreadshee... | mit |
yousrabk/mne-python | examples/realtime/plot_compute_rt_average.py | 18 | 1790 | """
========================================================
Compute real-time evoked responses using moving averages
========================================================
This example demonstrates how to connect to an MNE Real-time server
using the RtClient and use it together with RtEpochs to compute
evoked respo... | bsd-3-clause |
chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/linear_model/tests/test_sparse_coordinate_descent.py | 28 | 10014 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | apache-2.0 |
gully/Starfish | attic/old_code.py | 2 | 13197 |
print("Hello")
def downsample(w_m, f_m, w_TRES):
'''Given a model wavelength and flux (w_m, f_m) and the instrument wavelength (w_TRES), downsample the model to
exactly match the TRES wavelength bins. '''
spec_interp = interp1d(w_m, f_m, kind="linear")
@np.vectorize
def avg_bin(bin0, bin1):
... | bsd-3-clause |
procoder317/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
elijah513/scikit-learn | sklearn/metrics/tests/test_ranking.py | 75 | 40883 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
sriharshams/mlnd | smartcab/visuals.py | 17 | 7709 | ###########################################
# Suppress matplotlib user warnings
# Necessary for newer version of matplotlib
import warnings
warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib")
###########################################
#
# Display inline matplotlib plots with IPython
from I... | apache-2.0 |
KellyChan/python-examples | python/data_science/NYC/vis1_plot_weather_data.py | 3 | 1580 | from pandas import *
from ggplot import *
def plot_weather_data(turnstile_weather):
'''
You are passed in a dataframe called turnstile_weather.
Use turnstile_weather along with ggplot to make a data visualization
focused on the MTA and weather data we used in assignment #3.
You should feel free ... | mit |
amaggi/bda | chapter_03/bioassay.py | 1 | 3984 | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binom, uniform
from scipy.integrate import cumtrapz
from scipy.interpolate import interp1d
NSAMP = 1000
NPTS = 100
# dose xi (log g/ml)
dose = np.array([-0.86, -0.30, -0.05, 0.73])
# number of animals tested ni
nani = np.ones(4)*5
# number of ... | gpl-2.0 |
Mark-Ko/data-science-from-scratch | code/introduction.py | 48 | 8085 | from __future__ import division
##########################
# #
# FINDING KEY CONNECTORS #
# #
##########################
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn" },
{ "id": 2, "name": "Sue" },
{ "id": 3, "name": "Chi" },
{ "id":... | unlicense |
rhambach/TEMareels | gui/wq_stack.py | 1 | 13014 | """
Simple GUI for visualising and analysing wq-maps
USAGE
An example can be found at the end of this file and can be executed
using 'python wq_stack.py'
Copyright (c) 2013, rhambach.
This file is part of the TEMareels package and released
under the MIT-Licence. See LICENCE file for details.
... | mit |
cxxgtxy/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 |
kprestel/PyInvestment | tests/conftest.py | 2 | 3047 | import os
import queue
import pandas as pd
import pytest
import pytech.trading.blotter as b
from pytech.fin.asset.asset import Stock
from pytech import TEST_DATA_DIR
from pytech.data.handler import Bars
from pytech.fin.portfolio import BasicPortfolio
from pytech.fin.handler import BasicSignalHandler
from pytech.mongo... | mit |
siutanwong/scikit-learn | sklearn/utils/validation.py | 67 | 24013 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals i... | bsd-3-clause |
h2oai/h2o | py/testdir_single_jvm/test_KMeans_hastie_shuffle_fvec.py | 9 | 5295 | # Dataset created from this:
# Elements of Statistical Learning 2nd Ed.; Hastie, Tibshirani, Friedman; Feb 2011
# example 10.2 page 357
# Ten features, standard independent Gaussian. Target y is:
# y[i] = 1 if sum(X[i]) > .34 else -1
# 9.34 is the median of a chi-squared random variable with 10 degrees of freedom
# ... | apache-2.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/datasets/anes96/data.py | 3 | 3883 | """American National Election Survey 1996"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
http://www.electionstudies.org/
The American National Election Studies.
"""
DESCRSHORT = """This data is a subset of the American National Election Stud... | apache-2.0 |
pbosler/StrideSearch | python/TropicalDriver.py | 1 | 6908 | """
Stride Tropical Cyclone Search driver.
Copyright 2016 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000
with Sandia Corporation, the U.S. Government retains certain rights in this
software.
"""
from glob import glob
from os import chdir, remove
from SectorList import SectorListLatLon
from Data imp... | gpl-2.0 |
narimonf/PageRank | pagerank.py | 2 | 2281 | import os
import sys
import math
import numpy
import pandas
# Generalized matrix operations:
def __extractNodes(matrix):
nodes = set()
for colKey in matrix:
nodes.add(colKey)
for rowKey in matrix.T:
nodes.add(rowKey)
return nodes
def __makeSquare(matrix, keys, default=0.0):
matri... | mit |
sonnyhu/scipy | scipy/cluster/hierarchy.py | 14 | 91850 | """
========================================================
Hierarchical clustering (:mod:`scipy.cluster.hierarchy`)
========================================================
.. currentmodule:: scipy.cluster.hierarchy
These functions cut hierarchical clusterings into flat clusterings
or find the roots of the forest f... | bsd-3-clause |
cmcantalupo/geopm | integration/experiment/frequency_sweep/gen_plot_runtime_energy.py | 1 | 6747 | #!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, thi... | bsd-3-clause |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_tightlayout.py | 2 | 8159 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import numpy as np
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredOffsetbox, DrawingArea
from ma... | mit |
trankmichael/scikit-learn | examples/cluster/plot_cluster_comparison.py | 246 | 4684 | """
=========================================================
Comparing different clustering algorithms on toy datasets
=========================================================
This example aims at showing characteristics of different
clustering algorithms on datasets that are "interesting"
but still in 2D. The last ... | bsd-3-clause |
shyamalschandra/scikit-learn | sklearn/feature_selection/tests/test_base.py | 143 | 3670 | 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 |
LEX2016WoKaGru/pyClamster | pyclamster/clustering/old_labels.py | 1 | 6788 | # -*- coding: utf-8 -*-
"""
Created on 05.06.16
Created for pyclamster
@author: Tobias Sebastian Finn, tobias.sebastian.finn@studium.uni-hamburg.de
Copyright (C) {2016} {Tobias Sebastian Finn}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pub... | gpl-3.0 |
danmoser/pyhdust | pyhdust/triangle.py | 1 | 22470 | # -*- coding:utf-8 -*-
"""PyHdust auxiliary module: third-part MCMC plotting tools.
:co-author:Dan Foreman-Mackey
:license: GNU GPL v3.0 https://github.com/danmoser/pyhdust/blob/master/LICENSE
"""
from __future__ import print_function, absolute_import, unicode_literals
import numpy as _np
import warnings as _warn
imp... | gpl-3.0 |
bbfamily/abu | abupy/TradeBu/ABuCommission.py | 1 | 9854 | # -*- encoding:utf-8 -*-
"""
手续费模块
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import logging
from contextlib import contextmanager
import numpy as np
import pandas as pd
from ..MarketBu.ABuSymbolFutures import AbuFuturesCn
from ..CoreBu.ABuFi... | gpl-3.0 |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/matplotlib/testing/jpl_units/EpochConverter.py | 23 | 5479 | #===========================================================================
#
# EpochConverter
#
#===========================================================================
"""EpochConverter module containing class EpochConverter."""
#===========================================================================
# Pl... | mit |
timpalpant/KaggleTSTextClassification | scripts/predictors/random_forest.cv.py | 1 | 1158 | #!/usr/bin/env python
'''
Make predictions for the test data
TODO: Should explore min_samples_leaf >= 2 and max_features >= 0.2
'''
import argparse, logging
import cPickle as pickle
import numpy as np
from common import *
from sklearn.ensemble import RandomForestClassifier
logging.basicConfig(level=logging.DEBUG)
... | gpl-3.0 |
aetilley/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 222 | 3055 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
ArtsiomCh/tensorflow | tensorflow/contrib/learn/python/learn/estimators/kmeans_test.py | 40 | 20118 | # 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 |
brunojulia/ultracoldUB | Interfaz.py | 1 | 82967 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 18 15:14:44 2016
@author: ivan
"""
from PyQt4 import QtGui
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.uic import loadUiType
import math
Ui_MainWindow,QMainWindow=loadUiType('Main.ui')
import time
class Main(QMainWindow,Ui_MainWindow):
... | gpl-3.0 |
huongttlan/seaborn | seaborn/tests/test_linearmodels.py | 18 | 19157 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import nose.tools as nt
import numpy.testing as npt
import pandas.util.testing as pdt
from numpy.testing.decorators import skipif
from nose import SkipTest
try:
import statsmodels.regression.linear_model as smlm
_n... | bsd-3-clause |
fmfn/UnbalancedDataset | examples/evaluation/plot_metrics.py | 2 | 2758 | """
=======================================
Metrics specific to imbalanced learning
=======================================
Specific metrics have been developed to evaluate classifier which
has been trained using imbalanced data. :mod:`imblearn` provides mainly
two additional metrics which are not implemented in :mod:... | mit |
spallavolu/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
joequant/zipline | tests/modelling/test_engine.py | 8 | 15874 | """
Tests for SimpleFFCEngine
"""
from __future__ import division
from unittest import TestCase
from itertools import product
from numpy import (
full,
isnan,
nan,
)
from numpy.testing import assert_array_equal
from pandas import (
DataFrame,
date_range,
Int64Index,
MultiIndex,
rolling_... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.