repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/backends/backend_qt4agg.py
10
2177
""" Render to qt from agg """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import os # not used import sys import ctypes import warnings import matplotlib from matplotlib.figure import Figure from .backend_qt5agg import FigureCanvasQTAggBa...
gpl-3.0
nixphix/ml-projects
sentiment_analysis/twitter_sentiment_analysis-jallikattu/code/twitter_sentiment_analysis-jallikattu_FINAL.py
1
11757
# coding: utf-8 # ### Sentiment Analysis on "Jallikattu" with Twitter Data Feed <h3 style="color:red;">#DataScienceForSocialCause</h3> # # Twitter is flooded with Jallikattu issue, let us find peoples sentiment with Data Science tools. Following is the approach # * Register a Twitter API handle for data feed # * Pul...
mit
pdamodaran/yellowbrick
tests/checks.py
1
4707
# tests.checks # Performs checking that visualizers adhere to Yellowbrick conventions. # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Mon May 22 11:18:06 2017 -0700 # # Copyright (C) 2017 District Data Labs # For license information, see LICENSE.txt # # ID: checks.py [4131cb1] benjamin@ben...
apache-2.0
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/tests/test_merge_column_and_index.py
5
5592
import dask.dataframe as dd import numpy as np import pandas as pd import pytest from dask.dataframe.utils import assert_eq, PANDAS_VERSION # Fixtures # ======== @pytest.fixture def df_left(): # Create frame with 10 partitions # Frame has 11 distinct idx values partition_sizes = np.array([3, 4, 2, 5, 3, ...
gpl-3.0
hakonsbm/nest-simulator
extras/ConnPlotter/examples/connplotter_tutorial.py
18
27730
# -*- coding: utf-8 -*- # # connplotter_tutorial.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 Li...
gpl-2.0
comprna/SUPPA
scripts/generate_boxplot_event.py
1
5584
# The next script will format a phenotype table (junctions, events, trasncripts...) # for runnning FastQTL analysis #This version is for formatting the SCLC phenotype """ @authors: Juan L. Trincado @email: juanluis.trincado@upf.edu generate_boxplot_event.py: Generates a boxplot with the PSI values, given which sampl...
mit
OshynSong/scikit-learn
sklearn/utils/tests/test_fixes.py
281
1829
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Justin Vincent # Lars Buitinck # License: BSD 3 clause import numpy as np from nose.tools import assert_equal from nose.tools import assert_false from nose.tools import assert_true from numpy.testing import (assert_almost_equal, ...
bsd-3-clause
kazemakase/scikit-learn
sklearn/feature_extraction/hashing.py
183
6155
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
aflaxman/scikit-learn
examples/linear_model/plot_bayesian_ridge.py
33
3875
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
ueshin/apache-spark
python/run-tests.py
15
13614
#!/usr/bin/env python3 # # 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 "L...
apache-2.0
nwjs/chromium.src
tools/perf/experimental/representative_perf_test_limit_adjuster/adjust_upper_limits.py
1
6803
# Copyright 2019 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. from __future__ import print_function import json import os import sys import shutil import subprocess import tempfile CHROMIUM_PATH = os.path.join(os.path...
bsd-3-clause
iohannez/gnuradio
gr-filter/examples/synth_to_chan.py
7
3891
#!/usr/bin/env python # # Copyright 2010,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
breisfeld/avoplot
examples/adv_sine_wave.py
3
8650
import numpy import matplotlib.pyplot as plt import math from avoplot import plugins, series, controls, subplots from avoplot.gui import widgets import wx plugin_is_GPL_compatible = True class TrigFuncSubplot(subplots.AvoPlotXYSubplot): def my_init(self): """ When defining your own subplot class...
gpl-3.0
mojoboss/scikit-learn
sklearn/decomposition/tests/test_truncated_svd.py
240
6055
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
bsd-3-clause
JeroenZegers/Nabu-MSSS
nabu/postprocessing/reconstructors/deepclusteringnoise_reconstructor.py
1
5366
"""@file deepclusteringnoise_reconstructor.py contains the reconstor class using deep clustering for modified noise architecture""" from sklearn.cluster import KMeans import mask_reconstructor from nabu.postprocessing import data_reader import numpy as np import os class DeepclusteringnoiseReconstructor(mask_reconst...
mit
arg-hya/taxiCab
Tools/Misc/TaskPointGenerator.py
1
1502
import json import shapefile as shp import matplotlib.pyplot as plt import random def mean(numbers): return float(sum(numbers)) / max(len(numbers), 1) numbersX = [] numbersY = [] TaskPoints = {} shpFilePath = r"D:\TaxiCab\mycode\Plots\ShapefileAndTrajectory\taxi_zones\taxi_zones" sf = shp.Reader(shpFil...
gpl-3.0
dalejung/edamame
edamame/tools/follow.py
1
9062
import inspect import gc import sys import os.path import difflib from collections import OrderedDict import pandas as pd from pandas.core.common import in_ipnb def is_property(code): """ Using some CPython gc magics, check if a code object is a property gc idea taken from trace.py from stdlib """ ...
mit
krasch/smart-assistants
examples/visualize_habits.py
1
1689
# -*- coding: UTF-8 -*- """ Plot visualization of user habits, i.e. show which actions typically follow some given user action. Note: the figure for "Frontdoor=Closed" slightly deviates from Figure 1 in the paper and Figure 5.1 in the dissertation (see paper_experiments.py for bibliographical information). The numb...
mit
walterreade/scikit-learn
sklearn/datasets/tests/test_base.py
33
7160
import os import shutil import tempfile import warnings import nose import numpy from pickle import loads from pickle import dumps from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn...
bsd-3-clause
elidrc/PSO
test_pso.py
1
1192
from benchmark_functions import * from pso import * import matplotlib.pyplot as plt iterations = 100 particles = 500 dimensions = 2 search_space = [[-5.12] * dimensions, [5.12] * dimensions] # print init_pso(iterations, particles, search_space) velocity, fitness, local_best, local_position, global_best, global_positi...
mit
nmartensen/pandas
pandas/tests/scalar/test_interval.py
7
4026
from __future__ import division from pandas import Interval import pytest import pandas.util.testing as tm @pytest.fixture def interval(): return Interval(0, 1) class TestInterval(object): def test_properties(self, interval): assert interval.closed == 'right' assert interval.left == 0 ...
bsd-3-clause
lbishal/scikit-learn
sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
rmhyman/DataScience
Lesson3/exploratory_data_analysis_subway_data.py
1
1558
import numpy as np import pandas import matplotlib.pyplot as plt def entries_histogram(turnstile_weather): ''' Before we perform any analysis, it might be useful to take a look at the data we're hoping to analyze. More specifically, let's examine the hourly entries in our NYC subway data and d...
mit
josiahseaman/DNAResearch
Repeat_Graph.py
1
8201
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> %matplotlib inline from pylab import * import matplotlib.pyplot as plt from IPython.core.display import Image # <codecell> data = [] for y in range(10): data.append([y+x for x in range(10)]) # print(data) Image(data=data) # <headingcell level=1> ...
apache-2.0
CharlesGulian/Deconv
fits_tools_tesla.py
1
5575
# -*- coding: utf-8 -*- """ Created on Thu Jul 14 21:18:54 2016 @author: charlesgulian """ import os #os.chdir('/Users/annepstein/Work/Deconv') curr_dir = os.getcwd() import numpy as np from astropy.io import fits import matplotlib.pyplot as plt import matplotlib #from photutils import aperture_photometry #from phot...
gpl-3.0
gdl-civestav-localization/cinvestav_location_fingerprinting
experimentation/__init__.py
1
1691
import os import cPickle import matplotlib.pyplot as plt from datasets import DatasetManager def plot_cost(results, data_name, plot_label): plt.figure(plot_label) plt.ylabel('Accuracy (m)', fontsize=30) plt.xlabel('Epoch', fontsize=30) plt.yscale('symlog') plt.tick_params(axis='both', which='major...
gpl-3.0
Newsrecommender/newsrecommender
ArticleRecommendationProject/Recommendation/Collab_Content_Based.py
1
5856
import yaml import pandas as pd import numpy as np import sys import os from math import sqrt import matplotlib import matplotlib.pyplot as plot import networkx as nx def get_script_directory(): """ This function returns the directory of the script in scrip mode In interactive mode returns interpreter name...
mit
mrcslws/htmresearch
projects/feedback/feedback_sequences_additional.py
7
24229
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
tracierenea/gnuradio
gr-filter/examples/fir_filter_ccc.py
47
4019
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
jakevdp/klsh
klsh/hamming_ann.py
1
6489
""" This is a set of classes to perform fast (approximate) nearest neighbors searches over Hamming spaces. [1] M. Charikar. Similarity Estimation Techniques from Rounding Algorithms. ACM Symposium on Theory of Computing, 2002. """ __all__ = ["HammingANN", "HammingBrute", "HammingBallTree"] import numpy as np from...
bsd-3-clause
niltonlk/nest-simulator
pynest/examples/spatial/test_3d.py
14
2140
# -*- coding: utf-8 -*- # # test_3d.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (...
gpl-2.0
ChengeLi/VehicleTracking
utilities/embedding.py
1
3427
#### embedding from sklearn.decomposition import PCA from sklearn.manifold import TSNE, MDS from mpl_toolkits.mplot3d import Axes3D class embeddings(obj): def __init__(self, model,data): self.modelChoice = model self.data = data # self.data = FeatureMtx_norm def PCA_embedding(self,n_c...
mit
ZENGXH/scikit-learn
sklearn/utils/tests/test_estimator_checks.py
202
3757
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
iABC2XYZ/abc
DM_Twiss/TwissTrain3.py
2
4285
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Sep 20 13:37:16 2017 Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn Function: Check that the Distribution generation method is right. """ import matplotlib.pyplot as plt import tensorflow as tf import numpy as np from Orth import LambdaR,OrthT...
gpl-3.0
asi-uniovi/malloovia
malloovia/lpsolver.py
1
33503
# coding: utf-8 #  import pandas as pd """Malloovia interface to LP solver""" from typing import Sequence, List, Any from itertools import product as cartesian_product from inspect import ismethod from collections import namedtuple from uuid import uuid4 import os import pulp # type: ignore from pulp import ( L...
mit
ClimbsRocks/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
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/pandas/tseries/tests/test_frequencies.py
9
25284
from datetime import datetime, time, timedelta from pandas.compat import range import sys import os import nose import numpy as np from pandas import Index, DatetimeIndex, Timestamp, Series, date_range, period_range import pandas.tseries.frequencies as frequencies from pandas.tseries.tools import to_datetime impor...
apache-2.0
mne-tools/mne-tools.github.io
0.13/_downloads/plot_stats_cluster_methods.py
6
8607
# doc:slow-example """ .. _tut_stats_cluster_methods: ====================================================== Permutation t-test on toy data with spatial clustering ====================================================== Following the illustrative example of Ridgway et al. 2012, this demonstrates some basic ideas behin...
bsd-3-clause
fw1121/Roary
contrib/roary_plots/roary_plots.py
1
5754
#!/usr/bin/env python # Copyright (C) <2015> EMBL-European Bioinformatics Institute # 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 la...
gpl-3.0
OshynSong/scikit-learn
doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py
254
2005
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
billy-inn/scikit-learn
sklearn/gaussian_process/gaussian_process.py
83
34544
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from ..base import BaseEstimator, RegressorMixin from ..metrics...
bsd-3-clause
nrhine1/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
260
1219
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
hantek/BinaryConnect
mnist.py
1
6258
# Copyright 2015 Matthieu Courbariaux, Zhouhan Lin """ This file is adapted from BinaryConnect: https://github.com/MatthieuCourbariaux/BinaryConnect Running this script should reproduce the results of a feed forward net trained on MNIST. To train a vanilla feed forward net with ordinary backprop: ...
gpl-2.0
marscher/mdtraj
MDTraj/core/trajectory.py
1
51903
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2014 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: Kyle A. Beauchamp, TJ Lane, Jo...
lgpl-2.1
SergioGonzalezSanz/conformal_predictors
tests/nc_measures/SVMTest.py
1
1492
import unittest from conformal_predictors.nc_measures.SVM import SVCDistanceNCMeasure from sklearn.svm import SVC from numpy import array class SVMTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_1(self): x = array([[1, 1], [2, 2]]) y = ar...
mit
altairpearl/scikit-learn
sklearn/feature_extraction/tests/test_image.py
25
11187
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import numpy as np import scipy as sp from scipy import ndimage from nose.tools import assert_equal, assert_true from numpy.testing import assert_raises from sklearn...
bsd-3-clause
aewhatley/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
260
1219
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
bmcfee/librosa
librosa/util/utils.py
1
64787
#!/usr/bin/env python # -*- coding: utf-8 -*- """Utility functions""" import warnings import scipy.ndimage import scipy.sparse import numpy as np import numba from numpy.lib.stride_tricks import as_strided from .._cache import cache from .exceptions import ParameterError # Constrain STFT block sizes to 256 KB MAX_M...
isc
YeoLab/anchor
anchor/simulate.py
1
7366
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import six from .visualize import violinplot, MODALITY_ORDER, MODALITY_TO_COLOR, barplot def add_noise(data, iteration_per_noise=100, noise_percentages=np.arange(0, 101, step=10), plot=True, vio...
bsd-3-clause
spacetelescope/stsci.tools
doc/source/conf.py
1
7012
# -*- coding: utf-8 -*- # # stsci.tools documentation build configuration file, created by # sphinx-quickstart on Thu Oct 7 13:09:39 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. # #...
bsd-3-clause
xuewei4d/scikit-learn
sklearn/preprocessing/_discretization.py
5
13176
# -*- coding: utf-8 -*- # Author: Henry Lin <hlin117@gmail.com> # Tom Dupré la Tour # License: BSD import numbers import numpy as np import warnings from . import OneHotEncoder from ..base import BaseEstimator, TransformerMixin from ..utils.validation import check_array from ..utils.validation import chec...
bsd-3-clause
ngcurrier/ProteusCFD
GUI/dakotaHistogram.py
1
1543
#!/usr/bin/python import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt #reads a space delimited file with a header and returns a dictionary #attempts to cast dictionary entries into floats, if it fails, leaves as is def readSpaceDelimitedFile(filename): f = open(filename, 'r') hea...
gpl-3.0
jmschrei/scikit-learn
examples/gaussian_process/plot_gpr_co2.py
9
5718
""" ======================================================== Gaussian process regression (GPR) on Mauna Loa CO2 data. ======================================================== This example is based on Section 5.4.3 of "Gaussian Processes for Machine Learning" [RW2006]. It illustrates an example of complex kernel engine...
bsd-3-clause
Diyago/Machine-Learning-scripts
DEEP LEARNING/segmentation/Severstal-Steel-Defect-Detection-master/common_blocks/new_metrics.py
1
15642
from functools import partial import numpy as np import torch from catalyst.dl import Callback, RunnerState, MetricCallback, CallbackOrder from pytorch_toolbelt.utils.catalyst.visualization import get_tensorboard_logger from pytorch_toolbelt.utils.torch_utils import to_numpy from pytorch_toolbelt.utils.visualization i...
apache-2.0
mrshu/scikit-learn
sklearn/covariance/__init__.py
10
1197
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
ThorbenJensen/wifi-locator
src/utils_classification.py
1
2437
"""Module provides classification of signals and evaluates models.""" from random import randrange import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import VotingClassifier from sklearn.ensemble.weight_boosting import AdaBoostClassifier from sklearn.model_selection import c...
apache-2.0
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/pandas/core/series.py
1
89595
""" Data structure for 1-dimensional cross-sectional and time series data """ from __future__ import division # pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 import types import warnings from numpy import nan, ndarray import numpy as np import numpy.ma as ma from pandas.core.common import (i...
mit
asimshankar/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py
137
2219
# encoding: utf-8 # 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 r...
apache-2.0
malvikasharan/APRICOT
apricotlib/apricot_visualization.py
1
22211
#!/usr/bin/env python # Description = Visualizes different output data from APRICOT analysis from collections import defaultdict import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import os import sys try: import subprocess except ImportError: print('Python package subprocess is missing. ...
isc
jm-begon/scikit-learn
sklearn/datasets/base.py
196
18554
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
bsd-3-clause
joernhees/scikit-learn
examples/linear_model/plot_sgd_iris.py
58
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
ndingwall/scikit-learn
sklearn/linear_model/_ridge.py
2
77132
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
jensreeder/scikit-bio
skbio/diversity/beta/__init__.py
1
6898
""" Beta diversity measures (:mod:`skbio.diversity.beta`) ===================================================== .. currentmodule:: skbio.diversity.beta This package contains helper functions for working with scipy's pairwise distance (``pdist``) functions in scikit-bio, and will eventually be expanded to contain pair...
bsd-3-clause
formath/mxnet
docs/mxdoc.py
11
12953
# 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
mbonsma/studyGroup
lessons/python/matplotlib/hwk3.1.py
12
2149
# -*- coding: utf-8 -*- from numpy import float32 from numpy import linspace from numpy import polyfit from numpy import polyval import matplotlib.pyplot as plt #Read in data from csv f=open('data.csv','r') line=f.readlines() #Empty array for data FN=[] EFN=[] #This loop goes through every line, strips new line chara...
apache-2.0
mandli/multilayer-examples
1d/setplot_shelf.py
1
12827
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ import numpy as np # Plot customization import matplotlib # Markers and line widths matplotlib.rcParams['lines.line...
mit
camptocamp/QGIS
python/plugins/processing/algs/VectorLayerHistogram.py
1
2809
# -*- coding: utf-8 -*- """ *************************************************************************** EquivalentNumField.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *******************...
gpl-2.0
scholer/py2cytoscape
py2cytoscape/data/network_view.py
1
6734
# -*- coding: utf-8 -*- import json import pandas as pd import requests from py2cytoscape.data.edge_view import EdgeView from py2cytoscape.data.node_view import NodeView from . import BASE_URL, HEADERS from py2cytoscape.data.util_network import NetworkUtil BASE_URL_NETWORK = BASE_URL + 'networks' class CyNetworkVi...
mit
pompiduskus/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
nliolios24/textrank
share/doc/networkx-1.9.1/examples/algorithms/blockmodel.py
32
3009
#!/usr/bin/env python # encoding: utf-8 """ Example of creating a block model using the blockmodel function in NX. Data used is the Hartford, CT drug users network: @article{, title = {Social Networks of Drug Users in {High-Risk} Sites: Finding the Connections}, volume = {6}, shorttitle = {Social Networks of Drug ...
mit
ggirelli/gpseq-img-py
pygpseq/anim/series.py
1
12252
# -*- coding: utf-8 -*- ''' @author: Gabriele Girelli @contact: gigi.ga90@gmail.com @description: contains Series wrapper, which in turn contains Nucleus. ''' # DEPENDENCIES ================================================================= import math import os import matplotlib.pyplot as plt import numpy as np fro...
mit
raincoatrun/ThinkStats2
code/thinkplot.py
75
18140
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import math import matplotlib import matplotlib.pyplot as pyplot import numpy as...
gpl-3.0
ltiao/scikit-learn
sklearn/linear_model/tests/test_sgd.py
30
44274
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
nelson-liu/scikit-learn
examples/plot_multilabel.py
236
4157
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD 3 clause """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ...
bsd-3-clause
OpenDrift/opendrift
tests/models/test_readers.py
1
29038
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of OpenDrift. # # OpenDrift 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, version 2 # # OpenDrift is distributed in the hope that it will b...
gpl-2.0
frank-tancf/scikit-learn
examples/feature_selection/plot_f_test_vs_mi.py
75
1647
""" =========================================== Comparison of F-test and mutual information =========================================== This example illustrates the differences between univariate F-test statistics and mutual information. We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the targ...
bsd-3-clause
MattNolanLab/Ramsden_MEC
ABAFunctions/ABA_errors.py
1
4010
''' Code for error analysis Copyright (c) 2014, Helen Ramsden 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 above copyright notice, this list of cond...
bsd-3-clause
ManuSchmi88/landlab
landlab/plot/imshow.py
3
21050
#! /usr/bin/env python """ Methods to plot data defined on Landlab grids. Plotting functions ++++++++++++++++++ .. autosummary:: :toctree: generated/ ~landlab.plot.imshow.imshow_grid ~landlab.plot.imshow.imshow_grid_at_cell ~landlab.plot.imshow.imshow_grid_at_node """ import numpy as np import insp...
mit
NelisVerhoef/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
260
1219
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/pandas/io/tests/parser/quoting.py
7
5796
# -*- coding: utf-8 -*- """ Tests that quoting specifications are properly handled during parsing for all of the parsers defined in parsers.py """ import csv import pandas.util.testing as tm from pandas import DataFrame from pandas.compat import PY3, StringIO, u class QuotingTests(object): def test_bad_quote_...
apache-2.0
mehdidc/scikit-learn
sklearn/neighbors/tests/test_kde.py
17
5626
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
jbloom/mutpath
src/plot.py
1
10257
"""Module for performing plotting for ``mutpath`` package. This module uses ``pylab`` and ``matplotlib`` to make plots. These plots will fail if ``pylab`` and ``matplotlib`` are not available for importation. Before running any function in this module, you can run the *PylabAvailable* function to determine if ``pylab`...
gpl-3.0
xavierwu/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
AlexRobson/scikit-learn
sklearn/linear_model/coordinate_descent.py
37
74167
# 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
FernanOrtega/DAT210x
Module3/notes/2Dscatter_example.py
1
1245
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 11 21:14:57 2017 @author: fernando """ import pandas as pd import matplotlib import matplotlib.pyplot as plt plt.style.use('ggplot') df = pd.read_csv('concrete.csv') print df.describe() # Plot 1 df.plot.scatter(x='cement', y='strength') plt.s...
mit
Nelca/buildMLSystem
ch04/blei_lda.py
3
1602
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License from __future__ import print_function from gensim import corpora, models, similarities from mpltools im...
mit
elijah513/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
cbertinato/pandas
pandas/tests/indexes/test_setops.py
1
2362
''' The tests in this package are to ensure the proper resultant dtypes of set operations. ''' import itertools as it import numpy as np import pytest from pandas.core.dtypes.common import is_dtype_equal import pandas as pd from pandas import Int64Index, RangeIndex from pandas.tests.indexes.conftest import indices_l...
bsd-3-clause
Panos-Bletsos/spark-cost-model-optimizer
python/pyspark/sql/session.py
11
24874
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/doc/mpl_examples/widgets/menu.py
3
4882
import numpy as np import matplotlib import matplotlib.colors as colors import matplotlib.patches as patches import matplotlib.mathtext as mathtext import matplotlib.pyplot as plt import matplotlib.artist as artist import matplotlib.image as image class ItemProperties: def __init__(self, fontsize=14, labelcolor='...
gpl-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/test_nanops.py
7
44169
# -*- coding: utf-8 -*- from __future__ import division, print_function from functools import partial import warnings import numpy as np from pandas import Series, isnull from pandas.types.common import is_integer_dtype import pandas.core.nanops as nanops import pandas.util.testing as tm use_bn = nanops._USE_BOTTLEN...
gpl-3.0
musically-ut/statsmodels
statsmodels/tsa/vector_ar/dynamic.py
27
9932
# pylint: disable=W0201 from statsmodels.compat.python import iteritems, string_types, range import numpy as np from statsmodels.tools.decorators import cache_readonly import pandas as pd from . import var_model as _model from . import util from . import plotting FULL_SAMPLE = 0 ROLLING = 1 EXPANDING = 2 def _get...
bsd-3-clause
jblackburne/scikit-learn
examples/decomposition/plot_pca_vs_fa_model_selection.py
70
4523
""" =============================================================== Model selection with Probabilistic PCA and Factor Analysis (FA) =============================================================== Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the likelihood of new data can be u...
bsd-3-clause
HeraclesHX/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
jstoxrocky/statsmodels
statsmodels/sandbox/tsa/fftarma.py
30
16438
# -*- coding: utf-8 -*- """ Created on Mon Dec 14 19:53:25 2009 Author: josef-pktd generate arma sample using fft with all the lfilter it looks slow to get the ma representation first apply arma filter (in ar representation) to time series to get white noise but seems slow to be useful for fast estimation for nobs=1...
bsd-3-clause
mmaelicke/scikit-gstat
skgstat/plotting/stvariogram_plot3d.py
1
3989
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D try: import plotly.graph_objects as go except ImportError: pass def __calculate_plot_data(stvariogram, **kwargs): xx, yy = stvariogram.meshbins z = stvariogram.experimental # x = xx.flatten() # y = yy.fla...
mit
mjvakili/ccppabc
ccppabc/code/test_data.py
1
4243
''' Test the data.py module ''' import numpy as np import matplotlib.pyplot as plt import util import data as Data # --- Halotools --- from halotools.empirical_models import PrebuiltHodModelFactory from ChangTools.plotting import prettyplot from ChangTools.plotting import prettycolors def PlotCovariance(obvs, ...
mit
Andreea-G/Codds_DarkMatter
src/experiment_HaloIndep_Band.py
1
59260
""" Copyright (c) 2015 Andreea Georgescu Created on Wed Mar 4 00:47:37 2015 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 2 of the License, or (at your option) any later version. ...
gpl-2.0
caiostringari/swantools
test.py
1
2740
import swantools.io import swantools.utils import swantools.plot import datetime import matplotlib.pyplot as plt import numpy as np def readtable(): R = swantools.io.SwanIO() P = swantools.plot.SwanPlot() # Reading TABLE dada with headers: df = R.read_swantable('data/table.txt') y = df["Hsig...
gpl-2.0
tpsatish95/OCR-on-Indus-Seals
code/Test/TextROI.py
1
16306
# -*- coding: utf-8 -*- import skimage.io import matplotlib.pyplot as plt import matplotlib.patches as mpatches import selectivesearch import numpy as np import skimage.transform import os import shutil import caffe from PIL import Image candidates = set() merged_candidates = set() refined = set() final = set() final_...
apache-2.0