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 |
|---|---|---|---|---|---|
snipsco/ntm-lasagne | examples/sort-task.py | 1 | 3993 | import theano
import theano.tensor as T
import numpy as np
import matplotlib.pyplot as plt
from lasagne.layers import InputLayer, DenseLayer, ReshapeLayer
import lasagne.layers
import lasagne.nonlinearities
import lasagne.updates
import lasagne.objectives
import lasagne.init
from ntm.layers import NTMLayer
from ntm.m... | mit |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/sklearn/cluster/tests/test_affinity_propagation.py | 341 | 2620 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... | mit |
hobson/pug-invest | pug/invest/bin/cost-test.py | 1 | 1550 | from pug.invest.util import clipped_area
# from scipy.optimize import minimize
import pandas as pd
from matplotlib import pyplot as plt
np = pd.np
t = ['2014-12-09T00:00', '2014-12-09T00:15', '2014-12-09T00:30', '2014-12-09T00:45', '2014-12-09T01:00', '2014-12-09T01:15', '2014-12-09T01:30', '2014-12-09T01:45']
ts = p... | mit |
shenzebang/scikit-learn | examples/model_selection/plot_train_error_vs_test_error.py | 349 | 2577 | """
=========================
Train error vs Test error
=========================
Illustration of how the performance of an estimator on unseen data (test data)
is not the same as the performance on training data. As the regularization
increases the performance on train decreases while the performance on test
is optim... | bsd-3-clause |
rbiswas4/Cadence | gedankenLSST/gedankenLSST.py | 1 | 5658 | import numpy as np
import pandas as pd
__all__ = ['LSSTReq', 'GSN_Obs']
lsstBands = ['u', 'g', 'r', 'i', 'z', 'y']
LSSTReq = dict()
# Total Duration of survey in days
LSSTReq['Duration'] = 3650.
# Median Single Visit five Sigma Depth in mags
LSSTReq['medianSVD'] = pd.Series([23.9, 25., 24.7, 24.,23.3, 22.1],
... | mit |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/core/indexes/range.py | 1 | 26312 | from datetime import timedelta
import operator
from sys import getsizeof
from typing import Union
import warnings
import numpy as np
from pandas._libs import index as libindex
import pandas.compat as compat
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, cache_readonly
fr... | apache-2.0 |
vrooje/volcrowe_code | sessions_inproj_byuser_nonpanoptes.py | 1 | 20786 | #Python 2.7.9 (default, Apr 5 2015, 22:21:35)
import sys
# file with raw classifications (csv)
# put this way up here so if there are no inputs we exit quickly before even trying to load everything else
default_statstart = "session_stats"
try:
classfile_in = sys.argv[1]
except:
#classfile_in = 'data/2e3d12a2... | gpl-2.0 |
rcrowder/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_cairo.py | 69 | 16706 | """
A Cairo backend for matplotlib
Author: Steve Chaplin
Cairo is a vector graphics library with cross-device output support.
Features of Cairo:
* anti-aliasing
* alpha channel
* saves image files as PNG, PostScript, PDF
http://cairographics.org
Requires (in order, all available from Cairo website):
cairo, pyc... | agpl-3.0 |
danellecline/mbari-aesa | learn.py | 1 | 20418 | #!/usr/bin/env python
__author__ = "Danelle Cline"
__copyright__ = "Copyright 2016, MBARI"
__license__ = "GNU License"
__maintainer__ = "Danelle Cline"
__email__ = "dcline at mbari.org"
__status__ = "Development"
__doc__ = '''
This script runs transfer learning on the AESA training data set using the inception v3 mod... | gpl-3.0 |
marqh/vectorfield | lib/vectorfield/__init__.py | 1 | 7093 | import matplotlib.pyplot as plt
import numpy as np
import cartopy.crs as ccrs
import cartopy.mpl.geoaxes as geo_ax
import iris
from iris.analysis.interpolate import regrid
from iris.cube import Cube
class VectorField(object):
"""
A collection of vector components which together represent a single
vector... | gpl-3.0 |
akuefler/fovea | tests/polygon_testing.py | 2 | 2019 | """
polygon testing
"""
from __future__ import division
import PyDSTool.Toolbox.phaseplane as pp
import PyDSTool as dst
import matplotlib as mpl
import matplotlib.pyplot as plt
import shapely.geometry as geom
from shapely.geometry import polygon as P
from descartes.patch import PolygonPatch
def plot_coords(ax, ob, co... | bsd-3-clause |
tomlof/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 63 | 6459 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
google/makani | analysis/util/autoglide_analysis.py | 1 | 6988 | #!/usr/bin/python
# Copyright 2020 Makani Technologies LLC
#
# 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 applicabl... | apache-2.0 |
joshloyal/scikit-learn | sklearn/datasets/tests/test_lfw.py | 42 | 7253 | """This test for the LFW require medium-size data downloading and processing
If the data has not been already downloaded by running the examples,
the tests won't run (skipped).
If the test are run, the first execution will be long (typically a bit
more than a couple of minutes) but as the dataset loader is leveraging... | bsd-3-clause |
lorenzo-desantis/mne-python | examples/realtime/rt_feedback_server.py | 11 | 4945 | """
==============================================
Real-time feedback for decoding :: Server Side
==============================================
This example demonstrates how to setup a real-time feedback
mechanism using StimServer and StimClient.
The idea here is to display future stimuli for the class which
is pred... | bsd-3-clause |
hrjn/scikit-learn | examples/neural_networks/plot_mnist_filters.py | 79 | 2189 | """
=====================================
Visualization of MLP weights on MNIST
=====================================
Sometimes looking at the learned coefficients of a neural network can provide
insight into the learning behavior. For example if weights look unstructured,
maybe some were not used at all, or if very l... | bsd-3-clause |
ME-ICA/me-ica | meica.libs/mdp/configuration.py | 1 | 15454 | from __future__ import with_statement
import sys
import os
import tempfile
import inspect
import mdp
from repo_revision import get_git_revision
import cStringIO as StringIO
__docformat__ = "restructuredtext en"
class MetaConfig(type):
"""Meta class for config object to allow for pretty printing
of class conf... | lgpl-2.1 |
ville-k/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py | 52 | 69800 | # 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 |
susilehtola/psi4 | psi4/driver/qcdb/psivardefs.py | 7 | 15690 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
toastedcornflakes/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 161 | 1380 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
rs2/pandas | pandas/tests/config/test_config.py | 5 | 18257 | import warnings
import pytest
from pandas._config import config as cf
from pandas._config.config import OptionError
import pandas as pd
class TestConfig:
@classmethod
def setup_class(cls):
from copy import deepcopy
cls.cf = cf
cls.gc = deepcopy(getattr(cls.cf, "_global_config"))
... | bsd-3-clause |
mrklees/CYPY | cyautomation/cyschoolhouse/cyschoolhousesuite.py | 2 | 4759 | # -*- coding: utf-8 -*-
"""cyschoolhouse Suite
This suite is a set of helper functions which address the broader task of
accessing data on cyschoolhouse. This will include navigation functions, logins,
and other common tasks we can antipicate needing to do for multiple products.
"""
import io, getpass, logging, pickle... | gpl-3.0 |
wholmgren/pvlib-python | pvlib/irradiance.py | 1 | 108916 | """
The ``irradiance`` module contains functions for modeling global
horizontal irradiance, direct normal irradiance, diffuse horizontal
irradiance, and total irradiance under various conditions.
"""
from __future__ import division
import datetime
from collections import OrderedDict
from functools import partial
imp... | bsd-3-clause |
jmschrei/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 |
ifcharming/voltdb2.0 | tools/vis-micro-hudson.py | 4 | 9316 | #!/usr/bin/env python
# This is a visualizer which pulls microbenchmark results from the MySQL
# databases and visualizes them. Four graphs will be generated per workload,
# latency graphs on single node and multiple nodes, and throughput graphs
# on single node and multiple nodes.
#
# Run it without any arguments to ... | gpl-3.0 |
rinze/kaggle-public | instacart/most_common_items_double_weight.py | 1 | 2474 | import sqlite3
import pandas as pd
import csv
import gzip
from collections import defaultdict
if __name__ == '__main__':
conn = sqlite3.connect('data/instacart.db')
c = conn.cursor()
# This does the same (?; re-check) and is much faster
q = """
SELECT user_id,
MIN(n_items) AS min_items... | gpl-2.0 |
lewisodriscoll/sasview | src/sas/sascalc/calculator/sas_gen.py | 1 | 40392 | # pylint: disable=invalid-name
"""
SAS generic computation and sld file readers
"""
from __future__ import print_function
import sas.sascalc.calculator.core.sld2i as mod
from sas.sascalc.calculator.BaseComponent import BaseComponent
from periodictable import formula
from periodictable import nsf
import numpy as np
imp... | bsd-3-clause |
lekshmideepu/nest-simulator | pynest/examples/evaluate_quantal_stp_synapse.py | 8 | 9445 | # -*- coding: utf-8 -*-
#
# evaluate_quantal_stp_synapse.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 o... | gpl-2.0 |
matthiaskoenig/sbmlutils | misc/biomodels/biomodel_statistics.py | 1 | 4884 | """
Creates statistics of biomodels.
Models are 31th Biomodels Release
https://www.ebi.ac.uk/biomodels/content/news/biomodels-release-26th-june-2017
"""
import os
import pandas as pd
import libsbml
def get_model_paths(model_folder):
"""Returns list of SBML paths from given folder."""
paths = []
for f in... | lgpl-3.0 |
Spartronics4915/2016-Stronghold | src/org/usfirst/frc/team4915/stronghold/vision/jetson/imgExplore2/common.py | 5 | 6318 | #!/usr/bin/env python
'''
This module contais some common routines used by other samples.
'''
import numpy as np
import cv2
import os
from contextlib import contextmanager
import itertools as it
image_extensions = ['.bmp', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.pbm', '.pgm', '.ppm']
class Bunch(object):
de... | mit |
joequant/zipline | zipline/utils/test_utils.py | 8 | 9150 | from contextlib import contextmanager
from itertools import (
product,
)
from logbook import FileHandler
from mock import patch
from numpy.testing import assert_array_equal
import operator
from zipline.finance.blotter import ORDER_STATUS
from zipline.utils import security_list
from six import (
itervalues,
)
fr... | apache-2.0 |
fredhusser/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
jmcnamara/pandas_xlsxwriter_charts | examples/chart_axis_labels.py | 1 | 1613 | ##############################################################################
#
# An example of creating a chart with Pandas and XlsxWriter.
#
# Copyright 2013, John McNamara, jmcnamara@cpan.org
#
import random
import pandas as pd
# Some sample data to plot.
cat_1 = ['y1', 'y2', 'y3', 'y4']
index_1 = range(0, 21, 1)... | bsd-2-clause |
openworm/tracker-commons | src/Python/temp_example.py | 3 | 1338 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 13 00:47:21 2015
@author: Michael
"""
import numpy as np
import pandas as pd
import warnings
from six import StringIO
import json
from wcon import WCONWorms, MeasurementUnit
pd.set_option('display.expand_frame_repr', False)
# Suppress RuntimeWarni... | mit |
moutai/scikit-learn | examples/svm/plot_weighted_samples.py | 95 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
jswoboda/ISRSpectrum | Examples/elineex.py | 1 | 1935 | #!/usr/bin/env python
"""
elineexample.py
Created on Sun Dec 27 15:28:19 2015
This example shows everything up to electron line for magnitized and non-magnitized plasmas.
@author: John Swoboda
"""
import numpy as np
from ISRSpectrum import Specinit
import matplotlib.pylab as plt
import seaborn as sns
if __name__== ... | mit |
marcocaccin/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 206 | 1800 | """
===================================================================
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 |
teonlamont/mne-python | tutorials/plot_dipole_fit.py | 4 | 4429 | # -*- coding: utf-8 -*-
"""
============================================================
Source localization with equivalent current dipole (ECD) fit
============================================================
This shows how to fit a dipole using mne-python.
For a comparison of fits between MNE-C and mne-python, see... | bsd-3-clause |
OWASP/django-DefectDojo | dojo/tools/contrast/parser.py | 2 | 4897 | __author__ = 'aaronweaver'
import pandas as pd
import hashlib
from dojo.models import Finding, Endpoint
class ContrastCSVParser(object):
def __init__(self, filename, test):
dupes = dict()
self.items = ()
if filename is None:
self.items = ()
return
df = p... | bsd-3-clause |
vityurkiv/Ox | libmesh/doc/statistics/cloc_libmesh.py | 1 | 7881 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import math
# Import stuff for working with dates
from datetime import datetime
from matplotlib.dates import date2num
# git checkout `git rev-list -n 1 --before="$my_date" master`
# cloc.pl src/*/*.C include/*/*.h
data = [
# 2003 - All data fro... | lgpl-2.1 |
bearicc/3d-soil-vis | convert.py | 1 | 1196 | import scipy as sp
import numpy as np
import pandas as pd
from pyproj import *
import os
filename = ["data/05044572.xyzi",
"data/05044574.xyzi",
"data/05064572.xyzi",
"data/05064574.xyzi",
]
data_list = []
for i in range(len(filename)):
print("Load data "+filename[i]+" ..."... | gpl-3.0 |
vybstat/scikit-learn | benchmarks/bench_plot_nmf.py | 206 | 5890 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | bsd-3-clause |
jskew/gnuradio | gr-utils/python/utils/plot_data.py | 59 | 5818 | #
# Copyright 2007,2008,2011 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 option)
# any later ve... | gpl-3.0 |
Mitchkoens/sympy | sympy/plotting/plot_implicit.py | 4 | 14408 | """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 |
yyjiang/scikit-learn | examples/missing_values.py | 233 | 3056 | """
======================================================
Imputing missing values before building an estimator
======================================================
This example shows that imputing the missing values can give better results
than discarding the samples containing any missing value.
Imputing does not ... | bsd-3-clause |
HaroldMills/Vesper | scripts/plot_night_call_distributions.py | 1 | 7706 | """
Script that plots nightly NFC temporal distributions.
The script plots distributions for three nights and three detectors
for data collected at the Harold monitoring station from October 21-23,
2020.
The script expects several CSV input files, each containing clip metadata
for one detector and all three nights. T... | mit |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/decomposition/tests/test_sparse_pca.py | 160 | 6028 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | mit |
waynenilsen/statsmodels | statsmodels/sandbox/survival2.py | 35 | 17924 | #Kaplan-Meier Estimator
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
from scipy import stats
from statsmodels.iolib.table import SimpleTable
class KaplanMeier(object):
"""
KaplanMeier(...)
KaplanMeier(data, endog, exog=None, censoring=None)
Create an object of... | bsd-3-clause |
tosolveit/scikit-learn | examples/classification/plot_lda.py | 70 | 2413 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
pypot/scikit-learn | sklearn/linear_model/tests/test_ransac.py | 216 | 13290 | import numpy as np
from numpy.testing import assert_equal, assert_raises
from numpy.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises_regexp
from scipy import sparse
from sklearn.utils.testing import assert_less
from sklearn.linear_model import LinearRegression, RANSACRegressor
f... | bsd-3-clause |
arahuja/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 |
DaveBackus/Data_Bootcamp | Code/Lab/WB_nipa.py | 1 | 4069 | """
Messing around with World Bank data.
Prepared for the NYU Course "Data Bootcamp."
More at https://github.com/DaveBackus/Data_Bootcamp
NIPA codes
General government final consumption expenditure (current LCU) NE.CON.GOVT.CN
Household final consumption expenditure, etc. (current LCU) NE.CON.PETC.CN
Household final ... | mit |
RobertABT/heightmap | build/matplotlib/lib/matplotlib/fontconfig_pattern.py | 4 | 6517 | """
A module for parsing and generating fontconfig patterns.
See the `fontconfig pattern specification
<http://www.fontconfig.org/fontconfig-user.html>`_ for more
information.
"""
# Author : Michael Droettboom <mdroe@stsci.edu>
# License : matplotlib license (PSF compatible)
# This class is defined here because it m... | mit |
thegodone/pyms | Display/Class.py | 7 | 10046 | """
Class to Display Ion Chromatograms and TIC
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005-2012 Vladi... | gpl-2.0 |
pnedunuri/scikit-learn | sklearn/tests/test_cross_validation.py | 29 | 46740 | """Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse import csr_matrix
from scipy import stats
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.test... | bsd-3-clause |
gsmafra/sklearn-dummies | sklearn_dummies/base.py | 1 | 2836 | """
Base module.
"""
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin
class DataFrameDummies(TransformerMixin):
"""
Attributes
----------
cat_cols : list
List of categorical columns
final_cols : list
List of all columns with dummy values
... | mit |
Vvkmnn/books | ThinkBayes/code/sat.py | 1 | 12399 | from __future__ import print_function
"""This file contains code used in "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import csv
import math
import numpy
import sys
import matplotlib
import matplotlib.p... | gpl-3.0 |
Eigenstate/msmbuilder | msmbuilder/project_templates/msm/timescales-plot.py | 9 | 1908 | """Plot implied timescales vs lagtime
{{header}}
"""
# ? include "plot_header.template"
# ? from "plot_macros.template" import xdg_open with context
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
sns.set_style('ticks')
colors = sns.color_palette()
## Load
timescal... | lgpl-2.1 |
Castronova/EMIT | gui/views/PlotView.py | 1 | 2750 | from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar
import matplotlib.pyplot as plt
import seaborn as sb
sb.set_style("ticks")
class PlotView:
def __init__(self, panel):
self.figure = pl... | gpl-2.0 |
hainm/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 176 | 2169 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... | bsd-3-clause |
swkrueger/Thrifty | thrifty/toads_analysis.py | 1 | 10388 | """Calculate stats on data in .toads file.'"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
from thrifty impo... | gpl-3.0 |
bmazin/ARCONS-pipeline | examples/Pal2012-0656/writePL.py | 1 | 5316 | #!/bin/python
'''
Author: Matt Strader Date: March 6,2013
This program opens a series of observations of a pulsar and makes them into photon lists.
Only photons in a circular aperture around the expected position of the pulsar are put into the photon lists
'''
from util.ObsFile import ObsFile
from util.FileName... | gpl-2.0 |
briceburg/airflow | airflow/contrib/plugins/metastore_browser/main.py | 42 | 5126 | from datetime import datetime
import json
from flask import Blueprint, request
from flask.ext.admin import BaseView, expose
import pandas as pd
from airflow.hooks import HiveMetastoreHook, MySqlHook, PrestoHook, HiveCliHook
from airflow.plugins_manager import AirflowPlugin
from airflow.www import utils as wwwutils
M... | apache-2.0 |
brookehus/msmbuilder | msmbuilder/utils/probability.py | 12 | 1089 | from __future__ import print_function, division, absolute_import
import numpy as np
from sklearn.utils import check_random_state
__all__ = ['categorical']
def categorical(pvals, size=None, random_state=None):
"""Return random integer from a categorical distribution
Parameters
----------
pvals : sequ... | lgpl-2.1 |
nesterione/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 278 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
sandiegodata/age-friendly-communities | users/calvin/ageDataOver65_v3.py | 1 | 3606 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 23:56:12 2016
@author: CC
Using Python 3.5.2; Anaconda 4.2.0; Spyder 3.0.0
Purpose: open a CSV file from https://censusreporter.org/ and recode it with the corresponding JSON file
CSV raw data file containing age census data in San Diego: 'acs... | mit |
CompPhysics/MachineLearning | doc/LectureNotes/_build/jupyter_execute/chapter2.py | 1 | 43255 | # Resampling Methods
[Video of Lecture](https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h20/forelesningsvideoer/LectureSept3.mp4?vrtx=view-as-webpage)
## Introduction
Resampling methods are an indispensable tool in modern
statistics. They involve repeatedly drawing samples from a training
set and refitting ... | cc0-1.0 |
fivejjs/pyhsmm | examples/svi.py | 4 | 1487 | from __future__ import division
import numpy as np
from numpy import newaxis as na
from matplotlib import pyplot as plt
from os.path import join, dirname, isfile
from pyhsmm import models, distributions
from pyhsmm.util.general import sgd_passes, hold_out, get_file
from pyhsmm.util.text import progprint_xrange, progpr... | mit |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/tests/sparse/test_groupby.py | 18 | 1736 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import pandas.util.testing as tm
class TestSparseGroupBy(object):
def setup_method(self, method):
self.dense = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
'foo', 'bar', 'foo', 'foo'],
... | mit |
dpshelio/scikit-image | doc/examples/plot_edge_filter.py | 14 | 2258 | """
==============
Edge operators
==============
Edge operators are used in image processing within edge detection algorithms.
They are discrete differentiation operators, computing an approximation of the
gradient of the image intensity function.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.d... | bsd-3-clause |
Roboticmechart22/sms-tools | lectures/05-Sinusoidal-model/plots-code/peaks-on-spectrogram.py | 21 | 1317 | import numpy as np
import matplotlib.pyplot as plt
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi... | agpl-3.0 |
tyarkoni/pliers | pliers/tests/utils.py | 1 | 1973 | from os.path import dirname, join
from copy import deepcopy
import numpy as np
import pandas as pd
from pliers.stimuli import ImageStim
from pliers.extractors.base import Extractor, ExtractorResult
from pliers.transformers import BatchTransformerMixin
def get_test_data_path():
"""Returns the path to test datase... | bsd-3-clause |
gkioxari/RstarCNN | lib/fast_rcnn/test_scene.py | 1 | 8794 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
# --------------------------------------------------------
# R*CNN
# Wri... | bsd-2-clause |
mdesco/dipy | doc/examples/streamline_tools.py | 8 | 11609 | """
=========================================================
Connectivity Matrices, ROI Intersections and Density Maps
=========================================================
This example is meant to be an introduction to some of the streamline tools
available in dipy. Some of the functions covered in this example... | bsd-3-clause |
lensacom/sparkit-learn | splearn/preprocessing/tests/test_data.py | 2 | 1915 | # -*- coding: utf-8 -*-
"""
"""
from numpy.testing import assert_array_almost_equal
from sklearn.preprocessing import StandardScaler
from splearn.preprocessing.data import SparkStandardScaler
from splearn.utils.testing import SplearnTestCase
class TestSparkStandardScaler(SplearnTestCase):
def test_same_fit_tran... | apache-2.0 |
aetilley/scikit-learn | benchmarks/bench_plot_neighbors.py | 287 | 6433 | """
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import numpy as np
import pylab as pl
from matplotlib import ticker
from sklearn import neighbors, datasets
def get_data(N, D, dataset='dense'):
if dataset == 'dense':
np.random.seed(0)
return np.... | bsd-3-clause |
Djabbz/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 |
boland1992/seissuite_iran | build/lib.linux-x86_64-2.7/seissuite/ant/pspreprocess.py | 2 | 22507 | #!/usr/bin/env python
"""
Module that contains classes pertaining to key pre-prosessing methods
with respect to ambient noise seismic waveforms. These practically
should then be used to find the cross-correlation function of the waveforms
with time.
"""
from seissuite.ant import pserrors, psstation, psutils
... | gpl-3.0 |
mvfcopetti/pySSN | pyssn/utils/Config.py | 1 | 3121 | '''
Created on 16/01/2014
@author: morisset
'''
import os
from .misc import execution_path
from .logging import my_logging
class _Config(object):
"""
This is the place where to put stuff that any module may need, a kind of COMMON.
An instantiation is done in the main __init__ file using the "config" name.... | gpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/numpy/lib/polynomial.py | 35 | 37641 | """
Functions to operate on polynomials.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import re
import warnings
import numpy.core.... | mit |
phobson/statsmodels | statsmodels/datasets/star98/data.py | 3 | 3939 | """Star98 Educational Testing dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = "Star98 Educational Dataset"
SOURCE = """
Jeff Gill's `Generalized Linear Models: A Unified Approach`
http://jgill.wustl.e... | bsd-3-clause |
timestocome/Test-stock-prediction-algorithms | StockMarketMovingAverage/ARMA_ARIMA.py | 1 | 5635 | # http://github.com/timestocome
# take a look at the differences in daily returns for recent bull and bear markets
# http://afoysal.blogspot.com/2016/08/arma-and-arima-timeseries-prediction.html
# predictions appear to increase and decrease with actual returns but scale is much smaller
# of course if it was this eas... | mit |
lupien/pyHegel | pyHegel/qt_wrap.py | 1 | 9843 | # -*- coding: utf-8 -*-
########################## Copyrights and license ############################
# #
# Copyright 2011-2015 Christian Lupien <christian.lupien@usherbrooke.ca> #
# ... | lgpl-3.0 |
stefanpeidli/GoNet | Visualizations.py | 1 | 2717 | # -*- coding: utf-8 -*-
"""
@author: Stefan Peidli
License: MIT
Tags: Neural Network
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import colors
from Filters import apply_filters_by_id as filt
n = 9
test_data = np.round(np.random.uniform(-1, 1, (n, n)), 0)
# Visual... | mit |
elkingtonmcb/scikit-learn | sklearn/semi_supervised/label_propagation.py | 71 | 15342 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
ycaihua/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 45 | 5463 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
saiphcita/crowdsource-platform | fixtures/createJson.py | 16 | 2463 | __author__ = 'Megha'
# Script to transfer csv containing data about various models to json
# Input csv file constituting of the model data
# Output json file representing the csv data as json object
# Assumes model name to be first line
# Field names of the model on the second line
# Data seperated by __DELIM__
# Examp... | mit |
thomasaarholt/hyperspy | hyperspy/defaults_parser.py | 2 | 10674 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 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 |
kaiserroll14/301finalproject | main/pandas/tests/test_msgpack/test_newspec.py | 9 | 2586 | # coding: utf-8
from pandas.msgpack import packb, unpackb, ExtType
def test_str8():
header = b'\xd9'
data = b'x' * 32
b = packb(data.decode(), use_bin_type=True)
assert len(b) == len(data) + 2
assert b[0:2] == header + b'\x20'
assert b[2:] == data
assert unpackb(b) == data
data = b'x... | gpl-3.0 |
vortex-ape/scikit-learn | examples/linear_model/plot_sgd_early_stopping.py | 7 | 5697 | """
=============================================
Early stopping of Stochastic Gradient Descent
=============================================
Stochastic Gradient Descent is an optimization technique which minimizes a loss
function in a stochastic fashion, performing a gradient descent step sample by
sample. In particu... | bsd-3-clause |
github4ry/pathomx | setup.py | 2 | 3147 | #!/usr/bin/env python
# coding=utf-8
import os, sys
from copy import copy
import collections
from setuptools import setup, find_packages
__version__ = open('VERSION','rU').read()
sys.path.insert(0,'pathomx')
setup(
name='Pathomx',
version=__version__,
author='Martin Fitzpatrick',
author_email='martin... | gpl-3.0 |
jayflo/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 45 | 15091 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
fr... | bsd-3-clause |
abgoswam/data-science-from-scratch | code/working_with_data.py | 61 | 16549 | from __future__ import division
from collections import Counter, defaultdict
from functools import partial
from linear_algebra import shape, get_row, get_column, make_matrix, \
vector_mean, vector_sum, dot, magnitude, vector_subtract, scalar_multiply
from statistics import correlation, standard_deviation, mean
from... | unlicense |
NunoEdgarGub1/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 142 | 6276 | 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 |
atantet/transferCZ | tau/get_tau_norm.py | 1 | 13502 | import numpy as np
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from mpl_toolkits.basemap import Basemap, addcyclic
from scipy.io import FortranFile
# Amplification factor for the mean wind stress
ampMean = 3.0
initDir = '../init/'
nlat = 31
nlon = 30
year0 = 1961
year... | gpl-2.0 |
abhisg/scikit-learn | benchmarks/bench_glm.py | 297 | 1493 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... | bsd-3-clause |
Garrett-R/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 17 | 6222 | 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 |
taylorhxu/pybrain | examples/supervised/evolino/superimposed_sine.py | 25 | 3496 | from __future__ import print_function
#!/usr/bin/env python
__author__ = 'Michael Isik'
from pylab import plot, show, ion, cla, subplot, title, figlegend, draw
import numpy
from pybrain.structure.modules.evolinonetwork import EvolinoNetwork
from pybrain.supervised.trainers.evolino import EvolinoTrainer
from l... | bsd-3-clause |
peixian/Ultralisk | glaive/glaive.py | 1 | 3111 | import sklearn.cross_validation as cv
from sklearn import tree
import pandas as pd
import numpy as np
import os.path
import pprint
import matplotlib.pyplot as plt
import seaborn as sns
import runExperiments
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
from pybr... | mit |
hmendozap/auto-sklearn | test/automl/test_estimators.py | 1 | 6084 | # -*- encoding: utf-8 -*-
from __future__ import print_function
import os
import sys
import unittest
import numpy as np
import autosklearn.pipeline.util as putil
from autosklearn.classification import AutoSklearnClassifier
from autosklearn.util.backend import Backend
from autosklearn.constants import *
sys.path.appe... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.