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 |
|---|---|---|---|---|---|
CINPLA/expipe-dev | phy-contrib/examples/custom_view.py | 1 | 1208 | """Custom view plugin.
This plugin adds an interactive matplotlib figure showing the ISI of the
first selected cluster.
To activate the plugin, copy this file to `~/.phy/plugins/` and add this line
to your `~/.phy/phy_config.py`:
```python
c.KwikGUI.plugins = ['CustomView']
```
"""
from phy import IPlugin
import n... | gpl-3.0 |
dave-the-scientist/brugia_project | import_directionality.py | 1 | 4409 | import pandas
from cobra import Model, Metabolite, Reaction
from read_excel import read_excel, write_excel
elegans_file = 'iCEL1273.xlsx'
model_in_file = 'model_b_mal.xlsx'
model_out_file = 'model_b_mal_2-wip.xlsx'
reversible_arrow = '<==>'
irreversible_arrow = ('-->', '<--')
l_bound, u_bound = -1000, 1000
old_m = r... | gpl-3.0 |
alexeyum/scikit-learn | sklearn/neighbors/approximate.py | 40 | 22369 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
andaag/scikit-learn | sklearn/preprocessing/tests/test_label.py | 156 | 17626 | import numpy as np
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.testing impor... | bsd-3-clause |
jstoxrocky/statsmodels | statsmodels/sandbox/distributions/mv_measures.py | 33 | 6257 | '''using multivariate dependence and divergence measures
The standard correlation coefficient measures only linear dependence between
random variables.
kendall's tau measures any monotonic relationship also non-linear.
mutual information measures any kind of dependence, but does not distinguish
between positive and n... | bsd-3-clause |
heplesser/nest-simulator | pynest/examples/structural_plasticity.py | 8 | 13940 | # -*- coding: utf-8 -*-
#
# structural_plasticity.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 L... | gpl-2.0 |
neuroidss/neon | neon/diagnostics/visualize_rnn.py | 9 | 6325 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | apache-2.0 |
SamHames/scikit-image | doc/ext/plot2rst.py | 1 | 18498 | """
Example generation from python files.
Generate the rst files for the examples by iterating over the python
example files. Files that generate images should start with 'plot'.
To generate your own examples, add this extension to the list of
``extensions``in your Sphinx configuration file. In addition, make sure th... | bsd-3-clause |
h2educ/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 267 | 6813 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... | bsd-3-clause |
yonglehou/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/example/rcnn/symdata/loader.py | 11 | 8759 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
BV-DR/foamBazar | pythonScripts/oldStuff/fsTemplate2D.py | 1 | 13549 | #!/usr/bin/env python
#########################################################################
# Filename: fsTemplate2D.py #
# Date: 2018-May-14 #
# Version: 1. #
#... | gpl-3.0 |
deisi/SFG2D | sfg2d/widgets.py | 1 | 66147 | import os
from glob import glob
from collections import Counter
import numpy as np
from json import dump, load
from traitlets import TraitError
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import matplotlib.gridspec as gridspec
from traitlets import validate
from ipywidgets import IntRangeSlider
... | mit |
yavalvas/yav_com | build/matplotlib/lib/matplotlib/colorbar.py | 1 | 49309 | '''
Colorbar toolkit with two classes and a function:
:class:`ColorbarBase`
the base class with full colorbar drawing functionality.
It can be used as-is to make a colorbar for a given colormap;
a mappable object (e.g., image) is not needed.
:class:`Colorbar`
the derived class ... | mit |
rajat1994/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
alshedivat/tensorflow | tensorflow/contrib/timeseries/examples/lstm.py | 24 | 13826 | # 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 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pandas/tools/tests/test_merge.py | 1 | 122954 | # pylint: disable=E1103
import nose
from datetime import datetime
from numpy.random import randn
from numpy import nan
import numpy as np
import random
import pandas as pd
from pandas.compat import range, lrange, lzip, StringIO
from pandas import compat
from pandas.tseries.index import DatetimeIndex
from pandas.tool... | gpl-2.0 |
mortonjt/scipy | doc/source/tutorial/stats/plots/kde_plot4.py | 142 | 1457 | from functools import partial
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
def my_kde_bandwidth(obj, fac=1./5):
"""We use Scott's Rule, multiplied by a constant factor."""
return np.power(obj.n, -1./(obj.d+4)) * fac
loc1, scale1, size1 = (-2, 1, 175)
loc2, scale2, size2 = (2, ... | bsd-3-clause |
buntyke/GPy | setup.py | 8 | 4128 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from setuptools import setup, Extension
import numpy as np
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def read_to_rst(fname):
try:
import pypandoc
... | mit |
huaxz1986/git_book | chapters/PreProcessing/standardize.py | 1 | 1797 | # -*- coding: utf-8 -*-
"""
数据预处理
~~~~~~~~~~~~~~~~
数据标准化
:copyright: (c) 2016 by the huaxz1986.
:license: lgpl-3.0, see LICENSE for more details.
"""
from sklearn.preprocessing import MinMaxScaler,MaxAbsScaler,StandardScaler
def test_MinMaxScaler():
'''
测试 MinMaxScaler 的用法
:return: ... | gpl-3.0 |
QuinnSong/JPG-Tools | src/word_cloud.py | 1 | 4013 | # -*- coding: cp936 -*-
from wordcloud import (WordCloud, get_single_color_func, STOPWORDS)
#import imageio
import jieba
import io
from PIL import Image
import numpy
from random import Random
import colorsys
def get_single_color_func((color, wc_enable_random_color)):
old_r, old_g, old_b, old_a = color
enable... | gpl-3.0 |
adamgreenhall/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
mmottahedi/neuralnilm_prototype | scripts/e353.py | 2 | 6431 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
untom/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 387 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
stefanodoni/mtperf | parsers/PCMParser.py | 2 | 2732 | import pandas as pd
from parsers.Parser import Parser
class PCMParser (Parser):
columns = ['SysDate', 'SysTime', 'SysEXEC', 'SysIPC', 'SysFREQ',
'SysAFREQ', 'SysL3MISS', 'SysL2MISS', 'SysL3HIT', 'SysL2HIT',
'SysL3MPI', 'SysL2MPI', 'SysREAD', 'SysWRITE', 'SysINST',
'SysACYC', 'SysTIMEticks', 'SysPhysIP... | gpl-2.0 |
CA-Lab/moral-exchange | Data/hebb/3_testing_hebb.py | 1 | 4869 | import argparse
import matplotlib
#matplotlib.use('TkAgg')
matplotlib.use('svg')
import matplotlib.pyplot as plt
import pylab as pl
import random as rd
import scipy as sp
import networkx as nx
import numpy as np
import math as mt
import pprint as ppt
parser = argparse.ArgumentParser(description='Hebbian network simu... | gpl-3.0 |
pv/scikit-learn | sklearn/linear_model/least_angle.py | 57 | 49338 | """
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 |
pauldeng/nilmtk | nilmtk/timeframe.py | 6 | 10648 | from __future__ import print_function, division
import pandas as pd
import pytz
from datetime import timedelta
from copy import deepcopy
from warnings import warn
class TimeFrame(object):
"""A TimeFrame is a single time span or period,
e.g. from "2013" to "2014".
Attributes
----------
_start : pd.... | apache-2.0 |
ngoix/OCRF | examples/cluster/plot_face_segmentation.py | 71 | 2839 | """
===================================================
Segmenting the picture of a raccoon face in regions
===================================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous... | bsd-3-clause |
nuclear-wizard/moose | test/tests/samplers/distribute/execute.py | 3 | 2296 | #!/usr/bin/env python3
from __future__ import print_function
import time
import argparse
import pandas
import matplotlib.pyplot as plt
import multiprocessing
import mooseutils
def execute(infile, outfile, n_samples, processors, test_type):
"""Helper for running a memory study with increasing MPI ranks."""
da... | lgpl-2.1 |
RomainBrault/scikit-learn | sklearn/utils/tests/test_estimator_checks.py | 26 | 7393 | import scipy.sparse as sp
import numpy as np
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.testing import assert_raises_regex, assert_true
from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils.... | bsd-3-clause |
Irsan88/SeqTools | DataProcessing/roda/tags/2.0/bin/scripts/plotHomHetRegions.py | 6 | 1692 | import sys
import matplotlib.pyplot as plt
vcfIn = open(sys.argv[1], 'r')
positions = {}
allChroms = []
lengthContigs = {}
for line in vcfIn:
if line[0] == '#':
if line[0:8] == '##contig':
line = line.rstrip().split(',')
chrom = line[0].split('=')[-1]
length = line[1].split('=')[-1]
lengthContigs[chro... | gpl-2.0 |
blink1073/scikit-image | viewer_examples/plugins/watershed_demo.py | 35 | 1277 | import matplotlib.pyplot as plt
from skimage import data
from skimage import filters
from skimage import morphology
from skimage.viewer import ImageViewer
from skimage.viewer.widgets import history
from skimage.viewer.plugins.labelplugin import LabelPainter
class OKCancelButtons(history.OKCancelButtons):
def up... | bsd-3-clause |
ndingwall/scikit-learn | sklearn/multioutput.py | 7 | 30307 | """
This module implements multioutput regression and classification.
The estimators provided in this module are meta-estimators: they require
a base estimator to be provided in their constructor. The meta-estimator
extends single output estimators to multioutput estimators.
"""
# Author: Tim Head <betatim@gmail.com>... | bsd-3-clause |
aflaxman/scikit-learn | sklearn/cluster/k_means_.py | 6 | 60864 | """K-means clustering"""
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Thomas Rueckstiess <ruecksti@in.tum.de>
# James Bergstra <james.bergstra@umontreal.ca>
# Jan Schlueter <scikit-learn@jan-schlueter.de>
# Nelle Varoquaux
# Peter Prettenhofer <peter.prettenh... | bsd-3-clause |
crichardson17/starburst_atlas | Low_resolution_sims/Dusty_LowRes/Padova_cont/padova_cont_0/fullgrid/peaks_reader.py | 32 | 5021 | import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# ---------------------------------------------------... | gpl-2.0 |
quole/gensim | gensim/test/test_sklearn_integration.py | 2 | 7081 | import six
import unittest
import numpy
import os
import codecs
import pickle
from scipy import sparse
try:
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.datasets import load_files
from sklearn import linear_model
except ImportError:
... | lgpl-2.1 |
wllmtrng/ggplot | ggplot/scales/scale_facet.py | 13 | 10175 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
# TODO: This is fairly repetiive and can definitely be
# condensed into a lot less code, but it's working for now
import numpy as np
import matplotlib.pyplot as plt
from .utils import calc_axis_breaks_and_limi... | bsd-2-clause |
eg-zhang/scikit-learn | examples/datasets/plot_random_dataset.py | 348 | 2254 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... | bsd-3-clause |
alexfurtunatoifrn/parsecpy | parsecpy/dataprocess.py | 1 | 26272 | # -*- coding: utf-8 -*-
"""
Module with Classes that generates xArray DataArray
with processed data from Parsec applications execution.
"""
import os
from datetime import datetime
import json
import numpy as np
import xarray as xr
from copy import deepcopy
from collections import defaultdict
from typing impo... | mit |
Transkribus/TranskribusDU | TranskribusDU/gcn/DU_gcn_task.py | 1 | 37565 | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import pickle
import os.path
import random
import gcn.gcn_models as gcn_models
from gcn.gcn_datasets import GCNDataset
import time
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('train', '', "FilePath Train pickle file")
tf.app.flags.DEFINE_... | bsd-3-clause |
tsilifis/chaos_basispy | demos/demo0/demo_isometry.py | 1 | 1032 | """
Visualize isometry constructed
using different orthogonalization methods
> d = 15
> random coefficients qe ~ N(0,1)
"""
import numpy as np
import matplotlib.pyplot as plt
import chaos_basispy as cb
import matplotlib
matplotlib.rcParams.update({'font.size': 7})
def visualize_isometry(d):
d
qe = np.rand... | gpl-3.0 |
Obus/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 134 | 7452 | """
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected in... | bsd-3-clause |
johnveitch/cpnest | examples/diagnose_trajectory.py | 1 | 1089 | import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import sys, os
np.seterr(all='raise')
def log_likelihood(x):
return np.sum([-0.5*x[n]**2-0.5*np.log(2.0*np.pi) for n in range(x.shape[0])])
mode = sys.argv[1]
if mode == 'delete':
allfiles = os.listdir('.')
toremove = [a for a ... | mit |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/examples/pylab_examples/finance_work2.py | 3 | 6269 | import datetime
import numpy as np
import matplotlib.colors as colors
import matplotlib.finance as finance
import matplotlib.dates as mdates
import matplotlib.ticker as mticker
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
startdate = datetime.date(2006,... | gpl-2.0 |
fermiPy/lcpipe | summary_plot.py | 1 | 4708 | ## script to plot the output
## from fermipy,given a .npy file
## Sara Buson, Oct. 2017
## very basic, need to implement better
## the reading of png, laoding the npy
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.legend_handler import HandlerLine2D
import sys
from matplotlib.cbook import get_sa... | bsd-3-clause |
clemkoa/scikit-learn | sklearn/manifold/setup.py | 40 | 1284 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
mariusvniekerk/ibis | ibis/client.py | 4 | 13243 | # Copyright 2014 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
sorgerlab/belpy | indra/belief/wm_scorer.py | 1 | 2125 | from io import StringIO
import copy
import pandas
import requests
from . import SimpleScorer, BayesianScorer
default_priors = {'hume': [13, 7], 'cwms': [13, 7], 'sofia': [13, 7]}
def load_eidos_curation_table():
"""Return a pandas table of Eidos curation data."""
url = 'https://raw.githubusercontent.com/clu... | mit |
vibhorag/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
dnjohnstone/hyperspy | hyperspy/tests/drawing/test_utils.py | 1 | 1293 | # Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 ... | gpl-3.0 |
alexeyum/scikit-learn | sklearn/decomposition/tests/test_pca.py | 21 | 18046 | import numpy as np
from itertools import product
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.u... | bsd-3-clause |
miguelfrde/stanford-cs231n | assignment1/cs231n/classifiers/neural_net.py | 1 | 10841 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from past.builtins import xrange
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network. The net has an input dimension of
N, a hidden layer dimension of H, and performs classification over C classes.
W... | mit |
ZobairAlijan/osf.io | scripts/analytics/email_invites.py | 55 | 1332 | # -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from utils import plot_dates, mkdirp
user_collection = database['user']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH, 'figs', 'features')
mkdirp(FIG_PATH)
def analyze_email_invi... | apache-2.0 |
vuchetichbalint/useful_python_scripts | dockerize_ml_model_as_restapi/dockerize/flask/app/main.py | 1 | 3432 | # -*- coding: utf-8 -*-
import time
import sys
from functools import wraps
from flask import Flask, jsonify, request
from flask_restful import Api, Resource, abort
from sklearn.neighbors import KNeighborsClassifier
import pickle
import numpy as np
import pandas as pd
from minio import Minio
import joblib
from i... | gpl-3.0 |
kyleabeauchamp/DBayes | dbayes/test_dipoles.py | 1 | 1044 | import pymc
import pymbar
import dipoles
import numpy as np
import pandas as pd
import simtk.openmm.app as app
import simtk.openmm as mm
import simtk.unit as u
import mdtraj as md
q0 = pymc.Uniform("q0", 0.0, 1.)
sigma0 = pymc.Uniform("sigma0", 0.08, 0.5)
epsilon0 = pymc.Uniform("epsilon0", 0.1, 2.0)
sigma1 = pymc.Un... | gpl-2.0 |
handroissuazo/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py | 12 | 5049 | # 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 |
ozak/geopandas | setup.py | 1 | 1878 | #!/usr/bin/env/python
"""Installation script
"""
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import versioneer
LONG_DESCRIPTION = """GeoPandas is a project to add support for geographic data to
`pandas`_ objects.
The goal of GeoPandas is to make working... | bsd-3-clause |
glennq/scikit-learn | examples/svm/plot_separating_hyperplane_unbalanced.py | 329 | 1850 | """
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... | bsd-3-clause |
rhjvedder/Plague_models | tools/TempLoader.py | 1 | 6867 | """This program is designed to read temperature data from a csv file"""
import pandas as pd
from datetime import date
import netCDF4 as nc
from os.path import dirname, abspath
import os.path
class TempLoader:
def __init__(self, start=1991, end=1999, update=False, fname="1107903"):
self.parent_dir = dirnam... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/stackplot.py | 6 | 4198 | """
Stacked area plot for 1D arrays inspired by Douglas Y'barbo's stackoverflow
answer:
http://stackoverflow.com/questions/2225995/how-can-i-create-stacked-line-graph-with-matplotlib
(http://stackoverflow.com/users/66549/doug)
"""
from __future__ import (absolute_import, division, print_function,
... | gpl-3.0 |
schets/scikit-learn | sklearn/datasets/svmlight_format.py | 39 | 15319 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
cogmission/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/axes.py | 69 | 259904 | from __future__ import division, generators
import math, sys, warnings, datetime, new
import numpy as np
from numpy import ma
import matplotlib
rcParams = matplotlib.rcParams
import matplotlib.artist as martist
import matplotlib.axis as maxis
import matplotlib.cbook as cbook
import matplotlib.collections as mcoll
im... | agpl-3.0 |
QuLogic/cartopy | examples/miscellanea/axes_grid_basic.py | 6 | 2559 | """
Using Cartopy and AxesGrid toolkit
----------------------------------
This example demonstrates how to use cartopy `GeoAxes` with
`AxesGrid` from the `mpl_toolkits.axes_grid1`.
The script constructs an `axes_class` kwarg with Plate Carree projection
and passes it to the `AxesGrid` instance. The `AxesGrid` built-in... | lgpl-3.0 |
rupak0577/ginga | ginga/mplw/ipg.py | 5 | 1749 |
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
from ginga.mplw.ImageViewCanvasMpl import ImageViewCanvas
from ginga.misc import log
from ginga.AstroImage import AstroImage
from ginga import cmap
# add matplotlib colormaps to ginga's own set
cmap.add_matplotlib_cmaps()
## from... | bsd-3-clause |
hmendozap/auto-sklearn | autosklearn/pipeline/components/classification/gaussian_nb.py | 1 | 3040 | import numpy as np
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from autosklearn.pipeline.components.base import AutoSklearnClassificationAlgorithm
from autosklearn.pipeline.constants import *
class GaussianNB(AutoSklearnClassificationAlgorithm):
def __init__(self, random_state=None, ve... | bsd-3-clause |
WindfallLabs/ArcHacks | _core.py | 1 | 32818 | # -*- coding: utf-8 -*-
"""
Misc ArcPy Addons
Author: Garin Wally
License: MIT
"""
import os
import glob
import random
import re
import sys
#from time import sleep
from queue import Queue
from subprocess import Popen, PIPE
from collections import OrderedDict
from xml.dom import minidom as DOM
from ConfigParser import ... | mit |
fabian-paul/PyEMMA | pyemma/msm/estimators/_msm_estimator_base.py | 2 | 41856 | import numpy as _np
from msmtools import estimation as msmest
from pyemma._base.estimator import Estimator as _Estimator
from pyemma.msm import MSM as _MSM
from pyemma.msm.estimators._dtraj_stats import DiscreteTrajectoryStats as _DiscreteTrajectoryStats
from pyemma.util import types as _types
from pyemma.util.annotat... | lgpl-3.0 |
fmance/deep-medical-ir | classification/language-model/freqs.py | 1 | 3783 | import os
import sys
import codecs
import math
import re
import numpy as np
import scipy.stats
from collections import Counter, defaultdict
import matplotlib.pyplot as plt
sys.path.insert(0, "../../utils/")
import utils
CLASS_ID = sys.argv[1]
QUERY_OFFSETS = {"diag": 1, "test": 11, "treat": 21}
TARGETS = ["diag", "... | gpl-3.0 |
csae1152/seizure-prediction | seizure_prediction/cross_validation/legacy_strategy.py | 3 | 1468 | import numpy as np
import sklearn.cross_validation
from seizure_prediction.cross_validation.sequences import collect_sequence_ranges_from_meta
class LegacyStrategy:
"""
Hand-picked random folds maintaining sequence integrity with 80% train/cv split.
See k_fold_strategy for docs on each method.
"""
... | mit |
niazangels/CADL | session-5/libs/utils.py | 4 | 21027 | """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.
"""
import matplotlib.pyplot as plt
import tensorflow as tf
import urllib
import numpy as np
import zipfile
import os
... | apache-2.0 |
giorgiop/scikit-learn | sklearn/learning_curve.py | 7 | 15161 | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | bsd-3-clause |
hrishioa/ISci | PS8.py | 1 | 1867 | from random import *
import numpy
import matplotlib.pyplot as plt
import math
def throwDie(times):
mean = float(0)
for i in range(0,times):
mean += randint(1,6)
mean/=times
return mean
def throwSquareDie(times):
mean = float(0)
for i in range(0,times):
mean += randint(1,6)**2
mean/=ti... | gpl-2.0 |
PrincessMadMath/LOG8415-Advanced_Cloud | TP1/Sources/plot_CPU.py | 1 | 1183 | import matplotlib.pyplot as pyplot
import numpy
# inspired by http://people.duke.edu/~ccc14/pcfb/numpympl/MatplotlibBarPlots.html
xTickMarks = ["azure A1", "azure A4", "amazon T2", "amazon C4", "amazon M4", "amazon R4"]
N = 6
CPU_total_time = [66.8626, 66.6122, 29.8535, 25.0010, 29.3211, 27.8841]
CPU_avg_request = [6... | mit |
nicholasmalaya/paleologos | disputatio/routines/collective_duane.py | 2 | 1665 | #!/bin/py
#
#
#
import sys
import numpy as np
# no twist
flux = 1.35* np.array([0.99,1.02,1.1,1.12,1.12,1.11,1.112,1.123,1.1159,1.101,1.042])
it = [35,40,43,45,47,50,53,55,57,60,65]
#
# duane (top)
#
fluxd = 1.45*np.array([0.99,1.02,1.06,1.1,1.09,1.11,1.117,1.12,1.115,1.10,1.04])
itd = [35,40,43,45,47,50,53,55,57,60... | mit |
gammasky/cta-dc | sky_model_checks/plot_logN_logS.py | 2 | 19616 | import numpy as np
from astropy.table import Table, vstack
from gammapy.catalog import SourceCatalogGammaCat, SourceCatalogHGPS
import matplotlib.pyplot as plt
import os
# from gammapy.spectrum import CrabSpectrum
from astropy import units as u
from astropy.table import Column
#from scipy import optimize
from scipy.sta... | bsd-3-clause |
annoviko/pyclustering | pyclustering/cluster/tests/integration/it_somsc.py | 1 | 4743 | """!
@brief Integration-tests for SOM-SC algorithm.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest
import matplotlib
matplotlib.use('Agg')
from pyclustering.cluster.tests.somsc_templates import SyncnetTestTemplates
from pyclustering... | gpl-3.0 |
ssokota/tiny-hanabi | scripts/interface.py | 1 | 6551 | """Interface for running experiments.
"""
import argparse
from pathlib import Path
from typing import Optional
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from tiny_hanabi.agent.assemblers import construct_learner, learnertype
from tiny_hanabi.agent.single_agent_learners import Algorith... | mit |
jorik041/scikit-learn | sklearn/tests/test_qda.py | 155 | 3481 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ignore_war... | bsd-3-clause |
kerkphil/multi-country | Python/7CountryElliptical/AuxiliaryClass.py | 2 | 160723 | from __future__ import division
import csv
import time
import numpy as np
import scipy as sp
import scipy.optimize as opt
import scipy.interpolate as interpol
from matplotlib import pyplot as plt
from pprint import pprint
from mpl_toolkits.mplot3d import Axes3D
import AuxiliaryDemographics as demog
from pylab import sa... | mit |
simpeg/simpeg | examples/02-mesh/plot_cahn_hilliard.py | 1 | 4043 | """
Mesh: Operators: Cahn Hilliard
==============================
This example is based on the example in the FiPy_ library.
Please see their documentation for more information about the
Cahn-Hilliard equation.
The "Cahn-Hilliard" equation separates a field \\\\( \\\\phi \\\\)
into 0 and 1 with smooth transitions.
.... | mit |
marianotepper/csnmf | csnmf/tests/test_movies.py | 1 | 5418 | """
Copyright (c) 2015, Mariano Tepper, Duke University.
All rights reserved.
This file is part of RCNMF and is under the BSD 3-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-3-Clause
"""
from __future__ import print_function
from ... | bsd-2-clause |
sketchytechky/pyfolio | setup.py | 5 | 2484 | #!/usr/bin/env python
from setuptools import setup
import sys
DISTNAME = 'pyfolio'
DESCRIPTION = "pyfolio is a Python library for performance and risk analysis of financial portfolios"
LONG_DESCRIPTION = """pyfolio is a Python library for performance and risk analysis of
financial portfolios developed by `Quantopian ... | apache-2.0 |
mjescobar/RF_Estimation | Clustering/helpers/processClusters/processClusters.py | 2 | 4623 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# processClusters.py
#
# Copyright 2015 Monica Otero <monicaot2011@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... | gpl-2.0 |
jaimahajan1997/sympy | sympy/interactive/printing.py | 19 | 16398 | """Tools for setting up printing in interactive sessions. """
from __future__ import print_function, division
import sys
from distutils.version import LooseVersion as V
from io import BytesIO
from sympy import latex as default_latex
from sympy import preview
from sympy.core.compatibility import integer_types
from sy... | bsd-3-clause |
anirudhjayaraman/scikit-learn | sklearn/tests/test_random_projection.py | 79 | 14035 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
sonnyhu/scikit-learn | sklearn/ensemble/tests/test_iforest.py | 1 | 6932 | """
Testing for Isolation Forest algorithm (sklearn.ensemble.iforest).
"""
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.u... | bsd-3-clause |
jkarnows/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
krez13/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 278 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
manashmndl/scikit-learn | examples/plot_isotonic_regression.py | 303 | 1767 | """
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data. The
isotonic regression finds a non-decreasing approximation of a function
while minimizing the mean squared error on the training data. The benefit
of such a model is that it does not assume a... | bsd-3-clause |
AlwaysLearningDeeper/Project | src/Old files/randomGame.py | 2 | 4558 | import gym,time
import numpy as np
import random
from statistics import median, mean
from collections import Counter
import sys
import pickle
from matplotlib import pyplot as plt
#1 NO Op, 2-3 Either Right or Left
env = gym.make('Breakout-v0')
env.reset()
goal_steps=50000000000000000000000000000000
score_requirement ... | mit |
probml/pyprobml | scripts/spam_dtree_size.py | 1 | 5430 |
#Performance of tree ensembles. Based on the email spam example from chapter 10 of "Elements of statistical learning". Code is from Andrey Gaskov's site:
#https://github.com/empathy87/The-Elements-of-Statistical-Learning-Python-Notebooks/blob/master/examples/Spam.ipynb
from one_standard_error_rule_model import OneS... | mit |
procoder317/scikit-learn | sklearn/metrics/ranking.py | 44 | 25479 | """Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | bsd-3-clause |
tsherwen/AC_tools | AC_tools/AC_time.py | 1 | 16364 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Time processing functions for use with GEOS-Chem/Data analysis
Use help(<name of function>) to get details on a particular function.
Notes
-----
- This module is underdevelopment vestigial/inefficient code is being removed/updated.
- Where external code is used, credit ... | mit |
rkube/2dads | src/tests/arakawa_fd/test_arakawa_convergence.py | 1 | 2520 | #!/usr/bin/python
#-*- Encoding: UTF-8 -*-
"""
Load input and output from test_arakawa.cu
Compute {f,g} = -f_y g_x + g_y f_x
Input:
f(x, y) = -sin(2 pi x)^2 sin(2 pi y)^2
f_x = -4 pi (cos 2 pi x)sin(2 pi x) sin(2 pi y)^2
f_y = -4 pi(cos 2 pi y) sin(2 pi y) sin(2 pi x)^2
-> initializes arr1
g(x, ... | mit |
eadgarchen/tensorflow | tensorflow/contrib/timeseries/examples/multivariate.py | 67 | 5155 | # 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 |
kyleabeauchamp/HMCNotes | code/old/test_xhmc_respa_amoeba.py | 1 | 1990 | import lb_loader
import simtk.openmm.app as app
import numpy as np
import pandas as pd
import simtk.openmm as mm
from simtk import unit as u
from openmmtools import hmc_integrators, testsystems
pd.set_option('display.width', 1000)
n_steps = 3000
temperature = 300. * u.kelvin
hydrogenMass = 3.0 * u.amu
system, positi... | gpl-2.0 |
huobaowangxi/scikit-learn | examples/svm/plot_svm_anova.py | 250 | 2000 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... | bsd-3-clause |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/io/tests/test_date_converters.py | 1 | 5055 | from pandas.compat import StringIO, BytesIO
from datetime import date, datetime
import csv
import os
import sys
import re
import nose
from numpy import nan
import numpy as np
from numpy.testing.decorators import slow
from pandas import DataFrame, Series, Index, isnull
import pandas.io.parsers as parsers
from pandas.... | gpl-3.0 |
Peratham/tensor-sc | scripts/common_nodes.py | 2 | 1316 | import matplotlib.pyplot as plt
import numpy as np
import sys
data = sys.argv[1]
def num_common(list1, list2):
return len(list1) + len(list2) - len(np.unique(list1 + list2))
def best_num_common(order1, order2, num_nodes):
order1_first = order1[0:num_nodes]
order1_last = order1[-num_nodes:]
order2_fir... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.