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 |
|---|---|---|---|---|---|
huseinzol05/Deep-Learning-Tensorflow | deprecated/Deep Convolutional Network/pokemon-type/old-model/graph.py | 1 | 1505 | import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style = "whitegrid", palette = "muted")
import numpy as np
import matplotlib.gridspec as gridspec
import csv
import pandas as pd
from scipy import misc
def generategraph(x, accuracy, lost):
fig = plt.figure(figsize = (15, 5))
plt.subplot(1... | mit |
EderSantana/keras | tests/manual/check_callbacks.py | 4 | 7997 | import numpy as np
import random
import theano
from keras.models import Sequential
from keras.callbacks import Callback
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.regularizers import l2
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.utils import np_utils... | mit |
dingocuster/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 230 | 4762 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
otmaneJai/Zipline | zipline/pipeline/loaders/synthetic.py | 1 | 8291 | """
Synthetic data loaders for testing.
"""
from bcolz import ctable
from numpy import (
arange,
array,
float64,
full,
iinfo,
uint32,
)
from pandas import DataFrame, Timestamp
from six import iteritems
from sqlite3 import connect as sqlite3_connect
from .base import PipelineLoader
from .frame ... | apache-2.0 |
iismd17/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 68 | 23597 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
tritemio/FRETBursts | fretbursts/mfit.py | 1 | 21943 | #
# FRETBursts - A single-molecule FRET burst analysis toolkit.
#
# Copyright (C) 2014-2016 The Regents of the University of California,
# Antonino Ingargiola <tritemio@gmail.com>
#
"""
This model provides a class for fitting multi-channel data
(:class:`MultiFitter`) and a series of predefined functions f... | gpl-2.0 |
AllenDowney/MarriageNSFG | thinkplot.py | 1 | 19729 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np... | mit |
google-research/google-research | stacked_capsule_autoencoders/capsules/train/hooks.py | 1 | 10824 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
LohithBlaze/scikit-learn | sklearn/metrics/cluster/unsupervised.py | 230 | 8281 | """ Unsupervised evaluation metrics. """
# Authors: Robert Layton <robertlayton@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ..pairwise import pairwise_distances
def silhouette_score(X, labels, metric='euclidean', sample_size=None,
random... | bsd-3-clause |
ianozsvald/social_media_brand_disambiguator | learn1_coefficients.py | 1 | 7347 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""First simple sklearn classifier"""
from __future__ import division # 1/2 == 0.5, as in Py3
from __future__ import absolute_import # avoid hiding global modules with locals
from __future__ import print_function # force use of print("hello")
from __future__ import unico... | mit |
wzbozon/statsmodels | statsmodels/genmod/_prediction.py | 27 | 9437 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 19 11:29:18 2014
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
# this is similar to ContrastResults after t_test, partially copied and adjusted
class PredictionResults(object):
def __init__(self, predicted_mean, var_pred_mean... | bsd-3-clause |
robintw/scikit-image | skimage/viewer/plugins/color_histogram.py | 40 | 3271 | import numpy as np
import matplotlib.pyplot as plt
from ... import color, exposure
from .plotplugin import PlotPlugin
from ..canvastools import RectangleTool
class ColorHistogram(PlotPlugin):
name = 'Color Histogram'
def __init__(self, max_pct=0.99, **kwargs):
super(ColorHistogram, self).__init__(hei... | bsd-3-clause |
daler/metaseq-biotrac56 | heatmap-example.py | 1 | 21062 |
# coding: utf-8
# Overview
# This notebook is a follow-up to the [de-example.ipynb](de-
# example.ipynb) notebook.
# The end goal is a heatmap of normalized H3K4me3 ChIP-seq signal in
# K562 cells,
# split into signal over genes that were up, down and unchanged compared
# to H1-hESC
# cells.
# Show figures in the n... | mit |
llhe/tensorflow | tensorflow/python/estimator/canned/dnn_linear_combined_test.py | 5 | 26973 | # Copyright 2017 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 |
cbertinato/pandas | pandas/core/base.py | 1 | 49899 | """
Base and utility classes for pandas objects.
"""
import builtins
from collections import OrderedDict
import textwrap
import warnings
import numpy as np
import pandas._libs.lib as lib
from pandas.compat import PYPY
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pa... | bsd-3-clause |
HyukjinKwon/spark | python/pyspark/pandas/tests/plot/test_frame_plot_matplotlib.py | 14 | 18666 | #
# 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 |
mxjl620/scikit-learn | examples/exercises/plot_cv_diabetes.py | 231 | 2527 | """
===============================================
Cross-validation on diabetes Dataset Exercise
===============================================
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the :ref:`cv_estimators_tut` part of the
:ref:`model_selection_tut` section of ... | bsd-3-clause |
geophysics/mtpy | mtpy/imaging/plotptpseudosection.py | 1 | 59761 | # -*- coding: utf-8 -*-
"""
Created on Thu May 30 18:10:55 2013
@author: jpeacock-pr
"""
#==============================================================================
import matplotlib.pyplot as plt
import numpy as np
import os
import matplotlib.colors as colors
import matplotlib.patches as patches
import matplotl... | gpl-3.0 |
fredhusser/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
heprom/pymicro | examples/3d_visualisation/2-6-2_30k00_c1_3d.py | 1 | 1874 | import os, vtk, numpy as np
from vtk.util import numpy_support
from vtk.util.colors import *
from pymicro.file.file_utils import HST_read, HST_write, HST_info
from pymicro.view.scene3d import Scene3D
from pymicro.view.vtk_utils import *
if __name__ == '__main__':
'''
Create a 3d scene showing the 3d corner cra... | mit |
mjgrav2001/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 264 | 1804 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
leesavide/pythonista-docs | Documentation/matplotlib/examples/misc/rc_traits.py | 6 | 5531 | # Here is some example code showing how to define some representative
# rc properties and construct a matplotlib artist using traits.
# matplotlib does not ship with enthought.traits, so you will need to
# install it separately.
from __future__ import print_function
import sys, os, re
import traits.api as traits
from... | apache-2.0 |
bjornaa/ladim | examples/nested/animate_original.py | 1 | 2391 | # import itertools
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from netCDF4 import Dataset
from postladim import ParticleFile
# ---------------
# User settings
# ---------------
# Files
particle_file = "original.nc"
grid_file = "../data/ocean_avg_0014.nc"
# Subgr... | mit |
pbailis/hat-vldb2014-code | prototype-database-code/scripts/graph/legend.py | 1 | 1107 | import matplotlib
from matplotlib.font_manager import FontProperties
from pylab import *
from os import listdir
from sys import argv
fmtdict = {
"CONSTANT_TRANSACTIONREAD_COMMITTED-NO_ATOMICITY" : ["blue", '^-', 'RC'],
"MASTERED_EVENTUAL" : ["teal", 's-', 'Master'],
"CONSTANT_TRANSACTIONREAD_COMMITTED-CLIENT" : ["g... | apache-2.0 |
db4ple/mchf-github | mchf-eclipse/drivers/ui/lcd/edit-8x8-font.py | 4 | 2343 | # Tool to extract 8x8 font data, save to bitmap file, and apply modifications
# to source code after editing the bitmap.
from __future__ import print_function
from matplotlib.pyplot import imread, imsave, imshow, show
import numpy as np
import sys
# Where to find the font data - may need updated if code has changed.
... | gpl-3.0 |
rhennigan/code | python/forwardEuler.py | 1 | 1208 | # QUIZ
#
# Modify the for loop below to
# set the values of the t, x, and v
# arrays to implement the Forward
# Euler Method for num_steps many steps.
# To see plots on your own computer, uncomment the two lines below...
import numpy
import matplotlib.pyplot
# from udacityplots import * # ...and comment... | gpl-2.0 |
JosephKJ/SDD-RFCN-python | tools/train_svms.py | 16 | 13480 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Train post-hoc SVMs using the algorithm and ... | mit |
dcprojects/CoolProp | wrappers/Python/CoolProp/Plots/Plots.py | 3 | 16705 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import numpy as np
import warnings
import CoolProp
from CoolProp.Plots.Common import IsoLine,BasePlot,interpolate_values_1d
from CoolProp.Plots.SimpleCycles import StateContainer
class PropertyPlot(BasePlot):
def __init__(s... | mit |
trustedanalytics/spark-tk | regression-tests/sparktkregtests/testcases/models/collaborative_filtering_test.py | 10 | 14061 | # 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 |
heplesser/nest-simulator | pynest/examples/mc_neuron.py | 8 | 7424 | # -*- coding: utf-8 -*-
#
# mc_neuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
#... | gpl-2.0 |
dismalpy/dismalpy | dismalpy/ssm/compat/mlemodel.py | 1 | 88825 | """
State Space Model
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
from scipy.stats import norm
from dismalpy.ssm.kalman_filter import INVERT_UNIVARIATE, SOLVE_LU
import statsmodels.tsa.base.tsa_model as tsbase... | bsd-2-clause |
hsiaoyi0504/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 |
spennihana/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_link_functions_gamma_glm.py | 8 | 2455 | from __future__ import division
from __future__ import print_function
from past.utils import old_div
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import pandas as pd
import zipfile
import statsmodels.api as sm
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
def link... | apache-2.0 |
SiLab-Bonn/Scarce | scarce/examples/plot_properties.py | 1 | 11650 | ''' This example creates plots for all silicon properties available in Scarce.
'''
import numpy as np
import matplotlib.pylab as plt
from scarce import silicon
def plot_depletion_depth():
V_bias = np.linspace(0, 100., 1000.)
plt.clf()
# Plot depletion depth for different bias voltages
f... | mit |
chriscrosscutler/scikit-image | doc/examples/plot_skeleton.py | 18 | 1753 | """
===========
Skeletonize
===========
Skeletonization reduces binary objects to 1 pixel wide representations. This
can be useful for feature extraction, and/or representing an object's topology.
The algorithm works by making successive passes of the image. On each pass,
border pixels are identified and removed on t... | bsd-3-clause |
sharescience/ardupilot | Tools/mavproxy_modules/lib/magcal_graph_ui.py | 108 | 8248 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... | gpl-3.0 |
danstowell/markovrenewal | experiments/chiffchaff.py | 1 | 35302 | #!/bin/env python
# script to analyse mixtures of chiffchaff audios
# by Dan Stowell, summer 2012
from glob import glob
from subprocess import call
import os.path
import csv
from math import log, exp, pi, sqrt, ceil, floor
from numpy import array, mean, cov, linalg, dot, median, std
import numpy as np
import tempfile... | gpl-2.0 |
anniejw6/numb3rs_randomizer | app/static/art_api/pull_api.py | 3 | 1724 | import pandas as pd
import requests
class vaAPI(object):
""" Class to pull links to images from Victoria and Albert API
for more documentation, see http://www.vam.ac.uk/api/
"""
def __init__(self, before, after, limit = 45, img = 1, offset = 1):
self.base = 'http://www.vam.ac.uk/api/json/mu... | mit |
themrmax/scikit-learn | examples/ensemble/plot_feature_transformation.py | 115 | 4327 | """
===============================================
Feature transformations with ensembles of trees
===============================================
Transform your features into a higher dimensional, sparse space. Then
train a linear model on these features.
First fit an ensemble of trees (totally random trees, a rand... | bsd-3-clause |
daodaoliang/bokeh | bokeh/charts/builder/donut_builder.py | 31 | 8206 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Donut class which lets you build your Donut charts just passing
the arguments to the Chart class and calling the proper functions.
It also add a new chained stacked method.
"""
#---------------------... | bsd-3-clause |
sk-rai/SciKit-Learn-1 | notebooks/fig_code/svm_gui.py | 47 | 11549 | """
==========
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 |
mjgrav2001/scikit-learn | sklearn/cross_validation.py | 96 | 58309 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
giorgiop/scipy | scipy/stats/_multivariate.py | 35 | 69253 | #
# Author: Joris Vankerschaver 2013
#
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
from scipy.misc import doccer
from scipy.special import gammaln, psi, multigammaln
from scipy._lib._util import check_random_state
__all__ = ['multivariate_normal', 'dirichle... | bsd-3-clause |
mfjb/scikit-learn | sklearn/preprocessing/__init__.py | 268 | 1319 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | bsd-3-clause |
mcdeaton13/dynamic | Data/Calibration/Firm Calibration/data/soi/processing/pull_soi_proprietorship.py | 4 | 8182 | '''
SOI Proprietorship Tax Data (pull_soi_proprietorship.py):
-------------------------------------------------------------------------------
Last updated: 6/29/2015.
This module creates functions for pulling the proprietorship soi tax data into
NAICS trees.
'''
# Packages:
import os.path
import numpy as np
import pan... | mit |
KrisCheng/ML-Learning | archive/MOOC/Deeplearning_AI/NeuralNetworksandDeepLearning/PlanarDataClassificationWithOneHiddenLayer/planar_utils.py | 1 | 2254 | import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
def plot_decision_boundary(model, X, y):
# Set min and max values and give it some padding
x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1
y_min, y_max = X[1, :].min() - 1, X[1, :].max(... | mit |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/doc/mpl_examples/axes_grid/inset_locator_demo2.py | 8 | 1255 | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
import numpy as np
def get_demo_image():
from matplotlib.cbook import get_sample_data
import numpy as np
f = get_sample_data("axes_grid/bivariat... | gpl-2.0 |
jonyroda97/redbot-amigosprovaveis | lib/matplotlib/testing/jpl_units/Duration.py | 12 | 6736 | #===========================================================================
#
# Duration
#
#===========================================================================
"""Duration module."""
#===========================================================================
# Place all imports after here.
#
from __future_... | gpl-3.0 |
psychopy/versions | psychopy/visual/helpers.py | 1 | 16419 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper functions shared by the visual classes
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import absolute_impo... | gpl-3.0 |
5agado/conversation-analyzer | src/util/io.py | 1 | 4860 | import os
import sys
from datetime import datetime
from pandas import read_csv
from model.message import Message
from os.path import dirname
sys.path.append(dirname(__file__)+"\\..")
from util import logger
def parseMessagesFromFile(filePath, limit=0, startDate=None, endDate=None):
messages = []
senders = s... | apache-2.0 |
CforED/Machine-Learning | sklearn/metrics/cluster/tests/test_supervised.py | 41 | 8901 | 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 |
cycleuser/GeoPython | Experimental/PathTest.py | 2 | 2511 | import matplotlib.pyplot as plt
from matplotlib.path import Path
from matplotlib import path
import matplotlib.patches as patches
Types = {'item3': 3}
# test=path.Path( ([41, 3], [37, 3], [35, 9], [37, 14], [52.5, 18], [52.5, 14], [48.4, 11.5], [45, 9.4], [41, 7]))
# path.contains_point((0,10), radius=0.0)
fig = plt... | gpl-3.0 |
cerinunn/pdart | deep_moonquake_cross_correlations/e.stack_multiple_events.py | 1 | 4059 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright:
The PDART Development Team & Katja Heger & Ceri Nunn
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
import obspy
from obspy.signal.cross_correlation import xcorr_pick_correction
from obsp... | lgpl-3.0 |
cseed/hail | benchmark-service/benchmark/benchmark.py | 1 | 10801 | import asyncio
import os
import aiohttp
from aiohttp import web
import logging
from gear import setup_aiohttp_session, web_authenticated_developers_only
from hailtop.config import get_deploy_config
from hailtop.tls import get_in_cluster_server_ssl_context
from hailtop.hail_logging import AccessLogger, configure_logging... | mit |
ibm-cds-labs/pixiedust | pixiedust/display/chart/renderers/matplotlib/matplotlibBaseDisplay.py | 1 | 10091 | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | apache-2.0 |
f3r/scikit-learn | sklearn/datasets/__init__.py | 72 | 3807 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... | bsd-3-clause |
ClimbsRocks/scikit-learn | sklearn/manifold/isomap.py | 50 | 7515 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
woobe/h2o | py/testdir_single_jvm/test_summary2_unifiles.py | 1 | 10453 | import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_util, h2o_browse as h2b, h2o_print as h2p
import h2o_summ
DO_TRY_SCIPY = False
if getpass.getuser()=='kevin' or getpass.getuser()=='jenkins':
DO_TRY_SCIPY = True
DO_MEDIAN = Tr... | apache-2.0 |
keithhendry/treadmill | tests/reports_test.py | 3 | 5557 | """Unit test for treadmill.scheduler
"""
import datetime
import time
import unittest
import mock
import pandas as pd
from treadmill import scheduler
from treadmill import reports
def _construct_cell():
"""Constructs a test cell."""
cell = scheduler.Cell('top')
rack1 = scheduler.Bucket('rack:rack1', tra... | apache-2.0 |
LohithBlaze/scikit-learn | examples/cluster/plot_kmeans_silhouette_analysis.py | 242 | 5885 | """
===============================================================================
Selecting the number of clusters with silhouette analysis on KMeans clustering
===============================================================================
Silhouette analysis can be used to study the separation distance between the... | bsd-3-clause |
jreback/pandas | asv_bench/benchmarks/attrs_caching.py | 5 | 1777 | import numpy as np
import pandas as pd
from pandas import DataFrame
try:
from pandas.util import cache_readonly
except ImportError:
from pandas.util.decorators import cache_readonly
try:
from pandas.core.construction import extract_array
except ImportError:
extract_array = None
class DataFrameAttri... | bsd-3-clause |
hlin117/statsmodels | statsmodels/examples/tsa/ex_var.py | 33 | 1280 |
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
from statsmodels.tsa.api import VAR
# some example data
mdata = sm.datasets.macrodata.load().data
mdata = mdata[['realgdp','realcons','realinv']]
names = mdata.dtype.names
data = mdata.view((float,3))
use_growthrate = False #True #... | bsd-3-clause |
mpanteli/music-outliers | scripts/outliers.py | 1 | 6284 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 12 20:49:48 2016
@author: mariapanteli
"""
import numpy as np
import pandas as pd
import pickle
from collections import Counter
from sklearn.cluster import KMeans
import utils
import utils_spatial
def country_outlier_df(counts, labels, normalize=False, out_file=None):... | mit |
nilmtk/nilmtk | nilmtk/stats/tests/test_locategoodsections.py | 1 | 4493 | import unittest
from os.path import join
import numpy as np
import pandas as pd
from datetime import timedelta
from nilmtk.stats import GoodSections
from nilmtk.stats.goodsectionsresults import GoodSectionsResults
from nilmtk import TimeFrame, ElecMeter, DataSet
from nilmtk.datastore import HDFDataStore
from nilmtk.ele... | apache-2.0 |
gqueiroz/scigws | src/server/apps/scidb/db.py | 1 | 4504 | from exception import SciDBConnectionError
from server.settings import SCIDB_VERSION
import os
import sys
import numpy as np
sys.path.append(os.path.join('/opt/scidb/%s' % SCIDB_VERSION, 'lib'))
import scidbapi
class SciDBResultSet:
query_result = None
attr_iterators = None
chunk_iterators = None
du... | gpl-3.0 |
simpeg/processing | tests/test_ts.py | 1 | 1875 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 06 14:24:18 2017
@author: jpeacock
"""
#==============================================================================
# Imports
#==============================================================================
#import os
#import time
import numpy as np
#import mtpy.usgs.... | mit |
jmmease/pandas | pandas/tests/indexing/test_datetime.py | 2 | 9075 | import numpy as np
import pandas as pd
from pandas import date_range, Index, DataFrame, Series, Timestamp
from pandas.util import testing as tm
class TestDatetimeIndex(object):
def test_setitem_with_datetime_tz(self):
# 16889
# support .loc with alignment and tz-aware DatetimeIndex
mask =... | bsd-3-clause |
ankurankan/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
bnaul/scikit-learn | sklearn/neighbors/_unsupervised.py | 2 | 4948 | """Unsupervised nearest neighbors learner"""
from ._base import NeighborsBase
from ._base import KNeighborsMixin
from ._base import RadiusNeighborsMixin
from ..utils.validation import _deprecate_positional_args
class NearestNeighbors(KNeighborsMixin,
RadiusNeighborsMixin,
... | bsd-3-clause |
bgris/ODL_bgris | lib/python3.5/site-packages/spyder/utils/ipython/start_kernel.py | 1 | 7632 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
File used to start kernels for the IPython Console
"""
# Standard library imports
import os
import os.path as osp
import sys
# Check if we are ... | gpl-3.0 |
tawsifkhan/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 162 | 9771 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises_regexp
... | bsd-3-clause |
zfrenchee/pandas | pandas/tests/io/msgpack/test_sequnpack.py | 14 | 3074 | # coding: utf-8
from pandas import compat
from pandas.io.msgpack import Unpacker, BufferFull
from pandas.io.msgpack import OutOfData
import pytest
import pandas.util.testing as tm
class TestPack(object):
def test_partial_data(self):
unpacker = Unpacker()
msg = "No more data to unpack"
... | bsd-3-clause |
ron1818/Singaboat_RobotX2016 | robotx_nav/nodes/task1_toplevel.py | 3 | 9161 | #!/usr/bin/env python
""" task 1:
-----------------
Created by Ren Ye @ 2016-11-06
Authors: Ren Ye, Reinaldo
-----------------
<put the descriptions from robotx.org pdf file>
<put the algorithms in natural language, can use bullet points, best is to use markdown format>
<if you have plan... | gpl-3.0 |
wiheto/teneto | teneto/plot/slice_plot.py | 1 | 8304 | """Draw a slice_graph"""
import numpy as np
from ..utils import check_input, graphlet2contact
def slice_plot(netin, ax, nodelabels=None, timelabels=None,
communities=None, plotedgeweights=False, edgeweightscalar=1,
timeunit='', linestyle='k-', cmap=None, nodesize=100,
node... | gpl-3.0 |
MechCoder/scikit-learn | examples/feature_selection/plot_permutation_test_for_classification.py | 5 | 2294 | """
=================================================================
Test with permutations the significance of a classification score
=================================================================
In order to test if a classification score is significative a technique
in repeating the classification procedure aft... | bsd-3-clause |
chiffa/numpy | numpy/lib/npyio.py | 2 | 72679 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter, index as opindex
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core.multiarray import packbits, unpa... | bsd-3-clause |
JT5D/scikit-learn | benchmarks/bench_multilabel_metrics.py | 8 | 7082 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import numpy as np
fr... | bsd-3-clause |
ihmeuw/vivarium | src/vivarium/framework/lookup.py | 1 | 14897 | """
=============
Lookup Tables
=============
Simulations tend to require a large quantity of data to run. :mod:`vivarium`
provides the :class:`LookupTable` abstraction to ensure that accurate data can
be retrieved when it's needed. It's a callable object that takes in a
population index and returns data specific to ... | gpl-3.0 |
f3r/scikit-learn | sklearn/linear_model/__init__.py | 270 | 3096 | """
The :mod:`sklearn.linear_model` module implements generalized linear models. It
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
estimators computed with Least Angle Regression and coordinate descent. It also
implements Stochastic Gradient Descent related algorithms.
"""
# See http://scikit-le... | bsd-3-clause |
manulera/ModellingCourse | ReAct/Python/Oscy.py | 1 | 1739 | import numpy as np
from Gilles import *
import matplotlib.pyplot as plt
from ColorLine import *
# Initial conditions
user_input = ['DNA', 1,
'DNAP2', 0,
'mRNA_n', 0,
'mRNA_c', 0,
'Prot', 0,
'Prot2_c', 0,
'Prot2_n', 0,
'En... | gpl-3.0 |
Nyker510/scikit-learn | sklearn/preprocessing/data.py | 113 | 56747 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# License: BSD 3 clause
from itertools import chain, combina... | bsd-3-clause |
kiyoto/statsmodels | statsmodels/sandbox/nonparametric/kde2.py | 34 | 3158 | # -*- coding: utf-8 -*-
from __future__ import print_function
from statsmodels.compat.python import lzip, zip
import numpy as np
from . import kernels
#TODO: should this be a function?
class KDE(object):
"""
Kernel Density Estimator
Parameters
----------
x : array-like
N-dimensional array... | bsd-3-clause |
lerker/cupydle | cupydle/dnn/viejo/fileio.py | 1 | 3182 | __author__ = 'lerker'
# Dependencias externas
#from scipy.io import loadmat, savemat
import numpy as np
text_extensions = ['.dat', '.txt', '.csv']
def parse_point(line):
# TODO dar posibilidad de cambiar separador
values = [float(x) for x in line.split(';')]
return values[-1], values[0:-1]
# Checks
de... | apache-2.0 |
iledarn/addons-yelizariev | import_framework/import_base.py | 16 | 14556 | # -*- coding: utf-8 -*-
import mapper
try:
from pandas import DataFrame
except ImportError:
pass
import logging
_logger = logging.getLogger(__name__)
class create_childs(object):
def __init__(self, childs):
# extend childs to same set of fields
# collect fields
fields = set()
... | lgpl-3.0 |
petosegan/scikit-learn | sklearn/gaussian_process/gaussian_process.py | 83 | 34544 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | bsd-3-clause |
yyjiang/scikit-learn | sklearn/feature_selection/variance_threshold.py | 238 | 2594 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstim... | bsd-3-clause |
BoltzmannBrain/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/__init__.py | 69 | 2179 | from geo import AitoffAxes, HammerAxes, LambertAxes
from polar import PolarAxes
from matplotlib import axes
class ProjectionRegistry(object):
"""
Manages the set of projections available to the system.
"""
def __init__(self):
self._all_projection_types = {}
def register(self, *projections)... | agpl-3.0 |
ChanderG/scikit-learn | sklearn/decomposition/tests/test_pca.py | 199 | 10949 | 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_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
geekaia/edx-platform | docs/en_us/developers/source/conf.py | 30 | 6955 | # -*- coding: utf-8 -*-
# pylint: disable=C0103
# pylint: disable=W0622
# pylint: disable=W0212
# pylint: disable=W0613
import sys, os
from path import path
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append('../../../../')
from docs.shared.conf import *
# Add any paths that contain template... | agpl-3.0 |
hsuantien/scikit-learn | doc/sphinxext/gen_rst.py | 142 | 40026 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
bendudson/freegs | freegs/geqdsk.py | 1 | 15345 | """
Handles reading and writing of Equilibrium objects
Writing is relatively straightforward, but reading requires inferring
the currents in the PF coils
Copyright 2016 Ben Dudson, University of York. Email: benjamin.dudson@york.ac.uk
This file is part of FreeGS.
FreeGS is free software: you can redistribute it and... | lgpl-3.0 |
KFubuki/dotfiles | python/colormap-master/erics_PuBuGnYl_r.py | 1 | 13480 |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in viscm
parameters = {'xp': [22.674387857633945, 11.221508276482126, -14.356589454756971, -47.188177587392218, -34.590010048125208, 0.15039134803535603],
'yp': [-20.102530541012214,... | mit |
johnsmithm/dm | tensorflow/run.py | 1 | 37146 | from __future__ import absolute_import, division, print_function
import cv2
import argparse
import json
import os
import pickle
import math
import numpy as np
from pyimagesearch.transform import four_point_transform
from pyimagesearch import imutils
from sklearn.cluster import KMeans
import tensorflow as tf
import ope... | gpl-2.0 |
anntzer/scikit-learn | examples/ensemble/plot_random_forest_embedding.py | 73 | 3659 | """
=========================================================
Hashing feature transformation using Totally Random Trees
=========================================================
RandomTreesEmbedding provides a way to map data to a
very high-dimensional, sparse representation, which might
be beneficial for classificati... | bsd-3-clause |
CINPLA/expipe-dev | python-neo/doc/source/images/generate_diagram.py | 6 | 7653 | # -*- coding: utf-8 -*-
"""
This generate diagram in .png and .svg from neo.core
Author: sgarcia
"""
from datetime import datetime
import numpy as np
import quantities as pq
from matplotlib import pyplot
from matplotlib.patches import Rectangle, ArrowStyle, FancyArrowPatch
from matplotlib.font_manager import FontP... | gpl-3.0 |
ryandougherty/mwa-capstone | MWA_Tools/setup.py | 1 | 5669 | import os
from glob import glob
from numpy.distutils.core import setup, Command
from distutils.command.install import install as DistutilsInstall
from distutils.sysconfig import get_python_lib,EXEC_PREFIX
from subprocess import call
import subprocess, re
from distutils.command.sdist import sdist as _sdist
from numpy.di... | gpl-2.0 |
dquartul/BLonD | __EXAMPLES/main_files/EX_15_sparse_multi_bunch.py | 1 | 4699 |
# Copyright 2014-2017 CERN. This software is distributed under the
# terms of the GNU General Public Licence version 3 (GPL Version 3),
# copied verbatim in the file LICENCE.md.
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergover... | gpl-3.0 |
arcoslab/llars | depth_calc/tests/test2_pruebas.py | 1 | 4309 | #!/usr/bin/python
#####################################################
#Importar librerias
#####################################################
from PIL import Image
from PIL import ImageFilter
import numpy as np
import cv2
import datetime
import os
import time
import matplotlib.pyplot as plt
import math
#########... | gpl-3.0 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/backends/backend_qtagg.py | 2 | 5177 | """
Render to qt from agg
"""
from __future__ import division, print_function
import os, sys
import matplotlib
from matplotlib import verbose
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backen... | mit |
cloudmesh/reservation | doc/source/conf.py | 1 | 13252 | # -*- coding: utf-8 -*-
#
# Cloudmesh Plan documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 12 14:38:11 2013.
#
# 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.
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.