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
plazas/wfirst-detectors-vnl
code/bias_nonlinearity_vs_beta_version2_vs_magnitude.py
1
27257
#!/usr/bin/python import numpy as np import os import sys import math import matplotlib matplotlib.use('Pdf') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from matplotlib.backends.backend_pdf import PdfPages import matplotlib.font_manager as fm ## 7-20-15 ## Simple code to ...
mit
aewhatley/scikit-learn
sklearn/decomposition/truncated_svd.py
199
7744
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA). """ # Author: Lars Buitinck <L.J.Buitinck@uva.nl> # Olivier Grisel <olivier.grisel@ensta.org> # Michael Becker <mike@beckerfuffle.com> # License: 3-clause BSD. import numpy as np import scipy.sparse as sp try: from scipy.sp...
bsd-3-clause
kaiserroll14/301finalproject
main/pandas/io/tests/test_pickle.py
9
7588
# pylint: disable=E1101,E1103,W0232 """ manage legacy pickle tests """ from datetime import datetime, timedelta import operator import pickle as pkl import nose import os from distutils.version import LooseVersion import numpy as np import pandas.util.testing as tm import pandas as pd from pandas import Index from ...
gpl-3.0
aerijman/Transcriptional-Activation-Domains
empirical_null_model/libraries/predictions_library.py
2
5993
import pandas as pd import numpy as np import re,os import matplotlib.pyplot as plt ##################################### MISC. FUNCTIONS ################################## # list of one-letter aa aa = ['R','H','K','D','E','S','T','N','Q','A','V','L','I','M','F' ,'Y', 'W', 'C','G','P'] '''Split data into Train, Tes...
mit
musically-ut/statsmodels
statsmodels/iolib/summary2.py
21
19583
from statsmodels.compat.python import (lrange, iterkeys, iteritems, lzip, reduce, itervalues, zip, string_types, range) from statsmodels.compat.collections import OrderedDict import numpy as np import pandas as pd import datetime import textw...
bsd-3-clause
cginternals/glkernel
benchmarking/visualize.py
1
3064
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 13 12:28:50 2018 @author: florian """ #%% import matplotlib.figure import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas import itertools import seaborn as sns import pandas as pd from numpy im...
mit
Saurabh7/shogun
examples/undocumented/python_modular/graphical/preprocessor_kpca_graphical.py
26
1893
from numpy import * import matplotlib.pyplot as p import os, sys, inspect path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')) if not path in sys.path: sys.path.insert(1, path) del path from generate_circle_data import circle_data cir=circle_data() number_of_points_for_circle1=42 number_of_p...
mit
mrichart/NNcoloring
src/train_NN_cv.py
1
3993
import pickle import gc import numpy as np from sknn.mlp import Classifier, Convolution, Layer from sklearn.pipeline import Pipeline from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import StratifiedShuffleSplit from sklearn.model_selection import cross_val_score patch_sizes = [[3,3]] #[[3...
mit
plotly/python-api
packages/python/plotly/plotly/figure_factory/_bullet.py
2
13154
from __future__ import absolute_import import collections import math from plotly import exceptions, optional_imports import plotly.colors as clrs from plotly.figure_factory import utils import plotly import plotly.graph_objs as go pd = optional_imports.get_module("pandas") def _bullet( df, markers, m...
mit
mahajrod/MACE
MACE/Visualization/TrackGroups.py
1
3534
from MACE.Visualization.Styles.TrackGroup import TrackGroupStyle, default_track_group_style import math from collections import Iterable, OrderedDict import numpy as np import matplotlib.pyplot as plt plt.ioff() from matplotlib.collections import PatchCollection from matplotlib.patches import Rectangle class Track...
apache-2.0
balborian/libmesh
doc/statistics/github_traffic_base.py
1
6329
#!/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, num2date import calendar # Github has a "traffic" page now, but it doesn't seem like you can # put in an arbitrary date range?...
lgpl-2.1
peifu/tests
python/jira/jira_client.py
1
4613
#!/usr/bin/env python3 #coding: utf-8 from jira import JIRA import re import json import prettytable as pt import pandas as pd import numpy as np from io import StringIO DEBUG_ENABLE = 0 MAX_ISSUE = 50 MAX_SUMMARY = 80 JIRA_SERVER = "cfg/jira_server.json" JIRA_FILTER = "cfg/jira_filter.json" JIRA_PATTERN = "project...
gpl-2.0
timy/dm_spec
ana/mpi_spec_1d/plot_orien.py
1
1634
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from itertools import product, combinations n_esmb = 100000 fig = plt.figure() ax = fig.gca(projection='3d') ax.set_aspect("equal") data = np.loadtxt("res/euler.dat") #draw cube # r = [-1, 1] # for s, e in combinations(np.arra...
mit
MSeifert04/astropy
astropy/visualization/wcsaxes/tests/test_wcsapi.py
3
15461
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import warnings from textwrap import dedent import pytest import numpy as np import matplotlib.pyplot as plt from matplotlib.transforms import Affine2D, IdentityTransform from astropy.io import fits from astropy import units as u from astropy...
bsd-3-clause
skjerns/AutoSleepScorerDev
plotting.py
1
13645
# -*- coding: utf-8 -*- """ Created on Mon Jun 19 17:10:40 2017 @author: Simon """ import matplotlib.pyplot as plt import pickle import numpy as np import seaborn as sns import re import sdill as dill from sklearn.metrics import f1_score import tools cmap = sns.cubehelix_palette(8, start=2.8, rot=-.1, as_cmap=True) fs...
gpl-3.0
hrjn/scikit-learn
sklearn/linear_model/tests/test_ridge.py
13
26703
import numpy as np import scipy.sparse as sp from scipy import linalg from itertools import product from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn...
bsd-3-clause
alisaad05/cimpy
cimpy.py
1
13680
#!/usr/bin/env python #import math # import sys import numpy as np import matplotlib.pyplot as plt import mayavi.mlab as ml # to use mayavi mlab scripting tools and rendering from mpl_toolkits.mplot3d import Axes3D #to use Scatter/Scatter 3D from tvtk.api import tvtk # import vtk # All returned arrays...
gpl-2.0
kevin-intel/scikit-learn
examples/ensemble/plot_gradient_boosting_categorical.py
6
9151
""" ================================================ Categorical Feature Support in Gradient Boosting ================================================ .. currentmodule:: sklearn In this example, we will compare the training times and prediction performances of :class:`~ensemble.HistGradientBoostingRegressor` with dif...
bsd-3-clause
schoolie/bokeh
bokeh/sampledata/daylight.py
13
2683
""" Daylight hours from http://www.sunrisesunset.com """ from __future__ import absolute_import from bokeh.util.dependencies import import_required pd = import_required('pandas', 'daylight sample data requires Pandas (http://pandas.pydata.org) to be installed') import re import datetime import requests...
bsd-3-clause
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/pandas/io/excel.py
4
49188
""" Module parse to/from Excel """ #---------------------------------------------------------------------- # ExcelFile class import os import datetime import abc import numpy as np from pandas.io.parsers import TextParser from pandas.io.common import _is_url, _urlopen from pandas.tseries.period import Period from pan...
mit
tapomayukh/projects_in_python
rapid_categorization/haptic_map/NIDRR/Demo_April_2014/hmm_taxel_based_nidrr.py
1
14180
#!/usr/bin/env python # Online haptic_map implementation import pylab as pyl import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy as scp import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy import tf import os #import hrl_l...
mit
dch312/numpy
numpy/lib/twodim_base.py
2
26775
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function from numpy.core.numeric import ( asanyarray, arange, zeros, greater_equal, multiply, ones, asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal, ) from numpy.core import...
bsd-3-clause
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/indexes/timedeltas/test_setops.py
15
2556
import numpy as np import pandas as pd import pandas.util.testing as tm from pandas import TimedeltaIndex, timedelta_range, Int64Index class TestTimedeltaIndex(object): _multiprocess_can_split_ = True def test_union(self): i1 = timedelta_range('1day', periods=5) i2 = timedelta_range('3day',...
apache-2.0
gfyoung/pandas
pandas/tests/dtypes/test_concat.py
3
3254
import pytest import pandas.core.dtypes.concat as _concat import pandas as pd from pandas import DatetimeIndex, Period, PeriodIndex, Series, TimedeltaIndex import pandas._testing as tm @pytest.mark.parametrize( "to_concat, expected", [ # int/float/str ([["a"], [1, 2]], ["i", "object"]), ...
bsd-3-clause
h2oai/h2o-dev
h2o-py/h2o/estimators/pca.py
2
9737
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py # Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details) # from __future__ import absolute_import, division, print_function, unicode_literals from h2o.estimators.estimator_base ...
apache-2.0
jtorrents/networkx
examples/multigraph/chess_masters.py
11
5140
#!/usr/bin/env python """ An example of the MultiDiGraph clas The function chess_pgn_graph reads a collection of chess matches stored in the specified PGN file (PGN ="Portable Game Notation") Here the (compressed) default file --- chess_masters_WCC.pgn.bz2 --- contains all 685 World Chess Championship matches from...
bsd-3-clause
cactusbin/nyt
matplotlib/examples/animation/old_animation/animation_blit_gtk.py
3
1567
#!/usr/bin/env python from __future__ import print_function # For detailed comments on animation and the techniques used here, see # the wiki entry # http://www.scipy.org/wikis/topical_software/MatplotlibAnimation import time import gtk, gobject import matplotlib matplotlib.use('GTKAgg') import numpy as np import ...
unlicense
cbmoore/statsmodels
statsmodels/datasets/macrodata/data.py
25
3184
"""United States Macroeconomic data""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is public domain.""" TITLE = __doc__ SOURCE = """ Compiled by Skipper Seabold. All data are from the Federal Reserve Bank of St. Louis [1] except the unemployment rate which was taken from the National Bureau of...
bsd-3-clause
robcarver17/pysystemtrade
systems/accounts/curves/account_curve_group.py
1
5186
from copy import copy import pandas as pd from syscore.dateutils import Frequency from systems.accounts.curves.account_curve import accountCurve from systems.accounts.curves.dict_of_account_curves import dictOfAccountCurves from systems.accounts.pandl_calculators.pandl_generic_costs import GROSS_CURVE, NET_CURVE, COS...
gpl-3.0
pombredanne/django-cachalot
benchmark.py
3
10323
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals, print_function from collections import OrderedDict import io import os import platform from random import choice import re import sqlite3 from subprocess import check_output from time import time os.environ.setdefault('DJANGO_SETTINGS_MOD...
bsd-3-clause
scottpurdy/NAB
nab/plot.py
4
17555
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
klocey/hydrobide
figure_code/MacroecologyPatterns/DiversityAbundanceScaling.py
8
3887
from __future__ import division import matplotlib.pyplot as plt import pandas as pd import numpy as np import os import sys import scipy as sc from scipy import stats import statsmodels.stats.api as sms import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.stats.outliers_influence import ...
mit
boompieman/iim_project
project_python2/lib/python2.7/site-packages/IPython/terminal/ipapp.py
5
13824
#!/usr/bin/env python # encoding: utf-8 """ The :class:`~IPython.core.application.Application` object for the command line :command:`ipython` program. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import from __future__ import ...
gpl-3.0
astocko/statsmodels
examples/incomplete/arima.py
34
1605
from __future__ import print_function from statsmodels.datasets.macrodata import load_pandas from statsmodels.tsa.base.datetools import dates_from_range from statsmodels.tsa.arima_model import ARIMA import matplotlib.pyplot as plt import numpy as np import statsmodels.api as sm plt.interactive(False) # let's examine a...
bsd-3-clause
leggitta/mne-python
mne/tests/test_report.py
9
8943
# Authors: Mainak Jas <mainak@neuro.hut.fi> # Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) import os import os.path as op import glob import warnings import shutil from nose.tools import assert_true, assert_equal, assert_raises from mne import Epochs, read_events, pick_types, read_evokeds ...
bsd-3-clause
capitancambio/scikit-neuralnetwork
sknn/mlp.py
1
20512
from __future__ import (absolute_import, unicode_literals, print_function) __all__ = ['MultiLayerPerceptronRegressor', 'MultiLayerPerceptronClassifier'] import os import time import logging import itertools log = logging.getLogger('sknn') # By default, we force Theano to use a GPU and fallback to CPU, using 32-bit...
bsd-3-clause
TeamHG-Memex/eli5
tests/utils.py
1
4565
# -*- coding: utf-8 -*- from __future__ import print_function import os import inspect import json from pprint import pprint from hypothesis.strategies import integers from hypothesis.extra.numpy import arrays import numpy as np from eli5.base import Explanation from eli5.formatters import format_as_text, format_as_h...
mit
xgds/xgds_plot
xgds_plot/staticPlot.py
1
5302
#!/usr/bin/env python #__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file...
apache-2.0
Srisai85/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
IssamLaradji/scikit-learn
examples/linear_model/plot_logistic_path.py
349
1195
#!/usr/bin/env python """ ================================= Path with L1- Logistic Regression ================================= Computes path on IRIS dataset. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from datetime import datetime import numpy as np import...
bsd-3-clause
LCAV/pyroomacoustics
examples/room_from_rt60.py
1
2970
""" This example creates a room with reverberation time specified by inverting Sabine's formula. This results in a reverberation time slightly longer than desired. The simulation is pure image source method. The audio sample with the reverb added is saved back to `examples/samples/guitar_16k_reverb.wav`. """ import arg...
mit
operalib/operalib
operalib/kernels.py
2
18637
""" :mod:`operalib.kernels` implements some Operator-Valued Kernel models. """ # Author: Romain Brault <romain.brault@telecom-paristech.fr> with help from # the scikit-learn community. # License: MIT from numpy import dot, diag, sqrt from sklearn.metrics.pairwise import rbf_kernel from sklearn.kernel_approxim...
bsd-3-clause
joansmith/openmicroscopy
components/tools/OmeroPy/src/omero/install/perf_test.py
11
11850
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Add: screen/plate # Add: plotting # import re import os import sys import path import time import omero import logging import omero.cli import omero.util import omero.util.temp_files import uuid command_pattern = "^\s*(\w+)(\((.*)\))?(:(.*))?$" command_pattern_compi...
gpl-2.0
altairpearl/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
glouppe/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
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/scipy/signal/spectral.py
7
66506
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import _lombscargle from ._arraytools import const_ext, even_ext, odd_ext, zero_ext import warning...
mit
shogun-toolbox/shogun
examples/undocumented/python/graphical/classifier_perceptron_graphical.py
2
2321
import matplotlib.pyplot as plt import numpy as np parameter_list = [[20, 5, 1, 1000, 1, None, 5], [100, 5, 1, 1000, 1, None, 10]] def classifier_perceptron_graphical(n=100, distance=5, learn_rate=1, max_iter=1000, num_threads=1, seed=None, nperceptrons=5): import shogun as sg...
bsd-3-clause
victor-prado/broker-manager
environment/lib/python3.5/site-packages/pandas/tests/frame/test_mutate_columns.py
7
7831
# -*- coding: utf-8 -*- from __future__ import print_function from pandas.compat import range, lrange import numpy as np from pandas import DataFrame, Series, Index from pandas.util.testing import (assert_series_equal, assert_frame_equal, assertRaise...
mit
ClusterWhisperer/clusterstats
tests/test_http.py
1
8802
"""Testcases for the clusterstats module.""" import unittest import json from pprint import pprint import httpretty from requests import HTTPError, Timeout import pandas as pd from clusterstats import http from clusterstats import stats class ClusterStatsTest(unittest.TestCase): def test_read_servers(self): ...
mit
rhyolight/nupic.research
projects/l2_pooling/capacity_test.py
4
61224
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the ...
gpl-3.0
mirestrepo/voxels-at-lems
bmvc12/bof/plot_category_accuracy_all_trials.py
1
2424
#!/usr/bin/env python # encoding: utf-8 """ Author: Isabel Restrepo """ import os import sys import os; import optparse; import time; import sys; import numpy as np import matplotlib import matplotlib.pyplot as plt import glob main_dir="/Users/isa/Experiments/BOF/helicopter_providence"; clf_name = "svm_gamma_10.0...
bsd-2-clause
Mrngilles/matplotlib-styles
examples/test_functions.py
1
1342
import numpy as np import matplotlib.pyplot as plt import scipy.special as spsp PTS_NUM = 200 def sinplot(num = 5): fig, ax = plt.subplots() x = np.linspace(0, 14, PTS_NUM) for i in xrange(1, num): ax.plot(x, np.sin(x + 0.5*i)*(num-i), 'o-', label="i = {}".format(i)) ax.set_title("Modified sinu...
mit
fyffyt/scikit-learn
examples/decomposition/plot_faces_decomposition.py
204
4452
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
bjanesh/odi-tools
docs/source/conf.py
1
11137
# -*- coding: utf-8 -*- # # odi-tools documentation build configuration file, created by # sphinx-quickstart on Wed Aug 17 15:20:27 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
bsd-3-clause
Mazecreator/tensorflow
tensorflow/contrib/timeseries/examples/known_anomaly.py
53
6786
# 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
liyu1990/sklearn
sklearn/model_selection/tests/test_validation.py
20
27961
"""Test the validation module""" from __future__ import division import sys import warnings import numpy as np from scipy.sparse import coo_matrix, csr_matrix from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils...
bsd-3-clause
teuben/masc
examples/fitsdiff3.py
2
1131
#! /usr/bin/env python # # This routine can diff images from its neighbors. For a series i=1,N # this can loop over i=2,N-2 to produce N-2 difference images # # B_i = A_i - (A_i-1 + A_i+1) / 2 # # Optionally some hanning smoothing could be applied to the difference # image to improved source detection # from __futu...
mit
nipy/brainx
brainx/recarrutil.py
2
6756
"""Some utilities for manipulating recarrays. Warning ------- This module should *never* be imported as 'import *' """ import numpy as np import numpy.testing as nt import sys # The functionality in this module is now better provided by # Pandas' DataFrame -- http://pandas.pydata.org/ sys.stderr.write('brainx.reca...
bsd-3-clause
wesm/statsmodels
scikits/statsmodels/graphics/tsaplots.py
2
2369
import numpy as np #copied/moved from sandbox/tsa/example_arma.py def plotacf(ax, corr, lags=None, usevlines=True, **kwargs): """ Plot the auto or cross correlation. lags on horizontal and correlations on vertical axis Note: adjusted from matplotlib's pltxcorr Parameters ---------- ax ...
bsd-3-clause
ravindrapanda/tensorflow
tensorflow/python/estimator/inputs/queues/feeding_functions_test.py
59
13552
# 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
kHarshit/DAT210x_Microsoft
Module4/assignment1.py
1
3417
import pandas as pd import matplotlib.pyplot as plt import matplotlib import datetime from mpl_toolkits.mplot3d import Axes3D from plyfile import PlyData, PlyElement # Every 100 data samples, we save 1. If things run too # slow, try increasing this number. If things run too fast, # try decreasing it... =) reduce_fac...
mit
phdowling/scikit-learn
sklearn/datasets/lfw.py
141
19372
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
smartscheduling/scikit-learn-categorical-tree
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
poryfly/scikit-learn
sklearn/tests/test_isotonic.py
230
11087
import numpy as np import pickle from sklearn.isotonic import (check_increasing, isotonic_regression, IsotonicRegression) from sklearn.utils.testing import (assert_raises, assert_array_equal, assert_true, assert_false, assert_equal, ...
bsd-3-clause
wiheto/teneto
teneto/classes/bids.py
1
22842
"""TenetoBIDS is a class to use Teneto functions with data organized with BIDS (neuroimaging data).""" import os import inspect import json # import bids import importlib import numpy as np import pandas as pd import bids from .. import __path__ as tenetopath from .. import __version__ as tenetoversion from ..neuroimag...
gpl-3.0
0h-n0/forex_py
frxpy/data/csvfile.py
1
1436
""" csvfile.py --------------- This module contains some classes which can treat csv files. .. autoclass:: fileio.csvfile.CSV """ import time import codecs import pathlib import calendar import h5py import pandas import numpy as np class CSVFile(object): def __init__(self, csvfile, header_info='ohlc', bita...
mit
kylerbrown/scikit-learn
examples/datasets/plot_random_dataset.py
348
2254
""" ============================================== Plot randomly generated classification dataset ============================================== Plot several randomly generated 2D classification datasets. This example illustrates the :func:`datasets.make_classification` :func:`datasets.make_blobs` and :func:`datasets....
bsd-3-clause
rikima/spark
python/pyspark/sql/tests.py
1
272759
# -*- encoding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the ...
apache-2.0
lazywei/scikit-learn
sklearn/datasets/base.py
196
18554
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
bsd-3-clause
nhejazi/scikit-learn
examples/cluster/plot_digits_agglomeration.py
377
1694
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Feature agglomeration ========================================================= These images how similar features are merged together using feature agglomeration. """ print(__doc__) # Code source: Gaël Varoquaux #...
bsd-3-clause
homeslike/OpticalTweezer
scripts/data2/vCOMhist.py
28
1192
import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab import sys # import vCOMdata.dat as array # folder="../output/runs/170123_2033/" folder="../output/runs/"+str(sys.argv[1]) # when = str(sys.argv[1]) for i in range(0,len(sys.argv)): print(str(i) + ": "+ str(sys.argv[i])) # data = np....
mit
Srisai85/scikit-learn
benchmarks/bench_isotonic.py
268
3046
""" Benchmarks of isotonic regression performance. We generate a synthetic dataset of size 10^n, for n in [min, max], and examine the time taken to run isotonic regression over the dataset. The timings are then output to stdout, or visualized on a log-log scale with matplotlib. This alows the scaling of the algorith...
bsd-3-clause
Jokiva/Computational-Physics
lecture 14/Problem_3.py
1
2068
# import packages import numpy as np import matplotlib.pyplot as plt # the amount of shift up verti_dev = 3 # the modified integrand def f_prime(x): return 2 * np.sin(2 * np.sqrt(np.pi ** 2 - x ** 2)) + verti_dev if __name__ == '__main__': # test block """ x = np.linspace(0, np.pi) y = f_prime(...
gpl-3.0
cpcloud/ibis
ibis/config.py
1
20553
# This file has been adapted from pandas/core/config.py. pandas 3-clause BSD # license. See LICENSES/pandas # # Further modifications: # # Copyright 2014 Cloudera 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 ...
apache-2.0
etkirsch/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid 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 ListedColormap f...
bsd-3-clause
gmatteo/pymatgen
pymatgen/io/abinit/pseudos.py
5
65306
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides objects describing the basic parameters of the pseudopotentials used in Abinit, and a parser to instantiate pseudopotential objects.. """ import abc import collections import logging im...
mit
monkeypants/MAVProxy
MAVProxy/modules/lib/wxhorizon_ui.py
1
32242
import time from MAVProxy.modules.lib.wxhorizon_util import Attitude, VFR_HUD, Global_Position_INT, BatteryInfo, FlightState, WaypointInfo, FPS from MAVProxy.modules.lib.wx_loader import wx import math, time import matplotlib matplotlib.use('wxAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Fi...
gpl-3.0
wathen/PhD
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/SplitMatrix/MHDfluid.py
1
14477
#!/usr/bin/python # interpolate scalar gradient onto nedelec space import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc from dolfin import * Print = PETSc.Sys.Print # from MatrixOperations import * import numpy as np #import matplotlib.pylab as plt import PETScIO as IO import common import ...
mit
gaoshuming/udacity
tutorials/weight-initialization/helper.py
153
3649
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf def hist_dist(title, distribution_tensor, hist_range=(-4, 4)): """ Display histogram of a TF distribution """ with tf.Session() as sess: values = sess.run(distribution_tensor) plt.title(title) plt.hist(values, ...
mit
cjayb/mne-python
mne/viz/tests/test_topo.py
2
11648
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Robert Luke <mail@robertluke.net> # # License: Simplified BSD import os.path as op from col...
bsd-3-clause
kagayakidan/scikit-learn
sklearn/preprocessing/data.py
68
57385
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # License: BSD 3 clause from itertools import chain, combina...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/metrics/tests/test_ranking.py
75
40883
from __future__ import division, print_function import numpy as np from itertools import product import warnings from scipy.sparse import csr_matrix from sklearn import datasets from sklearn import svm from sklearn import ensemble from sklearn.datasets import make_multilabel_classification from sklearn.random_projec...
bsd-3-clause
zackriegman/pydnn
docs/conf.py
1
12621
# -*- coding: utf-8 -*- # # pydnn documentation build configuration file, created by # sphinx-quickstart on Tue Mar 24 09:05:39 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
mit
robbymeals/scikit-learn
sklearn/utils/tests/test_extmath.py
130
16270
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from scipy import stats from sklearn.utils.testing import assert_eq...
bsd-3-clause
jbedorf/tensorflow
tensorflow/contrib/timeseries/examples/predict.py
24
5843
# 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
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/matplotlib/tests/test_lines.py
5
5451
""" Tests specific to the lines module. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import itertools import matplotlib.lines as mlines import nose from nose.tools import assert_true, assert_raises from timeit import repeat import numpy as ...
apache-2.0
ch3ll0v3k/scikit-learn
benchmarks/bench_plot_fastkmeans.py
294
4676
from __future__ import print_function from collections import defaultdict from time import time import numpy as np from numpy import random as nr from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans def compute_bench(samples_range, features_range): it = 0 results = defaultdict(lambda: []) chun...
bsd-3-clause
JosmanPS/scikit-learn
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
okadate/romspy
romspy/tplot/tplot_wind.py
1
3991
# coding: utf-8 # (c) 2015-11-28 Teruhisa Okada import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter import netCDF4 import numpy as np import pandas as pd import romspy def stick_plot_default(time, u, v, **kw): from matplotlib.dates import date2num #width = kw.pop('width', ...
mit
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/nolearn-0.5/nolearn/decaf.py
11
6033
import os import sys from nolearn import cache import numpy as np from sklearn.base import BaseEstimator def _transform_cache_key(self, X): if len(X) == 1: raise cache.DontCache return ','.join([ str(X), str(len(X)), str(sorted(self.get_params().items())), ]) class C...
bsd-3-clause
yw374cornell/e-mission-server
bin/regenerate_data.py
2
2686
# Regenerate score and footprint information for a set of users. In the # production system, we only calculate the score for users who were part of the # "game" group and the footprint for users who were part of the "data" group. # When we want to analyse their engagement, though, we want to compare data # across all g...
bsd-3-clause
Monika319/EWEF-1
Cw2Rezonans/Karolina/Oscyloskop/OscyloskopZ5W3.py
1
1316
# -*- coding: utf-8 -*- """ Plot oscilloscope files from MultiSim """ import numpy as np import matplotlib.pyplot as plt import sys import os from matplotlib import rc rc('font',family="Consolas") files=["real_zad5_033f.txt"] for NazwaPliku in files: print NazwaPliku Plik=open(NazwaPliku) #print DeltaT ...
gpl-2.0
stylianos-kampakis/scikit-learn
examples/linear_model/plot_sparse_recovery.py
243
7461
""" ============================================================ 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
rhyswhitley/savanna_iav
src/figures/trends/rainfall_compare.py
1
4100
#!/usr/bin/env python2 import os import numpy as np import pandas as pd import netCDF4 as nc import seaborn as sns import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.dates as mdates from scipy import stats def fit_trend(x, y): z = np.polyfit(x, y, 1) p = np.poly1d(z) ...
cc0-1.0
cbertinato/pandas
pandas/tests/frame/test_reshape.py
1
39296
from datetime import datetime import itertools import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Period, Series, Timedelta, date_range) from pandas.tests.frame.common import TestData import pandas.util.testing as tm from pandas.util.testing import assert_frame...
bsd-3-clause
vermouthmjl/scikit-learn
sklearn/linear_model/tests/test_sparse_coordinate_descent.py
34
9987
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
kmike/scikit-learn
sklearn/feature_selection/rfe.py
4
14193
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD Style. """Recursive feature elimination for feature ranking""" import numpy as np from ..utils import check_arrays, safe_sqr, safe_mask from .....
bsd-3-clause
fegonda/icon_demo
code/model/unet/old/unet_multiChannel.py
1
15594
# yet another version of the IDSIA network # based on code from keras tutorial # http://keras.io/getting-started/sequential-model-guide/ from keras.models import Model, Sequential, model_from_json from keras.layers import Dense, Activation, Flatten, Input from keras.layers import Convolution2D, MaxPooling2D, UpSamplin...
mit
krzjoa/sciquence
sciquence/shapelets/shapelet_classifier.py
1
1335
# -*- coding: utf-8 -*- # Krzysztof Joachimiak 2017 # sciquence: Time series & sequences in Pythonn # # Shapelet processor # Author: Krzysztof Joachimiak # # License: MIT from shapelet_utils import all_candidates from sklearn.preprocessing import scale from sklearn.base import BaseEstimator class ShapeletClassifier(...
mit
ryi06/inferelator_ng
inferelator_ng/tests/test_results_processor.py
3
11794
import unittest from .. import results_processor import pandas as pd import numpy as np class TestResultsProcessor(unittest.TestCase): def test_combining_confidences_one_beta(self): # rescaled betas are only in the beta = pd.DataFrame(np.array([[0.5, 0], [0.5, 1]]), ['gene1', 'gene2'], ['tf1','tf...
bsd-2-clause