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
dialounke/pylayers
pylayers/mobility/transit/Person.py
2
20819
""" .. currentmodule:: pylayers.mobility.transit.Person Utility Functions ================= .. autosummary;; :toctree: generated/ scale copy Person Class ================= .. autosummary;; :toctree: generated/ Person.__init__ Person.__repr__ Person.move Person.delete """ from Sim...
mit
mxjl620/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/sparse/list.py
16
3695
import numpy as np from pandas.core.base import PandasObject from pandas.core.common import pprint_thing from pandas.sparse.array import SparseArray import pandas._sparse as splib class SparseList(PandasObject): """ Data structure for accumulating data to be converted into a SparseArray. Has similar API...
artistic-2.0
jakobworldpeace/scikit-learn
examples/cluster/plot_mean_shift.py
351
1793
""" ============================================= A demo of the mean-shift clustering algorithm ============================================= Reference: Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward feature space analysis". IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002. ...
bsd-3-clause
monitor1379/sammale
examples/e1_LinearPrimaryFunctionMode_for_regressionl.py
1
1822
# encoding: utf-8 """ @author: monitor1379 @contact: yy4f5da2@hotmail.com @site: www.monitor1379.com @version: 1.0 @license: GNU General Public License(Version 3) @file: e1_LinearPrimaryFunctionModel.py @time: 2016/12/18 23:56 """ from __future__ import print_function import matplotlib.pyplot as plt import numpy ...
gpl-3.0
BBN-Q/PyQLab
analysis/SSRO.py
4
6234
import numpy as np from scipy.signal import butter, lfilter from scipy.io import loadmat from sklearn import decomposition, preprocessing, cross_validation from sklearn import svm, grid_search import pywt import h5py import matplotlib.pyplot as plt def create_fake_data(SNR, dt, maxTime, numShots, T1=1.0): """ Hel...
apache-2.0
Jessime/Excision
src/play_levels.py
1
7834
import os import sys import json import markdown import subprocess as sp import numpy as np import pandas as pd from flask import Markup from pickle import load from importlib import import_module, reload from shutil import copyfile from traceback import format_exc from level_markdown import parse, change_log class ...
mit
sanuj/shogun
examples/undocumented/python_modular/graphical/interactive_gp_demo.py
10
14176
# # This program is free software you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation either version 3 of the License, or # (at your option) any later version. # # Written (C) 2012 Heiko Strathmann, based on interactive_svm_demo by ...
gpl-3.0
devanshdalal/scikit-learn
examples/covariance/plot_outlier_detection.py
36
5023
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates three different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assum...
bsd-3-clause
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/io/tests/test_pytables.py
9
194218
import nose import sys import os import warnings import tempfile from contextlib import contextmanager import datetime import numpy as np import pandas import pandas as pd from pandas import (Series, DataFrame, Panel, MultiIndex, Categorical, bdate_range, date_range, timedelta_range, Index, Dateti...
artistic-2.0
rtrwalker/geotecha
geotecha/consolidation/smear_zones.py
1
127140
# geotecha - A software suite for geotechncial engineering # Copyright (C) 2018 Rohan T. Walker (rtrwalker@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 version 3 of the L...
gpl-3.0
yaroslavvb/tensorflow
tensorflow/examples/learn/iris_custom_decay_dnn.py
56
1959
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
moosekaka/sweepython
tubule_het/psd_rand_carbon.py
1
4161
# -*- coding: utf-8 -*- """ Calculates and plots POWER SPEC DENSITY (psd) of Δψ for real and random dists. @author: sweel """ import os import os.path as op import cPickle as pickle from collections import defaultdict import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np import wr...
mit
twschum/mix-mind
mixmind_cli.py
1
15109
#!/usr/bin/env python """ Turn recipes json into a readable menu """ import argparse import pickle as pickle from collections import Counter, defaultdict import json import jsonschema import pandas as pd import mixmind.recipe as drink_recipe from mixmind.barstock import Barstock import mixmind.formatted_menu as form...
apache-2.0
deepesch/scikit-learn
examples/svm/plot_iris.py
225
3252
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
terkkila/scikit-learn
sklearn/decomposition/tests/test_fastica.py
272
7798
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises 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 skl...
bsd-3-clause
redreamality/daft
examples/exoplanets.py
7
1616
""" The Fergus model of exoplanet detection ======================================= Besides being generally awesome, this example also demonstrates how you can color the nodes and add arbitrary labels to the figure. """ from matplotlib import rc rc("font", family="serif", size=12) rc("text", usetex=True) import daf...
mit
daniaki/Enrich2
plugins/ratios_scorer.py
1
4679
# Copyright 2016-2017 Alan F Rubin # # This file is part of Enrich2. # # Enrich2 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. ...
gpl-3.0
lordkman/burnman
misc/benchmarks/debye.py
4
1721
from __future__ import absolute_import from __future__ import print_function import os.path import sys sys.path.insert(1, os.path.abspath('../..')) import numpy as np import matplotlib.pyplot as plt import burnman import scipy.integrate import time def old_thermal(T, debye_T, n): if T == 0: return 0 ...
gpl-2.0
akionakamura/scikit-learn
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
294
3417
""" ======================================== Label Propagation digits active learning ======================================== Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select the t...
bsd-3-clause
dsullivan7/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
FilipDominec/python-meep-utils
colormaps.py
28
50518
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt, # and (in the case of viridis) Eric Firing. # # This file and the colormaps in it are released under the CC0 license / # public domain dedication. We would appreciate credit if you use or # redistribute these colormaps, but do not impose any legal r...
gpl-2.0
tseaver/gcloud-python
bigquery/google/cloud/bigquery/table.py
1
46359
# Copyright 2015 Google LLC # # 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, s...
apache-2.0
simon-pepin/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
zooniverse/aggregation
active_weather/text_detection.py
1
4656
#!/usr/bin/env python import glob import active_weather import matplotlib.pyplot as plt import cv2 import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) height = 40#int(np.median(heights)) width = 30#int(np....
apache-2.0
btabibian/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/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 scipy.sparse as...
bsd-3-clause
tcchenbtx/project-zeta-J
code/correlation_analysis_scripts_sub5.py
3
23223
import numpy as np import os import matplotlib.pyplot as plt from matplotlib import colors import copy # maximally responded area, percentile setting: percent = 80 # object_list object_list = ["bottle", "cat", "chair", "face", "house", "scissors", "scrambledpix", "shoe"] # important path: base_path = os.path.abspath...
bsd-3-clause
arjoly/scikit-learn
sklearn/linear_model/tests/test_logistic.py
3
37569
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse import scipy from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from...
bsd-3-clause
chetan51/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/widgets.py
69
40833
""" GUI Neutral widgets All of these widgets require you to predefine an Axes instance and pass that as the first arg. matplotlib doesn't try to be too smart in layout -- you have to figure out how wide and tall you want your Axes to be to accommodate your widget. """ import numpy as np from mlab import dist from p...
gpl-3.0
cython-testbed/pandas
pandas/tests/scalar/timestamp/test_arithmetic.py
5
2572
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import pytest import numpy as np from pandas.compat import long from pandas.tseries import offsets from pandas import Timestamp, Timedelta class TestTimestampArithmetic(object): def test_overflow_offset(self): # xref https://github.com/sta...
bsd-3-clause
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/doc/mpl_examples/user_interfaces/embedding_in_gtk3.py
4
1137
#!/usr/bin/env python """ demonstrate adding a FigureCanvasGTK/GTKAgg widget to a gtk.ScrolledWindow """ import gtk from matplotlib.figure import Figure from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo #from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from matpl...
gpl-2.0
kaichogami/scikit-learn
examples/applications/plot_prediction_latency.py
85
11395
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
bsd-3-clause
rs2/pandas
pandas/tests/window/test_numba.py
1
2942
import numpy as np import pytest import pandas.util._test_decorators as td from pandas import Series, option_context import pandas._testing as tm from pandas.core.util.numba_ import NUMBA_FUNC_CACHE @td.skip_if_no("numba", "0.46.0") @pytest.mark.filterwarnings("ignore:\\nThe keyword argument") # Filter warnings whe...
bsd-3-clause
napsternxg/pytorch-practice
chunking_bilstm_crf_char_concat.py
1
7939
# coding: utf-8 # In[1]: import matplotlib matplotlib.use("Agg") import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim torch.manual_seed(1) import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pytorch_utils impo...
apache-2.0
miloharper/neural-network-animation
matplotlib/axes/_axes.py
10
260820
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import reduce, xrange, zip, zip_longest import math import warnings import numpy as np from numpy import ma import matplotlib rcParams = matplotlib.rcParams import matplotlib.cbook...
mit
rainest/dance-partner-matching
networkx/readwrite/tests/test_gml.py
1
2734
#!/usr/bin/env python import io from nose.tools import * from nose import SkipTest import networkx class TestGraph(object): @classmethod def setupClass(cls): global pyparsing try: import pyparsing except ImportError: try: import matplotlib.pyparsi...
bsd-2-clause
kirel/political-affiliation-prediction
topicmodel.py
2
3883
# -*- coding: utf-8 -*- from sklearn.cluster import KMeans import classifier from scipy import zeros,double import datetime import json import cPickle class Topicmodel(): ''' Wrapper class for different topic models ''' def __init__(self,folder='model',modeltype='kmeans',topics=100,topwords=10): ...
mit
darwinex/DarwinexLabs
tools/Python/MetaTrader_Helpers/Report_Conversion/MT_TO_PYTHON/DWX_MT_TO_PYTHON_v2_RC4.py
1
9361
# -*- coding: utf-8 -*- """ Created on Mon Feb 04 12:01:07 2019 @author: Darwinex Labs (www.darwinex.com) DWX_MT_TO_PYTHON_v2_RC4.py Purpose: This script enables traders knowledgable in Python to import their Account History and Strategy Tester reports directly into pandas dataframes....
bsd-3-clause
AnasGhrab/scikit-learn
sklearn/linear_model/stochastic_gradient.py
130
50966
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import scipy.sparse as sp from abc import ABCMeta, abstractmethod from ...
bsd-3-clause
Arn-O/kadenze-deep-creative-apps
final-project/libs/utils.py
1
2157
""" Utility for image manipulation, directly copied (and slightly modified) from: https://github.com/pkmital/CADL """ import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np def img_crop(img, pos): """Crop to square from a position. Parameters ---------- img : np.n...
apache-2.0
akrherz/dep
scripts/plots/scenario_soil.py
2
2595
"""Plot soil stuff.""" import os import glob import sys import numpy as np import matplotlib.pyplot as plt import pandas as pd from pyiem.dep import read_slp from pyiem.util import utc def read_data(): """Do intensive stuff""" scenarios = [] kr = [] for huc12 in [ "070600060701", "070...
mit
JT5D/scikit-learn
sklearn/tests/test_base.py
9
5815
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing imp...
bsd-3-clause
aydevosotros/tradingMachine
DataManager.py
1
1627
# # Copyright (c) 2015 by Antonio Molina García-Retamero. All Rights Reserved. # import requests import datetime import csv import numpy as np import matplotlib.pyplot as plt class DataManager(object): """docstring for DataManager""" def __init__(self, arg): super(DataManager, self).__init__() ...
gpl-2.0
shusenl/scikit-learn
sklearn/linear_model/tests/test_bayes.py
299
1770
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.linear_model.bayes import BayesianRidge, ARDRegres...
bsd-3-clause
adamrvfisher/TechnicalAnalysisLibrary
CSVtoDFDiv.py
1
1762
# -*- coding: utf-8 -*- """ Created on Sun May 21 11:47:12 2017 @author: AmatVictoriaCuramIII """ from pandas import read_csv import pandas as pd import os CSVfiles = os.listdir('F:\\Users\\AmatVictoriaCuram\\TemporaryCSV') ranger = range(0,len(CSVfiles)) for i in ranger: try: temp = read_cs...
apache-2.0
chengsoonong/digbeta
dchen/music/src/tools/evaluate.py
2
10972
import numpy as np # from sklearn.metrics import f1_score from sklearn.metrics import precision_recall_fscore_support, roc_auc_score from joblib import Parallel, delayed def calc_metrics(y_true, y_pred, tops=[]): assert y_true.ndim == y_pred.ndim == 1 assert len(y_true) == len(y_pred) npos = y_true.sum() ...
gpl-3.0
alexxyjiang/docker-images
jupyterlab/scala2.11/jupyter_notebook_config.py
2
23448
# Configuration file for jupyter-notebook. #------------------------------------------------------------------------------ # Application(SingletonConfigurable) configuration #------------------------------------------------------------------------------ ## This is an application. ## The date format used by logging f...
mit
Achuth17/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
buckiracer/data-science-from-scratch
RefMaterials/code-python3/introduction.py
6
8194
# at this stage in the book we haven't actually installed matplotlib, # comment this out if you need to from matplotlib import pyplot as plt ########################## # # # FINDING KEY CONNECTORS # # # ########################## users = [ { "id": 0, "name": "Hero" },...
unlicense
knutfrode/opendrift
opendrift/__init__.py
1
7342
import logging import unittest import importlib import numpy as np import time from datetime import timedelta from .version import __version__ # For automated access to available drift classes, e.g. for GUI # Hardcoded for now _available_models = \ ['leeway.Leeway', 'openoil.OpenOil', 'shipdrift.ShipDrif...
gpl-2.0
JPFrancoia/scikit-learn
examples/tree/plot_tree_regression.py
95
1516
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
bsd-3-clause
zorroblue/scikit-learn
benchmarks/bench_sparsify.py
50
3410
""" Benchmark SGD prediction time with dense/sparse coefficients. Invoke with ----------- $ kernprof.py -l sparsity_benchmark.py $ python -m line_profiler sparsity_benchmark.py.lprof Typical output -------------- input data sparsity: 0.050000 true coef sparsity: 0.000100 test data sparsity: 0.027400 model sparsity:...
bsd-3-clause
xubenben/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
benoitsteiner/tensorflow-opencl
tensorflow/contrib/learn/python/learn/learn_io/io_test.py
137
5063
# 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
MartinThoma/algorithms
Python/string-concat/main.py
1
2095
import operator import random import string import timeit from io import StringIO import matplotlib.pyplot as plt import numpy as np import seaborn as sns def main(): str_list = [create_random_string(255) for i in range(1000)] functions = [ (plus_concat, "plus_concat"), (join_concat, "join_co...
mit
roxyboy/scikit-learn
sklearn/utils/tests/test_extmath.py
130
16270
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from scipy import stats from sklearn.utils.testing import assert_eq...
bsd-3-clause
yavalvas/yav_com
build/matplotlib/lib/mpl_examples/pylab_examples/contour_demo.py
14
3478
#!/usr/bin/env python """ Illustrate simple contour plotting, contours on an image with a colorbar for the contours, and labelled contours. See also contour_image.py. """ import matplotlib import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt matplotlib.rcParams[...
mit
qifeigit/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
jmmease/pandas
pandas/errors/__init__.py
6
1697
# flake8: noqa """ Expose public exceptions & warnings """ from pandas._libs.tslib import OutOfBoundsDatetime class PerformanceWarning(Warning): """ Warning raised when there is a possible performance impact. """ class UnsupportedFunctionCall(ValueError): """ Exception raised when attemptin...
bsd-3-clause
cxhernandez/msmbuilder
msmbuilder/utils/nearest.py
12
6505
# Author: Matthew Harrigan <matthew.p.harrigan@gmail.com> # Contributors: # Copyright (c) 2015, Stanford University and the Authors # All rights reserved. from __future__ import absolute_import, print_function, division from scipy.spatial import KDTree as sp_KDTree import numpy as np from . import check_iter_of_seque...
lgpl-2.1
pepo27/PatternRecognition
Python/SegundoParcial/mx/pepo/pattern/perceptron.py
2
3439
__author__ = 'alberto' from random import choice #import matplotlib.pyplot as plt from numpy import array, dot, random import numpy as np import matplotlib.pyplot as plt def perceptronOR(): unit_step = lambda x: 0 if x < 0 else 1 training_data = [ (array([0,0,1]), 0), (array([0,1,1]), 1), (array([1,0,1]), 1...
gpl-2.0
teonlamont/mne-python
mne/decoding/tests/test_ems.py
2
3389
# Author: Denis A. Engemann <d.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np from numpy.testing import assert_array_almost_equal, assert_equal import pytest from mne import io, Epochs, read_events, pick_types from mne.utils import requires_version, check_version, run_tests_if...
bsd-3-clause
jmetzen/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
biocyberman/bcbio-nextgen
bcbio/structural/prioritize.py
1
10138
"""Prioritize structural variants based on biological information. Provides high level summaries of structural variants in regions of interest, as defined by the input configuration. Tries to narrow structural variant calls based on potential biological targets. """ import os import pandas as pd import toolz as tz fr...
mit
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/neighbors/tests/test_ball_tree.py
26
10379
import pickle import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dis...
mit
jmikko/fairnessML
zafar_methods/disparate_mistreatment/synthetic_data_demo/fairness_acc_tradeoff.py
1
11588
import os, sys import numpy as np from generate_synthetic_data import * sys.path.insert(0, '../../fair_classification/') # the code for fair classification is in this directory import utils as ut import funcs_disp_mist as fdm import loss_funcs as lf # loss funcs that can be optimized subject to various constraints i...
gpl-3.0
LiaoPan/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
ChanderG/scikit-learn
benchmarks/bench_plot_incremental_pca.py
374
6430
""" ======================== IncrementalPCA benchmark ======================== Benchmarks for IncrementalPCA """ import numpy as np import gc from time import time from collections import defaultdict import matplotlib.pyplot as plt from sklearn.datasets import fetch_lfw_people from sklearn.decomposition import Incre...
bsd-3-clause
pianomania/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/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 scipy.sparse as...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/plugins/externalconsole.py
2
64194
# -*- coding: utf-8 -*- # # Copyright © 2009-2010 Pierre Raybaut # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """External Console plugin""" # pylint: disable=C0103 # pylint: disable=R0903 # pylint: disable=R0911 # pylint: disable=R0201 # Qt imports from spyderlib.qt.QtGui i...
gpl-3.0
mdeff/ntds_2017
projects/reports/speech_recognition/main_pipeline.py
1
13366
import os from os.path import isdir, join from pathlib import Path import pandas as pd from tqdm import tqdm # Math import numpy as np import scipy.stats from scipy.fftpack import fft from scipy import signal from scipy.io import wavfile import librosa import librosa.display from scipy import sparse, stats, spatial i...
mit
xavierwu/scikit-learn
sklearn/utils/random.py
234
10510
# Author: Hamzeh Alsalhi <ha258@cornell.edu> # # License: BSD 3 clause from __future__ import division import numpy as np import scipy.sparse as sp import operator import array from sklearn.utils import check_random_state from sklearn.utils.fixes import astype from ._random import sample_without_replacement __all__ =...
bsd-3-clause
mjescobar/RF_Estimation
Clustering/helpers/processClusters/processClustersBin2.py
2
4923
#!/usr/bin/env python # -*- coding: utf-8 -*- # # processClustersBin2.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; eithe...
gpl-2.0
kaichogami/sympy
sympy/interactive/printing.py
19
16124
"""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
PythonCharmers/bokeh
bokeh/charts/builder/tests/test_heatmap_builder.py
33
4145
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
alexis-jacq/Mutual_Modelling
tools/teacher_learner_noise.py
1
3735
#!/usr/bin/env python # coding: utf-8 import numpy as np import random from mutualModelling import model,agent0 import matplotlib.pyplot as plt import copy def create_teacher(name,all_names): percepts = ["a","b","c"] actions = ["a","b","c","reward","punish"] #rewards = [["success",1.,1.],["fail",1.,-1.]] ...
isc
luo66/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
FelixPM/Learning-Machine-Learning
sentdex/best_fit_slope.py
1
2180
"""Linear Regression code Find slope and intercept """ import numpy as np import matplotlib.pyplot as plt from matplotlib import style import random style.use('fivethirtyeight') def create_dataset(how_many_points, variance, step=2, correlation='pos'): val = 1 ys = [] for i in range(how_many_points): ...
mit
bavardage/statsmodels
statsmodels/sandbox/multilinear.py
3
14059
"""Analyze a set of multiple variables with a linear models multiOLS: take a model and test it on a series of variables defined over a pandas dataset, returning a summary for each variable multigroup: take a boolean vector and the definition of several groups of variables and test if the group has a f...
bsd-3-clause
JosmanPS/scikit-learn
sklearn/linear_model/coordinate_descent.py
43
75144
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
bucricket/projectMASpreprocess
preparepydisalexi/processLandsatLAI.py
1
14392
#!/usr/bin/env python2 #!/Applications/anaconda/envs/root3 python # -*- coding: utf-8 -*- """ Created on Thu Dec 1 13:50:04 2016 @author: mschull """ #python from .search import Search import os import subprocess import glob import shutil import pandas as pd import datetime import argparse import getpass import keyr...
bsd-3-clause
ml-ensemble/ml-ensemble.github.io
info/source/tutorials_source/parallel.py
2
8200
# -*- coding: utf-8 -*- """ .. _parallel_tutorial: .. currentmodule: mlens.parallel Parallel Mechanics ================== ML-Ensemble is designed to provide an easy user interface. But it is also designed to be extremely flexible, all the wile providing maximum concurrency at minimal memory consumption. The lower-...
mit
psav/cfme_tests
cfme/utils/smem_memory_monitor.py
1
67380
"""Monitor Memory on a CFME/Miq appliance and builds report&graphs displaying usage per process.""" import json import time import traceback from collections import OrderedDict from datetime import datetime from threading import Thread import os import six import yaml from cycler import cycler from yaycl import AttrDi...
gpl-2.0
astocko/statsmodels
statsmodels/sandbox/survival2.py
35
17924
#Kaplan-Meier Estimator import numpy as np import numpy.linalg as la import matplotlib.pyplot as plt from scipy import stats from statsmodels.iolib.table import SimpleTable class KaplanMeier(object): """ KaplanMeier(...) KaplanMeier(data, endog, exog=None, censoring=None) Create an object of...
bsd-3-clause
ccauet/scikit-optimize
skopt/space/transformers.py
1
4631
import numpy as np from sklearn.preprocessing import LabelBinarizer # Base class for all 1-D transformers. class Transformer(object): def fit(self, X): return self def transform(self, X): raise NotImplementedError def inverse_transform(self, X): raise NotImplementedError class ...
bsd-3-clause
natasasdj/OpenWPM
analysis/15_images_zero.py
1
9003
import os import sqlite3 import pandas as pd import numpy as np from matplotlib.colors import LogNorm import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter from statsmodels.distributions.empirical_distribution import ECDF def thousands(x, pos): if x>=1e9: return '%dB' % (x*1e-9) e...
gpl-3.0
carolFrohlich/nipype
doc/sphinxext/numpy_ext/docscrape_sphinx.py
10
7922
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from builtins import str, bytes import re import inspect import textwrap import pydoc import sphinx from .docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, con...
bsd-3-clause
AlexRBaker/ScaffoldM
pwd/lib/python2.7/site-packages/scaffoldm/templateClass.py
2
4971
#!/usr/bin/env python ############################################################################### # # # scaffoldm.py # # ...
gpl-3.0
datacommonsorg/data
scripts/biomedical/pharmgkb/drug_gene_relations/pharm.py
1
23854
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
JosmanPS/scikit-learn
examples/plot_multioutput_face_completion.py
330
3019
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
bsd-3-clause
ishank08/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
pgdr/ert
python/python/ert_gui/plottery/plots/observations.py
3
2027
import math def plotObservations(plot_context, axes): ert = plot_context.ert() key = plot_context.key() config = plot_context.plotConfig() case_list = plot_context.cases() data_gatherer = plot_context.dataGatherer() if config.isObservationsEnabled() and data_gatherer.hasObservationGatherFuncti...
gpl-3.0
brchiu/tensorflow
tensorflow/contrib/distributions/python/ops/mixture.py
22
21121
# 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
thomasspiesser/MYpop
MYpop_plots.py
1
13621
#!/usr/bin/python # -*- coding: iso-8859-1 -*- import pylab as p from numpy import * from scipy import stats,polyval import sys import re from mpl_toolkits.mplot3d import Axes3D from matplotlib import rc,cm import mpl_toolkits.mplot3d.art3d as art3d from matplotlib.patches import PathPatch ################ plot per...
mit
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/tests/test_backend_pgf.py
9
6311
# -*- encoding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import six import os import shutil import numpy as np import nose from nose.plugins.skip import SkipTest import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.com...
mit
breznak/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/mathtext.py
69
101723
r""" :mod:`~matplotlib.mathtext` is a module for parsing a subset of the TeX math syntax and drawing them to a matplotlib backend. For a tutorial of its usage see :ref:`mathtext-tutorial`. This document is primarily concerned with implementation details. The module uses pyparsing_ to parse the TeX expression. .. _p...
agpl-3.0
andaag/scikit-learn
sklearn/cluster/setup.py
263
1449
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration cblas_libs, blas_info = ...
bsd-3-clause
tdhopper/scikit-learn
sklearn/tests/test_base.py
216
7045
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
bsd-3-clause
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/examples/pylab_examples/finance_demo.py
6
1134
#!/usr/bin/env python from pylab import * from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \ DayLocator, MONDAY from matplotlib.finance import quotes_historical_yahoo, candlestick,\ plot_day_summary, candlestick2 # (Year, month, day) tuples suffice as args for quotes_historical_yahoo...
gpl-2.0
sarahgrogan/scikit-learn
sklearn/cluster/bicluster.py
211
19443
"""Spectral biclustering algorithms. Authors : Kemal Eren License: BSD 3 clause """ from abc import ABCMeta, abstractmethod import numpy as np from scipy.sparse import dia_matrix from scipy.sparse import issparse from . import KMeans, MiniBatchKMeans from ..base import BaseEstimator, BiclusterMixin from ..external...
bsd-3-clause