repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
syl20bnr/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/blocking_input.py
69
12119
""" This provides several classes used for blocking interaction with figure windows: :class:`BlockingInput` creates a callable object to retrieve events in a blocking way for interactive sessions :class:`BlockingKeyMouseInput` creates a callable object to retrieve key or mouse clicks in a blocking way for int...
gpl-3.0
jreback/pandas
pandas/tests/indexes/timedeltas/test_timedelta_range.py
3
3258
import numpy as np import pytest from pandas import Timedelta, timedelta_range, to_timedelta import pandas._testing as tm from pandas.tseries.offsets import Day, Second class TestTimedeltas: def test_timedelta_range(self): expected = to_timedelta(np.arange(5), unit="D") result = timedelta_range...
bsd-3-clause
pypot/scikit-learn
examples/cluster/plot_cluster_comparison.py
246
4684
""" ========================================================= Comparing different clustering algorithms on toy datasets ========================================================= This example aims at showing characteristics of different clustering algorithms on datasets that are "interesting" but still in 2D. The last ...
bsd-3-clause
ritchyteam/odoo
addons/resource/faces/timescale.py
170
3902
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
aoehmichen/eae-docker
jupyter-sparkless/jupyter_notebook_config.py
1
21983
# Configuration file for jupyter-notebook. #------------------------------------------------------------------------------ # Application(SingletonConfigurable) configuration #------------------------------------------------------------------------------ ## This is an application. ## The date format used by logging f...
apache-2.0
rampasek/seizure-prediction
features/entropy.py
1
10855
from __future__ import division import warnings import os, sys import numpy as np import scipy.spatial import scipy.weave import scipy.stats.kde import matplotlib.pyplot as pp import bisect # apparently scipy.weave is depricated. I really shouldn't have used it. # the best thing would probably be to port entropy_nn()...
gpl-2.0
basnijholt/holoviews
setup.py
1
9955
#!/usr/bin/env python import sys, os import shutil from collections import defaultdict try: from setuptools import setup except ImportError: from distutils.core import setup setup_args = {} install_requires = ['param>=1.8.0,<2.0', 'numpy>=1.0', 'pyviz_comms>=0.7.0'] extras_require = {} # Notebook dependenc...
bsd-3-clause
antoinecarme/sklearn_explain
reason_codes/settings.py
1
1038
import pandas as pd import numpy as np class cScoreExplainerConfig: def __init__(self): self.mFeatureNames = None self.mCategoricalFeatureNames = None self.mScoreBins = 5 # score binning self.mFeatureBins = 5 # feature binning self.mCustomFeatureQuantiles = None sel...
bsd-3-clause
james-pack/ml
pack/ml/mnist/train_classifier.py
1
7499
import argparse import concurrent.futures from contextlib import ExitStack import math import numpy as np from matplotlib import pyplot as plt from pack.ml.datasets.validation_sets import ValidationSets from pack.ml.mnist.mnist_data import MnistData from pack.ml.nodes.file_set import FileSet from pack.ml.nodes.loss_vi...
mit
myt00seven/svrg
cifar/draw_3_BN.py
4
9604
# This is used to draw three comparisons for SGD+BN, SVRG+BN and Streaming SVRG +BN import matplotlib import matplotlib.pyplot as plt plt.switch_backend('agg') import pylab import numpy as np import sys # all the methods are with BN layers!!! PATH_DATA_adagrad = "data_3_BN/" PATH_DATA_SVRG = "data_3_BN/" ...
mit
diegocavalca/Studies
phd-thesis/benchmarkings/Imaging-NILM-time-series/Imaging-time-series-to-improve-classification-and-imputation-master/serie2QMlib.py
2
5921
# -*- coding: utf-8 -*- """ Created on Fri Apr 11 13:45:33 2014 Modified on Wed Jan 27 15:36:00 2016 @author: Stephen Wang """ import pandas as pd import numpy as np import scipy.io as sio import pickle def output_arff(dataset, filename="data.arff"): outfile = open(filename, 'w') features = {} labels = ...
cc0-1.0
nesterione/scikit-learn
examples/manifold/plot_compare_methods.py
259
4031
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
John-Jumper/Upside-MD
py/tensorflow_upside.py
1
11516
import sys import time import tables as tb import numpy as np import tempfile import subprocess as sp import os import cPickle as cp import collections import uuid import predict_chi1 import upside_engine as ue from mpi4py import MPI import mpi_collective_object as mco import threading gensym_salt = str(uuid.uuid4())...
gpl-2.0
zertan/PTR-Pipeline
setup.py
2
4674
"""A bioinformatics pipeline for estimation of relative cell periods.""" # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import environ environ['LC_ALL']='en_US.UTF-8' environ['LANG']='en_US.UTF-8' try: import py...
gpl-2.0
ChanderG/scikit-learn
examples/linear_model/plot_lasso_and_elasticnet.py
249
1982
""" ======================================== Lasso and Elastic Net for Sparse Signals ======================================== Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupted with an additive noise. Estimated coefficients are compared with the ground-truth. """ print(...
bsd-3-clause
binghongcha08/pyQMD
GWP/2D/1.1.0/plt.py
14
1041
##!/usr/bin/python import numpy as np import pylab as plt import seaborn as sns sns.set_context('poster') #with open("traj.dat") as f: # data = f.read() # # data = data.split('\n') # # x = [row.split(' ')[0] for row in data] # y = [row.split(' ')[1] for row in data] # # fig = plt.figure() # # ax1 ...
gpl-3.0
errcHuang/pyRM114
pyrm114/interface.py
1
15378
from sklearn.metrics import * from collections import namedtuple import numpy as np import matplotlib.pyplot as plt import os import sys import subprocess import argparse import random import ntpath #TO-DO: make training echo like classify is #basically training and test set partitioning is outside scope of class, #th...
mit
navijo/FlOYBD
DataMining/weather/ml/linearRegression.py
2
6641
from pyspark import SparkContext, SparkConf from pyspark.ml.evaluation import RegressionEvaluator from pyspark.ml.regression import LinearRegression from pyspark.ml.tuning import ParamGridBuilder, TrainValidationSplit from pyspark.ml.feature import VectorAssembler from pyspark.sql import SQLContext, SparkSession from...
mit
Roibal/Geotechnical_Engineering_Python_Code
Ventilation-Mining-Engineering/Data-Analysis-Examples-Ventilation-Mining/Data_Display_TestUGMine.py
1
4160
import matplotlib.pyplot as plt import csv import datetime """ The Purpose of "Data_Display_TestUGMine.py" is to load data and display data collected by the two data collection units (raspberry pi & sense Hat) for the purpose of ventilation engineering. The Data collected in this example was collected over a period...
mit
marionleborgne/nupic.research
projects/sequence_prediction/mackey_glass/visualize_results.py
13
1819
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
PMBio/limix
limix/deprecated/modules/lmmlasso.py
2
8245
''' Created on Dec 19, 2013 @author: johannes stephan, barbara rakitsch ''' from sklearn.linear_model import Lasso from sklearn.metrics import mean_squared_error import sklearn.cross_validation as cross_validation from .varianceDecomposition import VarianceDecomposition from . import qtl import scipy as SP import nu...
apache-2.0
cdiazbas/LMpyMilne
Versions/LMmilne_2cycle.py
1
10566
''' LMEI: Levenberg-Marquardt (with constrain) for a Milne-Eddignton atmosphere Inversion ''' from mutils2 import * from milne import * from numpy import arange, pi, sqrt, array, ones, imag, real, sign, random, diag, load from lmfit import minimize, Parameters, fit_report def inversionStokes(p0,x,yc,param,Chitol,Maxi...
mit
Luttik/mellowcakes_prototype
freya/machine_learning/test.py
1
1655
from sklearn.model_selection import cross_val_score from ..email_analysis_module import get_encoded_matrix import numpy as np def test(x, y, model, cv=10): results = np.array(list(cross_val_score(model, x, y, cv=cv))) return results.mean(), results.std() def dict_chain(dict): output = {} for label_1...
mit
vdrhtc/Measurement-automation
lib2/fulaut/ResonatorOracle.py
1
4919
from loggingserver import LoggingServer from scipy import * import pickle from scipy.signal import argrelextrema from matplotlib import gridspec, pyplot as plt from lib2.ExperimentParameters import ResonatorOracleParameters, GlobalParameters from lib2.ResonatorDetector import ResonatorDetector import os class Resonato...
gpl-3.0
niketanpansare/incubator-systemml
src/main/python/systemml/defmatrix.py
7
48505
# ------------------------------------------------------------- # # 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 unde...
apache-2.0
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Interface_Mesh_Types/Interface_1/SoftContact_ElPPlShear/Interface_Test_Shear_Plot.py
1
3515
#!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as np; plt.rcParams.update({'font.size': 28}) # set tick width mpl.rcParams['xtick.major.size'] = 10 mpl.rcParams['xtick.major.width'] = 5 mpl.rcParams['xtick.minor.size'] = 10 mpl.rcParams['xtick.minor.width...
cc0-1.0
cpcloud/blaze
blaze/server/server.py
2
13284
from __future__ import absolute_import, division, print_function import socket import functools import re from warnings import warn import collections import flask from flask import Blueprint, Flask, request, Response try: from bokeh.server.crossdomain import crossdomain except ImportError: def crossdomain(*...
bsd-3-clause
Karel-van-de-Plassche/QLKNN-develop
qlknn/dataset/prep_datasets.py
1
7789
import os import time import xarray as xr import numpy as np from qlknn.dataset.hypercube_to_pandas import * @profile def load_megarun1_ds(rootdir='.'): """ Load the 'megarun1' data as xarray/dask dataset For the megarun1 dataset, the data is split in the 'total fluxes + growth rates' and 'TEM/ITG/ETG fl...
mit
jblackburne/scikit-learn
sklearn/metrics/base.py
46
4627
""" Common code for all metrics """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Arnaud Joly <a.joly@ulg.ac.be> # Jochen Wersdorfer <jochen@wersdoerfer.de> # Lars Buitinck ...
bsd-3-clause
AstroHackWeek/AstroHackWeek2015
day4-day5-inference/straightline_utils.py
8
3701
# numpy: numerical library import numpy as np # avoid broken installs by forcing Agg backend... #import matplotlib #matplotlib.use('Agg') # pylab: matplotlib's matlab-like interface import pylab as plt # The data we will fit, sometimes: # x, y, sigma_y data1 = np.array([[201,592,61],[244,401,25],[47,583,38],[287,402,...
gpl-2.0
csferrie/python-qinfer
doc/source/conf.py
3
12884
# -*- coding: utf-8 -*- # # QInfer documentation build configuration file, created by # sphinx-quickstart on Tue Aug 14 21:12:57 2012. # # 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 ...
agpl-3.0
fzalkow/scikit-learn
examples/svm/plot_oneclass.py
249
2302
""" ========================================== One-class SVM with non-linear kernel (RBF) ========================================== An example using a one-class SVM for novelty detection. :ref:`One-class SVM <svm_outlier_detection>` is an unsupervised algorithm that learns a decision function for novelty detection: ...
bsd-3-clause
khkaminska/scikit-learn
examples/decomposition/plot_pca_iris.py
253
1801
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo...
bsd-3-clause
ioam/holoviews
holoviews/plotting/mpl/plot.py
2
48619
from __future__ import absolute_import, division, unicode_literals from itertools import chain from contextlib import contextmanager import param import numpy as np import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D # noqa (For 3D plots) from matplotlib import pyplot as plt from matplotlib import grid...
bsd-3-clause
AWI-Paleodyn/Python_Helpers
plot_tools/custom_cmap.py
2
3143
''' NAME Custom Colormaps for Matplotlib PURPOSE This program shows how to implement make_cmap which is a function that generates a colorbar. If you want to look at different color schemes, check out https://kuler.adobe.com/create. PROGRAMMER(S) Chris Slocum REVISION HISTORY 20130411 -- Initial...
gpl-2.0
umuzungu/zipline
zipline/sources/data_frame_source.py
5
5146
# # Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
nortti/trump-tweet-reception-predictor
word_count.py
1
6296
#!/usr/bin/env python import pandas as pd import string import plotly as py import plotly.graph_objs as go from nltk.stem.porter import PorterStemmer from collections import Counter import operator def generate(json_data, out_dir, num_top_words = 25): stopword_file = "stop-word-list.csv" # Data IN df = pd...
bsd-3-clause
btabibian/scikit-learn
sklearn/decomposition/base.py
5
5613
"""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 <denis-alexander.engemann@inria.fr> # Kyle Kastner <kastnerkyle@gmail.com> ...
bsd-3-clause
ankurankan/pgmpy
pgmpy/tests/test_estimators/test_CITests.py
2
8176
import unittest import math import numpy as np import pandas as pd from numpy import testing as np_test from pgmpy.estimators.CITests import * np.random.seed(42) class TestPearsonr(unittest.TestCase): def setUp(self): self.df_ind = pd.DataFrame(np.random.randn(10000, 3), columns=["X", "Y", "Z"]) ...
mit
mattilyra/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
nolanliou/tensorflow
tensorflow/contrib/timeseries/examples/multivariate.py
67
5155
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
olinguyen/self-driving-cars
p3-behavioral-cloning/model.py
1
4941
import pandas as pd import numpy as np import matplotlib.pyplot as plt import cv2 import math from keras.layers.core import Dense, Activation, Flatten, Dropout, Reshape, Lambda from keras.activations import relu, softmax from keras.layers.pooling import MaxPooling2D from keras.layers.convolutional import Convolution2D...
mit
pwcazenave/PyFVCOM
examples/pyfvcom_plot_example.py
1
3605
# coding: utf-8 # ### PyFVCOM plotting tools examples # # Here, we demonstrate plotting in three different dimensions: horizontal space, vertical space and time. # # First we load some model output into an object which can be passed to a number of plotting objects. These objects have methods for plotting different ...
mit
h2educ/scikit-learn
sklearn/tests/test_naive_bayes.py
70
17509
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.cross_validation import cross_val_score, train_test_split from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_almost_equal from sklearn.utils.te...
bsd-3-clause
SimonBiggs/electronfactors
Spline modelling electron insert factors standalone example.py
1
20465
import matplotlib.pyplot as plt get_ipython().magic('matplotlib inline') from bokeh.io import output_file from electronfactors import generic_shape_convert, parameterise, create_report input_dict = dict() applicator = 10 energy = 12 ssd = 100 # In[3]: key = '3cm circle' input_dict[key] = dict() input_dict[key]['f...
agpl-3.0
harisbal/pandas
pandas/tests/indexing/interval/test_interval.py
4
7948
import numpy as np import pytest import pandas as pd from pandas import DataFrame, Interval, IntervalIndex, Series import pandas.util.testing as tm class TestIntervalIndex(object): def setup_method(self, method): self.s = Series(np.arange(5), IntervalIndex.from_breaks(np.arange(6))) # To be removed...
bsd-3-clause
alexmojaki/blaze
blaze/compute/tests/test_pytables_compute.py
14
7657
from __future__ import absolute_import, division, print_function import os import pytest import pandas as pd tb = pytest.importorskip('tables') try: f = pd.HDFStore('foo') except (RuntimeError, ImportError) as e: pytest.skip('skipping test_hdfstore.py %s' % e) else: f.close() os.remove('foo') from ...
bsd-3-clause
WMD-group/MacroDensity
examples/PlanarAverage.py
1
1084
#! /usr/bin/env python import macrodensity as md import math import numpy as np import matplotlib.pyplot as plt input_file = 'LOCPOT' lattice_vector = 4.75 output_file = 'planar.dat' # No need to alter anything after here #------------------------------------------------------------------ # Get the potential # This se...
mit
mikeireland/chronostar
projects/scocen/galaxy_black.py
1
9585
""" Plot ScoCen in (l, b) coordinates, stars for each component with different colours. """ import numpy as np from astropy.table import Table from astropy import units as u import matplotlib.pyplot as plt import matplotlib.ticker as ticker plt.ion() # Pretty plots from fig_settings import * ########################...
mit
aewhatley/scikit-learn
sklearn/datasets/lfw.py
50
19048
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
mohazahran/Detecting-anomalies-in-user-trajectories
scripts/bipartite-it.py
2
1698
#-*- coding: utf8 from __future__ import division, print_function from statsmodels.distributions.empirical_distribution import ECDF import matplotlib #matplotlib.use('Agg') import sys import argparse import matplotlib.pyplot as plt import numpy as np import pandas as pd def main(): parser = argparse.ArgumentPar...
bsd-3-clause
serendio-labs-stage/diskoveror-datapreprocessing-python
premodelling routines/deviation/deviate.py
3
1227
''' Copyright 2015 Serendio Inc. Author - kshitij soni 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 wri...
apache-2.0
nvoron23/scikit-learn
sklearn/ensemble/gradient_boosting.py
50
67625
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
bsd-3-clause
yuanchao/pyHiggsML
sklearn/sk_atlas.py
1
2867
''' Example code for processing Atlas Machine-Learning Challenge Based on Darin Baumgartel's reference code. 2014/06/23 Yuan CHAO ''' print(__doc__) import numpy as np from sklearn.ensemble import GradientBoostingClassifier as GBC from sklearn.cross_validation import train_test_split import math # Load training...
gpl-2.0
plissonf/scikit-learn
examples/svm/plot_rbf_parameters.py
132
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radial Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
childresslab/MicrocavityExp1
logic/jupyterkernel/mpl/backend_inline.py
7
7669
"""A matplotlib backend for publishing figures via display_data Qudi 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. Qudi is distributed in...
gpl-3.0
massmutual/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
joernhees/scikit-learn
sklearn/metrics/cluster/__init__.py
91
1468
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
MatthewDaggitt/PathVision
modules/pathDisplayModule.py
1
3864
import tkinter from itertools import groupby from collections import defaultdict import matplotlib.pyplot as plt from matplotlib.colors import to_hex import networkx as nx import settings from modules.shared.graphFrame import GraphFrame from modules.shared.graphInteraction import DrawData ################ ## Control...
mit
hsiaoyi0504/scikit-learn
examples/text/hashing_vs_dict_vectorizer.py
284
3265
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
JustusSchwan/MasterThesis
trash/cluster_features.py
1
6740
import csv import os import shutil import numpy as np from sklearn.cluster import DBSCAN from sklearn.cluster import KMeans from sklearn import metrics from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.neighbors import NearestNeighbors from scipy.spatial import Conve...
mit
poryfly/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
bmcfee/librosa
docs/examples/plot_pcen_stream.py
2
3939
# coding: utf-8 # Code source: Brian McFee # License: ISC """ ============== PCEN Streaming ============== This notebook demonstrates how to use streaming IO with `librosa.pcen` to do dynamic per-channel energy normalization on a spectrogram incrementally. This is useful when processing long audio files that are too ...
isc
chenyyx/scikit-learn-doc-zh
doc/zh/tutorial/text_analytics/solutions/exercise_02_sentiment.py
104
3139
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
gpl-3.0
Messaoud-Boudjada/dipy
doc/sphinxext/docscrape_sphinx.py
154
7759
import re, inspect, textwrap, pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plots = config.get('use_plots', False) NumpyDocString.__init__(self, docstring, config=config) ...
bsd-3-clause
fabioticconi/scikit-learn
sklearn/tests/test_calibration.py
62
12288
# 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
kmclaugh/fastai_courses
deeplearning2/utils2.py
7
4587
import math, keras, datetime, pandas as pd, numpy as np, keras.backend as K, threading, json, re, collections import tarfile, tensorflow as tf, matplotlib.pyplot as plt, xgboost, operator, random, pickle, glob, os, bcolz import shutil, sklearn, functools, itertools, scipy from PIL import Image from concurrent.futures i...
apache-2.0
CPFL/gdev
compiler/as/ptx2sass/hydrazine/python/Plot.py
3
8644
################################################################################ ## \file RunRegression.py ## \author Gregory Diamos ## \date July 19, 2008 ## \brief A class and script for parsing a list of data elements and ## identifiers, and plotting them using Matplotlib ###########################################...
mit
bondenitrr2015/Machine-Learning
titanic_quick_1.py
1
3407
# This is the titanic data-set problem # Current Architecture is 3-5-3-1 import pandas as pd import tensorflow as tf # Step 1 - Load and parse the data # Importing of data titanic_train = pd.read_csv('/Users/path/to/train.csv') titanic_test = pd.read_csv('/Users/path/to/test.csv') titanic_test_result = pd.read_csv('/...
mit
colinbrislawn/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
pprett/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
mahak/spark
python/pyspark/pandas/tests/data_type_ops/test_null_ops.py
7
5691
# # 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
Kirubaharan/hydrology
stats/distribution_check.py
1
11192
#!/usr/bin/env python #title :distribution_checkX.py #description :Checks a sample against 80 distributions by applying the Kolmogorov-Smirnov test. #author :Andre Dietrich #email :dietrich@ivs.cs.uni-magdeburg.de #date :07.10.2014 #version :0.1 #usage :pyth...
gpl-3.0
wzbozon/scikit-learn
examples/model_selection/plot_precision_recall.py
249
6150
""" ================ Precision-Recall ================ Example of Precision-Recall metric to evaluate classifier output quality. In information retrieval, precision is a measure of result relevancy, while recall is a measure of how many truly relevant results are returned. A high area under the curve represents both ...
bsd-3-clause
ScreamingUdder/mantid
scripts/HFIR_4Circle_Reduction/mplgraphicsview.py
3
54538
#pylint: disable=invalid-name,too-many-public-methods,too-many-arguments,non-parent-init-called,R0902,too-many-branches,C0302 from __future__ import (absolute_import, division, print_function) from six.moves import range import os import numpy as np from PyQt4 import QtGui from PyQt4.QtCore import pyqtSignal from mat...
gpl-3.0
econ-ark/HARK
examples/Gentle-Intro/Gentle-Intro-To-HARK.py
1
20111
# --- # jupyter: # jupytext: # cell_metadata_filter: collapsed,code_folding # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 1.2.4 # kernelspec: # display_name: econ-ark-3.8 # language: ...
apache-2.0
stevenzhang18/Indeed-Flask
lib/pandas/io/tests/test_json/test_pandas.py
9
34431
# pylint: disable-msg=W0612,E1101 from pandas.compat import range, lrange, StringIO, OrderedDict import os import numpy as np from pandas import (Series, DataFrame, DatetimeIndex, Timestamp, CategoricalIndex, read_json, compat) from datetime import timedelta import pandas as pd from pandas.util.te...
apache-2.0
bendudson/freegs
freegs/shaped_coil.py
1
7126
""" Define a class of coil which contains a uniform current density over a shaped region. License ------- Copyright 2019 Ben Dudson, University of York. Email: benjamin.dudson@york.ac.uk This file is part of FreeGS. FreeGS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser ...
lgpl-3.0
rexshihaoren/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
WendyLiuLab/elisascripts
elisa/id_singlets.py
2
7486
import argparse import numpy as np import pandas as pd import scipy.ndimage as img import scipy.spatial as spatial from tifffile import tifffile as tf from elisa.annotate import surface_from_array, annotate_cells, PIL_from_surface from typing import Callable, Union # noqa:F401 from typing.io import BinaryIO # noqa...
bsd-3-clause
vybstat/scikit-learn
sklearn/metrics/cluster/__init__.py
312
1322
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
nicproulx/mne-python
tutorials/plot_artifacts_correction_ica.py
3
11598
""" .. _tut_artifacts_correct_ica: Artifact Correction with ICA ============================ ICA finds directions in the feature space corresponding to projections with high non-Gaussianity. We thus obtain a decomposition into independent components, and the artifact's contribution is localized in only a small numbe...
bsd-3-clause
cvdlab/lar-running-demo
py/computation/pngstack2array3d.py
3
4009
""" To import a stack of PNG images into a 3D array, with denoising and color quatization. Return a scipy ndarray. """ import sys import numpy as np from numpy import reshape,array from scipy.cluster.vq import kmeans,vq import png import matplotlib.pyplot as plt from scipy import ndimage import struct import os # Def...
mit
themrmax/scikit-learn
examples/linear_model/plot_lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/utils/setup.py
296
2884
import os from os.path import join from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): import numpy from numpy.distutils.misc_util import Configuration config = Configuration('utils', parent_package, top_path) config.add_subpackage('sparsetools') ...
bsd-3-clause
dsm054/pandas
pandas/io/formats/excel.py
1
24633
"""Utilities for conversion to writer-agnostic Excel representation """ import itertools import re import warnings import numpy as np from pandas.compat import reduce from pandas.core.dtypes import missing from pandas.core.dtypes.common import is_float, is_scalar from pandas.core.dtypes.generic import ABCMultiIndex...
bsd-3-clause
toros-astro/ProperImage
drafts/test_propersubtract.py
1
3915
#!/usr/bin/env python # -*- coding: utf-8 -*- # # test_propersubtract.py # # Copyright 2016 Bruno S <bruno@oac.unc.edu.ar> # # This file is part of ProperImage (https://github.com/toros-astro/ProperImage) # License: BSD-3-Clause # Full Text: https://github.com/toros-astro/ProperImage/blob/master/LICENSE.txt # import ...
bsd-3-clause
arabenjamin/scikit-learn
examples/ensemble/plot_forest_importances_faces.py
403
1519
""" ================================================= Pixel importances with a parallel forest of trees ================================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more impor...
bsd-3-clause
kkk669/mxnet
example/rcnn/rcnn/core/tester.py
25
10193
# 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
bioinfo-core-BGU/neatseq-flow_modules
neatseq_flow_modules/Liron/Snippy_module/MLST_parser.py
3
8400
import os, re import argparse import pandas as pd parser = argparse.ArgumentParser(description='Pars MLST') parser.add_argument('-M', type=str, help='MetaData file') parser.add_argument('-F', type=str, help='Merged MLST typing file') parser.add_argument('-O' , type=str, defaul...
gpl-3.0
roim/PyTranscribe
plotting/hps.py
1
3155
# Copyright 2015 Rodrigo Roim Ferreira # # 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. # # This program is distributed...
gpl-3.0
carrillo/scikit-learn
examples/covariance/plot_outlier_detection.py
235
3891
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates two different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assumin...
bsd-3-clause
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/matplotlib/tests/test_axes.py
9
108913
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import xrange from nose.tools import assert_equal, assert_raises, assert_false, assert_true import datetime import numpy as np from numpy import ma import matplotlib from matplotlib...
gpl-2.0
toastedcornflakes/scikit-learn
sklearn/metrics/pairwise.py
4
46488
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
manderelee/csc2521_final
scripts/tsne_3viz.py
1
1227
import matplotlib.pyplot as plt import sys from mpl_toolkits.mplot3d import Axes3D from utils import * from sklearn.manifold import TSNE if __name__ == "__main__": if len(sys.argv) != 3: print ("python pca_viz.py /path/to/pos/ex /path/to/neg/ex") else: # Truncate data to equalize number of exam...
mpl-2.0
vshtanko/scikit-learn
examples/svm/plot_svm_scale_c.py
223
5375
""" ============================================== Scaling the regularization parameter for SVCs ============================================== The following example illustrates the effect of scaling the regularization parameter when using :ref:`svm` for :ref:`classification <svm_classification>`. For SVC classificati...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sympy/physics/quantum/state.py
4
14797
"""Dirac notation for states.""" from sympy import Expr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.qexpr import ( QExpr, dispatch_method ) __all__ = [ 'KetBase', 'BraBase', 'StateBase', 'State', 'Ket', 'Bra', 'TimeDepState', 'TimeDepBra', ...
agpl-3.0
chianwei123/visualizer
context_switch.py
1
2487
#!/usr/bin/env python import matplotlib.pyplot as plt log = open('log', 'r') lines = log.readlines() # prepare for plotting fig, ax = plt.subplots() bar = 5 label = [] label_axes = [] context_switch = [] tasks = {} for line in lines: line = line.strip() inst, args = line.split(' ', 1) if inst == 'task': id,...
bsd-2-clause
awni/tensorflow
tensorflow/contrib/skflow/python/skflow/tests/test_base.py
1
5208
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/widgets/externalshell/start_ipython_kernel.py
2
6504
# -*- coding: utf-8 -*- # # Copyright © 2009-2012 Pierre Raybaut # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """Startup file used by ExternalPythonShell exclusively for IPython kernels (see spyderlib/widgets/externalshell/pythonshell.py)""" import sys import os.path as osp ...
gpl-3.0