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
AntonelliLab/seqcap_processor
src/remove_short_contigs.py
1
1290
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 26 15:21:03 2019 @author: Tobias Andermann (tobias.andermann@bioenv.gu.se) """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import glob contig_folder = '/Users/tobias/GitHub/seqcap_processor/data/processed/contigs/' cont...
mit
kernalphage/adventOfCode
day6.py
1
1105
from __future__ import print_function import re import numpy as np from matplotlib import pyplot as plt re_rect = re.compile("[^\d]*(\d*),(\d*) through (\d*),(\d*)") re_on = re.compile(".*on") re_off = re.compile(".*off") lights = np.zeros((1000,1000)) #### part 1 def turnOn(pt): lights[ pt[0],pt[1] ] = 1 def tu...
mit
mirandadam/bioinspired-optimization
src_python/multi_objective/test_mode.py
1
3224
#!/usr/bin/python3 # -*- coding: utf8 -*- import numpy as np import mode import base import sys import time sys.path.append('./ZDT') sys.path.append('./DTLZ') import ZDT1 import ZDT2 import ZDT3 import ZDT4 import DTLZ1_3obj import DTLZ2_3obj import DTLZ3_3obj import DTLZ5_3obj test_set=[ {'name':'ZDT1' ,'fun':ZDT1...
gpl-2.0
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/scipy/stats/morestats.py
8
94811
# Author: Travis Oliphant, 2002 # # Further updates and enhancements by many SciPy developers. # from __future__ import division, print_function, absolute_import import math import warnings from collections import namedtuple import numpy as np from numpy import (isscalar, r_, log, around, unique, asarray, ...
mit
ndingwall/scikit-learn
sklearn/linear_model/_logistic.py
6
84460
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> # ...
bsd-3-clause
Lawrence-Liu/scikit-learn
examples/model_selection/plot_roc_crossval.py
247
3253
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
ruohoruotsi/Wavelet-Tree-Synth
nnet/autoencoder_variational.py
1
4984
'''This script demonstrates how to build a variational autoencoder with Keras. Reference: "Auto-Encoding Variational Bayes" https://arxiv.org/abs/1312.6114 ''' import numpy as np import matplotlib.pyplot as plt from keras.layers import Input, Dense, Lambda from keras.models import Model from keras import backend as K...
gpl-2.0
702nADOS/sumo
tools/sumolib/visualization/helpers.py
1
13123
""" @file helpers.py @author Daniel Krajzewicz @author Laura Bieker @author Michael Behrisch @date 2013-11-11 @version $Id: helpers.py 22608 2017-01-17 06:28:54Z behrisch $ Helper methods for plotting SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2013-2017 DLR (http://www.dlr.de/)...
gpl-3.0
joshloyal/scikit-learn
sklearn/neighbors/lof.py
33
12186
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from warnings import warn from scipy.stats import scoreatpercentile from .base import NeighborsBase from .base import KNeighborsMixin from .bas...
bsd-3-clause
larose/ena
draw.py
1
1309
import itertools import numpy from matplotlib.collections import LineCollection import matplotlib.pyplot as plt def draw_intermediate_solution(cities, neurons, filename): figure = plt.figure() figure.gca().axison = False _draw_cities(figure, cities) _draw_elastic(figure, neurons) figure.savefig(fil...
bsd-2-clause
murali-munna/scikit-learn
sklearn/manifold/locally_linear.py
206
25061
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
tsurumeso/waifu2x-chainer
appendix/benchmark.py
1
7652
from __future__ import division from __future__ import print_function import argparse import os import sys import time import chainer import matplotlib.pyplot as plt import matplotlib.ticker as tick import numpy as np from PIL import Image import six sys.path.append('..') from lib import iproc # NOQA from lib import...
mit
mast-group/sequence-mining
scripts/pr.py
1
1869
# Plot itemset precision-recall import matplotlib.pyplot as plt from matplotlib import rc import numpy as np rc('ps', fonttype=42) rc('pdf', fonttype=42) rc('xtick', labelsize=16) rc('ytick', labelsize=16) def main(): path = '/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/PrecisionRecall/Background/' ...
gpl-3.0
mph-/lcapy
lcapy/zexpr.py
1
10952
"""This module provides the ZDomainExpression class to represent z-domain expressions. Copyright 2020--2021 Michael Hayes, UCECE """ from __future__ import division from .domains import ZDomain from .inverse_ztransform import inverse_ztransform from .sym import j, pi, fsym, omegasym from .dsym import nsym, ksym, zsy...
lgpl-2.1
XianliangJ/collections
DCTCPTest/plot_k_sweep.py
1
2427
''' Plot queue occupancy over time ''' from helper import * import plot_defaults from matplotlib.ticker import MaxNLocator from pylab import figure parser = argparse.ArgumentParser() parser.add_argument('--files', '-f', help="Queue timeseries output to one plot", required=True...
gpl-3.0
felipebetancur/scipy
scipy/signal/spectral.py
25
34809
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import lombscargle import warnings from scipy._lib.six import string_types __all__ = ['periodogr...
bsd-3-clause
klaus385/openpilot
selfdrive/test/plant/maneuverplots.py
2
4751
import os import numpy as np import matplotlib.pyplot as plt import pylab from selfdrive.config import Conversions as CV class ManeuverPlot(object): def __init__(self, title = None): self.time_array = [] self.gas_array = [] self.brake_array = [] self.steer_torque_array = [] self.distance_arr...
mit
leonardbinet/Transilien-Api
data_exploration/delay_prediction.py
2
6368
""" Module made to analyze training sets and provide predictions. Parameters to chose: - lines considered - sequence_diff considered (predictions for how many stations ahead) Then you should compute your own predictions on the test sample and assign it to the y_pred variable so that plot and scores are computed. """ ...
mit
jamesturner246/mpfa
tools/arpra_mpfr_2d.py
1
1265
import numpy as np import matplotlib.pyplot as plt # SETUP # %load_ext autoreload # %autoreload 2 # from tools.arpra_mpfr_2d import arpra_mpfr_2d # ##### def arpra_mpfr_2d (x, y, t, i_start, i_stop, path='./', ax_traj=None, ax_x=None, ax_y=None): with open(path + x, 'r') as xx_file, \ open(path + y, 'r...
lgpl-3.0
NunoEdgarGub1/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
dieterich-lab/rp-bp
rpbp/reference_preprocessing/extract_orf_coordinates.py
1
11486
#! /usr/bin/env python3 """This script extract the ORFs from the transcripts and write them as a BED12+ file, using genomic coordinates. Contains: get_orf_positions get_matching_stop_position get_orf_bed_entry get_orfs get_transcript """ import sys import logging import argparse import collection...
mit
jvbalen/cover_id
learn.py
1
13663
from __future__ import division, print_function import numpy as np import pandas as pd import tensorflow as tf class siamese_network(): def __init__(self, input_shape=(512,12)): """ """ n_frames, n_bins = input_shape self.x_A = tf.placeholder('float', shape=[None, n_frames, n_...
mit
kaiserroll14/301finalproject
main/pandas/tests/test_graphics.py
9
152089
#!/usr/bin/env python # coding: utf-8 import nose import itertools import os import string import warnings from distutils.version import LooseVersion from datetime import datetime, date import pandas as pd from pandas import (Series, DataFrame, MultiIndex, PeriodIndex, date_range, bdate_range) fr...
gpl-3.0
djfan/why_yellow_taxi
Output/1_dumbo_run_ys.py
1
4662
import sys import pyproj import csv import shapely.geometry as geom import fiona import fiona.crs import shapely import rtree import geopandas as gpd import numpy as np import operator import pandas as pd import pyspark from pyspark import SparkContext from shapely.geometry import Point from pyspark.sql import SQLConte...
mit
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/sklearn/linear_model/tests/test_least_angle.py
11
15904
from nose.tools import assert_equal import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import ass...
mit
jadelord/caeroc
setup.py
1
2942
import os import sys from runpy import run_path from glob import glob from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) # Get the long description from the relevant file with open(os.path.join(here, 'README.rst')) as f: long_description = f.read() lines = long_descrip...
gpl-3.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sklearn/preprocessing/tests/test_function_transformer.py
46
3387
import numpy as np from sklearn.utils import testing from sklearn.preprocessing import FunctionTransformer from sklearn.utils.testing import assert_equal, assert_array_equal def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X): def _func(X, *args, **kwargs): args_store.append(X) ar...
mit
wbadart/OS-Proj-5
parse.py
1
2773
#!/afs/nd.edu/user15/pbui/pub/anaconda-2.3.0/bin/python ''' ' parse.py ' ' Take the results of benchmark.sh and turn them ' into pretty plots. ' Record page faults, disk reads, and disk writes for each ' program, for each eviction algorithm, using fixed 100 pages, ' for each N frames from 3 to 100. ' ' Badart, Cat ' ...
gpl-3.0
grapesmoker/nba
drawing/court.py
1
1250
__author__ = 'jerry' from matplotlib.patches import Arc, RegularPolygon, Circle from matplotlib.colors import Normalize, BoundaryNorm, ListedColormap from matplotlib.colorbar import ColorbarBase from matplotlib import gridspec import matplotlib.pyplot as mpl def draw_court(ax): ax.set_xlim(-25, 25) ax.set_y...
gpl-2.0
adamallo/scripts_singlecrypt
subsmodel/evaluate28_DM.py
1
3537
# This program uses the 28-state model to evaluate the likelihood # of a tiny tree at various branch lengths, demonstrating how # the evaluations work. It relies on a rate matrix made by # program ratematrix28.py, and uses the eigenvalue/eigenvector # approach to compute the likelihoods. epsilon = 0.0000000000...
gpl-3.0
murali-munna/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
escorciav/video-utils
tools/video_info.py
1
2177
"Dump CSV with metadata of many videos" import argparse import os import pandas as pd from joblib import Parallel, delayed from okvideo.ffmpeg import (get_duration, get_frame_rate, get_num_frames, get_resolution) def video_stats(filename, dirname): stats = {} stats['video_name'] ...
mit
mahajrod/MACE
scripts/draw_coverage_per_scaffold.py
1
11064
#!/usr/bin/env python __author__ = 'Sergei F. Kliver' import os import pandas as pd import argparse from copy import deepcopy from _collections import OrderedDict import pandas as pd from BCBio import GFF from RouToolPa.Collections.General import SynDict, IdList from RouToolPa.Parsers.VCF import CollectionVCF from MAC...
apache-2.0
cwoodall/doppler-gestures-py
pydoppler/ambiguity.py
2
3333
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # ryanvolz's Ambiguity Function](https://gist.github.com/ryanvolz/8b0d9f3e48ec8ddcef4d import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def ambiguity(code, nfreq=1): """Calculate the ambiguity function of code for nfreq ...
mit
amandalund/openmc
docs/source/conf.py
3
7739
# -*- coding: utf-8 -*- # # metasci documentation build configuration file, created by # sphinx-quickstart on Sun Feb 7 22:29:49 2010. # # 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. # # All...
mit
jaidevd/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
chrsrds/scikit-learn
sklearn/inspection/tests/test_permutation_importance.py
1
5572
import pytest import numpy as np from numpy.testing import assert_allclose from sklearn.compose import ColumnTransformer from sklearn.datasets import load_boston from sklearn.datasets import load_iris from sklearn.datasets import make_regression from sklearn.ensemble import RandomForestRegressor from sklearn.ensemble...
bsd-3-clause
zcbenz/cefode-chromium
chrome/browser/nacl_host/test/gdb_rsp.py
99
2431
# 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. # This file is based on gdb_rsp.py file from NaCl repository. import re import socket import time def RspChecksum(data): checksum = 0 for char in ...
bsd-3-clause
pv/scikit-learn
examples/cluster/plot_ward_structured_vs_unstructured.py
320
3369
""" =========================================================== Hierarchical clustering: structured vs unstructured ward =========================================================== Example builds a swiss roll dataset and runs hierarchical clustering on their position. For more information, see :ref:`hierarchical_clus...
bsd-3-clause
anugrah-saxena/pycroscopy
pycroscopy/viz/plot_utils.py
1
50315
# -*- coding: utf-8 -*- """ Created on Thu May 05 13:29:12 2016 @author: Suhas Somnath """ # TODO: All general plotting functions should support data with 1, 2, or 3 spatial dimensions. from __future__ import division, print_function, absolute_import, unicode_literals import inspect from warnings import warn import ...
mit
cedadev/cis
cis/plotting/formatted_plot.py
2
8986
""" Routines for creating a plot and then formatting it, using command line options. It is not intended for plotting directly from Python, although it could be used for that. """ def set_log_scales(ax, logx, logy, rescale=True): """ Optionally log-scale one or both of the axis """ if logx: ax....
lgpl-3.0
Obus/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
249
1095
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
adamgreenhall/scikit-learn
sklearn/datasets/tests/test_lfw.py
230
7880
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
longle2718/audio_loc
python/audio_loc.py
1
7082
''' Utility functions Long Le <longle1@illinois.edu> University of Illinois ''' import numpy as np import matplotlib.pyplot as plt import multiprocessing from joblib import Parallel, delayed import os,sys os.system("taskset -p 0xff %d" % os.getpid()) sys.path.append(os.path.expanduser('~')+'/audio_class/python') sys....
mit
h2educ/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
rajat1994/scikit-learn
sklearn/tests/test_grid_search.py
83
28713
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import numpy as np import scipy.sparse as sp ...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/utils/multiclass.py
41
14732
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi # # License: BSD 3 clause """ Multi-class / multi-label utility function ========================================== """ from __future__ import division from collections import Sequence from itertools import chain from scipy.sparse import issparse from scipy.sparse....
mit
sammosummo/sammosummo.github.io
assets/scripts/bimodal-distribution.py
1
1213
"""Figure illustrating a bimodal distribution. """ import numpy as np import matplotlib.pyplot as plt import seaborn as sb from scipy.stats import norm if __name__ == "__main__": from matplotlib import rcParams as defaults figsize = defaults["figure.figsize"] # defaults["figure.figsize"] = [figsize[0],...
mit
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython-2.2.0-py2.7.egg/IPython/kernel/zmq/kernelapp.py
7
18674
"""An Application for launching a kernel Authors ------- * MinRK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.txt, distributed as pa...
apache-2.0
SCP-028/UGA
archive/metastasis/classifier/libs/logistic.py
1
1290
#!python3 from sklearn.linear_model import LogisticRegressionCV def logistic_regression(train, train_labels, n_jobs=3, score_method='f1_weighted', max_iter=4000): """Train a logistic regression model for multi-class classification. Parameters ---------- train: ar...
apache-2.0
bnaul/scikit-learn
examples/applications/wikipedia_principal_eigenvector.py
15
7570
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
bsd-3-clause
RomainBrault/scikit-learn
sklearn/tests/test_multioutput.py
23
12429
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.utils import shuffle from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_raises_regex from s...
bsd-3-clause
jakevdp/bokeh
sphinx/source/tutorial/solutions/stocks.py
3
2503
import numpy as np import pandas as pd from bokeh.plotting import * # Here is some code to read in some stock data from the Yahoo Finance API AAPL = pd.read_csv( "http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000", parse_dates=['Date']) GOOG = pd.read_csv( "http://ichart.yahoo.com/table.csv?s=GOOG&...
bsd-3-clause
kiyoto/statsmodels
statsmodels/stats/contingency_tables.py
2
43471
""" Methods for analyzing two-way contingency tables (i.e. frequency tables for observations that are cross-classified with respect to two categorical variables). The main classes are: * Table : implements methods that can be applied to any two-way contingency table. * SquareTable : implements methods that can...
bsd-3-clause
cuemacro/finmarketpy
finmarketpy_examples/fx_options_pricing_examples.py
1
14004
__author__ = 'saeedamen' # # Copyright 2020 Cuemacro # # 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 ...
apache-2.0
julien6387/supvisors
supvisors/tests/test_plot.py
2
2736
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2017 Julien LE CLEACH # # 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 Lic...
apache-2.0
ryanbressler/pydec
Examples/ResonantCavity/driver.py
6
2164
""" Solve the resonant cavity problem with Whitney forms. References: Douglas N. Arnold and Richard S. Falk and Ragnar Winther "Finite element exterior calculus: from Hodge theory to numerical stability" Bull. Amer. Math. Soc. (N.S.), vol. 47, No. 2, pp. 281--354 DOI : 10.1090/S0273-0979-10-01278-4...
bsd-3-clause
canavandl/bokeh
examples/compat/mpl/subplots.py
13
1798
""" Edward Tufte uses this example from Anscombe to show 4 datasets of x and y that have the same mean, standard deviation, and regression line, but which are qualitatively different. matplotlib fun for a rainy day """ import matplotlib.pyplot as plt import numpy as np from bokeh import mpl from bokeh.plotting import...
bsd-3-clause
squishbug/DataScienceProgramming
DataScienceProgramming/09-Machine-Learning-II/create_configurations.py
2
1120
#!/usr/bin/env python3.4 import pandas as pd import itertools DATAFILE = '/home/data/archive.ics.uci.edu/BankMarketing/bank.csv' MAX_DEPTH = '5,10' N_FEATURE = '5,14' NITER = 20 def spl_range(X): v = [int(t) for t in X.split(',')] return range(v[0], v[1]+1) if __name__ == '__main__': maxdepth = MAX_DEP...
cc0-1.0
anntzer/scikit-learn
sklearn/isotonic.py
6
14227
# Authors: Fabian Pedregosa <fabian@fseoane.net> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Nelle Varoquaux <nelle.varoquaux@gmail.com> # License: BSD 3 clause import numpy as np from scipy import interpolate from scipy.stats import spearmanr import warnings import math from .base import B...
bsd-3-clause
mxjl620/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
kazemakase/scikit-learn
examples/decomposition/plot_ica_blind_source_separation.py
349
2228
""" ===================================== Blind source separation using FastICA ===================================== An example of estimating sources from noisy data. :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 3 instruments playing simultaneously and 3 microphones recording the mixed si...
bsd-3-clause
tensorflow/models
research/delf/delf/python/examples/extract_boxes.py
1
7510
# 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 applicab...
apache-2.0
acimmarusti/isl_exercises
chap5/chap5ex9.py
1
2124
from __future__ import print_function, division import matplotlib.pyplot as plt import numpy as np import scipy import pandas as pd import seaborn as sns from sklearn.datasets import load_boston import statsmodels.formula.api as smf #Load boston dataset from sklearn# boston = load_boston() #Columns# #print(boston['fe...
gpl-3.0
jrh154/ChibbarGroup
Phylogeny Scripts/ncbi_sequence_grabber.py
2
2779
''' Script "suite" for grabbing and analyzing files from the NCBI database. Generally, the program will take a list of accession numbers and retrieve either the protein or nucleotide sequence and can save the file in either genbank or fasta form. The file containing the accession numbers should be in csv format with a ...
mit
cameronlai/ml-class-python
solutions/ex2/ex2_reg.py
1
3520
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import fmin_ncg from ex2 import * ## Machine Learning Online Class - Exercise 2: Logistic Regression # Instructions # ------------ # # This file contains code that helps you get started on the second part # of the exercise which covers regula...
mit
CSB-IG/natk
ninnx/pruning/mi_triangles.py
2
1793
import networkx as nx import itertools import matplotlib.pyplot as plt fig = plt.figure() fig.subplots_adjust(left=0.2, wspace=0.6) G = nx.Graph() G.add_edges_from([(1,2,{'w': 6}), (2,3,{'w': 3}), (3,1,{'w': 4}), (3,4,{'w': 12}), (4,5,{'w': 13})...
gpl-3.0
vibhorag/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
sorgerlab/indra
indra/assemblers/indranet/net.py
3
14200
import json import logging from os import path import numpy as np import pandas as pd import networkx as nx from decimal import Decimal import indra from indra.belief import SimpleScorer from indra.statements import Evidence from indra.statements import Statement logger = logging.getLogger(__name__) simple_scorer = ...
bsd-2-clause
magne-max/zipline-ja
tests/pipeline/test_us_equity_pricing_loader.py
1
20821
# # Copyright 2015 Quantopian, 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 wr...
apache-2.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py
7
95987
# -*- coding: utf-8 -*- """ A PDF matplotlib backend Author: Jouni K Seppänen <jks@iki.fi> """ from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import codecs import os import re import struct import sys import time impor...
mit
aspiringguru/sentexTuts
PracMachLrng/sentex_ML_demo2.py
1
2516
#working exercise from sentex tutorials. with mods for clarification + api doc references. #Regression Intro - Practical Machine Learning Tutorial with Python p.3 # import pandas as pd import sklearn import quandl import math stockcode = 'WIKI/GOOGL' print ("getting data") df = quandl.get(stockcode) #http://pandas.py...
mit
gnomex/analysis
src/many_pairwise_correlations.py
1
1085
""" Plotting a diagonal correlation matrix ====================================== _thumb: .3, .6 """ from string import ascii_letters import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set(style="white") # Generate a large random dataset rs = np.random.RandomState(33) d ...
gpl-3.0
kubeflow/kfserving
python/sklearnserver/sklearnserver/test_model.py
1
2107
# Copyright 2019 kubeflow.org. # # 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,...
apache-2.0
UDST/activitysim
activitysim/abm/models/util/test/test_mandatory_tour_frequency.py
2
1866
# ActivitySim # See full license in LICENSE.txt. import pytest import os import pandas as pd import pandas.util.testing as pdt from ..tour_frequency import process_mandatory_tours def mandatory_tour_frequency_alternatives(): configs_dir = os.path.join(os.path.dirname(__file__), 'configs') f = os.path.join(c...
bsd-3-clause
jaidevd/scikit-learn
examples/gaussian_process/plot_gpr_noisy.py
104
3778
""" ============================================================= Gaussian process regression (GPR) with noise-level estimation ============================================================= This example illustrates that GPR with a sum-kernel including a WhiteKernel can estimate the noise level of data. An illustration...
bsd-3-clause
jfemiani/srp-boxes
srp/visualize/plots.py
1
3158
"""Various functions to plot data. Plotting data from the torch dataloader during training: * plot_rgb: To plot the RGB portion of conctneated color+volumetric data * plot_lidar: To plot the LiDAR portion of concatenated color+volumetric data * plot_box: To plot the oriented bounding box, alligned with the plots ...
mit
Vimos/scikit-learn
sklearn/gaussian_process/kernels.py
31
67169
"""Kernels for Gaussian process regression and classification. The kernels in this module allow kernel-engineering, i.e., they can be combined via the "+" and "*" operators or be exponentiated with a scalar via "**". These sum and product expressions can also contain scalar values, which are automatically converted to...
bsd-3-clause
yngcan/patentprocessor
get_invpat.py
6
3576
""" Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the abo...
bsd-2-clause
krez13/scikit-learn
examples/decomposition/plot_sparse_coding.py
27
4037
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
psi4/mongo_qcdb
qcfractal/interface/models/rest_models.py
1
44921
""" Models for the REST interface """ import functools import re import warnings from typing import Any, Dict, List, Optional, Tuple, Union from pydantic import Field, constr, root_validator, validator from qcelemental.util import get_base_docs from .common_models import KeywordSet, Molecule, ObjectId, ProtoModel fro...
bsd-3-clause
priyanmuthu/priyanmuthu.github.io
markdown_generator/talks.py
199
4000
# coding: utf-8 # # Talks markdown generator for academicpages # # Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i...
mit
zuku1985/scikit-learn
examples/gaussian_process/plot_gpr_prior_posterior.py
104
2878
""" ========================================================================== Illustration of prior and posterior Gaussian process for different kernels ========================================================================== This example illustrates the prior and posterior of a GPR with different kernels. Mean, st...
bsd-3-clause
burakbayramli/emacs-ipython
ipython-tex.py
2
6294
from Pymacs import lisp import re, time, os, glob interactions = {} from IPython.testing.globalipapp import get_ipython from IPython.utils.io import capture_output from memo import * @memo def get_ip(): ip = get_ipython() ip.run_cell('%load_ext autoreload') ip.run_cell('%autoreload 2') ip...
gpl-3.0
IshankGulati/scikit-learn
sklearn/utils/tests/test_multiclass.py
58
14316
from __future__ import division import numpy as np import scipy.sparse as sp from itertools import product from sklearn.externals.six.moves import xrange from sklearn.externals.six import iteritems from scipy.sparse import issparse from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sp...
bsd-3-clause
Obus/scikit-learn
sklearn/svm/classes.py
37
39951
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...
bsd-3-clause
larsoner/mne-python
mne/decoding/tests/test_time_frequency.py
14
1199
# Author: Jean-Remi King, <jeanremi.king@gmail.com> # # License: BSD (3-clause) import numpy as np from numpy.testing import assert_array_equal import pytest from mne.utils import requires_sklearn from mne.decoding.time_frequency import TimeFrequency @requires_sklearn def test_timefrequency(): """Test TimeFreq...
bsd-3-clause
abhitopia/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/dataframe.py
85
4704
# 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
Jozhogg/iris
docs/iris/example_tests/extest_util.py
1
2324
# (C) British Crown Copyright 2010 - 2014, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
nmayorov/scipy
doc/source/tutorial/stats/plots/mgc_plot4.py
11
1341
import numpy as np import matplotlib.pyplot as plt from scipy.stats import multiscale_graphcorr def mgc_plot(x, y, mgc_dict): """Plot sim and MGC-plot""" plt.figure(figsize=(8, 8)) ax = plt.gca() # local correlation map mgc_map = mgc_dict["mgc_map"] # draw heatmap ax.set_title("Local Cor...
bsd-3-clause
ternaus/kaggle_digit_recognizer
src/convolutional_modern.py
1
5449
from __future__ import division from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet from lasagne.nonlinearities import softmax from sklearn.preprocessing import StandardScaler import numpy as np from sklearn.preprocessing import LabelEncoder __author__ = 'Vladi...
mit
Achuth17/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
265
4081
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
cangumeli/ResNets.jl
plot.py
1
1509
import matplotlib.pyplot as plt files = [ ('ResNet110', 'train_resnet110.out'), ('ResNet32', 'train_resnet32.out') ] for tf in files: title, fname = tf with open(fname) as f: lines = filter(lambda x: x.startswith('(:iter'), f.readlines()) iters = [] trns = [] tsts = [] ...
gpl-3.0
HGladiator/MyCodes
Python/exercise/python_day3_exercise.py
1
7166
# -*- coding: utf-8 -*- """ Created on Sun Apr 30 16:36:10 2017 @author: Isola """ ''' 1.X1 LIMIT_BAL 代表额度 2.X2 GENDER 代表性别,1为男性,2为女性,值种类2种 3.X3 EDUCATION 代表受教育水平,值种类6种 4.X4 MARRIAGE 代表是否婚配,值种类4种 5.X4 AGE 代表年龄 6.X6-X11 PAY_0至PAY_6代表延期时间,从September-April;-1表示按时还款,-2表示未消费,正数代表延期几个月 7.X12-X17 BILL_AMT1至BILL_AMT6代表当期账单金额...
mit
NeowithU/Trajectory
Outdated/osm_map.py
1
6180
# -*- coding:utf-8 -*- __author__ = 'Neo' import unicodecsv import overpass import os import glob import numpy as np from sklearn.cluster import DBSCAN, MeanShift, estimate_bandwidth, Birch from sklearn.metrics.pairwise import euclidean_distances from utilities import read_json from utilities import write_pickle from...
mit
ElDeveloper/scikit-learn
examples/cluster/plot_kmeans_digits.py
230
4524
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example we compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the gr...
bsd-3-clause
BrechtBa/mpcpy
examples/simple_space_heating_mpc.py
1
11279
#!/usr/bin/env python ################################################################################ # Copyright 2015 Brecht Baeten # This file is part of mpcpy. # # mpcpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # th...
gpl-3.0
kaiserroll14/301finalproject
main/pandas/tests/test_stats.py
12
6100
# -*- coding: utf-8 -*- from pandas import compat import nose from numpy import nan import numpy as np from pandas import Series, DataFrame from pandas.compat import product from pandas.util.testing import (assert_frame_equal, assert_series_equal, ass...
gpl-3.0
lucfra/RFHO
rfho/datasets.py
1
47300
""" This module contains utility functions to process and load various datasets. Most of the datasets are public, but are not included in the package; MNIST dataset will be automatically downloaded. There are also some classes to represent datasets. `ExampleVisiting` is an helper class that implements the stochastic s...
mit
belltailjp/scikit-learn
sklearn/utils/validation.py
66
23629
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp from ..externals i...
bsd-3-clause