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 |
|---|---|---|---|---|---|
ryfeus/lambda-packs | LightGBM_sklearn_scipy_numpy/source/sklearn/datasets/species_distributions.py | 3 | 8841 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/details/3038/0>`_ ,
the Bro... | mit |
Ziqi-Li/bknqgis | pandas/pandas/tests/sparse/test_pivot.py | 21 | 2390 | import numpy as np
import pandas as pd
import pandas.util.testing as tm
class TestPivotTable(object):
def setup_method(self, method):
self.dense = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
'foo', 'bar', 'foo', 'foo'],
'B': ... | gpl-2.0 |
hugobowne/scikit-learn | sklearn/utils/estimator_checks.py | 9 | 56482 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memory
from sklearn.utils.testing imp... | bsd-3-clause |
jreback/pandas | pandas/tests/io/json/test_pandas.py | 1 | 61595 | import datetime
from datetime import timedelta
from io import StringIO
import json
import os
import sys
import numpy as np
import pytest
from pandas.compat import IS64, PY38, is_platform_windows
import pandas.util._test_decorators as td
import pandas as pd
from pandas import DataFrame, DatetimeIndex, Series, Timesta... | bsd-3-clause |
woutdenolf/spectrocrunch | spectrocrunch/process/axis.py | 1 | 19935 | # -*- coding: utf-8 -*-
import sys
import difflib
import numpy as np
import pandas as pd
from ..utils import units
from ..utils import instance
from ..utils import listtools
def arg_closest_num(arr, value, check):
if check(value):
return value
else:
return np.argmin(np.abs(arr - value))
def... | mit |
wzbozon/statsmodels | statsmodels/datasets/longley/data.py | 25 | 1930 | """Longley dataset"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
The classic 1967 Longley Data
http://www.itl.nist.gov/div898/strd/lls/data/Longley.shtml
::
Longley, J.W. (1967) "An Appraisal of Least Squares Programs for the
El... | bsd-3-clause |
edhuckle/statsmodels | statsmodels/sandbox/mle.py | 33 | 1701 | '''What's the origin of this file? It is not ours.
Does not run because of missing mtx files, now included
changes: JP corrections to imports so it runs, comment out print
'''
from __future__ import print_function
import numpy as np
from numpy import dot, outer, random, argsort
from scipy import io, linalg, optimize
... | bsd-3-clause |
h2educ/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
brainwater/keras | examples/addition_rnn.py | 50 | 5900 | # -*- coding: utf-8 -*-
from __future__ import print_function
from keras.models import Sequential, slice_X
from keras.layers.core import Activation, Dense, RepeatVector
from keras.layers import recurrent
from sklearn.utils import shuffle
import numpy as np
"""
An implementation of sequence to sequence learning for per... | mit |
willu47/SALib | docs/conf.py | 1 | 9282 | # -*- coding: utf-8 -*-
#
# 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 configuration values have a default; values that are commented out
# serve to show the default.
import os
impo... | mit |
VirusTotal/msticpy | tools/mp_demo_data.py | 1 | 7926 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Demo Qu... | mit |
Titan-C/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 5 | 28816 | 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 |
pySTEPS/pysteps | pysteps/verification/plots.py | 1 | 6468 | # -- coding: utf-8 --
"""
pysteps.verification.plots
==========================
Methods for plotting verification results.
.. autosummary::
:toctree: ../generated/
plot_intensityscale
plot_rankhist
plot_reldiag
plot_ROC
"""
from matplotlib import cm
import matplotlib.pylab as plt
from mpl_toolki... | bsd-3-clause |
Titan-C/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 112 | 3203 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
amolkahat/pandas | pandas/tests/tseries/offsets/test_ticks.py | 3 | 8345 | # -*- coding: utf-8 -*-
"""
Tests for offsets.Tick and subclasses
"""
from datetime import datetime, timedelta
import pytest
import numpy as np
from hypothesis import given, assume, example, strategies as st
from pandas import Timedelta, Timestamp
from pandas.tseries import offsets
from pandas.tseries.offsets import ... | bsd-3-clause |
rbiswas4/shablona | shablona/shablona.py | 1 | 5476 | import numpy as np
import pandas as pd
from matplotlib import mlab
from scipy.special import erf
import scipy.optimize as opt
def transform_data(data):
"""
Function that takes experimental data and gives us the
dependent/independent variables for analysis
Parameters
----------
data : Pand... | mit |
terkkila/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 44 | 17033 | import tempfile
import shutil
import os.path as op
import warnings
from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.externals import joblib
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.t... | bsd-3-clause |
olafhauk/mne-python | tutorials/epochs/plot_10_epochs_overview.py | 4 | 20205 | # -*- coding: utf-8 -*-
"""
.. _tut-epochs-class:
The Epochs data structure: discontinuous data
=============================================
This tutorial covers the basics of creating and working with :term:`epoched
<epochs>` data. It introduces the :class:`~mne.Epochs` data structure in
detail, including how to lo... | bsd-3-clause |
KasparSnashall/Z-scan-models | Closed-scan-fitting.py | 1 | 6143 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 08:42:33 2015
@author: Kaspar Martin Snashall
script designed to normalise and fit z-scan data using stochiastic method
includes two models for fitting v1 and v2
license = MIT
"""
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from os import ... | mit |
d00d/quantNotebooks | Notebooks/strategies/09072017-Multi-Factor-Volume-Value-Momentum-Quality.py | 1 | 4586 | from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.factors import CustomFactor, SimpleMovingAverage
from quantopian.pipeline.data import morningstar
import pandas as pd
import n... | unlicense |
jmeyers314/batoid | batoid/optic.py | 1 | 63933 | from collections import OrderedDict
import numpy as np
from .coating import SimpleCoating
from .obscuration import ObscNegation, ObscCircle, ObscAnnulus
from .constants import globalCoordSys, vacuum
from .coordsys import CoordTransform
from .rayVector import concatenateRayVectors
from .utils import lazy_property
cl... | bsd-2-clause |
statwonk/lifetimes | lifetimes/plotting.py | 2 | 8682 | import numpy as np
import pandas as pd
from lifetimes.utils import coalesce, calculate_alive_path
__all__ = [
'plot_period_transactions',
'plot_calibration_purchases_vs_holdout_purchases',
'plot_frequency_recency_matrix',
'plot_probability_alive_matrix',
'plot_expected_repeat_purchases',
'plot_... | mit |
gfyoung/scipy | scipy/stats/stats.py | 1 | 202270 | # Copyright 2002 Gary Strangman. All rights reserved
# Copyright 2002-2016 The SciPy Developers
#
# The original code from Gary Strangman was heavily adapted for
# use in SciPy by Travis Oliphant. The original code came with the
# following disclaimer:
#
# This software is provided "as-is". There are no expressed or... | bsd-3-clause |
raghavgupta0296/Learning-Deep-Learning-Libraries | StocksTfLSTM/StocksPred.py | 1 | 2616 | import pandas as pd
import numpy as np
import tensorflow as tf
# read csv
data = pd.read_csv("nvda.csv")
data = np.array(data["Close"])
# print (data)
# invert array ordering - old to new dates
data2 = []
for i in range(len(data)-1,-1,-1):
data2.append(data[i])
data2 = np.array(data2)
data = data2
... | mit |
BhallaLab/moose-full | moose-examples/snippets/testWigglySpines.py | 2 | 8167 | ##################################################################
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2015 Upinder S. Bhalla. and NCBS
## It is made available under the terms of the
## GNU Lesser General Public License version 2.1
## S... | gpl-2.0 |
alorenzo175/pvlib-python | pvlib/test/test_crn.py | 2 | 2370 | import inspect
import os
import pandas as pd
from pandas.util.testing import assert_frame_equal
import numpy as np
from numpy import dtype, nan
from pvlib.iotools import crn
test_dir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe())))
testfile = os.path.join(test_dir,
... | bsd-3-clause |
FlyRanch/figurefirst | inkscape_extensions/1.x/tag_group.py | 1 | 2488 | #!/usr/bin/env python
import sys
sys.path.append('/usr/share/inkscape/extensions') # or another path, as necessary
sys.path.append('/Applications/Inkscape.app/Contents/Resources/extensions')
sys.path.append('C:\Program Files\Inkscape\share\extensions')
from lxml import etree
#import xml.etree.ElementTree as ET
#ET.regi... | mit |
shikhardb/scikit-learn | examples/classification/plot_lda_qda.py | 164 | 4806 | """
====================================================================
Linear and Quadratic Discriminant Analysis with confidence ellipsoid
====================================================================
Plot the confidence ellipsoids of each class and decision boundary
"""
print(__doc__)
from scipy import lin... | bsd-3-clause |
ClimbsRocks/scikit-learn | examples/decomposition/plot_incremental_pca.py | 175 | 1974 | """
===============
Incremental PCA
===============
Incremental principal component analysis (IPCA) is typically used as a
replacement for principal component analysis (PCA) when the dataset to be
decomposed is too large to fit in memory. IPCA builds a low-rank approximation
for the input data using an amount of memo... | bsd-3-clause |
Zhenxingzhang/AnalyticsVidhya | BigMartSales/TrainingModel.py | 1 | 2999 | import pandas as pd
import numpy as np
from sklearn import cross_validation, metrics, ensemble
from sklearn.linear_model import LinearRegression, Ridge, Lasso
import matplotlib.pyplot as plt
from sklearn.grid_search import GridSearchCV
def baseline(train_data):
# mean_sales = train_data['Item_Outlet_Sales'].mean(... | apache-2.0 |
akosiaris/kafka | system_test/utils/metrics.py | 28 | 13903 | # 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 |
mrGeen/metaseq | metaseq/test/examples/atf3_peaks.py | 3 | 4408 | """
Practical testing grounds to see what sorts of features are needed. Heavily
commented to serve as interim documentation.
Use the download_data.py script in the test/data dir to get ENCODE CTCF
ChIP-seq data.
Different modes -- TSS, intron, peaks.
Each one generates features of interest, and then grabs the raw d... | mit |
PatrickOReilly/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 |
lidavidm/sympy | sympy/utilities/runtests.py | 3 | 75854 | """
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly
(or identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* po... | bsd-3-clause |
LiaoPan/scikit-learn | examples/tree/plot_iris.py | 271 | 2186 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
andim/scipy | tools/refguide_check.py | 29 | 23595 | #!/usr/bin/env python
"""
refguide_check.py [OPTIONS] [-- ARGS]
Check for a Scipy 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 |
jburos/survivalstan | survivalstan/sim.py | 1 | 3086 |
"""
Functions to simulate failure-time data
for testing & model checking purposes
"""
import numpy as np
import pandas as pd
import patsy
def sim_data_exp(N, censor_time, rate):
"""
simulate true lifetimes (t) according to exponential model
Parameters
-----------
N: (int) num... | apache-2.0 |
Ziqi-Li/bknqgis | pandas/pandas/tests/indexes/test_multi.py | 2 | 114953 | # -*- coding: utf-8 -*-
import re
import warnings
from datetime import timedelta
from itertools import product
import pytest
import numpy as np
import pandas as pd
from pandas import (CategoricalIndex, DataFrame, Index, MultiIndex,
compat, date_range, period_range)
from pandas.compat import PY... | gpl-2.0 |
PatrickOReilly/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 176 | 2027 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
w-k-jones/brownian | test_brownian.py | 1 | 4959 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 22 21:02:33 2016
@author: William Jones
History:
22/10/2016: WJ - Created file, replicating matlab script collisiontrial.m
"""
import sys
import numpy as np
import matplotlib.pyplot as plt
# Define NaN array creation routine to save time
def na... | mit |
ikki407/stacking | examples/multi_class/scripts/multiclass.py | 1 | 10841 | # -*- coding: utf-8 -*-
# ----- for creating dataset -----
from sklearn.datasets import load_digits
from sklearn.cross_validation import train_test_split
# ----- general import -----
import pandas as pd
import numpy as np
# ----- stacking library -----
from stacking.base import FOLDER_NAME, PATH, INPUT_PATH, TEMP_PA... | mit |
Pragmatismo/Pigrow | scripts/visualisation/humid_graph.py | 1 | 5362 | #!/usr/bin/python3
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import datetime, sys, os
import numpy as np
homedir = os.getenv("HOME")
try:
sys.path.append(homedir + '/Pigrow/scripts/')
import pigrow_defs
script = 'humid_graph.py'
loc_locs = homedir + '/Pigrow/config/dirlocs... | gpl-3.0 |
droundy/deft | papers/pair-correlation/figs/plot-path-triplet-contact.py | 1 | 15672 | #!/usr/bin/python
from __future__ import division
import matplotlib, sys
if len(sys.argv) < 3 or sys.argv[2] != "show":
matplotlib.use('Agg')
from pylab import *
import scipy.ndimage
import os.path
import math
import matplotlib.patheffects
import bracket # our handy bracket function
import styles # our preferred lin... | gpl-2.0 |
tradingcraig/trading-with-python | cookbook/getDataFromYahooFinance.py | 77 | 1391 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 16 18:37:23 2011
@author: jev
"""
from urllib import urlretrieve
from urllib2 import urlopen
from pandas import Index, DataFrame
from datetime import datetime
import matplotlib.pyplot as plt
sDate = (2005,1,1)
eDate = (2011,10,1)
symbol = 'SPY'
fNa... | bsd-3-clause |
ZENGXH/scikit-learn | examples/cluster/plot_segmentation_toy.py | 258 | 3336 | """
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
spectral clustering is used to separate the circles.
In these settings, the :ref:`spectral_clustering` approach solve... | bsd-3-clause |
adamhaney/airflow | airflow/contrib/operators/hive_to_dynamodb.py | 21 | 4084 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
richlewis42/pandas-learn | tests/test_adaptor/test_regressor.py | 1 | 2591 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of pandas-learn
# https://github.com/RichLewis42/pandas-learn
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
# Copyright (c) 2015, Rich Lewis <rl403@cam.ac.uk>
"""
tests.test_adaptor.regressor
~~~~~~~~~~~~~~~~~~~~~~~~~~~... | mit |
samuel1208/scikit-learn | examples/cluster/plot_lena_compress.py | 271 | 2229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Vector Quantization Example
=========================================================
The classic image processing example, Lena, an 8-bit grayscale
bit-depth, 512 x 512 sized image, is used here to illustrate
how ... | bsd-3-clause |
jrn223/Freestyle | app/Stock_market_data.py | 1 | 3248 | # for email functionality, credit @s2t2
import os
import sendgrid
from sendgrid.helpers.mail import * # source of Email, Content, Mail, etc.
# for day of week
import datetime
# to query Google stock data
from pandas_datareader import data
from datetime import date, timedelta
#for sorting biggest gains to biggest los... | mit |
fboers/jumeg | jumeg/decompose/ica.py | 1 | 24050 | # Authors: Lukas Breuer <l.breuer@fz-juelich.de>
'''
Created on 27.11.2015
@author: lbreuer
'''
#######################################################
# #
# import necessary modules #
# ... | bsd-3-clause |
quadflor/Quadflor | Code/lucid_ml/gold_digger.py | 1 | 3411 | #!/usr/bin/env python3
import argparse
import pandas as pd
from operator import itemgetter
from collections import Counter
import numpy as np
try:
import matplotlib.pyplot as plt
PLOT=True
except ImportError:
print("WARNING: ImportError on matplotlib, I will not draw graphics")
PLOT=False
def gather(f... | bsd-3-clause |
pnedunuri/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
waynenilsen/statsmodels | examples/python/wls.py | 33 | 2675 |
## Weighted Least Squares
from __future__ import print_function
import numpy as np
from scipy import stats
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.sandbox.regression.predstd import wls_prediction_std
from statsmodels.iolib.table import (SimpleTable, default_txt_fmt)
np.random.seed... | bsd-3-clause |
sipjca/ccrypto_bot | chart.py | 1 | 10814 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.finance import candlestick_ochl
from matplotlib.dates import MinuteLocator, HourLocator, DayLocator, \
WeekdayLocator, MonthLocator, date2num, DateFormatter
import matplotlib.ticker as ticker
from telegram import InlineKeyboardMarku... | mit |
JackKelly/neuralnilm_prototype | scripts/e388.py | 2 | 6642 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
jmetzen/skgp | doc/sphinxext/gen_rst.py | 2 | 40958 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
iABC2XYZ/abc | Epics/rnn/DataRnnBPM2.1.py | 1 | 4696 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import matplotlib.pyplot as plt
plt.close('all')
numEpoch=100000
learningRate=0.3
depthRNN=8
numInput=10
numOutput=14
nameFo... | gpl-3.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/sklearn/examples/linear_model/plot_bayesian_ridge.py | 1 | 4683 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | mit |
ningchi/scikit-learn | examples/cluster/plot_kmeans_digits.py | 53 | 4524 | """
===========================================================
A demo of K-Means clustering on the handwritten digits data
===========================================================
In this example we compare the various initialization strategies for
K-means in terms of runtime and quality of the results.
As the gr... | bsd-3-clause |
percyfal/bokeh | bokeh/core/compat/mplexporter/renderers/base.py | 16 | 14360 | import warnings
import itertools
from contextlib import contextmanager
import numpy as np
from matplotlib import transforms
from .. import utils
from .. import _py3k_compat as py3k
class Renderer(object):
@staticmethod
def ax_zoomable(ax):
return bool(ax and ax.get_navigate())
@staticmethod
... | bsd-3-clause |
EmreAtes/spack | var/spack/repos/builtin/packages/py-goatools/package.py | 5 | 2106 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
petosegan/scikit-learn | examples/cluster/plot_digits_linkage.py | 369 | 2959 | """
=============================================================================
Various Agglomerative Clustering on a 2D embedding of digits
=============================================================================
An illustration of various linkage option for agglomerative clustering on
a 2D embedding of the di... | bsd-3-clause |
p-l-/ivre | setup.py | 1 | 19612 | #! /usr/bin/env python
# This file is part of IVRE.
# Copyright 2011 - 2020 Pierre LALET <pierre@droids-corp.org>
#
# IVRE 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
#... | gpl-3.0 |
kwikadi/orange3 | Orange/evaluation/testing.py | 2 | 24515 | import numpy as np
import sklearn.cross_validation as skl_cross_validation
from Orange.data import Table, Domain, ContinuousVariable, DiscreteVariable
__all__ = ["Results", "CrossValidation", "LeaveOneOut", "TestOnTrainingData",
"ShuffleSplit", "TestOnTestData", "sample"]
class Results:
"""
Clas... | bsd-2-clause |
jrleeman/MetPy | examples/plots/Station_Plot.py | 5 | 5551 | # Copyright (c) 2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Station Plot
============
Make a station plot, complete with sky cover and weather symbols.
The station plot itself is pretty straightforward, but there is a bit of code t... | bsd-3-clause |
heidecjj/openpilot | selfdrive/test/plant/maneuverplots.py | 3 | 4628 | import os
import numpy as np
import matplotlib.pyplot as plt
import pylab
from selfdrive.config import Conversions as CV
class ManeuverPlot(object):
def __init__(self, title = None):
self.time_array = []
self.gas_array = []
self.brake_array = []
self.steer_torque_array = []
self.distance_arr... | mit |
akoerner/HCC-Swanson | oldToolLayout/Tool2/HCCTool1.py | 1 | 6630 | #!/usr/bin/env python
# copyright 2013 UNL Holland Computing Center
#
# 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
#
# U... | apache-2.0 |
jpautom/scikit-learn | benchmarks/bench_isolation_forest.py | 40 | 3136 | """
==========================================
IsolationForest benchmark
==========================================
A test of IsolationForest on classical anomaly detection datasets.
"""
print(__doc__)
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import IsolationFore... | bsd-3-clause |
evanbiederstedt/RRBSfun | scripts/repeat_finder_scripts/faster_repeats/temp_RRBS_NormalBCD19pCD27pcell45_66.py | 1 | 1385 | import glob
import pandas as pd
import numpy as np
df1 = pd.read_csv("repeats_hg19.csv")
RRBS_files = glob.glob("RRBS_NormalBCD19pCD27pcell45_66*")
df_dict = {group : df for group, df in df1.groupby(by="chr")}
# In[11]:
from numpy import nan
def between_range(row, group_dict):
# get sub dataframe from dicti... | mit |
spallavolu/scikit-learn | examples/svm/plot_svm_margin.py | 318 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
tawsifkhan/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 |
asurve/arvind-sysml2 | scripts/perftest/python/google_docs/stats.py | 15 | 3540 | #!/usr/bin/env python3
# -------------------------------------------------------------
#
# 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 ... | apache-2.0 |
mkenworthy/exorings | starspot/starspot_anim.py | 1 | 12010 | import numpy as np
def make_isocosahedron():
g = (1. + np.sqrt(5)) / 2. # the golden ratio
# looking outside the isocosahedron in to the origin
# the vertices go in an anticlockwise direction around each face
# and the faces touch each other sequentially
v = np.array([
[ 0, 1, g],
[... | isc |
cauchycui/scikit-learn | sklearn/kernel_approximation.py | 258 | 17973 | """
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps base on Fourier transforms.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import svd
from .base im... | bsd-3-clause |
shenzebang/scikit-learn | benchmarks/bench_plot_svd.py | 325 | 2899 | """Benchmarks of Singular Value Decomposition (Exact and Approximate)
The data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import numpy as np
from collections import defaultdict
from scipy.linalg import svd
from sklearn.utils.extmath import randomized_svd
from sklearn.datasets.s... | bsd-3-clause |
ConeyLiu/spark | python/pyspark/sql/pandas/map_ops.py | 11 | 3636 | #
# 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 |
sarahgrogan/scikit-learn | sklearn/utils/tests/test_seq_dataset.py | 93 | 2471 | # Author: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.seq_dataset import ArrayDataset, CSRDataset
from sklearn.datasets import load_iris
from numpy.testing import assert_array_equal
from nose.tools import assert_equal
iris =... | bsd-3-clause |
Thomsen22/MissingMoney | Peak Load Reserve - EU system/optimization.py | 1 | 1599 | # Python standard modules
import pandas as pd
# Own modules
from dayahead_optclass import DayAhead
def optimization():
market = DayAhead()
market.optimize()
times = market.data.times
zones = market.data.zones
generators = market.data.generators
lines = market.data.lines
... | gpl-3.0 |
vamsirajendra/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/geo.py | 69 | 19738 | import math
import numpy as np
import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.artist import kwdocd
from matplotlib.axes import Axes
from matplotlib import cbook
from matplotlib.patches import Circle
from matplotlib.path import Path
from matplotlib.ticker import Formatter, Locat... | agpl-3.0 |
nick-thompson/wavetable | dsp/wavetable/wavetable.py | 2 | 3892 | """
Module for generating band-limited sine, triangle, sawtooth, and square
wavetables.
Construction is done with additive synthesis, including partials just up to
Nyquist so as to avoid aliasing, with no accommodation for the Gibbs Phenomenon.
Note that the table size and the sample rate in this implementation are f... | mit |
shusenl/scikit-learn | examples/mixture/plot_gmm_sin.py | 248 | 2747 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
EIT-ICT-RICH/ns-3-dev-TSCH | src/core/examples/sample-rng-plot.py | 188 | 1246 | # -*- Mode:Python; -*-
# /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRA... | gpl-2.0 |
HeraclesHX/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
fspaolo/scikit-learn | examples/cluster/plot_cluster_iris.py | 7 | 2577 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
skggm/skggm | inverse_covariance/tests/quic_graph_lasso_test.py | 1 | 10064 | import numpy as np
import pytest
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_allclose
from sklearn import datasets
from inverse_covariance import (
QuicGraphicalLasso,
QuicGraphicalLassoCV,
QuicGraphicalLassoEBIC,
quic,
)
def custom_init(X):
init_cov ... | mit |
wanggang3333/scikit-learn | sklearn/decomposition/tests/test_pca.py | 199 | 10949 | import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
ocefpaf/ulmo | test/cpc_drought_test.py | 4 | 3655 | import pandas
import ulmo
import test_util
test_sets = [
{
'filename': 'cpc/drought/palmer88',
'start': '1989-01-22',
'end': '1989-01-28',
'state': 'TX',
'climate_division': 1,
'values': [{
'cmi': -0.11,
'pdsi': 0.0,
'period': '... | bsd-3-clause |
squall1988/lquant | backtest/finance/controls.py | 11 | 12900 | #
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | bsd-2-clause |
nvoron23/statsmodels | statsmodels/tsa/statespace/tests/test_representation.py | 6 | 19651 | """
Tests for representation module
Author: Chad Fulton
License: Simplified-BSD
References
----------
Kim, Chang-Jin, and Charles R. Nelson. 1999.
"State-Space Models with Regime Switching:
Classical and Gibbs-Sampling Approaches with Applications".
MIT Press Books. The MIT Press.
"""
from __future__ import division... | bsd-3-clause |
bpsmith/tia | tia/analysis/model/trd.py | 1 | 3356 | import itertools
import pandas as pd
import numpy as np
__all__ = ['Trade', 'TradeBlotter']
class Trade(object):
"""Simple Trade Model"""
def __init__(self, tid, ts, qty, px, fees=0., **kwargs):
self.tid = tid
self.ts = pd.to_datetime(ts)
self.qty = qty
self.px = px
... | bsd-3-clause |
cactusbin/nyt | matplotlib/lib/matplotlib/tests/test_pickle.py | 2 | 5949 | from __future__ import print_function
import numpy as np
from matplotlib.testing.decorators import cleanup, image_comparison
import matplotlib.pyplot as plt
from nose.tools import assert_equal, assert_not_equal
# cpickle is faster, pickle gives better exceptions
import cPickle as pickle
#import pickle
from io impo... | unlicense |
jason-neal/companion_simulations | old_simulations/alpha_detection_limit_multiprocess.py | 1 | 11972 | #!/usr/bin/env python
# Test alpha variation at which cannot detect a planet
# Create a combined spectra with a planet at an alpha value.
# try and detect it by varying rv and alpha.
# At some stage the alpha will not vary when it becomes to small
# This will be the alpha detection limit.
# Maybe this is a wavelength... | mit |
hsiaoyi0504/scikit-learn | sklearn/tests/test_pipeline.py | 162 | 14875 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn... | bsd-3-clause |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/tests/frame/test_block_internals.py | 2 | 19211 | # -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime, timedelta
import itertools
from numpy import nan
import numpy as np
from pandas import (DataFrame, Series, Timestamp, date_range, compat,
option_context)
from pandas.compat import StringIO
import pandas ... | mit |
jjhelmus/scipy | scipy/interpolate/_fitpack_impl.py | 15 | 46563 | #!/usr/bin/env python
"""
fitpack (dierckx in netlib) --- A Python-C wrapper to FITPACK (by P. Dierckx).
FITPACK is a collection of FORTRAN programs for curve and surface
fitting with splines and tensor product splines.
See
http://www.cs.kuleuven.ac.be/cwis/research/nalag/research/topics/fitpack.html
... | bsd-3-clause |
thesuperzapper/tensorflow | tensorflow/examples/learn/iris_custom_decay_dnn.py | 30 | 2039 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
sumspr/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 |
mindriot101/bokeh | bokeh/core/property/wrappers.py | 3 | 16814 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
numanyilmaz/FremontBridge | jupyterworkflow/data.py | 1 | 1031 | import os
from urllib.request import urlretrieve
import pandas as pd
FREMONT_URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD'
def get_fremont_data(filename= 'Fremont.csv', url =FREMONT_URL,
force_download=False):
"""Download anc cache the fremont data
Pa... | mit |
clairetang6/bokeh | examples/webgl/clustering.py | 6 | 2136 | """ Example inspired by an example from the scikit-learn project:
http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html
"""
import numpy as np
try:
from sklearn import cluster, datasets
from sklearn.preprocessing import StandardScaler
except ImportError:
raise ImportError('This... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.