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 |
|---|---|---|---|---|---|
facaiy/spark | python/setup.py | 4 | 10245 | #!/usr/bin/env python
#
# 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 "Li... | apache-2.0 |
dennisss/tansa | scripts/plot.py | 1 | 1210 | #!/usr/bin/env python
# Used to nicely plot data from the `log` folder
import numpy as np
import matplotlib.pyplot as plt
import math
FILE = 'log/20170408-14_52_11.csv'
ROLE = 0
data = np.genfromtxt(FILE, delimiter=',', dtype=float)
#data = data[-10000:,:]
print(data.shape)
fig, axarr = plt.subplots(2, 1)
plo... | mit |
COHRINT/cops_and_robots | src/cops_and_robots/human_tools/nlp/templater.py | 1 | 13920 | #!/usr/bin/env python
from __future__ import division
"""MODULE_DESCRIPTION"""
__author__ = "Nick Sweet"
__copyright__ = "Copyright 2015, Cohrint"
__credits__ = ["Nick Sweet", "Nisar Ahmed"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "Nick Sweet"
__email__ = "nick.sweet@colorado.edu"
__status__ = "Deve... | apache-2.0 |
KristoferHellman/gimli | python/pygimli/mplviewer/__init__.py | 1 | 2935 | # -*- coding: utf-8 -*-
"""
Viewer interface .. dependents on matplotlib
"""
holdAxes_ = 0
def updateAxes(ax, a=None):
"""
for internal use
"""
if not holdAxes_:
try:
mpl.pyplot.pause(0.01)
except Exception as e:
#print(e)
pass
from .datavi... | gpl-3.0 |
Hornobster/Ball-Tracking | eval_classification_net.py | 1 | 5280 | #!/usr/bin/python
import numpy as np
import os
import sys
import h5py
import matplotlib.pyplot as plt
# check console arguments
if len(sys.argv) != 6:
print('Usage: %s descriptor model datasetDir batchSize numSamples' % sys.argv[0])
sys.exit(1)
# get console arguments
classifierDescriptor, classifierModel, da... | mit |
chrisjmccormick/simsearch | runDBSCAN.py | 1 | 5841 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 01 11:19:04 2016
@author: Chris
"""
from simsearch import SimSearch
from sklearn.cluster import DBSCAN
import sklearn
import time
from sklearn.neighbors import NearestNeighbors
def findEps(ssearch):
"""
Find a good epsilon value to use.
"""
###########... | mit |
datapythonista/pandas | pandas/tests/indexes/base_class/test_formats.py | 6 | 5155 | import numpy as np
import pytest
import pandas._config.config as cf
from pandas import Index
class TestIndexRendering:
@pytest.mark.parametrize(
"index,expected",
[
# ASCII
# short
(
Index(["a", "bb", "ccc"]),
"""Index(['a', 'bb... | bsd-3-clause |
hbp-unibi/SNABSuite | plot/2dim_plot.py | 1 | 5552 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# SNABSuite -- Spiking Neural Architecture Benchmark Suite
# Copyright (C) 2017 Andreas StΓΆckel, Christoph Jenzen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | gpl-3.0 |
rcomer/iris | docs/gallery_code/meteorology/plot_COP_1d.py | 4 | 3953 | """
Global Average Annual Temperature Plot
======================================
Produces a time-series plot of North American temperature forecasts for 2
different emission scenarios. Constraining data to a limited spatial area also
features in this example.
The data used comes from the HadGEM2-AO model simulations... | lgpl-3.0 |
stormsson/procedural_city_generation_wrapper | vendor/josauder/procedural_city_generation/roadmap/main.py | 2 | 2015 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
gui=None
def main():
from procedural_city_generation.roadmap.config import config
from copy import copy
singleton=config()
front=copy(singleton.global_lists.vertex_list)
front.pop(0)
front.pop()
vertex_queue = ... | mpl-2.0 |
nhejazi/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 159 | 2951 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/doc/mpl_examples/pylab_examples/tricontour_demo.py | 3 | 4605 | """
Contour plots of unstructured triangular grids.
"""
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import numpy as np
import math
# Creating a Triangulation without specifying the triangles results in the
# Delaunay triangulation of the points.
# First create the x and y coordinates of the points.
n... | mit |
musically-ut/statsmodels | statsmodels/stats/tests/test_statstools.py | 23 | 10622 | # TODO: Test robust skewness
# TODO: Test robust kurtosis
import numpy as np
import pandas as pd
from numpy.testing import (assert_almost_equal, assert_raises, TestCase)
from statsmodels.stats.stattools import (omni_normtest, jarque_bera,
durbin_watson, _medcouple_1d, medcouple,... | bsd-3-clause |
IntelLabs/hpat | examples/series/str/series_str_center.py | 1 | 1809 | # *****************************************************************************
# Copyright (c) 2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | bsd-2-clause |
xyguo/scikit-learn | 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... | bsd-3-clause |
usantamaria/mat281 | clases/Unidad3-ModelamientoyError/Clase01-TrainingTestError/mat281_code/data_analysis.py | 2 | 1944 | import numpy as np
from matplotlib import pyplot as plt
# Define error function
def error(vector_e):
return abs(vector_e).mean()
# Load the data
N = 200
data = np.loadtxt("dataN%d.txt"%N)
sorted = True
s = "sorted" if sorted else ""
nmax = 71
# Some properties
color_t = "b"
color_p = "g"
# Sort or keep it unsorte... | cc0-1.0 |
mattvonrocketstein/smash | smashlib/ipy3x/core/completer.py | 1 | 42847 | # encoding: utf-8
"""Word completion for IPython.
This module is a fork of the rlcompleter module in the Python standard
library. The original enhancements made to rlcompleter have been sent
upstream and were accepted as of Python 2.3, but we need a lot more
functionality specific to IPython, so this module will cont... | mit |
RachitKansal/scikit-learn | sklearn/manifold/tests/test_mds.py | 324 | 1862 | import numpy as np
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_raises
from sklearn.manifold import mds
def test_smacof():
# test metric smacof using the data of "Modern Multidimensional Scaling",
# Borg & Groenen, p 154
sim = np.array([[0, 5, 3, 4],
... | bsd-3-clause |
cwu2011/scikit-learn | sklearn/linear_model/tests/test_coordinate_descent.py | 44 | 22866 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.utils.testing ... | bsd-3-clause |
Windy-Ground/scikit-learn | sklearn/cluster/tests/test_k_means.py | 63 | 26190 | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | bsd-3-clause |
arnabgho/sklearn-theano | doc/conf.py | 9 | 8057 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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 |
kaushik94/pymc | pymc/examples/lasso_block_update.py | 2 | 1663 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# Sometimes, it is very useful to update a set of parameters together. For example, variables that are highly correlated are often good to update together. In PyMC 3 block updating is simple, as example will demonstrate.
#
# Here we have a LASSO regr... | apache-2.0 |
sandias42/mlware | feature_extract/dumb_extract_extra.py | 1 | 5247 | """ This file implements completely naive featurization of the xml files."""
import numpy as np
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.pipeline import make_pipeline
import os
from scipy import io
from optpa... | mit |
zhushun0008/sms-tools | software/models_interface/harmonicModel_function.py | 2 | 2895 | # function to call the main analysis/synthesis functions in software/models/harmonicModel.py
import numpy as np
import matplotlib.pyplot as plt
import os, sys
from scipy.signal import get_window
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
import utilFunctions as UF
import s... | agpl-3.0 |
bhwester/computer-science-projects | data_analysis_and_visualization_system/classifiers.py | 1 | 10735 | # Template by Bruce Maxwell
# Spring 2015
# CS 251 Project 8
#
# Classifier class and child definitions
import sys
import data
import analysis as an
import numpy as np
import scipy.cluster.vq as vq
import sklearn.metrics as cm
class Classifier:
def __init__(self, type):
'''The parent Classifier class st... | mit |
loli/sklearn-ensembletrees | examples/svm/plot_rbf_parameters.py | 26 | 4273 | '''
==================
RBF SVM parameters
==================
This example illustrates the effect of the parameters `gamma`
and `C` of the rbf kernel SVM.
Intuitively, the `gamma` parameter defines how far the influence
of a single training example reaches, with low values meaning 'far'
and high values meaning 'close'... | bsd-3-clause |
RobertABT/heightmap | build/matplotlib/lib/matplotlib/widgets.py | 4 | 52893 | """
GUI Neutral widgets
===================
Widgets that are designed to work for any of the GUI backends.
All of these widgets require you to predefine an :class:`matplotlib.axes.Axes`
instance and pass that as the first arg. matplotlib doesn't try to
be too smart with respect to layout -- you will have to figure ou... | mit |
lucabaldini/ximpol | ximpol/config/abell401.py | 1 | 2671 | #!/usr/bin/env python
#
# Copyright (C) 2015--2016, the ximpol team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU GengReral Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.... | gpl-3.0 |
KrasnitzLab/SCGV | scgv/views/heatmap.py | 1 | 1354 | '''
Created on Dec 14, 2016
@author: lubo
'''
# import matplotlib.pyplot as plt
# import matplotlib.patches as patches
# from utils.color_map import ColorMap
from scgv.views.base import ViewerBase
from scgv.utils.color_map import ColorMap
class HeatmapViewer(ViewerBase):
def __init__(self, model):
supe... | mit |
mugizico/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
h-mayorquin/camp_india_2016 | project1/plot_blocks.py | 1 | 1348 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns
sns.set(font_scale=2.0)
sns.set_style('whitegrid')
data_before = np.load('block_before.npy')
data_after = np.load('block_after.npy')
x = data_before[0]
y = data_after[0... | mit |
alanmitchell/fnsb-benchmark | benchmark.py | 1 | 65642 | """ -------------------- MAIN BENCHMARKING SCRIPT -----------------------
Run this script by executing the following from a command prompt:
python3 benchmark.py
Or, use just "python benchmark.py" if that is how you normally access Python 3.
One some operating systems (Linux, Mac OSX), you may be able to ... | mit |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/lib/matplotlib/backend_bases.py | 1 | 94467 |
"""
Abstract base classes define the primitives that renderers and
graphics contexts must implement to serve as a matplotlib backend
:class:`RendererBase`
An abstract base class to handle drawing/rendering operations.
:class:`FigureCanvasBase`
The abstraction layer that separates the
:class:`matplotlib.f... | gpl-2.0 |
jvpoulos/cs289-project | code/net_drop_bin_scaled.py | 1 | 4828 | # Code adapted from https://github.com/Newmu/Theano-Tutorials
import sys, time
from ntpath import basename
from os.path import splitext
from itertools import product
import cPickle as pickle
import theano
from theano import tensor as T
import numpy as np
from sklearn.cross_validation import KFold
def set_trace():
... | mit |
5aurabhpathak/masters-thesis | test/visualise_pbresults.py | 2 | 3521 | #!/bin/env python3
#Author: Saurabh Pathak
'''graph visualizer for PBSMT experiment results'''
from matplotlib import animation as an, pyplot as pl, rcParams
from mpl_toolkits.mplot3d import Axes3D
from numpy import loadtxt, arange, argmax, array
import sys, getopt
def graph_col1vscol2(x, y, z):
fig = pl.figure('{... | gpl-3.0 |
jungmannlab/picasso | picasso/gui/average3.py | 1 | 73230 | """
gui/average3
~~~~~~~~~~~~~~~~~~~~
Graphical user interface for three-dimensional averaging of particles
:author: Maximilian Strauss, 2017-2018
:copyright: Copyright (c) 2017-2018 Jungmann Lab, MPI of Biochemistry
"""
import os.path
import sys
import traceback
import colorsys
import matplotli... | mit |
masfaraud/volmdlr | scripts/mesh/mesher.py | 1 | 190637 | import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import matplotlib.tri as tri
import numpy as npy
import volmdlr as vm
import volmdlr.mesh as vmmesh
import finite_elements.elasticity as els
import finite_elements.core as corefe
import math
from scipy import ... | gpl-3.0 |
bsipocz/astropy | examples/coordinates/plot_obs-planning.py | 1 | 6338 | # -*- coding: utf-8 -*-
"""
===================================================================
Determining and plotting the altitude/azimuth of a celestial object
===================================================================
This example demonstrates coordinate transformations and the creation of
visibility cur... | bsd-3-clause |
marianotepper/sgft | sgft/test_temperatures.py | 1 | 3814 | from __future__ import absolute_import
import graph_tool.draw as gt_draw
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import seaborn.apionly as sns
import numpy as np
import pickle
import os
from scipy.spatial.distance import pdist, squareform
import sgft.temperatures as temperatures
import sgft.g... | mit |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/tseries/tests/test_timezones.py | 7 | 66322 | # pylint: disable-msg=E1101,W0612
from datetime import datetime, timedelta, tzinfo, date
import nose
import numpy as np
import pytz
from distutils.version import LooseVersion
from pandas.types.dtypes import DatetimeTZDtype
from pandas import (Index, Series, DataFrame, isnull, Timestamp)
from pandas import DatetimeInd... | mit |
wood-galaxy/FreeCAD | src/Mod/Plot/plotSeries/TaskPanel.py | 26 | 17784 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
CforED/Machine-Learning | examples/ensemble/plot_partial_dependence.py | 3 | 4833 | """
========================
Partial Dependence Plots
========================
Partial dependence plots show the dependence between the target function [2]_
and a set of 'target' features, marginalizing over the
values of all other features (the complement features). Due to the limits
of human perception the size of t... | bsd-3-clause |
iismd17/scikit-learn | sklearn/utils/testing.py | 71 | 26178 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import sys
import re
import platf... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow/source/numpy/fft/fftpack.py | 31 | 46059 | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
rfft(a, n=None, axis=-1)
irfft(a, n=None, axis=-1)
hfft(a, n=None, axis=-1)
ihfft(a, n=None, axis=-1)
fftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
rfftn(a, s=None, axes=None)
irfftn(a, s=None, axes=None... | mit |
ephes/scikit-learn | examples/preprocessing/plot_robust_scaling.py | 221 | 2702 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Robust Scaling on Toy Data
=========================================================
Making sure that each Feature has approximately the same scale can be a
crucial preprocessing step. However, when data contains o... | bsd-3-clause |
rexshihaoren/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 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/core/tests/refbug.py | 4 | 1505 | """Minimal script to reproduce our nasty reference counting bug.
The problem is related to https://github.com/ipython/ipython/issues/141
The original fix for that appeared to work, but John D. Hunter found a
matplotlib example which, when run twice in a row, would break. The problem
were references held by open figu... | bsd-2-clause |
LiaoPan/scikit-learn | sklearn/datasets/lfw.py | 38 | 19042 | """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 |
HaydenFaulkner/phd | keras_code/train.py | 1 | 8706 | '''
train.py = used for training a model
'''
import os
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path = dir_path[:dir_path.find('/phd')+4]
if not dir_path in sys.path:
sys.path.append(dir_path)
print(sys.path)
import argparse
import datetime
import math
import time
import numpy as ... | mit |
ssaeger/scikit-learn | examples/classification/plot_classification_probability.py | 138 | 2871 | """
===============================
Plot classification probability
===============================
Plot the classification probability for different classifiers. We use a 3
class dataset, and we classify it with a Support Vector classifier, L1
and L2 penalized logistic regression with either a One-Vs-Rest or multinom... | bsd-3-clause |
EUDAT-B2SHARE/invenio-old | modules/webstat/lib/webstat_engine.py | 1 | 105689 | ## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any ... | gpl-2.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/sklearn/tests/test_docstring_parameters.py | 3 | 5239 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Raghav RV <rvraghav93@gmail.com>
# License: BSD 3 clause
from __future__ import print_function
import inspect
import sys
import warnings
import importlib
from pkgutil import walk_packages
from inspect import getsource
import sklearn
from sklearn... | mit |
sfxfactor/StellarNumericalProj | plots.py | 1 | 2582 | import numpy as np
import matplotlib.pyplot as plt
import polytrope as poly
import scipy.interpolate as intp
from astropy.io import fits
import sys
from scipy.optimize import minimize
#argument to plots.py is the index of the polytrope
n = float(sys.argv[1])
filename='poly'+str(n)
#if the fits file exists, use it. If ... | mit |
badlands-model/BayesLands | pyBadlands/simulation/buildFlux.py | 1 | 13637 | ##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~##
## ##
## This file forms part of the Badlands surface processes modelling application. ##
## ... | gpl-3.0 |
prheenan/BioModel | BellZhurkov/Python/Code/Bell_Helper.py | 1 | 1033 | # force floating point division. Can still use integer with //
from __future__ import division
# This file is used for importing the common utilities classes.
import numpy as np
import matplotlib.pyplot as plt
import sys
from FitUtils.Python import FitClasses
class BellParamValues(FitClasses.ParamValues):
"""
... | gpl-2.0 |
arbalet-project/arbasdk | arbalet/colors.py | 1 | 14076 | """
Arbalet - ARduino-BAsed LEd Table
Operations on colors
Copyright 2015 Yoan Mollard - Arbalet project - http://github.com/arbalet-project
License: GPL version 3 http://www.gnu.org/licenses/gpl.html
"""
from numpy import isscalar, array
# From matplotlib.colors
cnames = {
'aliceblue': array((0.9... | gpl-3.0 |
mhdella/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
cheral/orange3 | Orange/projection/manifold.py | 2 | 5160 | import numpy as np
import sklearn.manifold as skl_manifold
from Orange.distance import (SklDistance, SpearmanDistance, PearsonDistance,
Euclidean)
from Orange.projection import SklProjector
__all__ = ["MDS", "Isomap", "LocallyLinearEmbedding", "SpectralEmbedding",
"TSNE"]
def... | bsd-2-clause |
zaxtax/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 22 | 1848 | """
===================================================================
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 |
josephcslater/scipy | scipy/signal/spectral.py | 6 | 66649 | """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... | bsd-3-clause |
ThomasMiconi/htmresearch | projects/capybara/anomaly_detection/plot_results.py | 9 | 1755 | __author__ = 'mleborgne'
import matplotlib.pyplot as plt
import csv
import os
from settings import (METRICS,
SENSORS,
PATIENT_IDS,
ANOMALY_LIKELIHOOD_THRESHOLD,
MODEL_RESULTS_DIR,
PLOT_RESULTS_DIR)
for patie... | agpl-3.0 |
mwv/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 |
heli522/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 248 | 2903 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
hitszxp/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
HealthCatalyst/healthcareai-py | healthcareai/tests/test_trainer.py | 4 | 7124 | import os
import sys
import unittest
from contextlib import contextmanager
from io import StringIO
from healthcareai.common.healthcareai_error import HealthcareAIError
from healthcareai.supervised_model_trainer import SupervisedModelTrainer
import healthcareai.tests.helpers as helpers
from healthcareai.trained_models.... | mit |
intel-analytics/analytics-zoo | pyzoo/test/zoo/chronos/model/forecast/test_tcmf_forecaster.py | 1 | 14341 | #
# Copyright 2018 Analytics Zoo Authors.
#
# 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... | apache-2.0 |
Adai0808/BuildingMachineLearningSystemsWithPython | ch08/chapter.py | 21 | 6372 | import numpy as np # NOT IN BOOK
from matplotlib import pyplot as plt # NOT IN BOOK
def load():
import numpy as np
from scipy import sparse
data = np.loadtxt('data/ml-100k/u.data')
ij = data[:, :2]
ij -= 1 # original data is in 1-based system
values = data[:, 2]
reviews = sparse.csc_matri... | mit |
mjgrav2001/scikit-learn | examples/decomposition/plot_sparse_coding.py | 247 | 3846 | """
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... | bsd-3-clause |
dyoung418/tensorflow | tensorflow/contrib/factorization/python/ops/kmeans.py | 19 | 17291 | # 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 |
ibis-project/ibis | ibis/backends/tests/test_timecontext.py | 1 | 3059 | import pandas as pd
import pandas.testing as tm
import pytest
import ibis
from ibis.config import option_context
from .test_vectorized_udf import calc_mean, create_demean_struct_udf
GROUPBY_COL = 'month'
ORDERBY_COL = 'timestamp_col'
TARGET_COL = 'float_col'
@pytest.fixture
def context():
# These need to be tz... | apache-2.0 |
smartscheduling/scikit-learn-categorical-tree | 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 |
Vimos/scikit-learn | sklearn/semi_supervised/tests/test_label_propagation.py | 44 | 2262 | """ test the label propagation module """
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.semi_supervised import label_propagation
from sklearn.metrics.pairwise import rbf_kernel
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
ESTIMATORS... | bsd-3-clause |
siou83/trading-with-python | lib/interactiveBrokers/histData.py | 76 | 6472 | '''
Created on May 8, 2013
Copyright: Jev Kuznetsov
License: BSD
Module for downloading historic data from IB
'''
import ib
import pandas as pd
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
import logger as logger
from pandas import DataFrame, Index
import os
imp... | bsd-3-clause |
chengsoonong/crowdastro | crowdastro/import_data.py | 1 | 34208 | """Imports and standardises data into crowdastro.
Matthew Alger
The Australian National University
2016
"""
import argparse
import csv
import hashlib
import logging
import os
from astropy.coordinates import SkyCoord
import astropy.io.fits
from astropy.io import ascii
import astropy.utils.exceptions
import astropy.wcs... | mit |
public-ink/public-ink | server/appengine/lib/matplotlib/tri/triplot.py | 21 | 3124 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib.tri.triangulation import Triangulation
def triplot(ax, *args, **kwargs):
"""
Draw a unstructured triangular grid as lines and/or markers.
The triang... | gpl-3.0 |
zhenv5/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
tcm129/trading-with-python | lib/extra.py | 77 | 2540 | '''
Created on Apr 28, 2013
Copyright: Jev Kuznetsov
License: BSD
'''
from __future__ import print_function
import sys
import urllib
import os
import xlrd # module for excel file reading
import pandas as pd
class ProgressBar:
def __init__(self, iterations):
self.iterations = iterations
... | bsd-3-clause |
tensorflow/lattice | examples/keras_functional_uci_heart.py | 1 | 13114 | # Copyright 2019 Google 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 applicable law or agreed to in writing, ... | apache-2.0 |
alexsavio/scikit-learn | sklearn/metrics/tests/test_common.py | 11 | 43054 | from __future__ import division, print_function
from functools import partial
from itertools import product
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils.multiclass import type_of_target
fro... | bsd-3-clause |
phayne/heat1d | python/setup.py | 1 | 1307 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
setup(
name="heat1d",
version="0.3.2",
de... | mit |
rhyolight/nupic.research | htmresearch/support/sequence_learning_utils.py | 10 | 4876 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | gpl-3.0 |
jseabold/statsmodels | statsmodels/discrete/tests/test_sandwich_cov.py | 4 | 22979 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 09 21:29:20 2013
Author: Josef Perktold
"""
import os
import numpy as np
import pandas as pd
import statsmodels.discrete.discrete_model as smd
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.genmod import families
from statsmodels.genmod.fam... | bsd-3-clause |
ChristianSch/skml | skml/problem_transformation/classifier_chain.py | 1 | 3449 | import numpy as np
from sklearn.base import clone
from sklearn.base import BaseEstimator, MetaEstimatorMixin, ClassifierMixin
from sklearn.utils import validation
class ClassifierChain(BaseEstimator, MetaEstimatorMixin, ClassifierMixin):
"""
This classifier constructs a chain of classifiers for multi-label
... | mit |
brsu/Learning-And-Adaptivity | assignment_template/code/letters_ml.py | 1 | 1141 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 13 00:32:05 2014
@author: alex
"""
import numpy as np
import sklearn
from sklearn import tree
from sklearn.externals.six import StringIO
import pydot
import time
class ScalabilityQuestion(object):
def __init__(self):
self.prepare_data()... | mit |
NICTA/dora | tests/test_sampler.py | 1 | 2410 | """
PyTest Modele for Sampler Class Testing.
"""
import numpy as np
import os
def test_gp(update_ref_data):
"""
Test the GaussianProcess sampler.
This is a wrapper on the general test for the GaussianProcess method
See Also
--------
verify_common_samplers : The general sampler testing framew... | apache-2.0 |
RPGOne/Skynet | scikit-learn-0.18.1/examples/gaussian_process/plot_gpr_prior_posterior.py | 104 | 2878 | """
==========================================================================
Illustration of prior and posterior Gaussian process for different kernels
==========================================================================
This example illustrates the prior and posterior of a GPR with different
kernels. Mean, st... | bsd-3-clause |
tylerjereddy/scipy | scipy/io/wavfile.py | 10 | 26615 | """
Module to read / write wav files using NumPy arrays
Functions
---------
`read`: Return the sample rate (in samples/sec) and data from a WAV file.
`write`: Write a NumPy array as a WAV file.
"""
import io
import sys
import numpy
import struct
import warnings
from enum import IntEnum
__all__ = [
'WavFileWarn... | bsd-3-clause |
schreiberx/sweet | benchmarks_sphere/galewsky/galewski_rk4_robert_nonlinear_T128/pp_plot_csv.py | 1 | 2240 | #! /usr/bin/python3
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import sys
first = True
s = 2e-5
vort_contour_levels = np.append(np.arange(-1e-4, 0, s), np.arange(s, 1e-4, s))
zoom_lat = True
zoom_lat = False
zoom_lat = 'vort' in sys.argv[1]
fontsize=8
figsize=(9, ... | mit |
Aasmi/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 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/testing/jpl_units/UnitDblFormatter.py | 23 | 1485 | #===========================================================================
#
# UnitDblFormatter
#
#===========================================================================
"""UnitDblFormatter module containing class UnitDblFormatter."""
#==========================================================================... | gpl-3.0 |
nrhine1/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 130 | 22974 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
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.utils.testing import assert_a... | bsd-3-clause |
drsstein/PyRat | Examples/LogisticRegressionModular.py | 1 | 2349 | # short lecture on learning logistic neurons by Geoffrey Hinton:
# https://www.youtube.com/watch?v=--_F0rbPH9M
import matplotlib.pyplot as plt
import numpy as np
import sys
sys.path.insert(0, "../..")
import PyRat as pr
def run():
#generate n samples of random 2d data from each class
n = 100
x_pos = np.r... | mit |
sivakasinathan/incubator | simulate_sequence/simulate_sequence.py | 1 | 6309 | from __future__ import division
from Bio import SeqIO
from Bio.Seq import Seq
import argparse
import glob
import os.path as op
import os
import numpy as np
import pandas as pd
import StringIO
# TO DO:
# - The mutate function should be changed such that it uses a more sophisticated mutation model and also allows indels... | mit |
sergpolly/Thermal_adapt_scripts | BOOTSTRAPS/Cherry_composition_analysis_Thermo_Rnd.py | 2 | 5786 | import pandas as pd
import os
import subprocess as sub
import re
import sys
from Bio import SeqUtils
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
path = os.path.join(os.path.expanduser('~'),'GENOMES_BACTER_RELEASE69/genbank')
# ['DbxRefs','Description','FeaturesNum','GenomicID','Genomic... | mit |
endlessm/chromium-browser | tools/perf/cli_tools/soundwave/worker_pool_test.py | 10 | 1670 | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import shutil
try:
import sqlite3
except ImportError:
pass
import tempfile
import unittest
from cli_tools.soundwave import pan... | bsd-3-clause |
DonBeo/statsmodels | statsmodels/tsa/filters/hp_filter.py | 27 | 3507 | from __future__ import absolute_import
from scipy import sparse
from scipy.sparse import dia_matrix, eye as speye
from scipy.sparse.linalg import spsolve
import numpy as np
from ._utils import _maybe_get_pandas_wrapper
def hpfilter(X, lamb=1600):
"""
Hodrick-Prescott filter
Parameters
----------
... | bsd-3-clause |
JavierGarciaD/Algorithmic_Thinking | src/project_2.py | 1 | 3172 | '''
Created on 10/09/2014
@author: javgar119
'''
# General imports
import networkx as nx
from collections import deque
from pprint import pprint
import matplotlib.pyplot as plt
from hw_1 import er_algorithm
# from app_2 import *
def bfs_visited(ugraph, start_node):
"""
Takes the undirected gr... | gpl-3.0 |
zorojean/scikit-learn | examples/model_selection/grid_search_digits.py | 227 | 2665 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.grid_search.GridSearc... | bsd-3-clause |
python-control/python-control | examples/robust_mimo.py | 2 | 5219 | """robust_mimo.py
Demonstrate mixed-sensitivity H-infinity design for a MIMO plant.
Based on Example 3.8 from Multivariable Feedback Control, Skogestad and Postlethwaite, 1st Edition.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from control import tf, ss, mixsyn, step_response
def weighting(... | bsd-3-clause |
butala/pyrsss | pyrsss/mag/process_hdf.py | 1 | 13040 | from __future__ import division
import sys
import logging
import warnings
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from datetime import timedelta
from itertools import groupby
from collections import OrderedDict
import numpy as NP
import pandas as PD
import scipy.signal
from iaga2hdf import... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.