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
skyfallen/Kaggle-Diabetic-Retinopathy-Detection
Code/svm/svm_test.py
1
1997
from sklearn.ensemble import RandomForestClassifier import numpy as np import os from scipy.misc import imsave,imread from sklearn.grid_search import GridSearchCV from datetime import datetime import cPickle def load_subset(subset): images_labels = {} path_to_images = '/storage/hpc_anna/Kaggle_DRD/imag...
mit
ianmtaylor1/pacal
pacal/depvars/copulas.py
1
35256
"""Set of copulas different types""" from pacal.integration import * from pacal.interpolation import * from matplotlib.collections import PolyCollection import pacal.distr #from pacal import * from pacal.segments import PiecewiseDistribution, MInfSegment, PInfSegment, Segment, _segint from pacal.segments import Piece...
gpl-3.0
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/tseries/tests/test_converter.py
13
5611
from datetime import datetime, time, timedelta, date import sys import os import nose import numpy as np from numpy.testing import assert_almost_equal as np_assert_almost_equal from pandas import Timestamp, Period from pandas.compat import u import pandas.util.testing as tm from pandas.tseries.offsets import Second, ...
gpl-2.0
akunze3/pytrajectory
pytrajectory/splines.py
1
30029
import numpy as np import sympy as sp import scipy.sparse as sparse from scipy.sparse.linalg import spsolve from log import logging # DEBUG from IPython import embed as IPS class Spline(object): ''' This class provides a representation of a cubic spline function. It simultaneously enables access to...
bsd-3-clause
jstoxrocky/statsmodels
statsmodels/examples/ex_kernel_regression_dgp.py
34
1202
# -*- coding: utf-8 -*- """ Created on Sun Jan 06 09:50:54 2013 Author: Josef Perktold """ from __future__ import print_function if __name__ == '__main__': import numpy as np import matplotlib.pyplot as plt from statsmodels.nonparametric.api import KernelReg import statsmodels.sandbox.nonparametric...
bsd-3-clause
mne-tools/mne-tools.github.io
0.22/_downloads/0671cb4b44003efe690d32b13faaff5d/plot_seeg.py
10
7388
""" .. _tut_working_with_seeg: ====================== Working with sEEG data ====================== MNE supports working with more than just MEG and EEG data. Here we show some of the functions that can be used to facilitate working with stereoelectroencephalography (sEEG) data. This example shows how to use: - sEE...
bsd-3-clause
justinfinkle/pydiffexp
scripts/analyze_sim_results.py
1
3040
import ast import numpy as np import pandas as pd from pydiffexp import get_scores, DEResults from pydiffexp.analyze import pairwise_corr from scipy import stats calc_correlation = False sim_data = pd.read_csv('intermediate_data/sim_stats_censoredtimes.tsv', sep='\t', index_col=[0, 1, 2], header=[0,1]) dea = pd.read_...
gpl-3.0
piem/aubio
python/demos/demo_specdesc.py
5
2580
#! /usr/bin/env python import sys import numpy as np from aubio import source, pvoc, specdesc win_s = 512 # fft size hop_s = win_s // 4 # hop size if len(sys.argv) < 2: print("Usage: %s <filename> [samplerate]" % sys.argv[0]) sys.exit(1) filename = sys.argv[1] samplerate = 0 if len...
gpl-3.0
shaneknapp/spark
python/pyspark/pandas/usage_logging/__init__.py
16
8972
# # 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
lily-zhangying/find_best_mall
recomendation system/filter_demo_data.py
3
486609
import csv #from mall_count_dataset import dict import pandas as pd dict = {"test mall": {"footwear": 3, "fasion wholesale": 2, "restaurant": 2, "guest services": 1, "eyewear":2},"turtle creek mall": {"hair care": 1, "shoes": 1, "restaurant": 1, "beauty products": 1, "plus size clothing": 1, "women's clothing": 3, "chi...
mit
nelango/ViralityAnalysis
model/lib/sklearn/gaussian_process/tests/test_gaussian_process.py
267
6813
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Licence: BSD 3 clause from nose.tools import raises from nose.tools import assert_true import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process ...
mit
quantrocket-llc/quantrocket-client
quantrocket/history.py
1
19663
# Copyright 2017 QuantRocket - 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
CheMcCandless/hyperopt-sklearn
hpsklearn/components.py
4
26520
import numpy as np import sklearn.svm import sklearn.ensemble import sklearn.neighbors import sklearn.decomposition import sklearn.preprocessing import sklearn.neural_network import sklearn.linear_model import sklearn.feature_extraction.text import sklearn.naive_bayes from hyperopt.pyll import scope, as_apply from hype...
bsd-3-clause
GitYiheng/reinforcement_learning_test
test01_cartpendulum/Feb/t8_cartpole_mc_plot.py
1
7022
import tensorflow as tf # neural network for function approximation import gym # environment import numpy as np # matrix operation and math functions from gym import wrappers import gym_morph # customized environment for cart-pole import matplotlib.pyplot as plt import time # Hyperparameters RANDOM_NUMBER_SEED = 2 # ...
mit
akionakamura/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
pompiduskus/scikit-learn
examples/plot_kernel_ridge_regression.py
230
6222
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
kjung/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
davemccormick/pyAnimalTrack
src/pyAnimalTrack/ui/Controller/DeadReckoningWindow.py
1
4620
import os from PyQt5 import uic import matplotlib.pyplot as plt import pandas as pd from PyQt5.QtWidgets import QMainWindow, QFileDialog from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from pyAnimalTrack.backend.deadreckoning.dead_reckoning import DeadReckoning from pyAnimalTrack.back...
gpl-3.0
samuel1208/scikit-learn
sklearn/qda.py
140
7682
""" Quadratic Discriminant Analysis """ # Author: Matthieu Perrot <matthieu.perrot@gmail.com> # # License: BSD 3 clause import warnings import numpy as np from .base import BaseEstimator, ClassifierMixin from .externals.six.moves import xrange from .utils import check_array, check_X_y from .utils.validation import ...
bsd-3-clause
plugaai/pytrthree
pytrthree/utils.py
1
5462
import datetime import io import logging import os import re import sys import time from zeep.exceptions import Fault import pandas as pd import yaml from zeep.xsd.valueobjects import CompoundValue logger = logging.getLogger('pytrthree') def make_logger(name, config=None) -> logging.Logger: log_path = os.path.e...
mit
RobertABT/heightmap
build/matplotlib/examples/pylab_examples/contourf_log.py
9
1350
''' Demonstrate use of a log color scale in contourf ''' from matplotlib import pyplot as P import numpy as np from numpy import ma from matplotlib import colors, ticker, cm from matplotlib.mlab import bivariate_normal N = 100 x = np.linspace(-3.0, 3.0, N) y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # A ...
mit
shoyer/xarray
xarray/tests/test_computation.py
1
40215
import functools import operator import pickle import numpy as np import pandas as pd import pytest from numpy.testing import assert_array_equal import xarray as xr from xarray.core.computation import ( _UFuncSignature, apply_ufunc, broadcast_compat_data, collect_dict_values, join_dict_keys, o...
apache-2.0
jorge2703/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
bthcode/cmake_scipy_ctypes_example
src/python/plotting_utils.py
2
1927
import matplotlib ################################################################################ # Utility functions intended for use by other functions an classes in this module ################################################################################ def get_plottable( input_axis, object_type ): '''Get...
bsd-3-clause
anntzer/scikit-learn
examples/svm/plot_separating_hyperplane_unbalanced.py
44
2463
""" ================================================= SVM: Separating hyperplane for unbalanced classes ================================================= Find the optimal separating hyperplane using an SVC for classes that are unbalanced. We first find the separating plane with a plain SVC and then plot (dashed) the ...
bsd-3-clause
xuewei4d/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
68
2848
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009 [1]_. The loss function used is binomial deviance. Regularization via shrinkage (`...
bsd-3-clause
csgwon/dl-pipeline
train/tools.py
1
1551
# -*- coding: utf-8 -*- import pandas as pd import numpy as np name_data = pd.read_csv('data/names/names_train_new.csv', sep='\t') name_data = name_data.dropna() labels = ['Arabic', 'Chinese', 'Czech', 'Dutch', 'English', 'French', 'German', 'Greek', 'Irish', 'Italian', 'Japanese', 'Korean', 'Polish', 'Portuguese', ...
apache-2.0
CodeMonkeyJan/hyperspy
hyperspy/drawing/_widgets/label.py
3
3731
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
fyffyt/scikit-learn
sklearn/externals/joblib/parallel.py
79
35628
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
bsd-3-clause
mfjb/scikit-learn
sklearn/cluster/tests/test_bicluster.py
226
9457
"""Testing for Spectral Biclustering methods""" import numpy as np from scipy.sparse import csr_matrix, issparse from sklearn.grid_search import ParameterGrid from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from...
bsd-3-clause
3manuek/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== 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
ChanderG/scikit-learn
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
alphaBenj/zipline
zipline/assets/synthetic.py
3
9273
from itertools import product from string import ascii_uppercase import pandas as pd from pandas.tseries.offsets import MonthBegin from six import iteritems from .futures import CME_CODE_TO_MONTH def make_rotating_equity_info(num_assets, first_start, frequ...
apache-2.0
golden1232004/webrtc_new
tools/cpu/cpu_mon.py
6
2057
#!/usr/bin/env python # # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All...
gpl-3.0
Garrett-R/scikit-learn
examples/mixture/plot_gmm_classifier.py
250
3918
""" ================== GMM classification ================== Demonstration of Gaussian mixture models for classification. See :ref:`gmm` for more information on the estimator. Plots predicted labels on both training and held out test data using a variety of GMM classifiers on the iris dataset. Compares GMMs with sp...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/pandas/core/reshape/melt.py
1
14965
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 import numpy as np from pandas.core.dtypes.common import is_list_like from pandas import compat from pandas.core.arrays import Categorical from pandas.core.dtypes.generic import ABCMultiIndex from pandas.core.frame import _shared_docs from panda...
mit
tomolaf/trading-with-python
lib/interactivebrokers.py
77
18140
""" Copyright: Jev Kuznetsov Licence: BSD Interface to interactive brokers together with gui widgets """ import sys # import os from time import sleep from PyQt4.QtCore import (SIGNAL, SLOT) from PyQt4.QtGui import (QApplication, QFileDialog, QDialog, QVBoxLayout, QHBoxLayout, QDialogButtonBox, ...
bsd-3-clause
kpj/OsciPy
old/reconstruction.py
1
7299
""" Try to reconstruct system parameters from observed solutions """ import sys import numpy as np import pandas as pd import networkx as nx import seaborn as sns import matplotlib as mpl import matplotlib.pylab as plt from tqdm import tqdm, trange from utils import DictWrapper as DW, save, solve_system from inves...
mit
djnugent/mavlink
pymavlink/tools/mavgpslag.py
43
3446
#!/usr/bin/env python ''' calculate GPS lag from DF log ''' import sys, time, os from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--plot", action='store_true', default=False, help="plot errors") parser.add_argument("--minspeed", type=float, default=6, help="minimu...
lgpl-3.0
samuel1208/scikit-learn
sklearn/manifold/tests/test_t_sne.py
162
9771
import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises_regexp ...
bsd-3-clause
aimalz/qp
docs/desc-0000-qp-photo-z_approximation/research/production_script.py
1
3763
def do_case(i): print(cases[i]) (dirname, n_pdfs, n_params) = cases[i] (z_low, z_high) = datasets[dirname]['z_ends'] z = np.arange(z_low, z_high, 0.01, dtype='float') z_range = z_high - z_low delta_z = z_range / len(z) with open(datasets[dirname]['filename'], 'rb') as data_file: li...
mit
anand-c-goog/tensorflow
tensorflow/examples/tutorials/input_fn/boston.py
19
2448
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
ctogle/msched
src/msched/controllers/user.py
1
4035
import msched.core.settings as st import msched.core.tools as tl import msched.core.ctree as ct import msched.core.stage as sg import msched.core.controller as cn import matplotlib.pyplot as plt import time,random,mpi4py from mpi4py import MPI ##########################################################################...
mit
ConeyLiu/spark
python/pyspark/sql/session.py
6
29784
# # 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
wmvanvliet/mne-python
examples/time_frequency/plot_compute_source_psd_epochs.py
25
3523
""" ===================================================================== Compute Power Spectral Density of inverse solution from single epochs ===================================================================== Compute PSD of dSPM inverse solution on single trial epochs restricted to a brain label. The PSD is compu...
bsd-3-clause
jcli1023/NSERC-eng234
sepideh_nn.py
1
4560
#!/usr/bin/env python3 import pandas as pd import tensorflow as tf import numpy as np import sys from datetime import datetime # Constants CLASSES = {"Half-Circle": 0, "Line": 1, "Sine": 2} LEARNING_RATE = 0.01 NUMBER_OF_EPOCHS = 1000 REGULAR_DATASET = "0" REGULAR_DELTA_DATASET = "1" ORIENTATIONS_DATASET = "2" ORIEN...
gpl-3.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/linear_model/tests/test_least_angle.py
20
26139
import warnings import numpy as np from scipy import linalg from sklearn.model_selection import train_test_split from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from ...
mit
ctralie/SlidingWindowVideoTDA
Penn_Action/getActions.py
1
1097
import numpy as np import matplotlib.pyplot as plt import scipy.io as sio import os import subprocess if __name__ == '__main__': files = os.listdir('labels') actions = {} for f in files: s = "labels/%s"%f x = sio.loadmat(s) a = x['action'][0] if not a in actions: ...
apache-2.0
olebole/astrometry.net
sdss/dr9.py
2
1887
# This file is part of the Astrometry.net suite. # Licensed under a 3-clause BSD style license - see LICENSE from __future__ import print_function from __future__ import absolute_import from .common import * from .dr8 import * class DR9(DR8): def __init__(self, **kwargs): ''' Useful kwargs: ...
bsd-3-clause
choderalab/openpathsampling
openpathsampling/analysis/tis/flux.py
3
14062
import collections import openpathsampling as paths from openpathsampling.netcdfplus import StorableNamedObject import pandas as pd import numpy as np from .core import MultiEnsembleSamplingAnalyzer def flux_matrix_pd(flux_matrix, sort_method="default"): """Convert dict form of flux to a pandas.Series Parame...
lgpl-2.1
l8orre/XG8
nxtPwt/nxtModels.py
1
125431
#from PyQt4.QtCore import QObject ,QAbstractTableModel, pyqtSignal, pyqtSlot, SIGNAL, QModelIndex , Qt from PyQt4.Qt import * from PyQt4.QtGui import QColor, QPixmap, QIcon import time from PyQt4.QtCore import QObject , pyqtSignal, pyqtSlot, SIGNAL from copy import copy import numpy as np from nxtPwt.nxtApiPr...
mit
ominux/scikit-learn
doc/sphinxext/numpy_ext/docscrape_sphinx.py
22
7924
import re, inspect, textwrap, pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots = config.get('use_plots', False) NumpyDoc...
bsd-3-clause
alvason/stochastic-evolution
code/stochastic_diffusion.py
2
9368
# coding: utf-8 # # Stochastic infectious pulse # https://github.com/alvason/stochastic-infectious-pulse # # ### Stochastic version for evolutionary insights # In[24]: ''' author: Alvason Zhenhua Li date: 07/07/2015 ''' get_ipython().magic(u'matplotlib inline') import numpy as np import matplotlib.pyplot as plt...
gpl-2.0
r39132/airflow
tests/contrib/operators/test_hive_to_dynamodb_operator.py
7
5053
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
ASU-CompMethodsPhysics-PHY494/final-rendezvous-with-ramageddon
resources/mdlj.py
2
11667
#!/usr/bin/env python # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # Molecular Dynamics of the Lennard Jones Fluid # Skeleton code --- incomplete. # # Written by Oliver Beckstein for ASU PHY494 # http://asu-compmethodsphysics-phy494.github.io/ASU-PH...
gpl-3.0
tomlof/scikit-learn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
toobaz/pandas
pandas/tests/indexes/timedeltas/test_partial_slicing.py
2
3145
import numpy as np import pytest import pandas as pd from pandas import Series, Timedelta, timedelta_range from pandas.util.testing import assert_series_equal class TestSlicing: def test_slice_keeps_name(self): # GH4226 dr = pd.timedelta_range("1d", "5d", freq="H", name="timebucket") asse...
bsd-3-clause
ndaniels/Ammolite
scripts/overlap_conversion.py
2
1724
import matplotlib.pyplot as plt from pylab import polyfit, show import sys def parse( filename): f = open( filename) lineNum = 0; molOverlap = [] repOverlap = [] molTanimoto = [] repTanimoto = [] rawMolOverlap = [] rawRepOverlap = [] rawMolTanimoto = [] rawRepTanimoto = [] for line in f: if lineNum >=...
gpl-2.0
raghavrv/scikit-learn
examples/ensemble/plot_voting_probas.py
316
2824
""" =========================================================== Plot class probabilities calculated by the VotingClassifier =========================================================== Plot the class probabilities of the first sample in a toy dataset predicted by three different classifiers and averaged by the `VotingC...
bsd-3-clause
rishikksh20/scikit-learn
examples/text/document_clustering.py
32
8526
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
bsd-3-clause
bsipocz/AstroHackWeek2015
day3-machine-learning/plots/plot_interactive_tree.py
13
2539
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs from sklearn.tree import DecisionTreeClassifier from sklearn.externals.six import StringIO # doctest: +SKIP from sklearn.tree import export_graphviz from scipy.misc import imread from scipy import ndimage import os GRAPHVIS_P...
gpl-2.0
OshynSong/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
57
8062
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
xray/xray
doc/gallery/plot_rasterio.py
4
1486
""" .. _recipes.rasterio: ================================= Parsing rasterio's geocoordinates ================================= Converting a projection's cartesian coordinates into 2D longitudes and latitudes. These new coordinates might be handy for plotting and indexing, but it should be kept in mind that a grid ...
apache-2.0
unnati-xyz/droidcon-twitter-analytics
geeksrus/analytics/wordcloud.py
1
6714
from datetime import datetime import traceback import re from operator import itemgetter import pandas as pd import nltk from nltk.corpus import stopwords from geeksrus import LOGGER from geeksrus.utils.dbconn import read_mongo, write_mongo, read_mongo_projection, find_and_sort_desc from geeksrus import dbcon from ge...
mit
atechnicolorskye/Stratospheric-UAV-Simulator
gfs_data_simulator_local.py
1
100831
""" gfs_data_simulator_local.py GFS Local Data Simulator DESCRIPTION ----------- GFS Data Local Simulator Module: This module simulates the descent of a UAV through multiple atmopsheric layers. The properties of the layers are obtained from National Oceanic and Atmospheric Administration's (NOAA) Global Forecast Sys...
gpl-2.0
beiko-lab/gengis
bin/Lib/site-packages/matplotlib/testing/jpl_units/__init__.py
6
3064
#======================================================================= """ This is a sample set of units for use with testing unit conversion of matplotlib routines. These are used because they use very strict enforcement of unitized data which will test the entire spectrum of how unitized data might be used (it is...
gpl-3.0
rseubert/scikit-learn
benchmarks/bench_covertype.py
154
7296
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
pbenya/office-nfl-pool
extra_code/make_datasheet.py
4
3996
""" make_datasheet.py ~~~~~~~~~~~~~~~~~~ A one-sheet log for the 2015 season. Read in the CSV in '../data/nfl_season2015.csv' and write out to '../excel_files/season2015_datasheet.xlsx' The input file '../data/nfl_season2015.csv' looks like: Season,Category,Week,Team,Opponent,AtHome,Points,PointsAllowed,Date,Stadiu...
mit
cauchycui/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
pianomania/scikit-learn
examples/linear_model/plot_logistic_l1_l2_sparsity.py
384
2601
""" ============================================== L1 Penalty and Sparsity in Logistic Regression ============================================== Comparison of the sparsity (percentage of zero coefficients) of solutions when L1 and L2 penalty are used for different values of C. We can see that large values of C give mo...
bsd-3-clause
RaviSoji/probabilistic_LDA
tests/test_model/test_model_integration.py
1
6430
# Copyright 2017 Ravi Sojitra. 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
Mic92/tthread
src/inspector/graph.py
2
12231
import sys import json from collections import defaultdict import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec, ticker import matplotlib FIELDS = [ "times", # "log_sizes", # "user_time", # "alignment-faults", # 'branch-instru...
gpl-2.0
shikhardb/scikit-learn
sklearn/datasets/species_distributions.py
24
7871
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
COSMOGRAIL/PyCS
pycs/tdc/metrics.py
1
29385
""" Functions related to the TDC metrics """ import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec ############## Here, we work with estimates objects ############## def fN(estimates): """ @param estimates: list of Estimate objects @return: length of the estimates list """ ...
gpl-3.0
jimcunderwood/MissionPlanner
Lib/site-packages/numpy/core/function_base.py
82
5474
__all__ = ['logspace', 'linspace'] import numeric as _nx from numeric import array def linspace(start, stop, num=50, endpoint=True, retstep=False): """ Return evenly spaced numbers over a specified interval. Returns `num` evenly spaced samples, calculated over the interval [`start`, `stop` ]. Th...
gpl-3.0
GitYiheng/reinforcement_learning_test
test03_monte_carlo/t27_rlvps04_hn24_clr0p01.py
1
7659
import tensorflow as tf # neural network for function approximation import gym # environment import numpy as np # matrix operation and math functions from gym import wrappers import gym_morph # customized environment for cart-pole import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import time star...
mit
pratapvardhan/pandas
pandas/io/parsers.py
3
123349
""" Module contains tools for processing files into DataFrames or other objects """ from __future__ import print_function from collections import defaultdict import re import csv import sys import warnings import datetime from textwrap import fill import numpy as np from pandas import compat from pandas.compat import...
bsd-3-clause
DTOcean/dtocean-core
dtocean_core/utils/moorings.py
1
21601
# -*- coding: utf-8 -*- # Copyright (C) 2016-2018 Mathew Topper # # 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...
gpl-3.0
miloharper/neural-network-animation
matplotlib/projections/polar.py
11
27444
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import math import warnings import numpy as np import matplotlib rcParams = matplotlib.rcParams from matplotlib.axes import Axes import matplotlib.axis as maxis from matplotlib import cbook from m...
mit
hovo1990/deviser
generator/util/generateCode.py
1
21616
#!/usr/bin/env python # # @file generateCode.py # @brief function for generating all code files # @author Frank Bergmann # @author Sarah Keating # # <!-------------------------------------------------------------------------- # # Copyright (c) 2013-2015 by the California Institute of Technology # (California, US...
lgpl-2.1
apmoore1/semeval
svrs/feature_extractors/Tokeniser.py
1
1328
from semeval import helper as helper from sklearn.base import TransformerMixin from sklearn.base import BaseEstimator class Tokeniser(BaseEstimator, TransformerMixin): def __init__(self, ngram_range=(1,1), tokeniser_func=helper.unitok_tokens): self.ngram_range = ngram_range self.tokeniser_func ...
gpl-3.0
Lawrence-Liu/scikit-learn
sklearn/metrics/tests/test_classification.py
83
49782
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import la...
bsd-3-clause
gVallverdu/myScripts
VASP/moduleDOS.py
1
10347
#!/usr/bin/env python3 # -*-coding:utf-8 -*- """ Apply scofield cross sections to a DOS Journal of Electron Spectroscopy and Related Phenomena, 8 (1976) 129-137) """ import numpy as np import matplotlib.pyplot as plt from pymatgen.electronic_structure.core import Spin, OrbitalType from pymatgen.io.vasp.outputs import...
gpl-2.0
midnightradio/gensim
docs/src/gallery/tutorials/run_word2vec.py
6
25525
r""" Word2Vec Model ============== Introduces Gensim's Word2Vec model and demonstrates its use on the `Lee Evaluation Corpus <https://hekyll.services.adelaide.edu.au/dspace/bitstream/2440/28910/1/hdl_28910.pdf>`_. """ import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging...
gpl-3.0
OpenPIV/openpiv-python
openpiv/test/test_windef.py
2
5243
# -*- coding: utf-8 -*- """ Created on Fri Oct 4 14:33:21 2019 @author: Theo """ import numpy as np from openpiv import windef from openpiv.test import test_process from openpiv import preprocess import pathlib import os import matplotlib.pyplot as plt frame_a, frame_b = test_process.create_pair(image_size=256) ...
gpl-3.0
PythonCharmers/bokeh
examples/interactions/interactive_bubble/gapminder.py
20
4375
import pandas as pd from jinja2 import Template from bokeh.browserlib import view from bokeh.models import ( ColumnDataSource, Plot, Circle, Range1d, LinearAxis, HoverTool, Text, SingleIntervalTicker, ) from bokeh.models.actions import Callback from bokeh.models.widgets import Slider from bokeh.palettes i...
bsd-3-clause
nextgenusfs/amptk
amptk/filter.py
2
31579
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import os import argparse import math from Bio import SeqIO from natsort import natsorted import pandas as pd import numpy as np import amptk.amptklib as lib class colr(object...
bsd-2-clause
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/matplotlib/pyplot.py
10
120496
# Note: The first part of this file can be modified in place, but the latter # part is autogenerated by the boilerplate.py script. """ Provides a MATLAB-like plotting framework. :mod:`~matplotlib.pylab` combines pyplot with numpy into a single namespace. This is convenient for interactive work, but for programming it ...
gpl-2.0
hongchhe/myhadoop
spark/scripts/mllibTest.py
1
5324
import json import sys import traceback def getDataFrameFromSource(jsonData, hdfsHost="spark-master0", hdfsPort="9000", rootFolder="users"): """ get spark DataFrame once the input data source is valid. Notes: hdfsHost, hdfsPort, rootFolder are available if jsonData["sourceType"] is hdfs and the hdfsUr...
apache-2.0
sgagnon/lyman-tools
roi/extract_local_max.py
1
4059
#! /usr/bin/env python """ This script finds clusters in group FFX (MNI space, smoothed), and then outputs the peaks within a specified ROI as a csv file. """ import numpy as np import glob import os import os.path as op from scipy import stats import nibabel as nib import pandas as pd from moss import locator fro...
bsd-2-clause
0xSteve/detection_learning
P_model/Visualizations/UUAV_depth_finding/analytics.py
1
4407
'''A script that gathers analytical data regarding the automata.''' from lrp import Linear_Reward_Penalty as LRP from mse import MSE from environment import Environment from pinger import Pinger import numpy as np # import matplotlib.pyplot as plt import plotly.plotly as py import plotly.graph_objs as go # import tune_...
apache-2.0
anmolshkl/oppia-ml
scikit_stress_test.py
1
1319
from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn import metrics from sklearn import svm import numpy as np import os import random import timeit import yaml import load_data import utilities def main(): # Load data X_train, ...
apache-2.0
anirudhjayaraman/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
eggplantbren/DNest4
code/Templates/Builder/coal.py
1
2682
import numpy as np import matplotlib.pyplot as plt import dnest4.builder as bd # The data, as a dictionary data = {} data["t"] = np.array([1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, ...
mit
gmnamra/python-image-utils
gabor_spaces.py
1
2017
#!/usr/bin/env python ''' gabor_threads.py ========= Sample demonstrates: - use of multiple Gabor filter convolutions to get Fractalius-like image effect (http://www.redfieldplugins.com/filterFractalius.htm) - use of python threading to accelerate the computation Usage ----- gabor_threads.py [image filename] ''' ...
mit
chatcannon/numpy
numpy/core/function_base.py
30
12092
from __future__ import division, absolute_import, print_function import warnings import operator from . import numeric as _nx from .numeric import (result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError,asanyarray) __all__ = ['logspace', 'linspace', 'geomspace'] def _index_deprecate(...
bsd-3-clause
schoolie/bokeh
bokeh/plotting/tests/test_figure.py
4
11797
from __future__ import absolute_import import unittest import pytest import pandas as pd from bokeh.core.properties import value from bokeh.models import ( BoxZoomTool, ColumnDataSource, LassoSelectTool, Legend, LinearAxis, PanTool, ResetTool, ResizeTool, Title, ) import bokeh.plot...
bsd-3-clause
zooniverse/aggregation
active_weather/old/gold_standard.py
1
1654
# from __future__ import print_function # from active_weather import ActiveWeather import matplotlib.pyplot as plt import cv2 import numpy as np import sobel_transform import csv directory = "/home/ggdhines/Databases/old_weather/aligned_images/Bear/1940/" # min_x,max_x,min_y,max_y region_bounds = (559,3282,1276,2097)...
apache-2.0
mcdaniel67/sympy
sympy/plotting/tests/test_plot.py
43
8577
from sympy import (pi, sin, cos, Symbol, Integral, summation, sqrt, log, oo, LambertW, I, meijerg, exp_polar, Max, Piecewise) from sympy.plotting import (plot, plot_parametric, plot3d_parametric_line, plot3d, plot3d_parametric_surface) from sympy.plotting.plot import unset...
bsd-3-clause
mhdella/scikit-learn
examples/cluster/plot_kmeans_assumptions.py
270
2040
""" ==================================== Demonstration of k-means assumptions ==================================== This example is meant to illustrate situations where k-means will produce unintuitive and possibly unexpected clusters. In the first three plots, the input data does not conform to some implicit assumptio...
bsd-3-clause