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 |
|---|---|---|---|---|---|
freeman-lab/dask | dask/array/core.py | 1 | 65152 | from __future__ import absolute_import, division, print_function
import operator
from operator import add, getitem
import inspect
from numbers import Number
from collections import Iterable, MutableMapping
from bisect import bisect
from itertools import product, count
from collections import Iterator
from functools im... | bsd-3-clause |
iproduct/course-social-robotics | 11-dnn-keras/venv/Lib/site-packages/matplotlib/tests/test_axes.py | 1 | 211255 | from collections import namedtuple
import datetime
from decimal import Decimal
import io
from itertools import product
import platform
from types import SimpleNamespace
try:
from contextlib import nullcontext
except ImportError:
from contextlib import ExitStack as nullcontext # Py3.6.
import dateutil.tz
impo... | gpl-2.0 |
ubccr/tacc_stats | analyze/process_pickles/memusage.py | 1 | 1355 | #!/usr/bin/env python
import analyze_conf
import sys
import datetime, glob, job_stats, os, subprocess, time
import cPickle as pickle
import matplotlib
if not 'matplotlib.pyplot' in sys.modules:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy
import scipy
import argparse
import tspl, tspl_utils
def... | lgpl-2.1 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/core/series.py | 7 | 98121 | """
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 numpy import nan, ndarray
import numpy as np
import numpy.ma as ma
from pandas.types.common import (... | mit |
akrherz/dep | scripts/gridorder/v1summary.py | 2 | 1129 | """Summarize DEP v1 data, we have 2007 through 2015
The 2007, 2008, and 2009 data looks wonky now, lets just do 2010 thru 2015
"""
import matplotlib.pyplot as plt
from pandas.io.sql import read_sql
from pyiem.util import get_dbconn
pgconn = get_dbconn("wepp")
df = read_sql(
"""
with sums as (
select ... | mit |
bgris/ODL_bgris | lib/python3.5/site-packages/ipython_genutils/testing/decorators.py | 21 | 10913 | # -*- coding: utf-8 -*-
"""Decorators for labeling test objects.
Decorators that merely return a modified version of the original function
object are straightforward. Decorators that return a new function object need
to use nose.tools.make_decorator(original_function)(decorator) in returning the
decorator, in order t... | gpl-3.0 |
mne-tools/mne-tools.github.io | 0.21/_downloads/2a0dcf3becdbea26da3b5a186ec2924a/plot_time_frequency_global_field_power.py | 8 | 5692 | """
.. _ex-time-freq-global-field-power:
===========================================================
Explore event-related dynamics for specific frequency bands
===========================================================
The objective is to show you how to explore spectrally localized
effects. For this purpose we ada... | bsd-3-clause |
h-mayorquin/coursera | neural_data/04_exercise/problem_set4.py | 1 | 10735 | #
# NAME
# problem_set4.py
#
# DESCRIPTION
# In Problem Set 4, you will classify EEG data into NREM sleep stages and
# create spectrograms and hypnograms.
#
from __future__ import division
import numpy as np
import matplotlib.pylab as plt
import matplotlib.mlab as m
from sklearn.linear_model impo... | bsd-2-clause |
dssg/wikienergy | disaggregator/build/pandas/pandas/io/tests/test_excel.py | 1 | 55943 | # pylint: disable=E1101
from pandas.compat import u, range, map, openpyxl_compat
from datetime import datetime, date, time
import sys
import os
from distutils.version import LooseVersion
import operator
import functools
import nose
from numpy import nan
import numpy as np
from numpy.testing.decorators import slow
f... | mit |
cybernet14/scikit-learn | sklearn/linear_model/tests/test_coordinate_descent.py | 114 | 25281 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.utils.testing ... | bsd-3-clause |
bgris/ODL_bgris | lib/python3.5/site-packages/skimage/io/tests/test_mpl_imshow.py | 3 | 4056 | from __future__ import division
import numpy as np
from skimage import io
from skimage._shared._warnings import expected_warnings
import matplotlib.pyplot as plt
def setup():
io.reset_plugins()
# test images. Note that they don't have their full range for their dtype,
# but we still expect the display range to ... | gpl-3.0 |
nemo-tj/biendata | source/task1.py | 1 | 9050 | # -*- coding: utf-8 -*-
# !/usr/bin/python3
import pandas as pd
import numpy as np
from numpy import nan as NA
import re
import os
import requests
from bs4 import BeautifulSoup
import urllib3
from collections import defaultdict
import PM
import task1craw
def build_validCSV():
memento = {'#id':[],'#name':[],'#org'... | gpl-3.0 |
MechCoder/scikit-learn | sklearn/utils/tests/test_utils.py | 8 | 9395 | from itertools import chain
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import pinv2
from scipy.sparse.csgraph import laplacian
from sklearn.utils.testing import (assert_equal, assert_raises, assert_true,
assert_almost_equal, assert_array_equal,
... | bsd-3-clause |
lisaleemcb/sncosmo_lc_analysis | lc.py | 2 | 14228 | import sncosmo
import triangle
from astropy.table import Table
import matplotlib.pyplot as plt
import numpy as np
import collections
class LC(object):
"""class to streamline light curve fits with SNCosmo """
def __init__(self, model, data, vparams, bounds={'c':(-0.3, 0.3), 'x1':(-3.0, 3.0)}, truths=None):
... | mit |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/io/api.py | 4 | 1103 | """
Data IO api
"""
# flake8: noqa
from pandas.io.parsers import read_csv, read_table, read_fwf
from pandas.io.clipboards import read_clipboard
from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
from pandas.io.pytables import HDFStore, get_store, read_hdf
from pandas.io.json import read_json
from pandas.i... | mit |
a0x77n/chucky-tools | src/chucky_tools/base/chucky_embedding_loader.py | 1 | 2672 | import numpy as np
from sklearn.datasets import load_svmlight_file
from chucky_tools.base import ChuckyLogger
class ChuckyEmbeddingLoader(ChuckyLogger):
"""
A basic tool for loading an embedding in libsvm/svmlight format.
"""
def __init__(self, description):
super(ChuckyEmbeddingLoader, sel... | gpl-3.0 |
rbirger/OxfordHCVNonSpatial | Non-Spatial Model Outline and Code_old.py | 1 | 44084 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# ###Description and preliminary code for Continuous-Time Markov Chain Model
#
# This model will test the importance of including a spatial component in the system. We will use ODEs to describe the dynamics of each lineage and competition between li... | bsd-2-clause |
edlectrico/twitter_nltk_volkswagen | allwords.py | 1 | 1518 | import pandas as pd
import os
import sys
from nltk.corpus import wordnet
def generate_all_words(language):
input_lang = language[0].lower()
input_csv = pd.read_csv('output/vw_clean_' + input_lang + '_rechecked.csv')
input_df = pd.DataFrame(data=input_csv)
input_classified_csv = pd.read_csv('output/vw_classif... | apache-2.0 |
wwf5067/statsmodels | examples/python/tsa_filters.py | 34 | 4559 |
## Time Series Filters
from __future__ import print_function
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
dta = sm.datasets.macrodata.load_pandas().data
index = pd.Index(sm.tsa.datetools.dates_from_range('1959Q1', '2009Q3'))
print(index)
dta.index = index
del dta['year']
del... | bsd-3-clause |
jseabold/statsmodels | statsmodels/stats/tests/test_sandwich.py | 5 | 3592 | # -*- coding: utf-8 -*-
"""Tests for sandwich robust covariance estimation
see also in regression for cov_hac compared to Gretl and
sandbox.panel test_random_panel for comparing cov_cluster, cov_hac_panel and
cov_white
Created on Sat Dec 17 08:39:16 2011
Author: Josef Perktold
"""
import numpy as np
from numpy.testi... | bsd-3-clause |
raghavrv/scikit-learn | sklearn/neighbors/tests/test_neighbors.py | 18 | 48928 | from itertools import product
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn import metrics
from sklearn import neighbors, datasets
from sklearn.exceptions import DataConversionWarning
from sklearn.metrics.pai... | bsd-3-clause |
pratapvardhan/scikit-learn | sklearn/decomposition/pca.py | 21 | 25995 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Michael Eickenberg <michael.eickenberg@inria.fr>
# ... | bsd-3-clause |
ChanderG/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
Davidjohnwilson/sympy | sympy/plotting/tests/test_plot.py | 43 | 8577 | from sympy import (pi, sin, cos, Symbol, Integral, summation, sqrt, log,
oo, LambertW, I, meijerg, exp_polar, Max, Piecewise)
from sympy.plotting import (plot, plot_parametric, plot3d_parametric_line,
plot3d, plot3d_parametric_surface)
from sympy.plotting.plot import unset... | bsd-3-clause |
jonyroda97/redbot-amigosprovaveis | lib/matplotlib/image.py | 2 | 51644 | """
The image module supports basic image loading, rescaling and display
operations.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves.urllib.parse import urlparse
from six.moves.urllib.request import urlopen
from io import Bytes... | gpl-3.0 |
mitenjain/R3N | lib/utils.py | 1 | 13191 | #!/usr/bin/env python
"""Utility functions for MinION signal alignments
"""
from __future__ import print_function
import os
import theano
import sys
import glob
import cPickle
import pandas as pd
import numpy as np
import theano.tensor as T
from itertools import chain
from model import NeuralNetwork, ThreeLayerNetwork,... | mit |
neurospin/pylearn-epac | examples/design_new_plugin.py | 1 | 6885 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 25 17:05:28 2013
@author: jinpeng.li@cea.fr
@author: edouard.duchesnay.li@cea.fr
"""
import numpy as np
from sklearn import datasets
from epac import CV
from epac.map_reduce.reducers import Reducer
from epac.map_reduce.results import Result
from epac import Methods
from ... | bsd-3-clause |
etkirsch/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 |
wdm0006/git-pandas | setup.py | 1 | 1081 | from setuptools import setup, find_packages
from codecs import open
from os import path
VERSION = '2.0.0'
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='git-p... | bsd-3-clause |
TuKo/brainiak | examples/factoranalysis/htfa_cv_example.py | 7 | 11484 | # 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 |
AIML/scikit-learn | sklearn/metrics/pairwise.py | 5 | 43701 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck ... | bsd-3-clause |
pkruskal/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 110 | 34127 | 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 |
gfyoung/pandas | pandas/core/arrays/masked.py | 1 | 13718 | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple, Type, TypeVar, Union
import numpy as np
from pandas._libs import lib, missing as libmissing
from pandas._typing import ArrayLike, Dtype, NpDtype, Scalar
from pandas.errors import AbstractMethodError
from pandas.util.... | bsd-3-clause |
seckcoder/lang-learn | python/sklearn/examples/linear_model/plot_lasso_lars.py | 5 | 1056 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetest dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariz... | unlicense |
rhambach/TEMareels | ecal/test_energy_dispersion_single_peak.py | 1 | 1883 | """
Compare the energy dispersion estimated from the distance
between the ZLP and plasmon (energy_dispersion.py) and from
the position of the ZLP or plasmon alone, if we correct the
nominal beam energy (energy_dispersion_single_peak.py)
"""
### TODO: no longer working ! #########
# set package root dir (if n... | mit |
Pragmatismo/TimelapsePi-EasyControl | webcamcap_show_numpy_graph.py | 1 | 12105 | #!/usr/bin/python
import time
import os
import sys
import pygame
import numpy
from PIL import Image, ImageDraw, ImageChops
print("")
print("")
print(" USE l=3 to take a photo every 3 somethings, try a 1000 or 2")
print(" t to take triggered photos ")
print(" cap=/home/pi/folder/ to set caps path other than c... | gpl-2.0 |
nikitasingh981/scikit-learn | examples/classification/plot_lda.py | 142 | 2419 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
Sentient07/scikit-learn | benchmarks/bench_glmnet.py | 111 | 3890 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
alexvmarch/atomic | exatomic/mpl.py | 3 | 23126 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Custom Axes
###################
"""
#
#import seaborn as sns
#
#from exa.mpl import _plot_contour, _plot_surface
#from exatomic import Energy
#
#
#def _get_minimum(mindf):
# a... | apache-2.0 |
twotwo/tools-python | log_to_graphs/day_response_group.py | 1 | 4042 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============================
Paint Daily Response in Group
=============================
Copyright (c) 2017年 li3huo.com All rights reserved.
"""
import numpy as np
import matplotlib.pyplot as plt
from numpy_helper import Helper
import sys, os
def paint_horizantal_b... | mit |
hainm/statsmodels | statsmodels/tsa/vector_ar/var_model.py | 25 | 50516 | """
Vector Autoregression (VAR) processes
References
----------
Lutkepohl (2005) New Introduction to Multiple Time Series Analysis
"""
from __future__ import division, print_function
from statsmodels.compat.python import (range, lrange, string_types, StringIO, iteritems,
cStringIO)
fr... | bsd-3-clause |
david-zwicker/py-utils | utils/data_structures/nested_dict.py | 1 | 19788 | '''
Created on Aug 9, 2016
@author: David Zwicker <dzwicker@seas.harvard.edu>
'''
from __future__ import division
import datetime
import os.path
import warnings
try:
from collections.abc import MutableMapping, Mapping
except ImportError: # python 2 fallback
from collections import MutableMapping, Mapping
... | mit |
fzalkow/scikit-learn | sklearn/decomposition/truncated_svd.py | 199 | 7744 | """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# Olivier Grisel <olivier.grisel@ensta.org>
# Michael Becker <mike@beckerfuffle.com>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
try:
from scipy.sp... | bsd-3-clause |
nhejazi/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 225 | 6278 | import sys
import re
import numpy as np
from scipy.sparse import csc_matrix, csr_matrix, lil_matrix
from sklearn.utils.testing import (assert_almost_equal, assert_array_equal,
assert_true)
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as ... | bsd-3-clause |
dunovank/jupyter-themes | jupyterthemes/__init__.py | 1 | 8605 | import os
import sys
from argparse import ArgumentParser
from glob import glob
from . import stylefx
from . import jtplot
# path to local site-packages/jupyterthemes
package_dir = os.path.dirname(os.path.realpath(__file__))
modules = glob(os.path.dirname(__file__) + "/*.py")
__all__ = [os.path.basename(f)[:-3] for f i... | mit |
ODZ-UJF-AV-CR/osciloskop | blesk-standalone.py | 1 | 4041 | #!/usr/bin/env python
# Standalone version of time-tagging script
# Based on Kakl's version for Micsig.
# MK, VS
#
# Usage:
# - Connect GPS antenna to time tagger-unit
# - Configure RIGOL
# - Connect Rigol Trigger Out BNC by cable to BNC input on time-tagger unit
# - Connect USB
# Settings:
# --------
#
# Trigge... | gpl-3.0 |
nonhermitian/scipy | tools/refguide_check.py | 5 | 28531 | #!/usr/bin/env python
"""
refguide_check.py [OPTIONS] [-- ARGS]
Check for a Scipy submodule whether the objects in its __all__ dict
correspond to the objects included in the reference guide.
Example of usage::
$ python refguide_check.py optimize
Note that this is a helper script to be able to check if things ar... | bsd-3-clause |
gakarak/BTBDB_ImageAnalysisSubPortal | experimental_code/step02_FCNN_CT_Lung_Segmentation_2.5D/run04_inference_on_many_samples_v1.py | 1 | 2039 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar (Alexander Kalinovsky)'
import os
import argparse
import matplotlib.pyplot as plt
import nibabel as nib
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.backend.tensorflow_backend import set_session
import time
from app.co... | apache-2.0 |
classicboyir/BuildingMachineLearningSystemsWithPython | ch07/boston_cv_penalized.py | 24 | 1381 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
# This script fits several forms of penalized regression
from __future__ import print_function
import ... | mit |
ernfrid/skll | examples/make_example_iris_data.py | 1 | 1695 | #!/usr/bin/env python
"""
This is a simple script to download and transform some example data from
sklearn.datasets.
:author: Michael Heilman (mheilman@ets.org)
:organization: ETS
"""
from __future__ import print_function, unicode_literals
import json
import os
import sys
import sklearn.datasets
from sklearn.cross... | bsd-3-clause |
ilyes14/scikit-learn | examples/covariance/plot_mahalanobis_distances.py | 348 | 6232 | r"""
================================================================
Robust covariance estimation and Mahalanobis distances relevance
================================================================
An example to show covariance estimation with the Mahalanobis
distances on Gaussian distributed data.
For Gaussian dis... | bsd-3-clause |
PyWavelets/pywt | doc/source/pyplots/plot_mallat_2d.py | 3 | 1471 | import numpy as np
import pywt
from matplotlib import pyplot as plt
from pywt._doc_utils import wavedec2_keys, draw_2d_wp_basis
x = pywt.data.camera().astype(np.float32)
shape = x.shape
max_lev = 3 # how many levels of decomposition to draw
label_levels = 3 # how many levels to explicitly label on the plots
f... | mit |
wangzw/tushare | tushare/stock/macro.py | 37 | 12728 | # -*- coding:utf-8 -*-
"""
宏观经济数据接口
Created on 2015/01/24
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
import pandas as pd
import numpy as np
import re
import json
from tushare.stock import macro_vars as vs
from tushare.stock import cons as ct
try:
from urllib.request import urlopen, Reques... | bsd-3-clause |
josenavas/QiiTa | qiita_db/metadata_template/util.py | 1 | 14704 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
WafaaT/spark-tk | regression-tests/sparktkregtests/testcases/models/linear_regression_test.py | 10 | 6006 | # vim: set encoding=utf-8
# Copyright (c) 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 require... | apache-2.0 |
senthil10/scilifelab | scripts/plot_complexity_curves.py | 4 | 5925 | import sys
import os
import yaml
import glob
import subprocess
import argparse
import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
def main(ccurves, output_name='complexity_curves', x_min=0, x_max=500000000):
"""
This script plots the complexity curves generated for one or several libra... | mit |
pathfinder14/OpenSAPM | utils/environment_properties_analyzers/visual_analyzer.py | 1 | 1879 | import numpy as np
import matplotlib.pyplot as plt
class visual_analyzer(object):
"""
This class is in charge of parsing given picture model of environment
and providing class <environment_properties> with needed input data
TODO
"""
# Constructor
# Needs thr path to the picture as paramet... | mit |
hugobowne/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 14 | 44270 | 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 |
jzt5132/scikit-learn | examples/text/document_clustering.py | 230 | 8356 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
lpantano/scripts_hsph | glasgow/sv/svreport.py | 1 | 2152 | """
"""
import os
import os.path as op
from argparse import ArgumentParser
from collections import Counter, defaultdict
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import gzip
from collections import Counter
import pandas as pd
# from ggplot import *
import vcf
def _sv_dist(fn_in):
... | mit |
aeklant/scipy | scipy/ndimage/fourier.py | 1 | 11196 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | bsd-3-clause |
0x0all/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 |
andaag/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
lonelycorn/AHRS | source/visualization/plotter.py | 1 | 6753 | import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import matplotlib.pyplot as plt
import numpy as np
from threading import RLock # re-entrant lock
import copy
from base.config import *
from base.SO3 import rodrigues, SO3
from visualization.visualization_camera import VisualizationCamera
class ... | mit |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/matplotlib/backends/backend_wx.py | 7 | 64807 | """
A wxPython backend for matplotlib, based (very heavily) on
backend_template.py and backend_gtk.py
Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)
Derived from original copyright work by John Hunter
(jdhunter@ace.bsd.uchicago.edu)
Copyright (C) Jeremy O'Donoghue & John Hunter, 2003-4
License: This work ... | mit |
mvfcopetti/pySSN | pyssn/qt/pyssn_qt.py | 1 | 219113 | """
This is the window manager part of pySSN
pySSN is available under the GNU licence providing you cite the developpers names:
Ch. Morisset (Instituto de Astronomia, Universidad Nacional Autonoma de Mexico)
D. Pequignot (Meudon Observatory, France)
Inspired by a demo code by:
Eli Bendersky (eliben@gmail.c... | gpl-3.0 |
AeroPython/Taller-PyConEs-2015 | Ejercicios/Laberinto/laberinto/laberinto.py | 1 | 11769 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Ejercicio del Algoritmo de Colonia de Hormigas
Taller de la PyConEs 2015: Simplifica tu vida con sistemas complejos y algoritmos genéticos
Este script contiene las funciones y clases necesarias para el ejercicio del laberinto.
Este script usa arrays de numpy, aunque... | mit |
prheenan/Research | Perkins/Projects/Primers/Demos/2017-1-2-dna-hairpin/2017-1-27-dna-hairpin-labelled-with-spacers/main_labelled_spacers.py | 1 | 1032 | # force floating point division. Can still use integer with //
from __future__ import division
# This file is used for importing the common utilities classes.
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../../../")
from Util import KmerUtil,IdtUtil
def run():
"""
"""
# ... | gpl-3.0 |
cainiaocome/scikit-learn | sklearn/tree/tests/test_tree.py | 72 | 47440 | """
Testing for the tree module (sklearn.tree).
"""
import pickle
from functools import partial
from itertools import product
import platform
import numpy as np
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import coo_matrix
from sklearn.random_projection import sparse_rand... | bsd-3-clause |
debugger22/sympy | sympy/utilities/runtests.py | 34 | 81153 | """
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly
(or identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* po... | bsd-3-clause |
cython-testbed/pandas | pandas/tests/frame/test_dtypes.py | 2 | 41374 | # -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
from datetime import timedelta
import numpy as np
from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp,
Categorical, compat, concat, option_context)
from pandas.compat import u
from pandas import _np_v... | bsd-3-clause |
jjx02230808/project0223 | sklearn/ensemble/tests/test_voting_classifier.py | 22 | 6543 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import RandomForestCl... | bsd-3-clause |
AlertaDengue/InfoDenguePredict | infodenguepredict/models/ensemble.py | 2 | 4310 | """
Use Tpot regressor to test varius models on the problem
Ensemble model
"""
from tpot import TPOTRegressor
import pickle
import sys
sys.path.insert(0, '../../')
from infodenguepredict.data.infodengue import get_cluster_data
from infodenguepredict.predict_settings import *
from sklearn.model_selection import train_t... | gpl-3.0 |
bhargav/scikit-learn | sklearn/neural_network/tests/test_mlp.py | 46 | 18585 | """
Testing for Multi-layer Perceptron module (sklearn.neural_network)
"""
# Author: Issam H. Laradji
# Licence: BSD 3 clause
import sys
import warnings
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_equal
from sklearn.datasets import load_digits, load_boston
from sklearn.datasets i... | bsd-3-clause |
fabianp/scikit-learn | sklearn/metrics/setup.py | 299 | 1024 | import os
import os.path
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("metrics", parent_package, top_path)
cblas_libs, blas_info = get_blas_info()
if os.name ==... | bsd-3-clause |
ENPH-479/dolphin-env-api | src/agents/mk_rnn_lstm_train.py | 1 | 4744 | """
This module implements a Recurrent Neural Network (RNN) Mario Kart AI Agent using
Long Short-Term Memory (LSTM) and PyTorch.
"""
import logging
import os
import matplotlib.pyplot as plt
from src import helper, keylog
from src.agents.train_valid_data import get_mario_train_valid_loader
import torch
import torch.n... | mit |
hrjn/scikit-learn | sklearn/neighbors/unsupervised.py | 29 | 4756 | """Unsupervised nearest neighbors learner"""
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import RadiusNeighborsMixin
from .base import UnsupervisedMixin
class NearestNeighbors(NeighborsBase, KNeighborsMixin,
RadiusNeighborsMixin, UnsupervisedMixin):
"""Unsu... | bsd-3-clause |
camisatx/pySecMaster | pySecMaster/download.py | 1 | 67312 | from datetime import datetime, timedelta
from functools import wraps
import numpy as np
import pandas as pd
import time
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
from utilities.date_conversions import date_to_iso
__author__ = 'Josh Schertz'
__copyright__ = 'Copyright (C) 2018 Jo... | agpl-3.0 |
ihmeuw/vivarium | src/vivarium/framework/results/manager.py | 1 | 8706 | from typing import Callable, List
import pandas as pd
class ResultsManager:
@property
def name(self):
return 'results_manager'
def add_mapping_strategy(self, *args, **kwargs):
...
def add_default_grouping_columns(self, *args, **kwargs):
...
def register_results_produce... | gpl-3.0 |
cdegroc/scikit-learn | sklearn/linear_model/ridge.py | 1 | 19134 | """
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: Simplified BSD
import numpy as np
from .base import LinearModel
from ..utils.extmath import safe_sparse_dot
from ..utils import safe_asarray
from ..preprocessing import LabelBinarizer
from ..grid_search import GridSearchCV
def _so... | bsd-3-clause |
liuwenf/moose | modules/tensor_mechanics/test/tests/capped_mohr_coulomb/small_deform_21.py | 4 | 1943 | #!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
def expected(fn):
f = open(fn, "r")
data = sorted([map(float, line.strip().split(",")[3:6]) for line in f.readlines()[1:]])
data = [d for d in data if (d[0] >= d[1] and d[1] >= d[2])] # physical region only
b... | lgpl-2.1 |
pwcberry/climate | mccsearch/code/mainProgTemplate.py | 5 | 4713 | #
# 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 n... | apache-2.0 |
gustavla/vzlog | vzlog/image/image_grid.py | 1 | 12057 | from __future__ import division, print_function, absolute_import
import numpy as np
class ImageGrid(object):
"""
An image grid used for combining equally-sized intensity images into a
single larger image.
Parameters
----------
data : ndarray, ndim in [2, 3, 4]
The last two axes should... | bsd-3-clause |
mengyun1993/RNN-binary | rnn15.py | 1 | 29038 | """ Vanilla RNN
@author Graham Taylor
"""
import numpy as np
import theano
import theano.tensor as T
from sklearn.base import BaseEstimator
import logging
import time
import os
import datetime
import pickle as pickle
import math
import matplotlib.pyplot as plt
plt.ion()
mode = theano.Mode(linker='cvm')
#mode = '... | bsd-3-clause |
classicboyir/BuildingMachineLearningSystemsWithPython | ch08/chapter.py | 21 | 6372 | import numpy as np # NOT IN BOOK
from matplotlib import pyplot as plt # NOT IN BOOK
def load():
import numpy as np
from scipy import sparse
data = np.loadtxt('data/ml-100k/u.data')
ij = data[:, :2]
ij -= 1 # original data is in 1-based system
values = data[:, 2]
reviews = sparse.csc_matri... | mit |
mugizico/scikit-learn | sklearn/cluster/birch.py | 207 | 22706 | # Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
from scipy import sparse
from math import sqrt
fro... | bsd-3-clause |
yandex/rep | tests/m_test_matrixnet_applier.py | 1 | 3463 | """
Here we test the correctness and speed of the formula.
"""
from __future__ import division, print_function, absolute_import
import os
import time
import numpy
from scipy.special import expit
import pandas
from six import BytesIO
from six.moves import zip
from rep.estimators._matrixnetapplier import MatrixNetApplie... | apache-2.0 |
gmariotti/lassim | source/core/solutions/lassim_solution.py | 1 | 2139 | from typing import List
import numpy as np
import pandas as pd
from PyGMO.core import champion
from sortedcontainers import SortedDict
from core.base_solution import BaseSolution
from core.core_problem import CoreProblem
__author__ = "Guido Pio Mariotti"
__copyright__ = "Copyright (C) 2016 Guido Pio Mariotti"
__lice... | gpl-3.0 |
joshuahellier/PhDStuff | codes/exact/matStuff/simpleGroundStateFinder.py | 1 | 8985 | import scipy.sparse as sp
import scipy.sparse.linalg as la
import numpy as np
import math as m
import time
import sys
import os
import pandas as pd
import statsmodels.formula.api as sm
resultDir = os.environ.get('RESULTS')
if resultDir == None :
print ("WARNING! $RESULTS not set! Attempt to write results will fai... | mit |
nesterione/scikit-learn | sklearn/pipeline.py | 162 | 21103 | """
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# Licence: BSD
from collections import defaultdict... | bsd-3-clause |
ljvillanueva/bits-and-pieces | python/wavspec.py | 1 | 4965 | #!/usr/bin/python
from struct import pack, unpack #Some unpacking for the WAV encoding
from FFT import * #Some FFT goodness
from Numeric import * #Gotta have speedy math
import wave #For opening WAV files
from pylab import * #For ploting
from m... | gpl-3.0 |
ml-lab/neuralnilm | neuralnilm/data/stridesource.py | 4 | 6512 | from __future__ import print_function, division
from copy import copy
from datetime import timedelta
import numpy as np
import pandas as pd
import nilmtk
from nilmtk.timeframegroup import TimeFrameGroup
from nilmtk.timeframe import TimeFrame
from neuralnilm.data.source import Sequence
from neuralnilm.utils import check... | apache-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/series/test_asof.py | 7 | 4718 | # coding=utf-8
import nose
import numpy as np
from pandas import (offsets, Series, notnull,
isnull, date_range, Timestamp)
import pandas.util.testing as tm
from .common import TestData
class TestSeriesAsof(TestData, tm.TestCase):
_multiprocess_can_split_ = True
def test_basic(self):
... | mit |
etamponi/resilient-protocol | resilient/pdfs.py | 1 | 2025 | from abc import ABCMeta, abstractmethod
import cmath
import numpy
from scipy.spatial import distance
from sklearn.base import BaseEstimator
__author__ = 'Emanuele Tamponi <emanuele.tamponi@diee.unica.it>'
class PDF(BaseEstimator):
__metaclass__ = ABCMeta
@abstractmethod
def probability(self, x):
... | gpl-2.0 |
toobaz/pandas | pandas/tests/dtypes/test_generic.py | 2 | 4127 | from warnings import catch_warnings, simplefilter
import numpy as np
from pandas.core.dtypes import generic as gt
import pandas as pd
from pandas.util import testing as tm
class TestABCClasses:
tuples = [[1, 2, 2], ["red", "blue", "red"]]
multi_index = pd.MultiIndex.from_arrays(tuples, names=("number", "co... | bsd-3-clause |
arielmakestuff/loadlimit | test/unit/stat/conftest.py | 1 | 1268 | # -*- coding: utf-8 -*-
# loadlimit/test/unit/stat/conftest.py
# Copyright (C) 2016 authors and contributors (see AUTHORS file)
#
# This module is released under the MIT License.
"""Pytest config for unit tests"""
# ============================================================================
# Imports
# =============... | mit |
adit-chandra/tensorflow | tensorflow/python/kernel_tests/constant_op_eager_test.py | 33 | 21448 | # 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 |
elijah513/scikit-learn | sklearn/linear_model/tests/test_perceptron.py | 378 | 1815 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_raises
from sklearn.utils import check_random_state
from sklearn.datasets import load_iris
from sklearn.linear_model import Pe... | bsd-3-clause |
toastedcornflakes/scikit-learn | sklearn/feature_extraction/text.py | 9 | 50313 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gmail.com>
#
# License: B... | bsd-3-clause |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/util/test_assert_frame_equal.py | 2 | 7082 | import pytest
from pandas import DataFrame
from pandas.util.testing import assert_frame_equal
@pytest.fixture(params=[True, False])
def by_blocks_fixture(request):
return request.param
@pytest.fixture(params=["DataFrame", "Series"])
def obj_fixture(request):
return request.param
def _assert_frame_equal_b... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.