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 |
|---|---|---|---|---|---|
pkruskal/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 |
Titan-C/scikit-learn | examples/linear_model/plot_sparse_recovery.py | 11 | 7453 | """
============================================================
Sparse recovery: feature selection for sparse linear models
============================================================
Given a small number of observations, we want to recover which features
of X are relevant to explain y. For this :ref:`sparse linear ... | bsd-3-clause |
datapythonista/pandas | pandas/tests/indexes/datetimes/methods/test_to_series.py | 4 | 1275 | import numpy as np
import pytest
from pandas import (
DatetimeIndex,
Series,
)
import pandas._testing as tm
class TestToSeries:
@pytest.fixture
def idx_expected(self):
naive = DatetimeIndex(["2013-1-1 13:00", "2013-1-2 14:00"], name="B")
idx = naive.tz_localize("US/Pacific")
... | bsd-3-clause |
marfcg/fludashboard | fludashboard/libs/charts.py | 2 | 4423 | from plotly import tools
from plotly.offline.offline import _plot_html
import cufflinks as cf
import numpy as np
import pandas as pd
import plotly.graph_objs as go
import colorlover as cl
# local
from .episem import episem, lastepiday
cf.set_config_file(theme='white')
def ethio_ts(df=pd.DataFrame, scale_id=int, y... | gpl-3.0 |
MatthieuBizien/scikit-learn | benchmarks/bench_lasso.py | 111 | 3364 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
spallavolu/scikit-learn | examples/linear_model/plot_sgd_iris.py | 286 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
CompPhysics/ThesisProjects | doc/MSc/msc_students/former/sean/Thesis/Codes/CCD_prototype/CCD/plotter.py | 1 | 3411 | #this is a simple plotter where you manually insert data sets (in case you are interested in spesific cases)
import itertools
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from matplotlib import rc
import matplotlib.ticker as ticker
#xData = range(3,40)
#yData = [14.474197721372551,
# 14... | cc0-1.0 |
PredictiveScienceLab/pysmc | examples/simple_model_run.py | 2 | 1089 | """
Run SMC on the simple model.
Author:
Ilias Bilionis
Date:
9/28/2013
"""
import simple_model
import pymc
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import pysmc
import matplotlib.pyplot as plt
import pickle
import numpy as np
if __name__ == '__main__':
# Construct the SMC sampl... | lgpl-3.0 |
scikit-multilearn/scikit-multilearn | skmultilearn/embedding/classifier.py | 1 | 6571 | from skmultilearn.base import ProblemTransformationBase
import numpy as np
import scipy.sparse as sp
from copy import copy
class EmbeddingClassifier(ProblemTransformationBase):
"""Embedding-based classifier
Implements a general scheme presented in LNEMLC: label network embeddings for multi-label classificatio... | bsd-2-clause |
Haunter17/MIR_SU17 | exp8/exp8a_sgmd.py | 1 | 7615 | import numpy as np
import tensorflow as tf
import h5py
from sklearn.preprocessing import OneHotEncoder
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
import scipy.io
# Functions for initializing neural nets parameters
def weight_variable(shape):
initial = tf.truncat... | mit |
zseymour/python-imagenet | pyimagenet.py | 1 | 2926 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 22 12:57:23 2015
@author: zach
"""
from nltk.corpus import wordnet as wn
import pandas as pd
import itertools
import os
import pickle
import random
SYNSET_FORMAT = "n{:0>8}"
class ImageHierarchy(object):
def __init__(self, image_dir, caffe_root, dataset="val")... | gpl-2.0 |
CharlesGulian/Deconv | create_regfile.py | 1 | 2164 | #!/usr/bin/env python
"""
Created on Tue Jun 14 14:06:37 2016
@author: charlesgulian
"""
import os
#import matplotlib.pyplot as plt
#import numpy as np
#from astropy.io import fits
dir_name = os.getcwd()
n = open(dir_name + '/img_name.txt','r')
n.readline() # Ignore first line of .txt file
for line in n:
img_ta... | gpl-3.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/sklearn/examples/plot_feature_stacker.py | 80 | 1911 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | mit |
timothydmorton/bokeh | bokeh/charts/builder/tests/test_step_builder.py | 33 | 2495 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
kundor/gpstools | readnav.py | 1 | 3872 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 6 15:30:54 2017
@author: nima9589
"""
import subprocess
from urllib.parse import urlparse
from urllib.request import urlopen
from contextlib import closing
import pandas as pd
import numpy as np
from utility import info
CDDIS_HRLY = 'ftp://cddis.g... | gpl-3.0 |
all-umass/superman | superman/preprocess/utils.py | 1 | 2332 | from __future__ import absolute_import, division, print_function
import numpy as np
from sklearn.preprocessing import normalize
def crop_resample(bands, intensities, crops):
intensities = np.atleast_2d(intensities)
crops = sorted(crops)
# check that each chunk is valid and doesn't overlap with any other
prev_... | mit |
356255531/SpikingDeepRLControl | code/EnvBo/Q-Learning/Testing_Arm_4points/agents.py | 1 | 5201 | #!/usr/bin/python
import matplotlib.pyplot as plt
import numpy as np
# ARM PARAMETERS
ANGULAR_ARM_VELOCITY = 1.0/180.0*np.pi
ARM_LENGTH_1 = 2.0
ARM_LENGTH_2 = 3.0
SCENARIOS = [(0,0),(0,30),(35,45),(0,150)]
# TODO: extend actions to all combinations, i.e. instead of 4 actions, all 3*3=9 actions (if too much ... | gpl-3.0 |
RPGOne/Skynet | scikit-learn-0.18.1/examples/decomposition/plot_pca_3d.py | 354 | 2432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | bsd-3-clause |
edublancas/dstools | src/dstools/pipeline/validators/validators.py | 2 | 3348 | from functools import partial, wraps
class Assert:
def __init__(self):
self.messages_error = []
self.messages_warning = []
def __call__(self, expression, error_message):
if not expression:
self.messages_error.append(error_message)
def warn(self, expression, warning_m... | mit |
MadsJensen/CAA | hilbert_preprocessing.py | 1 | 3552 | import mne
from my_settings import *
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
n_jobs = 3
for subject in [subjects_select[-1]]:
raw = mne.io.Raw(save_folder + "%s_filtered_ica_mc_raw_tsss.fif" % subject,
preload=True)
raw.resample(250, n_jobs=n_jobs, v... | bsd-3-clause |
CallaJun/hackprince | indico/matplotlib/tri/triplot.py | 21 | 3124 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib.tri.triangulation import Triangulation
def triplot(ax, *args, **kwargs):
"""
Draw a unstructured triangular grid as lines and/or markers.
The triang... | lgpl-3.0 |
mehdidc/scikit-learn | benchmarks/bench_sparsify.py | 28 | 3380 | """
Benchmark SGD prediction time with dense/sparse coefficients.
Invoke with
-----------
$ kernprof.py -l sparsity_benchmark.py
$ python -m line_profiler sparsity_benchmark.py.lprof
Typical output
--------------
input data sparsity: 0.050000
true coef sparsity: 0.000100
test data sparsity: 0.027400
model sparsity:... | bsd-3-clause |
DEK11/Predicting-EOB-delay | withoutpayer.py | 1 | 2272 | import pandas as pd
import numpy as np
train = pd.read_csv('train.csv', header=0)
test = pd.read_csv('test.csv', header=0)
delcol = ['claim_file_arrival_year','claim_file_arrival_month','bill_print_year','bill_print_month','claim_min_service_year','claim_max_service_year','claim_frequency_type_code','claim_min_servic... | apache-2.0 |
casawa/mdtraj | mdtraj/core/trajectory.py | 2 | 68051 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2014 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Kyle A. Beauchamp, TJ Lane, Jo... | lgpl-2.1 |
uglyboxer/linear_neuron | mini_net/network.py | 1 | 10900 | """Author: Cole Howard
Email: uglyboxer@gmail.com
network.py is a basic implementation of a one layer linear neural network, to
examine an implementation of backpropagation. It is based on the basic model
of the Perceptron. Information on that can be found at:
https://en.wikipedia.org/wiki/Perceptron
The intent ... | mit |
phobson/statsmodels | statsmodels/discrete/discrete_margins.py | 1 | 25391 | #Splitting out maringal effects to see if they can be generalized
from statsmodels.compat.python import lzip, callable, range
import numpy as np
from scipy.stats import norm
from statsmodels.tools.decorators import cache_readonly, resettable_cache
#### margeff helper functions ####
#NOTE: todo marginal effects for gr... | bsd-3-clause |
benanne/theano-tutorial | 6_convnet.py | 2 | 2601 | import theano
import theano.tensor as T
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
import load
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
# load data
x_train, t_train, x_test, t_test = load.cifar10(dtype=theano.config.floatX)
labels_test = np... | mit |
jakubczaplicki/LogAnalyser | uispeed.py | 1 | 1352 | import re, os, sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
def read_ui_performance_fps():
fname = "uispeed.log"
x = []
results = []
f = open(fname, 'r')
for line in f:
#[Tue Feb 28 17:35:24.500 2012] I/UITEST ( 1147): 60.728745 fps
m = re... | mit |
tmaiwald/OSIM | OSIM/Simulation/CircuitAnalysis/CircuitAnalysis.py | 1 | 7658 | from __future__ import print_function
from copy import deepcopy
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as AA
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import spsolve
import scipy as np
from mpl_toolkits.axes_grid1 import host_subplot
from numba import jit
UNIT_CURRENT = 0
U... | bsd-2-clause |
stylianos-kampakis/scikit-learn | sklearn/decomposition/tests/test_truncated_svd.py | 240 | 6055 | """Test truncated SVD transformer."""
import numpy as np
import scipy.sparse as sp
from sklearn.decomposition import TruncatedSVD
from sklearn.utils import check_random_state
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
assert_raises, assert_greater,
... | bsd-3-clause |
pizzathief/numpy | tools/refguide_check.py | 3 | 31290 | #!/usr/bin/env python
"""
refguide_check.py [OPTIONS] [-- ARGS]
Check for a NumPy submodule whether the objects in its __all__ dict
correspond to the objects included in the reference guide.
Example of usage::
$ python refguide_check.py optimize
Note that this is a helper script to be able to check if things ar... | bsd-3-clause |
robwarm/gpaw-symm | gpaw/test/big/g2_1/pbe_gpaw_nrel_plot.py | 1 | 7442 | import os
import warnings
# silence matplotlib.use() warning
warnings.filterwarnings('ignore', '.*This call to matplotlib\.use.*',)
import csv
import numpy as np
import heapq
import matplotlib.pyplot as plt
from ase.data.molecules import latex
ann_fontsize = 'small'
label_fontsize = 12
from ase.data import atomi... | gpl-3.0 |
yunfeilu/scikit-learn | sklearn/covariance/tests/test_covariance.py | 69 | 11116 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
CrazyGuo/bokeh | bokeh/charts/builder/donut_builder.py | 31 | 8206 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Donut class which lets you build your Donut charts just passing
the arguments to the Chart class and calling the proper functions.
It also add a new chained stacked method.
"""
#---------------------... | bsd-3-clause |
tjhei/burnman | examples/example_grid.py | 5 | 2103 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
example_grid
------------
This example shows how to evaluate seismic quantities on a :math:`P,T` grid.
"""
fro... | gpl-2.0 |
alexholcombe/twoWords | Charlie/noiseStaircaseHelpers.py | 3 | 11616 | import numpy as np
from psychopy import visual, data, logging
import itertools
from math import log
from copy import deepcopy
from pandas import DataFrame
import pylab, os
from matplotlib.ticker import ScalarFormatter
def toStaircase(x,descendingPsycho):
#Don't need to take log, staircase internals will do that
... | mit |
cython-testbed/pandas | pandas/core/sorting.py | 2 | 16130 | """ miscellaneous sorting / groupby utilities """
import numpy as np
from pandas.compat import long, string_types, PY3
from pandas.core.dtypes.common import (
ensure_platform_int,
ensure_int64,
is_list_like,
is_categorical_dtype)
from pandas.core.dtypes.cast import infer_dtype_from_array
from pandas.co... | bsd-3-clause |
hsuantien/scikit-learn | examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py | 218 | 3893 | """
==============================================
Feature agglomeration vs. univariate selection
==============================================
This example compares 2 dimensionality reduction strategies:
- univariate feature selection with Anova
- feature agglomeration with Ward hierarchical clustering
Both metho... | bsd-3-clause |
MatthieuBizien/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 28 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
NERC-CEH/jules-jasmin | majic/joj/services/netcdf.py | 1 | 7934 | from netCDF4 import Dataset
import datetime
import numpy
import os
from pydap.client import open_url
import paste
import pylons
from coards import parse
import shutil
from joj.lib.ecomaps_utils import WorkingDirectory, working_directory, find_closest
__author__ = 'Phil Jenkins (Tessella)'
class DatasetConversionWork... | gpl-2.0 |
cbmoore/statsmodels | statsmodels/discrete/discrete_model.py | 17 | 116208 | """
Limited dependent variable and qualitative variables.
Includes binary outcomes, count data, (ordered) ordinal data and limited
dependent variables.
General References
--------------------
A.C. Cameron and P.K. Trivedi. `Regression Analysis of Count Data`.
Cambridge, 1998
G.S. Madalla. `Limited-Dependent an... | bsd-3-clause |
alcmrt/Machine-Learning | scikit-learn/accuracy score/show_accuracy.py | 1 | 5074 | """
Shows training accuracy of decision tree, support vector classifier
and neural network classifier via scikit - learn.
"""
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score, classification_report
from sklearn.neural_network import MLPClassifier
from sklearn.svm import SVC
from sklearn.tree i... | mit |
nmayorov/scikit-learn | sklearn/cross_decomposition/tests/test_pls.py | 42 | 14316 | import numpy as np
from sklearn.utils.testing import (assert_array_almost_equal,
assert_array_equal, assert_true,
assert_raise_message)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_, CCA
from nose.tools impor... | bsd-3-clause |
wazeerzulfikar/scikit-learn | sklearn/cross_validation.py | 21 | 73625 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
plissonf/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 130 | 6059 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
jcnelson/syndicate | planetlab/graphs/bars.py | 2 | 5048 | #!/usr/bin/python
"""
Copyright 2013 The Trustees of Princeton University
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless r... | apache-2.0 |
zhuhong/pRDF | pRDF_test.py | 1 | 11895 | #!/usr/bin/python
'''
TODO:
write all the atoms of the solvent molecule to the index file.
'''
import math
import sys
import os
import numpy
import MDAnalysis
from itertools import izip
from MDPackage import Index
from MDPackage import Simple_atom
from MDPackage import usage
import MDPackage
import time as Time
im... | gpl-2.0 |
schreiberx/sweet | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky_reprod_2020_03_21/postprocessing_consolidate_prog_vort.py | 8 | 4739 | #! /usr/bin/env python3
import sys
import math
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.timestepping_method'... | mit |
nvoron23/scikit-learn | examples/model_selection/plot_validation_curve.py | 229 | 1823 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
codevlabs/pandashells | pandashells/test/plot_lib_tests.py | 7 | 10281 | #! /usr/bin/env python
import os
import tempfile
import shutil
from unittest import TestCase
from pandashells.lib import plot_lib, arg_lib
import argparse
from mock import patch, MagicMock
import matplotlib as mpl
import pylab as pl
import pandas as pd
from dateutil.parser import parse
class PlotLibTests(TestCase):
... | bsd-2-clause |
TheTimmy/spack | var/spack/repos/builtin/packages/py-elephant/package.py | 3 | 2338 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
jkarnows/scikit-learn | sklearn/lda.py | 56 | 17706 | """
Linear Discriminant Analysis (LDA)
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
from __future__ import print_function
import warnings
import numpy as np
from scipy import linalg
from .externals.six import string_types
f... | bsd-3-clause |
eleflow/uberdata | iuberdata_zeppelin/src/main/resources/python/zeppelin_pyspark.py | 1 | 11239 | #
# 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 |
huzq/scikit-learn | examples/neighbors/plot_species_kde.py | 20 | 4755 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
cxxgtxy/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py | 62 | 3960 | # Copyright 2015 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 |
jreback/pandas | pandas/tests/plotting/test_boxplot_method.py | 2 | 20508 | """ Test cases for .boxplot method """
import itertools
import string
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame, MultiIndex, Series, date_range, timedelta_range
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase, _check_pl... | bsd-3-clause |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/matplotlib/tests/test_axes.py | 4 | 137795 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from distutils.version import LooseVersion
import six
from six.moves import xrange
from itertools import chain
import io
from nose.tools import assert_equal, assert_raises, assert_false, assert_true
from nose.... | mit |
aminert/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
AaronWatters/inferelator_strawman | inferelator_strawman/design_response_R.py | 1 | 3334 | """
Compute design and response by calling R subprocess.
"""
import os
import subprocess
import pandas as pd
my_dir = os.path.dirname(__file__)
R_dir = os.path.join(my_dir, "R_code")
DR_module = os.path.join(R_dir, "design_and_response.R")
R_template = r"""
source('{module}')
meta.data <- read.table('{meta_file}'... | bsd-2-clause |
jluttine/bayespy | bayespy/inference/vmp/nodes/gp.py | 4 | 23431 | ################################################################################
# Copyright (C) 2011-2012 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
import itertools
import numpy as np
import scipy as sp
import sci... | mit |
RayMick/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | 394 | 1770 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal, assert_almost_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([T... | bsd-3-clause |
quevedin/ThinkStats2 | code/populations.py | 68 | 2609 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import csv
import logging
import sys
import numpy as np
import pandas
import thinkpl... | gpl-3.0 |
mlyundin/scikit-learn | sklearn/preprocessing/__init__.py | 268 | 1319 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | bsd-3-clause |
PyBossa/pybossa | setup.py | 1 | 3972 | from setuptools import setup, find_packages
requirements = [
"alembic>=0.6.4, <1.0",
"beautifulsoup4>=4.3.2, <5.0",
"blinker>=1.3, <2.0",
"Flask-Babel>=0.9, <0.10",
"flask-login", # was pinned to Flask-Login==0.2.3 in the past. GitHub version 3.0+ is used now.
"Flask-Mail>=... | agpl-3.0 |
guschmue/tensorflow | tensorflow/contrib/eager/python/examples/rnn_colorbot/rnn_colorbot.py | 4 | 13109 | # 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 |
strongh/GPy | GPy/models/gplvm.py | 4 | 3086 | # Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from .. import kern
from ..core import GP, Param
from ..likelihoods import Gaussian
from .. import util
class GPLVM(GP):
"""
Gaussian Process Latent Variable Model
"... | bsd-3-clause |
mdastro/UV_ETGs | Coding/Model/uv_regression_model.py | 1 | 3005 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script aims at constructing a regression model to explain the uv upturn of early-type galaxies in redshift.
The model consists in a Bayesian Grouped Logit Model (or simply Binomial Model).
@author: Maria Luiza Linhares Dantas
@date: 2017.09.18
... | mit |
MadsJensen/RP_scripts | graph_efficiency_ada.py | 1 | 2128 | import numpy as np
import bct
from sklearn.externals import joblib
from my_settings import *
from sklearn.ensemble import AdaBoostClassifier
from sklearn.cross_validation import (StratifiedShuffleSplit, cross_val_score)
from sklearn.grid_search import GridSearchCV
subjects = ["0008", "0009", "0010", "0012", "0013", "... | bsd-3-clause |
commaai/openpilot | selfdrive/debug/toyota_eps_factor.py | 1 | 1763 | #!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model # pylint: disable=import-error
from selfdrive.car.toyota.values import STEER_THRESHOLD
from tools.lib.route import Route
from tools.lib.logreader import MultiLogIterator
MIN_SAMPLES = 30 * 100
def ... | mit |
kyleabeauchamp/HMCNotes | code/obsolete/generate_hmr_data.py | 1 | 1507 | import lb_loader
import numpy as np
import pandas as pd
import simtk.openmm as mm
from simtk.openmm import app
from simtk import unit as u
from openmmtools import integrators, testsystems
pd.set_option('display.width', 1000)
n_steps = 3000
temperature = 300. * u.kelvin
masses = [1.0, 2.0, 3.0, 3.5, 4.0]
data = []
for... | gpl-2.0 |
tillrohrmann/flink | flink-python/pyflink/fn_execution/beam/beam_coders.py | 1 | 13848 | ################################################################################
# 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... | apache-2.0 |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/ensemble/plot_voting_probas.py | 1 | 2822 | """
===========================================================
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... | mit |
npit/docker-bde-event-detection-sc7 | event_csv_to_json.py | 1 | 3371 | import pandas, json, sys, math, numpy
events=[]
df = pandas.read_csv(sys.argv[1], header=None)
names="id text entities eventDate sources images areas titles twitter".split()
desired_names="id entities eventDate images areas titl... | apache-2.0 |
Arthaey/anki | oldanki/graphs.py | 20 | 14438 | # -*- coding: utf-8 -*-
# Copyright: Damien Elmes <oldanki@ichi2.net>
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
"""\
Graphs of deck statistics
==============================
"""
__docformat__ = 'restructuredtext'
import os, sys, time
import oldanki.stats
from oldanki.lang import _
... | agpl-3.0 |
huongttlan/statsmodels | examples/python/tsa_arma_0.py | 22 | 4424 |
## Autoregressive Moving Average (ARMA): Sunspots data
from __future__ import print_function
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.graphics.api import qqplot
### Sunpots Data
print(sm.datasets.sunspots.NOTE)
... | bsd-3-clause |
andyh616/mne-python | examples/decoding/plot_decoding_csp_eeg.py | 4 | 5552 | """
===========================================================================
Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)
===========================================================================
Decoding of motor imagery applied to EEG data decomposed using CSP.
Here the classifier... | bsd-3-clause |
stccenter/datadiscovery | ranking/classifiers comparison.py | 1 | 3525 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 11:11:33 2018
Compared muliple common supervised machine learning models
@author: yjiang
"""
import csv
from sklearn import preprocessing
from sklearn import linear_model
from sklearn.metrics import accuracy_score
from sklearn.svm import SVC
from... | apache-2.0 |
jseabold/scikit-learn | examples/neighbors/plot_classification.py | 287 | 1790 | """
================================
Nearest Neighbors Classification
================================
Sample usage of Nearest Neighbors classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColorm... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/tslibs/test_libfrequencies.py | 1 | 2961 | import pytest
from pandas._libs.tslibs.frequencies import INVALID_FREQ_ERR_MSG, _period_str_to_code
from pandas._libs.tslibs.parsing import get_rule_month
from pandas.tseries import offsets
from pandas.tseries.frequencies import is_subperiod, is_superperiod # TODO: move tests
@pytest.mark.parametrize(
"obj,exp... | bsd-3-clause |
aflaxman/scikit-learn | sklearn/datasets/tests/test_rcv1.py | 322 | 2414 | """Test the rcv1 loader.
Skipped if rcv1 is not already downloaded to data_home.
"""
import errno
import scipy.sparse as sp
import numpy as np
from sklearn.datasets import fetch_rcv1
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing i... | bsd-3-clause |
simoninireland/epydemic | utils/make-monitor-progress.py | 1 | 5307 | # Create the doc/cookbook/sir-progress-*.png graphs
#
# Copyright (C) 2017--2020 Simon Dobson
#
# This file is part of epydemic, epidemic network simulations in Python.
#
# epydemic 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 ... | gpl-3.0 |
arjoly/scikit-learn | sklearn/decomposition/__init__.py | 76 | 1490 | """
The :mod:`sklearn.decomposition` module includes matrix decomposition
algorithms, including among others PCA, NMF or ICA. Most of the algorithms of
this module can be regarded as dimensionality reduction techniques.
"""
from .nmf import NMF, ProjectedGradientNMF, non_negative_factorization
from .pca import PCA, Ra... | bsd-3-clause |
beiko-lab/gengis | bin/Lib/site-packages/scipy/stats/morestats.py | 1 | 53721 | # Author: Travis Oliphant, 2002
#
# Further updates and enhancements by many SciPy developers.
#
from __future__ import division, print_function, absolute_import
import math
import warnings
from . import statlib
from . import stats
from .stats import find_repeats
from . import distributions
from numpy i... | gpl-3.0 |
jseabold/scikit-learn | sklearn/neighbors/base.py | 30 | 30586 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | bsd-3-clause |
Ziqi-Li/bknqgis | geopandas/geopandas/io/tests/test_io.py | 1 | 2152 | from __future__ import absolute_import
import fiona
import geopandas
from geopandas import read_postgis, read_file
from geopandas.tests.util import connect, create_db, unittest, validate_boro_df
class TestIO(unittest.TestCase):
def setUp(self):
nybb_zip_path = geopandas.datasets.get_path('nybb')
... | gpl-2.0 |
kaichogami/sympy | examples/advanced/autowrap_ufuncify.py | 45 | 2446 | #!/usr/bin/env python
"""
Setup ufuncs for the legendre polynomials
-----------------------------------------
This example demonstrates how you can use the ufuncify utility in SymPy
to create fast, customized universal functions for use with numpy
arrays. An autowrapped sympy expression can be significantly faster tha... | bsd-3-clause |
mbaijal/incubator-mxnet | example/svm_mnist/svm_mnist.py | 44 | 4094 | # 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 |
yanheven/pyfolio | pyfolio/tests/test_timeseries.py | 5 | 10678 | from __future__ import division
from unittest import TestCase
from nose_parameterized import parameterized
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
from .. import timeseries
DECIMAL_PLACES = 8
class TestDrawdown(TestCase):
px_list_1 = np.array(
[100, 120, 100, 80, 70, 1... | apache-2.0 |
js850/PyGMIN | pygmin/wham/histogram_reweighting1d.py | 1 | 4952 | import numpy as np #to access np.exp() not built int exp
#import timeseries # for timeseries analysis
#import commands
#import pdb;
#import pickle
from wham_potential import WhamPotential
#import matplotlib.pyplot as plt
#from matplotlib.pyplot import *
import wham_utils
class wham1d:
""" class to combine 1d... | gpl-3.0 |
luo66/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 |
Jeremy123W/Optimizing-Employee-Shuttle-Stops | Scripts/sector4.py | 1 | 3275 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 1 20:31:46 2017
@author: jeremy
"""
import math
import pandas as pd
import gmplot
import itertools
import datetime
emp_addresses = pd.read_csv('employees_with_geocode.csv')
bus_stops = pd.read_csv('bus_stops_with_geocode.csv')
#37.78<longitu... | gpl-3.0 |
SEL-Columbia/bamboo | bamboo/core/calculator.py | 2 | 14420 | from collections import defaultdict
from celery.task import task
from pandas import concat, DataFrame
from bamboo.core.aggregator import Aggregator
from bamboo.core.frame import add_parent_column, join_dataset
from bamboo.core.parser import Parser
from bamboo.lib.datetools import recognize_dates
from bamboo.lib.jsont... | bsd-3-clause |
phobson/engarde | engarde/checks.py | 2 | 6328 | # -*- coding: utf-8 -*-
"""
checks.py
Each function in here should
- Take a DataFrame as its first argument, maybe optional arguments
- Makes its assert on the result
- Return the original DataFrame
"""
import numpy as np
import pandas as pd
from engarde import generic
from engarde.generic import verify, verify_all,... | mit |
Alwnikrotikz/marinemap | lingcod/spacing/models.py | 3 | 17201 | from django.contrib.gis.db import models
from django.contrib.gis import geos
from django.contrib.gis.measure import *
from django.core.files import File
from django.db import connection
from django.conf import settings
from lingcod.unit_converter.models import length_in_display_units, area_in_display_units
from ... | bsd-3-clause |
wukan1986/kquant_data | demo_future/A02_download_futureoir.py | 1 | 1545 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
同一品种的下载流程
"""
from WindPy import w
import os
import numpy as np
from datetime import datetime,timedelta
import pandas as pd
from kquant_data.wind.tdays import read_tdays
from kquant_data.config import __CONFIG_TDAYS_SHFE_FILE__
from kquant_data.wind_resume.wset import r... | bsd-2-clause |
rrohan/scikit-learn | examples/decomposition/plot_ica_vs_pca.py | 306 | 3329 | """
==========================
FastICA on 2D point clouds
==========================
This example illustrates visually in the feature space a comparison by
results using two different component analysis techniques.
:ref:`ICA` vs :ref:`PCA`.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA... | bsd-3-clause |
rafaelmds/fatiando | gallery/seismic/convolutional_model.py | 6 | 1804 | r"""
Synthetic seismograms using the convolutional model
---------------------------------------------------
The simplest way to get a seismogram (in time x offset) is through the
convolutional model
.. math::
trace(t) = wavelet(t) \ast reflectivity(t)
Module :mod:`fatiando.seismic.conv` defines functions for d... | bsd-3-clause |
dsullivan7/scikit-learn | examples/text/document_clustering.py | 31 | 8036 | """
=======================================
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 |
gsmaxwell/phase_offset_rx | gr-filter/examples/fmtest.py | 12 | 7793 | #!/usr/bin/env python
#
# Copyright 2009,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... | gpl-3.0 |
glennq/scikit-learn | examples/feature_selection/plot_feature_selection.py | 95 | 2847 | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.