repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
jhamman/xarray | asv_bench/benchmarks/rolling.py | 3 | 2217 | import numpy as np
import pandas as pd
import xarray as xr
from . import parameterized, randn, requires_dask
nx = 3000
long_nx = 30000000
ny = 2000
nt = 1000
window = 20
randn_xy = randn((nx, ny), frac_nan=0.1)
randn_xt = randn((nx, nt))
randn_t = randn((nt,))
randn_long = randn((long_nx,), frac_nan=0.1)
class Ro... | apache-2.0 |
sonium0/pymatgen | pymatgen/electronic_structure/plotter.py | 2 | 42465 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
"""
This module implements plotter for DOS and band structure.
"""
__author__ = "Shyue Ping Ong, Geoffroy Hautier"
__copyright__ = "Copyright ... | mit |
sara-02/fabric8-analytics-stack-analysis | util/softnet_util.py | 1 | 2671 | """Utility functions for handling package lists, compute similarity score etc."""
import numpy as np
import pandas as pd
import analytics_platform.kronos.softnet.src.softnet_constants as softnet_constants
def generate_parent_tuple_list(node_list, edge_dict_list):
"""Generate parent tuple list."""
child_to_p... | gpl-3.0 |
pv/scikit-learn | examples/neighbors/plot_regression.py | 349 | 1402 | """
============================
Nearest Neighbors regression
============================
Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@... | bsd-3-clause |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/pandas/util/decorators.py | 9 | 9665 | from pandas.compat import StringIO, callable
from pandas.lib import cache_readonly
import sys
import warnings
from functools import wraps
def deprecate(name, alternative, alt_name=None):
alt_name = alt_name or alternative.__name__
def wrapper(*args, **kwargs):
warnings.warn("%s is deprecated. Use %s ... | gpl-2.0 |
neilhan/tensorflow | tensorflow/examples/skflow/mnist_rnn.py | 14 | 2812 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/contrib/learn/__init__.py | 42 | 2596 | # 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... | mit |
fabioticconi/scikit-learn | sklearn/metrics/cluster/tests/test_supervised.py | 5 | 8869 | import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import homogeneity_score
from sklearn.metrics.cluster import completeness_score
from sklearn.metrics.cluster import v_measure_score
from sklearn.metrics.cluster import homogeneity_completeness_v_measure
from sklearn... | bsd-3-clause |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/matplotlib/finance.py | 10 | 51311 | """
A collection of functions for collecting, analyzing and plotting
financial data. User contributions welcome!
This module is deprecated in 1.4 and will be moved to `mpl_toolkits`
or it's own project in the future.
"""
from __future__ import (absolute_import, division, print_function,
unic... | mit |
petosegan/scikit-learn | sklearn/utils/metaestimators.py | 283 | 2353 | """Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# Licence: BSD
from operator import attrgetter
from functools import update_wrapper
__all__ = ['if_delegate_has_method']
class _IffHasAttrDescriptor(object):
"""Implements a conditional property using the descriptor protocol.
... | bsd-3-clause |
APPIAN-PET/APPIAN | src/dashboard/dashboard.py | 1 | 13109 | import os
import glob
import json
import subprocess
import sys
import importlib
import h5py
import nipype.interfaces.minc as minc
import nipype.pipeline.engine as pe
import nipype.interfaces.io as nio
import nipype.interfaces.utility as util
import nipype.interfaces.utility as niu
import distutils
import nibabel as nib... | mit |
JaneliaSciComp/hybridizer | tests/adc_to_volume.py | 4 | 5112 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import matplotlib.pyplot as plot
import numpy
from numpy.polynomial.polynomial import polyfit,polyadd,Polynomial
import yaml
INCHES_PER_ML = 0.078
VOLTS_PER_ADC_UNIT = 0.0049
def load_numpy_data(path):
with open(path,'r') as fid:
hea... | bsd-3-clause |
ThirdProject/android_external_chromium_org | chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py | 26 | 11131 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Do all the steps required to build and test against nacl."""
import optparse
import os.path
import re
import shutil
import subproc... | bsd-3-clause |
lanselin/pysal | pysal/__init__.py | 4 | 5450 | """
Python Spatial Analysis Library
===============================
Documentation
-------------
PySAL documentation is available in two forms: python docstrings and an html \
webpage at http://pysal.org/
Available sub-packages
----------------------
cg
Basic data structures and tools for Computational G... | bsd-3-clause |
vermouthmjl/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
robin-lai/scikit-learn | examples/svm/plot_iris.py | 225 | 3252 | """
==================================================
Plot different SVM classifiers in the iris dataset
==================================================
Comparison of different linear SVM classifiers on a 2D projection of the iris
dataset. We only consider the first 2 features of this dataset:
- Sepal length
- Se... | bsd-3-clause |
befelix/GPy | GPy/plotting/plotly_dep/plot_definitions.py | 4 | 16743 | #===============================================================================
# Copyright (c) 2015, Max Zwiessele
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source... | bsd-3-clause |
alvaroing12/CADL | session-5/libs/utils.py | 6 | 21427 | """Utilities used in the Kadenze Academy Course on Deep Learning w/ Tensorflow.
Creative Applications of Deep Learning w/ Tensorflow.
Kadenze, Inc.
Parag K. Mital
Copyright Parag K. Mital, June 2016.
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import tensorflow as tf
import urllib
import... | apache-2.0 |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/tests/test_window.py | 7 | 146653 | from itertools import product
import nose
import sys
import warnings
from nose.tools import assert_raises
from datetime import datetime
from numpy.random import randn
import numpy as np
from distutils.version import LooseVersion
import pandas as pd
from pandas import (Series, DataFrame, Panel, bdate_range, isnull,
... | apache-2.0 |
rbalda/neural_ocr | env/lib/python2.7/site-packages/matplotlib/offsetbox.py | 4 | 55560 | """
The OffsetBox is a simple container artist. The child artist are meant
to be drawn at a relative position to its parent. The [VH]Packer,
DrawingArea and TextArea are derived from the OffsetBox.
The [VH]Packer automatically adjust the relative postisions of their
children, which should be instances of the OffsetBo... | mit |
tmrowco/electricitymap | parsers/occtonet.py | 1 | 8424 | #!/usr/bin/env python3
# coding=utf-8
import logging
import datetime
import pandas as pd
# The arrow library is used to handle datetimes
import arrow
# The request library is used to fetch content through HTTP
import requests
from io import StringIO
# Abbreviations:
# JP-HKD : Hokkaido
# JP-TH : Tohoku (incl. Niigat... | gpl-3.0 |
aewhatley/scikit-learn | examples/ensemble/plot_forest_importances_faces.py | 403 | 1519 | """
=================================================
Pixel importances with a parallel forest of trees
=================================================
This example shows the use of forests of trees to evaluate the importance
of the pixels in an image classification task (faces). The hotter the pixel,
the more impor... | bsd-3-clause |
rajat1994/scikit-learn | examples/cluster/plot_digits_linkage.py | 369 | 2959 | """
=============================================================================
Various Agglomerative Clustering on a 2D embedding of digits
=============================================================================
An illustration of various linkage option for agglomerative clustering on
a 2D embedding of the di... | bsd-3-clause |
WafaaT/spark-tk | regression-tests/sparktkregtests/testcases/models/logistic_regression_test.py | 10 | 19546 | # 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 |
hydrosquall/tiingo-python | tests/test_tiingo_pandas.py | 1 | 7087 | #!/usr/bin/env python
"""Unit tests for pandas functionality in tiingo"""
import vcr
from unittest import TestCase
from tiingo import TiingoClient
from tiingo.exceptions import APIColumnNameError, InstallPandasException, MissingRequiredArgumentError
try:
import pandas as pd
pandas_is_installed = True
except Im... | mit |
sonnyhu/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 93 | 3243 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
skudriashev/incubator-airflow | airflow/www/views.py | 2 | 97479 | # -*- coding: utf-8 -*-
#
# 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 writing, software
... | apache-2.0 |
m0re4u/LeRoT-SCLP | visual_eval/create_histogram.py | 1 | 3474 | from time import sleep
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import argparse
import yaml
import sys
SEAGREEN = (0, 128 / 255., 102 / 255.)
INTERVAL = 500
MINIMUM = 0.03
def create_histogram(filename, iterations, stepsize, x_label, y_label, max_x,
min_y, max_y):... | gpl-3.0 |
JosephKJ/SDD-RFCN-python | tools/demo_faster_rcnn.py | 1 | 6898 | #!/usr/bin/env python
# --------------------------------------------------------
# R-FCN
# Copyright (c) 2016 Yuwen Xiong
# Licensed under The MIT License [see LICENSE for details]
# Written by Yuwen Xiong
# --------------------------------------------------------
"""
Demo script showing detections in sample images.
... | mit |
joernhees/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
ColdMatter/EDMSuite | MoleculeMOTScripts/analysis3.py | 1 | 60116 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 15 06:30:01 2019
@author: arijit
"""
from __future__ import print_function
import numpy as np
import os,zipfile
from PIL import Image
from scipy.optimize import curve_fit
from scipy import optimize
from scipy.signal import savgol_filter
import matp... | mit |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/numpy/lib/function_base.py | 6 | 109722 | __docformat__ = "restructuredtext en"
__all__ = ['select', 'piecewise', 'trim_zeros', 'copy', 'iterable',
'percentile', 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex',
'disp', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax',
'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'av... | agpl-3.0 |
spallavolu/scikit-learn | examples/model_selection/plot_precision_recall.py | 249 | 6150 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
polyaxon/polyaxon | core/polyaxon/polyboard/events/schemas.py | 1 | 16747 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | apache-2.0 |
fraricci/pymatgen | pymatgen/analysis/defects/thermodynamics.py | 2 | 30439 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import logging
import numpy as np
from monty.json import MSONable
from scipy.spatial import HalfspaceIntersection
from scipy.optimize import bisect
from itertools import chain
from pymatgen.electronic_structur... | mit |
tensorflow/probability | tensorflow_probability/python/sts/regularization.py | 1 | 12469 | # Copyright 2021 The TensorFlow Probability 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 o... | apache-2.0 |
adewynter/Tools | MLandDS/MachineLearning/Kmeans-CustomerAnalysis.py | 1 | 3531 | # Adrian deWynter, 2016
# This dataset is nasty, so we are also going to use some PCA.
import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import matplotlib
import math
PLOT_TYPE_TEXT = False
PLOT_VECTORS = True
matplotlib.style.u... | mit |
conversationai/wikidetox | experimental/conversation_go_awry/kaggle/trainer/model.py | 1 | 12041 | """
Classifiers for the Toxic Comment Classification Kaggle challenge,
https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge
To run locally:
python trainer/model.py --train_data=train.csv --predict_data=test.csv --y_class=toxic
To run locally using Cloud ML Engine:
gcloud ml-engine local train \
... | apache-2.0 |
conversationai/conversationai-models | model_evaluation/utils_export/utils_cloudml_test.py | 1 | 4111 | # 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 |
TaxIPP-Life/Til | til/pgm/Archives/DataTable_from_liam.py | 2 | 7093 | # -*- coding:utf-8 -*-
"""
Convert Liam output in OpenFisca Input
"""
from pandas import HDFStore, merge # DataFrame
import numpy as np
import pdb
import time
from src.lib.simulation import SurveySimulation
from src.parametres.paramData import XmlReader, Tree2Object
import pandas as pd
import datetime as dt
impor... | gpl-3.0 |
khaeru/py-gdx | gdx/__init__.py | 1 | 19054 | # coding: utf-8
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from itertools import cycle
import logging
import numpy
import pandas
import xarray as xr
from .pycompat import install_aliases, filter, raise_from, range, super, zip
install_aliases()
from .a... | mit |
huangyh09/hilearn | hilearn/plot/seaborn_plot.py | 1 | 2264 | # some wrapped functions from seaborn
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
def regplot(x, y, hue=None, hue_values=None, show_corr=True, legend_on=True,
**kwargs):
"""Extended plotting of `seaborn.regplot` with showing correlation
coeffecient and supporting mu... | apache-2.0 |
JPFrancoia/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
lucashtnguyen/wqio | wqio/core/hydro.py | 1 | 29082 | import warnings
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.gridspec as gridspec
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
import seaborn.apionly as seaborn
import pandas
from wqio import utils
SEC_PER_MINUTE = 60.
MIN_PER_HOUR ... | bsd-3-clause |
rhambach/TEMareels | qcal/momentum_dispersion.py | 1 | 26008 | """
Analysis of the q/x dispersion from the borders of
a small, round aperture in momentum space / real space.
TODO
- polynomial distortion fails if dispersion has no zero
Copyright (c) 2013, rhambach.
This file is part of the TEMareels package and released
under the MIT-Licence. See LICENCE file... | mit |
KIT-MRT/PLCC | SumImages.py | 1 | 2341 | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of PLCC.
#
# Copyright 2016 Johannes Graeter <johannes.graeter@kit.edu (Karlsruhe Institute of Technology)
#
# PLCC comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
#
# PLCC is free software: you can redistribute it and/or modify
# it under the... | gpl-3.0 |
gviejo/ThalamusPhysio | python/main_make_AUTOCOR_during_SPINDLES.py | 1 | 2006 | #!/usr/bin/env python
'''
File name: main_ripp_mod.py
Author: Guillaume Viejo
Date created: 16/08/2017
Python Version: 3.5.2
Sharp-waves ripples modulation
Used to make figure 1
'''
import numpy as np
import pandas as pd
import scipy.io
from functions import *
# from pylab import *
# import ipyp... | gpl-3.0 |
eezee-it/addons-yelizariev | sugarcrm_migration/import_sugarcrm.py | 16 | 44410 | # -*- coding: utf-8 -*-
import logging
_logger = logging.getLogger(__name__)
try:
import MySQLdb
import MySQLdb.cursors
from pandas import merge, DataFrame
except ImportError:
pass
from openerp.addons.import_framework.import_base import import_base, create_childs
from openerp.addons.import_framework.... | lgpl-3.0 |
jburos/stancache | stancache/stancache.py | 1 | 11994 | import os
import pickle
import dill
import pystan
import hashlib
import base64
import logging
from fnmatch import fnmatch
import ntpath
from . import seed
from time import time
from datetime import timedelta
import pandas as pd
import re
import Cython
from . import config
import types
import numpy as np
import xxhash
... | apache-2.0 |
PascalSteger/twiddle | analysis/plot_isobartest.py | 1 | 1061 | #!/usr/bin/env python3
## \file
# plot abundances from cat rectest.log|grep "Y:"|cut -d":" -f2|pr -s -t -l9|tee rectest.col
import sys
infile = sys.argv[1]; outfile = sys.argv[2]
from matplotlib import pyplot as PLT
fig = PLT.figure()
ax1 = fig.add_subplot(111)
import numpy as NP
with open(infile) as f:
v = NP... | gpl-2.0 |
kartikp1995/gnuradio | gr-fec/python/fec/polar/decoder.py | 24 | 10396 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is... | gpl-3.0 |
xju2/HZZ_llvv_ws | HZZ_llvv_ws/interpolate_acceptance.py | 1 | 1820 | # -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(os.path.realpath(__file__))), '..')))
from HZZ_llvv_ws import helper
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
from scipy import interpolate
i... | mit |
rs2/pandas | pandas/tests/plotting/test_boxplot_method.py | 2 | 18166 | import itertools
import string
import numpy as np
from numpy import random
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame, MultiIndex, Series, date_range, timedelta_range
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase, _check_plot_works
impor... | bsd-3-clause |
Mogeng/IOHMM | tests/test_OLS.py | 2 | 33960 | from __future__ import print_function
from __future__ import division
# import json
from past.utils import old_div
import unittest
import numpy as np
import statsmodels.api as sm
from IOHMM import OLS
# //TODO sample weight all zero
# Corner cases
# General
# 1. sample_weight is all zero
# 2. sample_weight is all... | bsd-3-clause |
astronomeara/xastropy-old | xastropy/spec/analysis.py | 1 | 4788 | """
#;+
#; NAME:
#; analysis
#; Version 1.0
#;
#; PURPOSE:
#; Module for Analysis of Spectra
#; 07-Sep-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import ba... | bsd-3-clause |
soneoed/naowalkoptimiser | server/MCLLocalisation.py | 2 | 26832 | """ An SIR Particle Filter based localisation system for tracking a robot with ambiguous bearing
Jason Kulk
"""
from NAO import NAO
import numpy, time
class Localisation:
X = 0
Y = 1
THETA = 2
XDOT = 3
YDOT = 4
THETADOT = 5
STATE_LENGTH = 6
VEL_PAST_LENGTH = 13
def __init__... | gpl-3.0 |
TaikiGoto/master | ch06/overfit_weight_decay.py | 3 | 2080 | # coding: utf-8
import os
import sys
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
import matplotlib.pyplot as plt
from dataset.mnist import load_mnist
from common.multi_layer_net import MultiLayerNet
from common.optimizer import SGD
(x_train, t_train), (x_test, t_test) = load_mnist(norma... | mit |
alisidd/tensorflow | tensorflow/python/client/notebook.py | 109 | 4791 | # 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 |
Akshay0724/scikit-learn | sklearn/neural_network/tests/test_mlp.py | 28 | 22183 | """
Testing for Multi-layer Perceptron module (sklearn.neural_network)
"""
# Author: Issam H. Laradji
# License: 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, load_iris
from sklearn... | bsd-3-clause |
pratapvardhan/pandas | pandas/tests/sparse/test_groupby.py | 18 | 1736 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import pandas.util.testing as tm
class TestSparseGroupBy(object):
def setup_method(self, method):
self.dense = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
'foo', 'bar', 'foo', 'foo'],
... | bsd-3-clause |
lbishal/scikit-learn | examples/plot_multilabel.py | 236 | 4157 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
ettm2012/MissionPlanner | Lib/site-packages/scipy/signal/ltisys.py | 53 | 23848 | """
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
#
from filter_design import tf2zpk, zpk2tf, normalize
import numpy
from numpy import product, zeros, array, dot, tra... | gpl-3.0 |
vortex-ape/scikit-learn | sklearn/cluster/birch.py | 4 | 23758 | # 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 |
rdhyee/PyTables | doc/sphinxext/plot_directive.py | 65 | 20399 | """
A special directive for generating a matplotlib plot.
.. warning::
This is a hacked version of plot_directive.py from Matplotlib.
It's very much subject to change!
Usage
-----
Can be used like this::
.. plot:: examples/example.py
.. plot::
import matplotlib.pyplot as plt
plt.plot... | bsd-3-clause |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/examples/skflow/mnist_rnn.py | 14 | 2812 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
gundramleifert/exp_tf | models/htr_iam/bdlstm_iam_v1.py | 1 | 11648 | # Author: Tobi and Gundram
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.contrib.layers import batch_norm
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops.rnn import... | apache-2.0 |
kaiserroll14/301finalproject | main/pandas/tseries/index.py | 9 | 75758 | # pylint: disable=E1101
from __future__ import division
import operator
import warnings
from datetime import time, datetime
from datetime import timedelta
import numpy as np
from pandas.core.common import (_NS_DTYPE, _INT64_DTYPE,
_values_from_object, _maybe_box,
... | gpl-3.0 |
pmatigakis/jsbsim | tests/TestTurboProp.py | 4 | 3032 | # TestTurboProp.py
#
# Regression tests for the turboprop engine model.
#
# Copyright (c) 2016 Bertrand Coconnier
#
# 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 Licens... | lgpl-2.1 |
vivekmishra1991/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 |
carlvlewis/bokeh | bokeh/charts/builder/timeseries_builder.py | 26 | 6252 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the TimeSeries class which lets you build your TimeSeries charts just
passing the arguments to the Chart class and calling the proper functions.
"""
#-----------------------------------------------------... | bsd-3-clause |
mahak/spark | python/pyspark/sql/pandas/types.py | 20 | 13357 | #
# 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 |
zaxtax/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
nelson-liu/scikit-learn | examples/applications/svm_gui.py | 124 | 11251 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
belltailjp/scikit-learn | sklearn/preprocessing/tests/test_data.py | 14 | 37957 | import warnings
import numpy as np
import numpy.linalg as la
from scipy import sparse
from distutils.version import LooseVersion
from sklearn.utils.testing import assert_almost_equal, clean_warning_registry
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal... | bsd-3-clause |
arabenjamin/scikit-learn | examples/linear_model/plot_sparse_recovery.py | 243 | 7461 | """
============================================================
Sparse recovery: feature selection for sparse linear models
============================================================
Given a small number of observations, we want to recover which features
of X are relevant to explain y. For this :ref:`sparse linear ... | bsd-3-clause |
llhe/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/ops.py | 77 | 46403 | # 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 |
murali-munna/scikit-learn | examples/svm/plot_svm_margin.py | 318 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/sklearn/svm/classes.py | 6 | 40597 | import warnings
import numpy as np
from .base import _fit_liblinear, BaseSVC, BaseLibSVM
from ..base import BaseEstimator, RegressorMixin
from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \
LinearModel
from ..feature_selection.from_model import _LearntSelectorMixin
from ..utils import check_X... | gpl-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/testing/jpl_units/__init__.py | 21 | 3240 | #=======================================================================
"""
This is a sample set of units for use with testing unit conversion
of matplotlib routines. These are used because they use very strict
enforcement of unitized data which will test the entire spectrum of how
unitized data might be used (it is... | gpl-3.0 |
cjayb/mne-python | mne/viz/_brain/tests/test_brain.py | 1 | 23280 | # -*- coding: utf-8 -*-
#
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
# Oleh Kozynets <ok7mailbox@gmail.com>
#
# License: Simplified BSD
imp... | bsd-3-clause |
wazeerzulfikar/scikit-learn | benchmarks/bench_saga.py | 45 | 8474 | """Author: Arthur Mensch
Benchmarks of sklearn SAGA vs lightning SAGA vs Liblinear. Shows the gain
in using multinomial logistic regression in term of learning time.
"""
import json
import time
from os.path import expanduser
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import fetch_rcv1, ... | bsd-3-clause |
nielmishra/eSIM | python code backup/__main__.py | 1 | 1828 | import os
import sys
import numpy as np
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def get_plot_files(file):
open_file = open(os.path.realpath(file),'r')
raw_data = open_file.read()
array = raw_data.split('* ')
array.po... | gpl-3.0 |
MLWave/auto-sklearn | source/conf.py | 5 | 8715 | # -*- coding: utf-8 -*-
#
# AutoSklearn documentation build configuration file, created by
# sphinx-quickstart on Thu May 21 13:40:42 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | bsd-3-clause |
ptonner/GPy | GPy/examples/regression.py | 8 | 18746 | # Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
"""
Gaussian Processes regression examples
"""
try:
from matplotlib import pyplot as pb
except:
pass
import numpy as np
import GPy
def olympic_marathon_men(optimize=True, plot=True):
"""Ru... | bsd-3-clause |
jakobj/UP-Tasks | NEST/single_neuron_task/single_neuron.py | 3 | 1344 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import nest # import NEST module
def single_neuron(spike_times, sim_duration):
nest.set_verbosity('M_WARNING') # reduce NEST output
nest.ResetKernel() # reset simulation kernel
# create LIF neuron with exponential synaptic currents... | gpl-2.0 |
jmschrei/scikit-learn | sklearn/utils/tests/test_class_weight.py | 90 | 12846 | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... | bsd-3-clause |
kernc/scikit-learn | sklearn/linear_model/least_angle.py | 11 | 57260 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... | bsd-3-clause |
tom-f-oconnell/multi_tracker | multi_tracker_analysis/read_hdf5_file_to_pandas.py | 1 | 27945 |
import copy
import os
import imp
import pickle
import warnings
import time
import inspect
import warnings
# used?
import types
import numpy as np
import h5py
import pandas
import scipy.interpolate
def get_filenames(path, contains, does_not_contain=['~', '.pyc']):
cmd = 'ls ' + '"' + path + '"'
ls = os.popen... | mit |
ch3ll0v3k/scikit-learn | sklearn/cluster/tests/test_bicluster.py | 226 | 9457 | """Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... | bsd-3-clause |
fcole90/nemesys-qos | nemesys/netgraph.py | 9 | 3506 | #!/usr/bin/env python
# printing_in_wx.py
#
from collections import deque
from contabyte import Contabyte
from pcapper import Pcapper
from threading import Thread
import math
import matplotlib
import numpy
import socket
import time
import wx
SECONDS = 60
POINTS_PER_SECONDS = 1
SAMPLE_INTERVAL = 0.8
matplotlib.use('W... | gpl-3.0 |
stelat/GoRec | train_SVM.py | 1 | 1689 | import numpy as np
import cv2
from sklearn import svm, cross_validation
import pickle
from sklearn.externals import joblib
from extract_feature import *
from os import listdir
from os.path import isfile, join
from random import shuffle
def data_shuffle(X,Y):
list1_shuf = []
list2_shuf = []
index_shuf = ran... | bsd-3-clause |
peterwilletts24/Python-Scripts | plot_scripts/Rain/Diurnal/sea_diurnal_rain_plot_domain_constrain_southern_eastern_indian_ocean.py | 1 | 10337 | """
Load npy xy, plot and save
"""
import os, sys
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcPa... | mit |
marcharper/stationary | examples/entropic_equilibria_plots.py | 1 | 9181 | """Figures for the publication
"Entropic Equilibria Selection of Stationary Extrema in Finite Populations"
"""
from __future__ import print_function
import math
import os
import pickle
import sys
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import sc... | mit |
Clyde-fare/scikit-learn | examples/linear_model/plot_ols.py | 220 | 1940 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | bsd-3-clause |
shenzebang/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 |
DiegoCorrea/ouvidoMusical | apps/evaluators/MRR/analyzer/benchmark.py | 1 | 11662 | import matplotlib.pyplot as plt
import numpy as np
import logging
import os
from collections import Counter
from apps.CONSTANTS import (
SET_SIZE_LIST,
INTERVAL,
AT_LIST,
GRAPH_SET_COLORS_LIST
)
from apps.data.users.models import User
from apps.evaluators.MRR.algorithm.models import MRR
logger = loggi... | mit |
ueshin/apache-spark | python/pyspark/pandas/tests/test_series_conversion.py | 15 | 3303 | #
# 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 |
SheffieldML/GPy | setup.py | 1 | 9929 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
# Copyright (c) 2012 - 2014, GPy authors (see AUTHORS.txt).
# Copyright (c) 2014, James Hensman, Max Zwiessele
# Copyright (c) 2015, Max Zwiessele
#
# All rights reserved.
#
# Redistribution a... | bsd-3-clause |
pnedunuri/scikit-learn | sklearn/ensemble/tests/test_forest.py | 48 | 39224 | """
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import combinations
from itertools import product
import numpy ... | bsd-3-clause |
jseabold/statsmodels | statsmodels/tsa/arima_process.py | 5 | 28643 | """ARMA process and estimation with scipy.signal.lfilter
Notes
-----
* written without textbook, works but not sure about everything
briefly checked and it looks to be standard least squares, see below
* theoretical autocorrelation function of general ARMA
Done, relatively easy to guess solution, time consuming t... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.