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 |
|---|---|---|---|---|---|
DistrictDataLabs/yellowbrick | yellowbrick/model_selection/validation_curve.py | 1 | 14338 | # yellowbrick.model_selection.validation_curve
# Implements a visual validation curve for a hyperparameter.
#
# Author: Benjamin Bengfort
# Created: Sat Mar 31 06:27:28 2018 -0400
#
# Copyright (C) 2018 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: validation_curve.py [c5355ee] benjamin@b... | apache-2.0 |
rzzzwilson/morse | morse/gui.py | 1 | 6275 | # class taken from the SciPy 2015 Vispy talk opening example
# see https://github.com/vispy/vispy/pull/928
import sys
import threading
import atexit
import numpy as np
import pyaudio
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import Naviga... | mit |
alancucki/multipoint_tsne | multipoint_tsne.py | 1 | 28802 | import datetime as dt
import logging
import sys
from collections import defaultdict
import numpy as np
import theano
import theano.tensor as tt
from scipy.spatial.distance import squareform
from sklearn import utils
from sklearn.decomposition import PCA
from sklearn.manifold import t_sne#, _barnes_hut_tsne
from sklear... | bsd-3-clause |
leferrad/learninspy | test/test_metrics.py | 1 | 3016 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'leferrad'
# For Travis CI compatibility on plots
import matplotlib
matplotlib.use('agg')
from learninspy.utils.evaluation import ClassificationMetrics, RegressionMetrics
from learninspy.utils.fileio import get_logger
from learninspy.utils.plots import plot_... | isc |
mne-tools/mne-tools.github.io | 0.18/_downloads/84edbf21b0a4d2c809f9a980df68abb5/plot_define_target_events.py | 29 | 3376 | """
============================================================
Define target events based on time lag, plot evoked response
============================================================
This script shows how to define higher order events based on
time lag between reference and target events. For
illustration, we will... | bsd-3-clause |
raghavrv/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 9 | 17289 | from __future__ import division
from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import scipy.sparse as sp
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import a... | bsd-3-clause |
devanshdalal/scikit-learn | examples/gaussian_process/plot_gpr_co2.py | 131 | 5705 | """
========================================================
Gaussian process regression (GPR) on Mauna Loa CO2 data.
========================================================
This example is based on Section 5.4.3 of "Gaussian Processes for Machine
Learning" [RW2006]. It illustrates an example of complex kernel engine... | bsd-3-clause |
tapomayukh/projects_in_python | sandbox_tapo/src/skin_related/Cody_Data/time_varying_data_exploration.py | 1 | 5730 | #!/usr/bin/env python
import math, numpy as np
#from enthought.mayavi import mlab
import matplotlib.pyplot as pp
import matplotlib.cm as cm
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
import tf
#import hrl_lib.mayavi2_util as mu
import hrl_lib.viz as hv
import... | mit |
sarahgrogan/scikit-learn | sklearn/ensemble/weight_boosting.py | 71 | 40664 | """Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseWeightBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each ot... | bsd-3-clause |
dilawar/moose-full | moose-examples/snippets/ionchannel.py | 2 | 8640 | # ionchannel.py ---
#
# Filename: ionchannel.py
# Description:
# Author: Subhasis Ray
# Maintainer:
# Created: Wed Sep 17 10:33:20 2014 (+0530)
# Version:
# Last-Updated:
# By:
# Update #: 0
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Change log:
#
#
#
#
# This p... | gpl-2.0 |
obarquero/intro_machine_learning_udacity | Projects/ud120-projects-master/naive_bayes/nb_author_id.py | 1 | 1315 | #!/usr/bin/python
"""
this is the code to accompany the Lesson 1 (Naive Bayes) mini-project
use a Naive Bayes Classifier to identify emails by their authors
authors and labels:
Sara has label 0
Chris has label 1
"""
import sys
from time import time
sys.path.append("../tools/")
from em... | gpl-2.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/dask/bag/core.py | 2 | 72889 | from __future__ import absolute_import, division, print_function
import io
import itertools
import math
import uuid
import warnings
from collections import Iterable, Iterator, defaultdict
from distutils.version import LooseVersion
from functools import wraps, partial
from operator import getitem
from random import Ran... | gpl-3.0 |
juharris/tensorflow | tensorflow/examples/skflow/out_of_core_data_classification.py | 9 | 2462 | # 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 |
giulioungaretti/qt_dot_fitter | stat.py | 1 | 1164 | import numpy as np
import os
import matplotlib.pyplot as plt
def sigmaz(results, sigma=2):
return (results[abs(results-results.mean())/results.std() < sigma])
def do(folder):
all = os.listdir(folder)
files = [i for i in all if 'csv' in i]
print files
tmp = []
for file in files:
try:
... | mit |
subdir/yndx-astana-demo-bot | yndx_astana_demo_bot/voice_gender.py | 1 | 3166 | #train_models.py
import os
from glob import glob
import cPickle
import numpy as np
from scipy.io.wavfile import read
from sklearn.mixture import GMM
from sklearn import preprocessing
import python_speech_features as mfcc
import warnings
warnings.filterwarnings('ignore', 'Class GMM is deprecated', DeprecationWarning... | unlicense |
zorojean/tushare | tushare/datayes/trading.py | 14 | 4741 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Created on 2015年7月4日
@author: JimmyLiu
@QQ:52799046
"""
from tushare.datayes import vars as vs
import pandas as pd
from pandas.compat import StringIO
class Trading():
def __init__(self, client):
self.client = client
def dy_market_tickRT(se... | bsd-3-clause |
izu-mi/py-tensor | utils/lstm.py | 1 | 5171 | """ LSTM Module for stock prediction algorithm """
import time
import warnings
from six.moves import xrange
import numpy as np
from numpy import newaxis
import pandas as pd
from keras.layers.core import Dense, Activation, Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
import matplo... | mit |
linebp/pandas | pandas/core/internals.py | 1 | 178177 | import copy
import itertools
import re
import operator
from datetime import datetime, timedelta, date
from collections import defaultdict
import numpy as np
from pandas.core.base import PandasObject
from pandas.core.dtypes.dtypes import (
ExtensionDtype, DatetimeTZDtype,
CategoricalDtype)
from pandas.core.dt... | bsd-3-clause |
rabernat/xray | xarray/core/variable.py | 1 | 63679 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import timedelta
from collections import defaultdict
import functools
import itertools
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
from . import common
from ... | apache-2.0 |
connorcoley/ochem_predict_nn | scripts/characterize_transforms.py | 1 | 3963 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})
import sys
import os
def get_counts(collection):
'''
Gets the 'count' field for all entries in a MongoDB collection
'''
counts = np.zeros((collection... | mit |
timbennett/twitter-tools | get_recent_tweets.py | 1 | 1318 | '''
export user's last 3240 tweets to CSV (full structure)
usage: python get_recent_tweets.py screenname
requires pandas because why reinvent to_csv()?
'''
import tweepy #https://github.com/tweepy/tweepy
import csv
import sys
import json
import pandas as pd
# make sure twitter_auth.py exists with contents:
#
# acce... | mit |
Designist/sympy | sympy/plotting/plot_implicit.py | 83 | 14400 | """Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... | bsd-3-clause |
xodus7/tensorflow | tensorflow/contrib/timeseries/examples/predict_test.py | 80 | 2487 | # 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 |
chendaniely/spring_2016_cs_5854-PathLinker | src/setup_pl2.py | 1 | 20313 | #! /usr/env/python
import collections
import itertools
import random
import pandas as pd
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
def find_grouped_edges(edge_data):
"""Takes a dataframe of edges
returns a dictionary:
'edges' are tuples of edges and
'reverse_edges' are ... | gpl-3.0 |
JanNash/sms-tools | lectures/04-STFT/plots-code/windows.py | 24 | 1247 | import matplotlib.pyplot as plt
import numpy as np
import time, os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DF
import utilFunctions as UF
from scipy.fftpack import fft, ifft
import math
(fs, x) = UF.wavread('../../../sounds/oboe-A... | agpl-3.0 |
gfyoung/scipy | scipy/ndimage/filters.py | 1 | 49434 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | bsd-3-clause |
CIFASIS/pylearn2 | pylearn2/models/tests/test_s3c_inference.py | 44 | 14386 | from __future__ import print_function
from pylearn2.models.s3c import S3C
from pylearn2.models.s3c import E_Step_Scan
from pylearn2.models.s3c import Grad_M_Step
from pylearn2.models.s3c import E_Step
from pylearn2.utils import contains_nan
from theano import function
import numpy as np
from theano.compat.six.moves im... | bsd-3-clause |
tawsifkhan/scikit-learn | examples/svm/plot_separating_hyperplane_unbalanced.py | 329 | 1850 | """
=================================================
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 |
joernhees/scikit-learn | examples/ensemble/plot_adaboost_multiclass.py | 354 | 4124 | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | bsd-3-clause |
cactusbin/nyt | matplotlib/lib/matplotlib/afm.py | 4 | 16093 | """
This is a python interface to Adobe Font Metrics Files. Although a
number of other python implementations exist, and may be more complete
than this, it was decided not to go with them because they were
either:
1) copyrighted or used a non-BSD compatible license
2) had too many dependencies and a free standin... | unlicense |
wholmgren/pvlib-python | pvlib/test/test_midc.py | 2 | 2266 | import inspect
import os
import pandas as pd
from pandas.util.testing import network
import pytest
import pytz
from pvlib.iotools import midc
@pytest.fixture
def test_mapping():
return {
'Direct Normal [W/m^2]': 'dni',
'Global PSP [W/m^2]': 'ghi',
'Rel Humidity [%]': 'relative_humidity',... | bsd-3-clause |
Titan-C/scikit-learn | examples/linear_model/plot_multi_task_lasso_support.py | 77 | 2319 | #!/usr/bin/env python
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same across
tasks. This example simulates... | bsd-3-clause |
bennlich/scikit-image | doc/examples/plot_censure.py | 23 | 1079 | """
========================
CENSURE feature detector
========================
The CENSURE feature detector is a scale-invariant center-surround detector
(CENSURE) that claims to outperform other detectors and is capable of real-time
implementation.
"""
from skimage import data
from skimage import transform as tf
fro... | bsd-3-clause |
cactusbin/nyt | matplotlib/examples/statistics/histogram_demo_features.py | 7 | 1039 | """
Demo of the histogram (hist) function with a few features.
In addition to the basic histogram, this demo shows a few optional features:
* Setting the number of data bins
* The ``normed`` flag, which normalizes bin heights so that the integral of
the histogram is 1. The resulting histogram is a proba... | unlicense |
tomlof/scikit-learn | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
StratsOn/zipline | zipline/examples/dual_moving_average.py | 5 | 1974 | #!/usr/bin/env python
#
# Copyright 2014 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 ... | apache-2.0 |
BiaDarkia/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
poryfly/scikit-learn | sklearn/utils/tests/test_class_weight.py | 140 | 11909 | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... | bsd-3-clause |
UDST/activitysim | activitysim/abm/models/util/test/test_vectorize_tour_scheduling.py | 2 | 2354 | # ActivitySim
# See full license in LICENSE.txt.
import os
import pytest
import pandas as pd
import numpy as np
import pandas.util.testing as pdt
from activitysim.core import inject
from ..vectorize_tour_scheduling import get_previous_tour_by_tourid, \
vectorize_tour_scheduling
def test_vts():
inject.add... | bsd-3-clause |
quheng/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
gautam1858/tensorflow | tensorflow/contrib/learn/python/learn/grid_search_test.py | 137 | 2035 | # 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 |
xpspectre/multiple-myeloma | prep_baseline_clinical_data.py | 1 | 3680 | # Run this after prep_clinical_data.py
import os
import pandas as pd
import numpy as np
# from fancyimpute import KNN, MICE
data_dir = 'data/processed'
# Load study data - to keep just the CoMMpass patients
study_data = pd.read_csv(os.path.join(data_dir, 'patient_study.csv'))
study_data.set_index('PUBLIC_ID', inplac... | mit |
MJuddBooth/pandas | pandas/tests/indexes/multi/test_names.py | 2 | 3942 | # -*- coding: utf-8 -*-
import pytest
import pandas as pd
from pandas import MultiIndex
import pandas.util.testing as tm
def check_level_names(index, names):
assert [level.name for level in index.levels] == list(names)
def test_slice_keep_name():
x = MultiIndex.from_tuples([('a', 'b'), (1, 2), ('c', 'd')]... | bsd-3-clause |
ElDeveloper/scikit-learn | benchmarks/bench_plot_approximate_neighbors.py | 244 | 6011 | """
Benchmark for approximate nearest neighbor search using
locality sensitive hashing forest.
There are two types of benchmarks.
First, accuracy of LSHForest queries are measured for various
hyper-parameters and index sizes.
Second, speed up of LSHForest queries compared to brute force
method in exact nearest neigh... | bsd-3-clause |
fspaolo/scikit-learn | examples/ensemble/plot_gradient_boosting_quantile.py | 14 | 2087 | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
import pylab as pl
from sklearn.ensemble i... | bsd-3-clause |
bnaul/scikit-learn | examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py | 18 | 4240 | """
====================================================
Multiclass sparse logistic regression on 20newgroups
====================================================
Comparison of multinomial logistic L1 vs one-versus-rest L1 logistic regression
to classify documents from the newgroups20 dataset. Multinomial logistic
reg... | bsd-3-clause |
btabibian/scikit-learn | sklearn/manifold/tests/test_spectral_embedding.py | 7 | 11096 | import numpy as np
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from scipy import sparse
from scipy.linalg import eigh
from sklearn.manifold.spectral_embedding_ import SpectralEmbedding
from sklearn.manifold.spectral_embedding_ import _graph_is_connected
from sklear... | bsd-3-clause |
petosegan/scikit-learn | sklearn/tree/tree.py | 113 | 34767 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | bsd-3-clause |
advatar/caffe | examples/web_demo/app.py | 10 | 7400 | import os
import time
import cPickle
import datetime
import logging
import flask
import werkzeug
import optparse
import tornado.wsgi
import tornado.httpserver
import numpy as np
import pandas as pd
from PIL import Image as PILImage
import cStringIO as StringIO
import urllib
import caffe
import exifutil
REPO_DIRNAME = ... | bsd-2-clause |
michigraber/scikit-learn | examples/applications/plot_outlier_detection_housing.py | 243 | 5577 | """
====================================
Outlier detection on a real data set
====================================
This example illustrates the need for robust covariance estimation
on a real data set. It is useful both for outlier detection and for
a better understanding of the data structure.
We selected two sets o... | bsd-3-clause |
dpshelio/scikit-image | doc/examples/plot_radon_transform.py | 17 | 8432 | """
===============
Radon transform
===============
In computed tomography, the tomography reconstruction problem is to obtain
a tomographic slice image from a set of projections [1]_. A projection is
formed by drawing a set of parallel rays through the 2D object of interest,
assigning the integral of the object's con... | bsd-3-clause |
ceholden/yatsm | yatsm/regression/pickles/serialize.py | 3 | 1859 | """ Setup script to pickle various statistical estimators for distribution
Available pickles to build:
* glmnet_Lasso20.pkl
* sklearn_Lasso20.pkl
"""
from __future__ import print_function
import json
import logging
import os
import traceback
# Don't alias to ``np``: https://github.com/numba/numba/issues/155... | mit |
Karl-Marka/data-mining | scleroderma-prediction/Feature_selector_ANOVA-F.py | 1 | 1981 | from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_classif
import pandas as pd
def oligosList():
oligosPath = input('Path to the file containing the list of oligos to use: ')
oligos = open(oligosPath)
oligos = oligos.readlines()
oligosList = []
for oligo in ol... | gpl-3.0 |
rsivapr/scikit-learn | examples/grid_search_text_feature_extraction.py | 5 | 4157 | """
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the do... | bsd-3-clause |
chris-nemeth/pseudo-extended-mcmc-code | Section_4.3-Sparse_logistic_regression_with_horseshoe_priors/main.py | 1 | 4141 | #This script tests out the horseshoe prior for variable selection based on Piironen and Vehtari (2017).
import scipy.io as spio
import numpy as np
import pystan
from scipy.stats import cauchy, norm
from matplotlib import pyplot as plt
import csv
#Load the data
mat = spio.loadmat('colon.mat', squeeze_me=True) #or 'p... | gpl-3.0 |
meduz/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 84 | 1221 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
galad-loth/LearnDescriptor | patchmatch/test_kpt_match.py | 1 | 2223 | # -*- codingL utf-8-*-
"""
Created on Tue Oct 07 10:10:15 2018
@author: galad-loth
"""
import numpy as npy
from matplotlib import pyplot as plt
import cv2
from cnn_desc import get_cnn_desc
img1=cv2.imread(r"D:\_Datasets\VGGAffine\ubc\img1.ppm",cv2.IMREAD_COLOR)
img2=cv2.imread(r"D:\_Datasets\VGGAffine\ubc\i... | apache-2.0 |
mmottahedi/neuralnilm_prototype | scripts/e488.py | 2 | 6822 | 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 |
astroclark/bhextractor | bin/libbhex_posteriors.py | 1 | 9464 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 James Clark <james.clark@ligo.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
#... | gpl-2.0 |
jstac/recursive_utility_code | python/long_run_risk/src/stability_plots.py | 1 | 1055 |
import matplotlib.pyplot as plt
import numpy as np
def stability_plot(R,
x, y,
xlb, ylb,
txt_flag="by",
dot_loc=None,
coords=(-225, 30)):
if txt_flag == "by":
text = "Bansal and Yaron"
else:
te... | mit |
cms-btv-pog/rootpy | rootpy/plotting/tests/test_root2matplotlib.py | 3 | 2304 | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from rootpy.plotting import Hist, Hist2D, HistStack, Graph
from nose.plugins.skip import SkipTest
from nose.tools import with_setup
def setup_func():
try:
import matplotlib
except ImportError:
... | gpl-3.0 |
wdurhamh/statsmodels | statsmodels/examples/ex_kernel_regression2.py | 34 | 1511 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 02 13:43:44 2013
Author: Josef Perktold
"""
from __future__ import print_function
import numpy as np
import numpy.testing as npt
import statsmodels.nonparametric.api as nparam
if __name__ == '__main__':
np.random.seed(500)
nobs = [250, 1000][0]
sig_fac = 1... | bsd-3-clause |
wanderine/nipype | nipype/algorithms/modelgen.py | 1 | 34772 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The modelgen module provides classes for specifying designs for individual
subject analysis of task-based fMRI experiments. In particular it also includes
algorithms for generating regressors for sparse... | bsd-3-clause |
kubeflow/kfserving | docs/samples/v1beta1/transformer/feast/driver_transformer/__main__.py | 1 | 1914 | # Copyright 2019 kubeflow.org.
#
# 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,... | apache-2.0 |
stevenzhang18/Indeed-Flask | lib/pandas/io/stata.py | 9 | 78805 | """
Module contains tools for processing Stata files into DataFrames
The StataReader below was originally written by Joe Presbrey as part of PyDTA.
It has been extended and improved by Skipper Seabold from the Statsmodels
project who also developed the StataWriter and was finally added to pandas in
a once again improv... | apache-2.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/tests/io/test_packers.py | 3 | 32058 | import pytest
from warnings import catch_warnings
import os
import datetime
import numpy as np
import sys
from distutils.version import LooseVersion
from pandas import compat
from pandas.compat import u, PY3
from pandas import (Series, DataFrame, Panel, MultiIndex, bdate_range,
date_range, period_... | mit |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/matplotlib/_cm.py | 4 | 93997 | """
Nothing here but dictionaries for generating LinearSegmentedColormaps,
and a dictionary of these dictionaries.
Documentation for each is in pyplot.colormaps()
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
_binary_data = {
... | mit |
abhishekgahlot/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 43 | 1791 | """
===================================================================
Multi-output Decision Tree Regression
===================================================================
An example to illustrate multi-output regression with decision tree.
The :ref:`decision trees <tree>`
is used to predict simultaneously the ... | bsd-3-clause |
toastedcornflakes/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
tardis-sn/tardis | tardis/model/base.py | 1 | 27746 | import os
import logging
import numpy as np
import pandas as pd
from astropy import units as u
from tardis import constants
from tardis.util.base import quantity_linspace
from tardis.io.parsers.csvy import load_csvy
from tardis.io.model_reader import (
read_density_file,
read_abundances_file,
read_uniform_... | bsd-3-clause |
Titan-C/slaveparticles | examples/spins/plot_z_half_multiorb.py | 1 | 1049 | # -*- coding: utf-8 -*-
"""
======================================================
Drop of quasiparticle weight by increasing interaction
======================================================
The quasiparticle weight of the electronic system drops as the local interaction
is increased. Multi orbital degenerate system... | gpl-3.0 |
kochhar/cric | cric/inning.py | 1 | 3313 | import math
import numpy as np
import pandas as pd
import pickers as pck
def create_innings_dataframe(number, innings):
"""Given an cricsheet innings convert it into a data frame"""
delivery_ids, outcomes = split_id_outcome(pck.pick_deliveries(innings))
# heirarchical index by over and delivery. eg: 4.3 =... | agpl-3.0 |
roxyboy/scikit-learn | sklearn/linear_model/stochastic_gradient.py | 130 | 50966 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import scipy.sparse as sp
from abc import ABCMeta, abstractmethod
from ... | bsd-3-clause |
antonxy/audiosync | tests/chirp_test.py | 1 | 2542 | import analyse_audio
import numpy as np
import matplotlib.pyplot as plt
def chirp_single_test(length, freq0, freq1, noise_factor=0):
chirp = analyse_audio.generate_chirp(freq0, freq1, length, 48000)
zeros = np.zeros(chirp.size)
signal = np.append(np.append(zeros, chirp), zeros)
if nois... | mit |
opcon/plutokore | scripts/calculate-luminosity.py | 2 | 1986 | #!/bin/env python3
import os
import sys
if os.path.exists(os.path.expanduser('~/plutokore')):
sys.path.append(os.path.expanduser('~/plutokore'))
else:
sys.path.append(os.path.expanduser('~/uni/plutokore'))
import plutokore as pk
import matplotlib as mpl
mpl.use('PS')
import matplotlib.pyplot as plot
import num... | mit |
shikhardb/scikit-learn | examples/exercises/plot_cv_diabetes.py | 231 | 2527 | """
===============================================
Cross-validation on diabetes Dataset Exercise
===============================================
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the :ref:`cv_estimators_tut` part of the
:ref:`model_selection_tut` section of ... | bsd-3-clause |
detrout/debian-statsmodels | tools/backport_pr.py | 30 | 5263 | #!/usr/bin/env python
"""
Backport pull requests to a particular branch.
Usage: backport_pr.py branch [PR]
e.g.:
python tools/backport_pr.py 0.13.1 123
to backport PR #123 onto branch 0.13.1
or
python tools/backport_pr.py 1.x
to see what PRs are marked for backport that have yet to be applied.
Copied fr... | bsd-3-clause |
anntzer/scikit-learn | examples/calibration/plot_calibration.py | 15 | 4977 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
salbrandi/patella | patella/click_commands.py | 1 | 3221 | # -*- coding: utf-8 -*-
"""
Controls command line operations
The only particularly relevant command now i: patella startup <path>
not all commands retain functionality - this will be updated eventually (read: it might not be)
"""
# \/ Third-Party Packages \/
import os
import os.path
import click
import pandas as ... | mit |
AlexRobson/scikit-learn | sklearn/linear_model/tests/test_omp.py | 272 | 7752 | # Author: Vlad Niculae
# Licence: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equa... | bsd-3-clause |
fraka6/trading-with-python | lib/functions.py | 76 | 11627 | # -*- coding: utf-8 -*-
"""
twp support functions
@author: Jev Kuznetsov
Licence: GPL v2
"""
from scipy import polyfit, polyval
import datetime as dt
#from datetime import datetime, date
from pandas import DataFrame, Index, Series
import csv
import matplotlib.pyplot as plt
import numpy as np
import p... | bsd-3-clause |
brynpickering/calliope | calliope/core/preprocess/lookup.py | 1 | 10678 | """
Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
lookup.py
~~~~~~~~~~~~~~~~~~
Functionality to create DataArrays for looking up string values between loc_techs
and loc_tech_carriers, to avoid string operations during backend operations.
""... | apache-2.0 |
vadimadr/python-algorithms | setup.py | 1 | 1083 | import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args ... | mit |
cwu2011/scikit-learn | examples/text/mlcomp_sparse_document_classification.py | 292 | 4498 | """
========================================================
Classification of text documents: using a MLComp dataset
========================================================
This is an example showing how the scikit-learn can be used to classify
documents by topics using a bag-of-words approach. This example uses
a s... | bsd-3-clause |
jmausolf/Congressional_Record | Python_Scripts/__speech_classifier2.py | 1 | 11291 | ###################################
### ###
### Joshua G. Mausolf ###
### Department of Sociology ###
### Computation Institute ###
### University of Chicago ###
### ###
###################################
import re
import pandas as pd
i... | apache-2.0 |
hdmetor/scikit-learn | sklearn/tests/test_lda.py | 71 | 5883 | 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.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert... | bsd-3-clause |
sangorrin/iwatsu-ds-8812-bringo-dso-application | logic.py | 1 | 13726 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Daniel Sangorrin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | mit |
rajat1994/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 |
sonnyhu/scikit-learn | sklearn/gaussian_process/tests/test_kernels.py | 6 | 11602 | """Testing for kernels for Gaussian processes."""
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
from collections import Hashable
from sklearn.externals.funcsigs import signature
import numpy as np
from sklearn.gaussian_process.kernels import _approx_fprime
from sklearn.metrics... | bsd-3-clause |
dsg2806/acti.monash | timetest.py | 2 | 771542 | import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
times = ['5/07/2011 13:57:00', '5/07/2011 13:58:00', '5/07/2011 13:59:00', '5/07/2011 14:00:00', '5/07/2011 14:01:00', '5/07/2011 14:02:00', '5/07/2011 14:03:00', '5/07/2011 14:04:00', '5/07/2011 14:05:00', '5/07/2011 14:06:00', ... | agpl-3.0 |
kexinrong/macrobase | tools/py_analysis/plot_outlier_histograms.py | 2 | 2598 | import argparse
import itertools
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from common import add_db_args
from common import add_plot_limit_args
from common import set_db_connection
from common import set_plot_limits
from matplotlib.colors import LogNorm
from plot_esti... | apache-2.0 |
lfairchild/PmagPy | programs/strip_magic.py | 2 | 14657 | #!/usr/bin/env python
import sys
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.pmag as pmag
def main():
"""
NAME
strip_magic.py
DESCRIPTION
plots various parameters versus depth or age
SYN... | bsd-3-clause |
ContextLab/hypertools | setup.py | 1 | 2235 | # -*- coding: utf-8 -*-
import os
import subprocess
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
os.environ["MPLCONFIGDIR"] = "."
NAME = 'hypertools'
VERSION = '0.7.0'
AUTHOR = 'Contextual Dynamics Lab'
AUTHOR_EMAIL = 'contextualdynamics@gmail.com'
URL = 'http... | mit |
MatthieuBizien/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 37 | 12559 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
agconti/kaggle-titanic | Python Examples/agcfirstforest.py | 6 | 4031 | #RandomForest, non parametric modeling
#agconti
import numpy as np
import csv as csv
from sklearn.ensemble import RandomForestClassifier
train_data=[] # Create a bin to hold our training data.
test_data=[] # Create a bin to hold our test data.
# Read in CSVs, train and test
with open('train.csv', 'rb') as f1:
... | apache-2.0 |
GeoMop/Intersections | src/bspline_plot.py | 1 | 7295 | """
Functions to plot Bspline curves and surfaces.
"""
plot_lib = "plotly"
import plotly.offline as pl
import plotly.graph_objs as go
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
class PlottingPlotly:
def __init__(self):
self.i_... | gpl-3.0 |
MJuddBooth/pandas | pandas/tests/frame/test_asof.py | 2 | 4640 | # coding=utf-8
import numpy as np
import pytest
from pandas import DataFrame, Series, Timestamp, date_range, to_datetime
import pandas.util.testing as tm
from .common import TestData
class TestFrameAsof(TestData):
def setup_method(self, method):
self.N = N = 50
self.rng = date_range('1/1/1990',... | bsd-3-clause |
pgandhi999/spark | python/pyspark/serializers.py | 5 | 30967 | #
# 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 |
magne-max/zipline-ja | zipline/data/resample.py | 1 | 24726 | # Copyright 2016 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 writ... | apache-2.0 |
anntzer/scikit-learn | examples/manifold/plot_manifold_sphere.py | 89 | 5055 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.