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
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/sandbox/qtpandas.py
13
4347
''' Easy integration of DataFrame into pyqt framework @author: Jev Kuznetsov ''' # GH9615 import warnings warnings.warn("The pandas.sandbox.qtpandas module is deprecated and will be " "removed in a future version. We refer users to the external package " "here: https://github.com/datalyze...
artistic-2.0
shikhardb/scikit-learn
benchmarks/bench_sgd_regression.py
283
5569
""" Benchmark for SGD regression Compares SGD regression against coordinate descent and Ridge on synthetic data. """ print(__doc__) # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import numpy as np import pylab as pl import gc from time import time from sklearn.linear_model i...
bsd-3-clause
deepesch/scikit-learn
sklearn/grid_search.py
32
36586
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
nuclear-wizard/moose
test/tests/time_integrators/scalar/run_stiff.py
12
5982
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
clingsz/GAE
main.py
1
1502
# -*- coding: utf-8 -*- """ Created on Wed May 10 12:38:40 2017 @author: cling """ def summarizing_cross_validation(): import misc.cv.collect_ND5_3 as cv cv.fig_boxplot_cverr() def test_trainer(): import misc.data_gen as dg import gae.model.trainer as tr data = dg.get_training_data() ...
gpl-3.0
internetmosquito/image-tagging-apis
image_tagging.py
1
16562
import os import yaml import json import zipfile import pandas import simplejson import ntpath import base64 import time from httplib2 import HttpLib2Error from googleapiclient import discovery from googleapiclient.errors import HttpError from oauth2client.client import GoogleCredentials from watson_developer_clou...
mit
codevlabs/pandashells
pandashells/bin/p_linspace.py
7
1450
#! /usr/bin/env python # standard library imports import sys # NOQA import sys to allow for mocking sys.argv in tests import argparse import textwrap from pandashells.lib import module_checker_lib, arg_lib, io_lib # import required dependencies module_checker_lib.check_for_modules(['numpy', 'pandas']) import numpy...
bsd-2-clause
gclenaghan/scikit-learn
examples/gaussian_process/plot_compare_gpr_krr.py
67
5191
""" ========================================================== Comparison of kernel ridge and Gaussian process regression ========================================================== Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn a target function by employing internally the "kernel trick...
bsd-3-clause
m3wolf/xanespy
tests/test_importers.py
1
48905
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2016 Mark Wolf # # This file is part of Xanespy. # # Xanespy 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 # ...
gpl-3.0
ywcui1990/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/rcsetup.py
69
23344
""" The rcsetup module contains the default values and the validation code for customization using matplotlib's rc settings. Each rc setting is assigned a default value and a function used to validate any attempted changes to that setting. The default values and validation functions are defined in the rcsetup module, ...
agpl-3.0
soulmachine/scikit-learn
sklearn/ensemble/tests/test_bagging.py
7
21070
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause 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_equal from sklearn.u...
bsd-3-clause
bartslinger/paparazzi
sw/airborne/test/math/compare_utm_enu.py
77
2714
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import sys import os PPRZ_SRC = os.getenv("PAPARAZZI_SRC", "../../../..") sys.path.append(PPRZ_SRC + "/sw/lib/python") from pprz_math.geodetic import * from pprz_math.algebra import DoubleRMat, DoubleEulers, DoubleVect3 from math ...
gpl-2.0
Adai0808/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
297
1247
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import pylab as pl from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_random_state(0) ...
bsd-3-clause
VaclavDedik/classifier
classifier/selectors.py
1
9474
import numpy as np from nltk.corpus import stopwords from sklearn.decomposition import TruncatedSVD from sklearn import feature_selection from sklearn.feature_extraction.text import CountVectorizer import utils class AbstractSelector(object): """Abstract feature selector. When implementing a subclass, you have ...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sklearn/qda.py
3
6694
""" Quadratic Discriminant Analysis """ # Author: Matthieu Perrot <matthieu.perrot@gmail.com> # # License: BSD Style. import warnings import numpy as np from .base import BaseEstimator, ClassifierMixin from .utils.fixes import unique from .utils import check_arrays __all__ = ['QDA'] class QDA(BaseEstimator, Clas...
agpl-3.0
sunny94/temp
sympy/plotting/tests/test_plot_implicit.py
17
2600
import warnings from sympy import (plot_implicit, cos, Symbol, Eq, sin, re, And, Or, exp, I, tan, pi) from sympy.plotting.plot import unset_show from tempfile import NamedTemporaryFile from sympy.utilities.pytest import skip from sympy.external import import_module #Set plots not to show unset_show(...
bsd-3-clause
animeshh/nuclei-analysis
hackrpi/plot_dbscan.py
2
3735
import numpy as np from scipy.spatial import distance from sklearn.cluster import DBSCAN from sklearn import metrics #from os import getcwd ############################################################################## # Generate sample data #centers = [[1, 1], [-1, -1], [1, -1]] #X, labels_true = make_blobs(n_sampl...
mit
mmottahedi/neuralnilm_prototype
scripts/e470.py
2
7017
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectiona...
mit
stefanhenneking/mxnet
example/bayesian-methods/bdk_demo.py
45
15837
# 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
igsr/igsr_analysis
scripts/VCF/QC/generate_report.py
1
6092
import argparse import glob import re import pdb import os import pandas as pd import openpyxl from tabulate import tabulate def check_variantype(value): if value !='snps' and value!='indels': raise argparse.ArgumentTypeError("%s is an invalid variant type" % value) return value parser = argparse.Ar...
apache-2.0
superbobry/hyperopt-sklearn
hpsklearn/tests/test_estimator.py
4
1604
try: import unittest2 as unittest except: import unittest import numpy as np from hpsklearn.estimator import hyperopt_estimator from hpsklearn import components class TestIter(unittest.TestCase): def setUp(self): np.random.seed(123) self.X = np.random.randn(1000, 2) self.Y = (sel...
bsd-3-clause
matthew-tucker/mne-python
examples/inverse/plot_label_source_activations.py
32
2269
""" ==================================================== Extracting the time series of activations in a label ==================================================== We first apply a dSPM inverse operator to get signed activations in a label (with positive and negative values) and we then compare different strategies to ...
bsd-3-clause
glennq/scikit-learn
examples/cluster/plot_adjusted_for_chance_measures.py
105
4300
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
bsd-3-clause
bzero/statsmodels
statsmodels/genmod/_prediction.py
27
9437
# -*- coding: utf-8 -*- """ Created on Fri Dec 19 11:29:18 2014 Author: Josef Perktold License: BSD-3 """ import numpy as np from scipy import stats # this is similar to ContrastResults after t_test, partially copied and adjusted class PredictionResults(object): def __init__(self, predicted_mean, var_pred_mean...
bsd-3-clause
grevutiu-gabriel/sympy
examples/intermediate/mplot3d.py
93
1252
#!/usr/bin/env python """Matplotlib 3D plotting example Demonstrates plotting with matplotlib. """ import sys from sample import sample from sympy import sin, Symbol from sympy.external import import_module def mplot3d(f, var1, var2, show=True): """ Plot a 3d function using matplotlib/Tk. """ im...
bsd-3-clause
ssaeger/scikit-learn
sklearn/neighbors/classification.py
132
14388
"""Nearest Neighbor Classification""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by ...
bsd-3-clause
EnSpec/SpecDAL
specdal/gui/gui.py
1
7156
import os import sys import tkinter as tk from tkinter import ttk from tkinter import filedialog import tkinter.simpledialog as tksd sys.path.insert(0, os.path.abspath("../..")) import matplotlib matplotlib.use('TkAgg') from specdal.spectrum import Spectrum from specdal.collection import Collection from viewer import V...
mit
bsaleil/lc
tools/benchtime.py
1
8755
#!/usr/bin/python3 #--------------------------------------------------------------------------- # # Copyright (c) 2015, Baptiste Saleil. 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. ...
bsd-3-clause
bgris/ODL_bgris
lib/python3.5/site-packages/IPython/lib/tests/test_latextools.py
8
3869
# encoding: utf-8 """Tests for IPython.utils.path.py""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. try: from unittest.mock import patch except ImportError: from mock import patch import nose.tools as nt from IPython.lib import latextools from IPython...
gpl-3.0
vaxin/captcha
line.py
1
3107
import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np import random import util def _fpart(x): return x - int(x) def _rfpart(x): return 1 - _fpart(x) def getpixel(img, xy): if xy[0] >= len(img) or xy[1] >= len(img[xy[0]]): return (255., 255., 255.) return img[xy[0]][xy[1]] def p...
mit
pythonvietnam/scikit-learn
examples/model_selection/plot_confusion_matrix.py
244
2496
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
jm-begon/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
Fireblend/scikit-learn
examples/preprocessing/plot_function_transformer.py
161
1949
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
bsd-3-clause
xavierwu/scikit-learn
sklearn/linear_model/tests/test_sag.py
93
25649
# Authors: Danny Sullivan <dbsullivan23@gmail.com> # Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # Licence: BSD 3 clause import math import numpy as np import scipy.sparse as sp from sklearn.linear_model.sag import get_auto_step_size from sklearn.linear_model.sag_fast import get_max_squared_sum from skle...
bsd-3-clause
leesavide/pythonista-docs
Documentation/matplotlib/users/plotting/examples/annotate_simple04.py
6
1048
import matplotlib.pyplot as plt plt.figure(1, figsize=(3,3)) ax = plt.subplot(111) ann = ax.annotate("Test", xy=(0.2, 0.2), xycoords='data', xytext=(0.8, 0.8), textcoords='data', size=20, va="center", ha="center", bbox=dict(boxstyle="round4", fc=...
apache-2.0
ahoyosid/scikit-learn
sklearn/neighbors/classification.py
18
13871
"""Nearest Neighbor Classification""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by ...
bsd-3-clause
YinongLong/scikit-learn
examples/mixture/plot_gmm.py
122
3265
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians obtained with Expectation Maximisation (``GaussianMixture`` class) and Variational Inference (``BayesianGaussianMixture`` class models with a Dirichlet ...
bsd-3-clause
Cignite/primdb
primdb_app/plot/massrange.py
2
1421
''' Counting the number of precursor ion masses in a define range from the database data. ''' import numpy.numarray as na import matplotlib.pyplot as plt import psycopg2 #establish connection with the postgres server with the given configuration conn = psycopg2.connect(host="localhost",user="primuser",password...
agpl-3.0
CarlosA-Lopez/Proyecto_Embebidos_Grupo2
plotly-1.2.9/plotly/matplotlylib/mplexporter/utils.py
4
11384
""" Utility Routines for Working with Matplotlib Objects ==================================================== """ import itertools import io import base64 import numpy as np import warnings import matplotlib from matplotlib.colors import colorConverter from matplotlib.path import Path from matplotlib.markers import ...
unlicense
lucidfrontier45/scikit-learn
examples/cluster/plot_lena_segmentation.py
2
2410
""" ========================================= Segmenting the picture of Lena in regions ========================================= This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogenous regions. This procedure (spec...
bsd-3-clause
shenzebang/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
potash/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
43
39945
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from itertools import product from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix from scipy.sparse import coo_matrix from sklearn import datasets from sklearn.base import clo...
bsd-3-clause
rohanp/scikit-learn
sklearn/metrics/cluster/unsupervised.py
230
8281
""" Unsupervised evaluation metrics. """ # Authors: Robert Layton <robertlayton@gmail.com> # # License: BSD 3 clause import numpy as np from ...utils import check_random_state from ..pairwise import pairwise_distances def silhouette_score(X, labels, metric='euclidean', sample_size=None, random...
bsd-3-clause
yanlend/scikit-learn
setup.py
76
9370
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # License: 3-clause BSD descr = """A set of python modules for machine learning and data mining""" import sys import os import shutil from distutils.command.clean ...
bsd-3-clause
aswolf/xmeos
xmeos/test/test_models_composite.py
1
40896
import numpy as np import xmeos from xmeos import models from xmeos.models import core import pytest import matplotlib.pyplot as plt import matplotlib as mpl from abc import ABCMeta, abstractmethod import copy import test_models #==================================================================== # Define "slow" te...
mit
ageron/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
39
32726
# 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
rahulremanan/python_tutorial
NLP/00-Multivariate_LSTM/src/binary_classification.py
1
12229
''' Created on 06 lug 2017 @author: mantica https://github.com/Azure/lstms_for_predictive_maintenance/blob/master/Deep%20Learning%20Basics%20for%20Predictive%20Maintenance.ipynb https://ti.arc.nasa.gov/tech/dash/pcoe/prognostic-data-repository/#turbofan Binary classification: Predict if an asset will fail within cer...
mit
henrykironde/scikit-learn
examples/semi_supervised/plot_label_propagation_digits.py
268
2723
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
bsd-3-clause
perimosocordiae/scipy
doc/source/tutorial/stats/plots/kde_plot3.py
12
1249
import numpy as np import matplotlib.pyplot as plt from scipy import stats rng = np.random.default_rng() x1 = rng.normal(size=200) # random data, normal distribution xs = np.linspace(x1.min()-1, x1.max()+1, 200) kde1 = stats.gaussian_kde(x1) kde2 = stats.gaussian_kde(x1, bw_method='silverman') fig = plt.figure(fig...
bsd-3-clause
jdrudolph/scikit-bio
skbio/stats/distance/_bioenv.py
12
9577
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
mjgrav2001/scikit-learn
setup.py
143
7364
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # License: 3-clause BSD descr = """A set of python modules for machine learning and data mining""" import sys import os import shutil from distutils.command.clean ...
bsd-3-clause
jorge2703/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
155
8058
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import (assert_array_almost_equal, assert_less, assert_equal, assert_not_equal, assert_raises) from sklearn.decomposition import PCA, KernelPCA from sklearn.datasets import mak...
bsd-3-clause
tafdata/cardinal
app/organizer/jyoriku.py
1
3647
import numpy as np import mojimoji import pandas as pd from django.db.models.aggregates import Count from django.db.models import Max from django.core.exceptions import ObjectDoesNotExist # Models from competitions.models import Comp, Event, EventStatus, GR as GRecord from organizer.models import Entry from organizer...
mit
jzt5132/scikit-learn
examples/svm/plot_separating_hyperplane.py
294
1273
""" ========================================= SVM: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a Support Vector Machine classifier with linear kernel. """ print(__doc__) import numpy as np impor...
bsd-3-clause
timqian/sms-tools
lectures/8-Sound-transformations/plots-code/hps-morph-total.py
24
3956
import numpy as np import matplotlib.pyplot as plt from scipy.signal import get_window import sys, os sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/transformations/')) i...
agpl-3.0
SuperDARNCanada/placeholderOS
tools/testing_utils/filter_testing/filter_rawrf.py
2
1174
# # Filter written rawrf data using remai filter. # # Then beamform and produce output_samples_iq import json import matplotlib from scipy.fftpack import fft import math matplotlib.use('TkAgg') import matplotlib.pyplot as plt import numpy as np import sys import collections import os import deepdish import argparse im...
gpl-3.0
wazeerzulfikar/scikit-learn
examples/model_selection/plot_roc.py
102
5056
""" ======================================= Receiver Operating Characteristic (ROC) ======================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality. ROC curves typically feature true positive rate on the Y axis, and false positive rate on the X a...
bsd-3-clause
FordyceLab/AcqPack
acqpack/autosampler.py
1
5202
import numpy as np import pandas as pd import utils as ut class Autosampler: """ A high-level wrapper that coordinates XY and Z axes to create an autosampler. Incorporates a deck. """ def __init__(self, z, xy): # TODO: ditch frames; just have position_tables, each of which stores should t...
mit
mantidproject/mantid
scripts/SCD_Reduction/SCDCalibratePanels2PanelDiagnostics.py
3
15813
#!/usr/bin/env python # Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identi...
gpl-3.0
andrewnc/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
lazywei/scikit-learn
examples/manifold/plot_mds.py
261
2616
""" ========================= Multi-dimensional scaling ========================= An illustration of the metric and non-metric MDS on generated noisy data. The reconstructed points using the metric MDS and non metric MDS are slightly shifted to avoid overlapping. """ # Author: Nelle Varoquaux <nelle.varoquaux@gmail....
bsd-3-clause
yyjiang/scikit-learn
sklearn/tests/test_calibration.py
213
12219
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_greater, assert_almost_equal, ...
bsd-3-clause
TimBizeps/BachelorAP
V504_Thermische Elektronenemission/auswertung3.py
1
1423
import matplotlib as mpl mpl.use('pgf') import numpy as np import scipy.constants as const import matplotlib.pyplot as plt from scipy.optimize import curve_fit from uncertainties import ufloat import uncertainties.unumpy as unp from uncertainties.unumpy import (nominal_values as noms, std_devs as stds) mpl.rcParams.upd...
gpl-3.0
SeyVu/subscription_renewal
support_functions.py
1
2424
######################################################################################################### # Description: Collection of support functions that'll be used often # ######################################################################################################### import numpy as np import pandas as ...
mit
adbroido/LRTanalysis
code/sortgmls.py
2
3782
import numpy as np import igraph import glob import os import pickle import pandas as pd """ Assorted functions to check whether a graph (as an igraph object) has certain properties. All are meant to be called directly. """ # filepath to error file errorfp = 'gmlerror.txt' def weighted(g, fp=''): """ Check whe...
gpl-3.0
InstaSketch/image-picker
imagePicker/image_query/management/commands/query.py
1
2326
import os import io import cProfile import cv2 import requests import pstats import numpy as np from matplotlib import pyplot as plt from django.core.management.base import BaseCommand, CommandError from image_api.imageloader import Imageloader from image_query import query class Command(BaseCommand): help = 'Que...
apache-2.0
xyguo/scikit-learn
sklearn/svm/tests/test_bounds.py
280
2541
import nose from nose.tools import assert_equal, assert_true from sklearn.utils.testing import clean_warning_registry import warnings import numpy as np from scipy import sparse as sp from sklearn.svm.bounds import l1_min_c from sklearn.svm import LinearSVC from sklearn.linear_model.logistic import LogisticRegression...
bsd-3-clause
YinongLong/scikit-learn
examples/calibration/plot_compare_calibration.py
82
5012
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
OpringaoDoTurno/airflow
tests/operators/hive_operator.py
40
14061
# -*- coding: utf-8 -*- # # 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, software ...
apache-2.0
depet/scikit-learn
examples/svm/plot_rbf_parameters.py
6
4080
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters `gamma` and `C` of the rbf kernel SVM. Intuitively, the `gamma` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' and high values meaning 'close'...
bsd-3-clause
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/tests/scalar/test_interval.py
7
3606
from __future__ import division import pytest from pandas import Interval import pandas.util.testing as tm class TestInterval(object): def setup_method(self, method): self.interval = Interval(0, 1) def test_properties(self): assert self.interval.closed == 'right' assert self.interval...
mit
amiremadmarvasti/cuda-convnet2
convdata.py
174
14675
# Copyright 2014 Google Inc. 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 applicable law or...
apache-2.0
kristoforcarlson/nest-simulator-fork
pynest/examples/intrinsic_currents_subthreshold.py
9
7172
# -*- coding: utf-8 -*- # # intrinsic_currents_subthreshold.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 ...
gpl-2.0
konstantint/matplotlib-venn
tests/region_test.py
1
4302
''' Venn diagram plotting routines. Test module (meant to be used via py.test). Tests of the classes and methods in _regions.py Copyright 2014, Konstantin Tretyakov. http://kt.era.ee/ Licensed under MIT license. ''' import pytest import os import numpy as np from tests.utils import exec_ipynb from matplotlib_venn._r...
mit
huzq/scikit-learn
examples/preprocessing/plot_scaling_importance.py
34
5381
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Importance of Feature Scaling ========================================================= Feature scaling through standardization (or Z-score normalization) can be an important preprocessing step for many machine lear...
bsd-3-clause
bartslinger/paparazzi
sw/misc/attitude_reference/pat/utils.py
42
6283
# # Copyright 2013-2014 Antoine Drouin (poinix@gmail.com) # # This file is part of PAT. # # PAT 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...
gpl-2.0
ashhher3/scikit-learn
sklearn/tree/tests/test_tree.py
9
46546
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
bsd-3-clause
Pybonacci/bezierbuilder
bezierbuilder.py
1
6844
# BézierBuilder # # Copyright (c) 2013, Juan Luis Cano Rodríguez <juanlu001@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above...
bsd-2-clause
billy-inn/scikit-learn
sklearn/cluster/tests/test_spectral.py
262
7954
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
aolindahl/streaking
area_fill.py
1
3843
# -*- coding: utf-8 -*- """ Created on Thu Oct 29 08:55:06 2015 @author: antlin """ import numpy as np import process_hdf5 import matplotlib.pyplot as plt def zero_crossing_area(y): # Find zero crossings around peak i_max = np.argmax(y) i_end = i_max + np.argmax(y[i_max:] < 0) i_start = i_max - np....
gpl-2.0
jrh154/ChibbarGroup
Phylogeny Scripts/sequence_combiner.py
2
1372
''' Combines fasta files based on a list of accession numbers with formated headers Usage: python sequence_combiner.py file_info.csv fasta_directory out_directory ''' from os import listdir, remove from os.path import join, isfile import pandas as pd import sys def File_Reader(file_info): data_dict = {} df = pd....
mit
gef756/seaborn
seaborn/timeseries.py
8
15217
"""Timeseries plotting functions.""" from __future__ import division import numpy as np import pandas as pd from scipy import stats, interpolate import matplotlib as mpl import matplotlib.pyplot as plt from .external.six import string_types from . import utils from . import algorithms as algo from .palettes import c...
bsd-3-clause
shuggiefisher/brain4k
brain4k/transforms/b4k/__init__.py
2
3461
import logging import itertools from copy import deepcopy import pandas as pd from brain4k.transforms import PipelineStage class DataJoin(PipelineStage): """ Perform a left join across two datasources. Useful in case one stage of the pipeline depends upon results generated at a prior stage, and the...
apache-2.0
appapantula/scikit-learn
sklearn/datasets/tests/test_20news.py
280
3045
"""Test the 20news downloader, if the data is available.""" import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import SkipTest from sklearn import datasets def test_20news(): try: data = dat...
bsd-3-clause
SciTools/cartopy
lib/cartopy/tests/mpl/test_web_services.py
2
1691
# Copyright Cartopy Contributors # # This file is part of Cartopy and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. import matplotlib.pyplot as plt from matplotlib.testing.decorators import cleanup import pytest from cartopy.tests.mpl ...
lgpl-3.0
jkarnows/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
230
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
kambysese/mne-python
tutorials/source-modeling/plot_beamformer_lcmv.py
10
12809
""" Source reconstruction using an LCMV beamformer ============================================== This tutorial gives an overview of the beamformer method and shows how to reconstruct source activity using an LCMV beamformer. """ # Authors: Britta Westner <britta.wstnr@gmail.com> # Eric Larson <larson.eric.d@...
bsd-3-clause
uvchik/pvlib-python
pvlib/test/test_forecast.py
1
4065
from datetime import datetime, timedelta import inspect from math import isnan from pytz import timezone import numpy as np import pandas as pd import pytest from numpy.testing import assert_allclose from conftest import requires_siphon, has_siphon, skip_windows pytestmark = pytest.mark.skipif(not has_siphon, reaso...
bsd-3-clause
pystockhub/book
ch14/03.py
1
1207
import pandas_datareader.data as web import datetime import matplotlib.pyplot as plt from zipline.api import order_target, record, symbol from zipline.algorithm import TradingAlgorithm start = datetime.datetime(2010, 1, 1) end = datetime.datetime(2016, 3, 29) data = web.DataReader("AAPL", "yahoo", start, end) #plt.pl...
mit
mhue/scikit-learn
sklearn/feature_extraction/tests/test_text.py
75
34122
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause
minglong-cse2016/stupidlang
docs/conf.py
1
8724
# -*- coding: utf-8 -*- # # 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 configuration values have a default; values that are commented out # serve to show the default. import sys # ...
mit
jimsrc/seatos
etc/n_CR/individual/check_pos.py
1
2610
#!/usr/bin/env ipython from pylab import * #from load_data import sh, mc, cr import func_data as fd import share.funcs as ff #import CythonSrc.funcs as ff import matplotlib.patches as patches import matplotlib.transforms as transforms from os import environ as env from os.path import isfile, isdir from h5py import File...
mit
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/tseries/index.py
2
71968
# pylint: disable=E1101 import operator from datetime import time, datetime from datetime import timedelta import numpy as np import warnings from pandas.core.common import (_NS_DTYPE, _INT64_DTYPE, _values_from_object, _maybe_box, ABCSeries, is_intege...
gpl-2.0
pprett/scikit-learn
sklearn/gaussian_process/tests/test_gaussian_process.py
46
7057
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # License: BSD 3 clause import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process import regression_models as regression from sklearn.gaussian_proce...
bsd-3-clause
neale/CS-program
534-MachineLearning2/decision_tree/decision_tree.py
1
5371
import os import sys import operator import itertools import matplotlib.pyplot as plt import numpy as np import collections verbose = False def import_data(): with open('iris_test-1.csv', 'rb') as f: X = f.readlines() for i, l in enumerate(X): X[i] = X[i].strip('\r\n').split(';') ...
unlicense
MMTObservatory/mmtwfs
mmtwfs/wfs.py
1
72281
# Licensed under a 3-clause BSD style license - see LICENSE.rst # coding=utf-8 """ Classes and utilities for operating the wavefront sensors of the MMTO and analyzing the data they produce """ import warnings import pathlib import numpy as np import photutils import matplotlib.pyplot as plt import matplotlib.cm as...
bsd-3-clause
drammock/mne-python
tutorials/preprocessing/70_fnirs_processing.py
5
14145
""" .. _tut-fnirs-processing: Preprocessing functional near-infrared spectroscopy (fNIRS) data ================================================================ This tutorial covers how to convert functional near-infrared spectroscopy (fNIRS) data from raw measurements to relative oxyhaemoglobin (HbO) and deoxyhaemogl...
bsd-3-clause
apache/incubator-airflow
tests/providers/amazon/aws/transfers/test_hive_to_dynamodb.py
7
4590
# # 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...
apache-2.0
boland1992/seissuite_iran
build/lib/seissuite/ant/pscrosscorr.py
1
151866
#!/usr/bin/env python """ Module that contains classes holding cross-correlations and related processing, such as frequency-time analysis (FTAN) to measure dispersion curves. """ from seissuite.ant import pserrors, psutils, pstomo import obspy.signal try: import obspy.io.xseed except: import obspy.xseed ...
gpl-3.0
UDST/urbansim
urbansim/utils/sampling.py
4
7852
import math import numpy as np import pandas as pd def get_probs(data, prob_column=None): """ Checks for presence of a probability column and returns the result as a numpy array. If the probabilities are weights (i.e. they don't sum to 1), then this will be recalculated. Parameters ----------...
bsd-3-clause