repo_name stringlengths 6 112 | path stringlengths 4 204 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 714 810k | license stringclasses 15
values |
|---|---|---|---|---|---|
kmike/scikit-learn | sklearn/utils/__init__.py | 3 | 10094 | """
The :mod:`sklearn.utils` module includes various utilites.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array, check_arrays, safe_asarray,
assert_all_fini... | bsd-3-clause |
mne-tools/mne-tools.github.io | 0.20/_downloads/76822bb92a8465181ec2a7ee96ca8cf4/plot_decoding_csp_timefreq.py | 1 | 6457 | """
============================================================================
Decoding in time-frequency space data using the Common Spatial Pattern (CSP)
============================================================================
The time-frequency decomposition is estimated by iterating over raw data that
has be... | bsd-3-clause |
bijanfallah/OI_CCLM | src/RMSE_MAPS_INGO.py | 1 | 2007 | # Program to show the maps of RMSE averaged over time
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error
import os
from netCDF4 import Dataset as NetCDFFile
import numpy as np
from CCLM_OUTS import Plot_CCLM
# option == 1 -> shift 4 with default cclm domain and nboundlines = 3
# option == 2... | mit |
hsu/chrono | src/demos/trackVehicle/validationPlots_test_M113.py | 5 | 4229 | # -*- coding: utf-8 -*-
"""
Created on Wed May 06 11:00:53 2015
@author: newJustin
"""
import ChronoTrack_pandas as CT
import pylab as py
if __name__ == '__main__':
# logger
import logging as lg
lg.basicConfig(fileName = 'logFile.log', level=lg.WARN, format='%(message)s')
# default fo... | bsd-3-clause |
lancezlin/ml_template_py | lib/python2.7/site-packages/sklearn/metrics/tests/test_score_objects.py | 15 | 17443 | import pickle
import tempfile
import shutil
import os
import numbers
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regexp
from sklearn.utils.t... | mit |
wavelets/zipline | zipline/examples/dual_ema_talib.py | 2 | 3230 | #!/usr/bin/env python
#
# Copyright 2013 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 ... | apache-2.0 |
ChanChiChoi/scikit-learn | examples/model_selection/plot_roc.py | 146 | 3697 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
rcolasanti/CompaniesHouseScraper | DVLACompanyNmeMatchCoHoAPIFindMissing.py | 1 | 5174 |
import requests
import json
import numpy as np
import pandas as pd
import CoHouseToken
from difflib import SequenceMatcher
# In[3]:
def exactMatch(line1, line2):
line1=line1.upper().rstrip()
line2=line2.upper().rstrip()
#print("|"+line1+"|"+line2+"|",line1==line2)
return line1==line2
def ... | gpl-3.0 |
mclaughlin6464/pasta | pasta/ising.py | 1 | 5474 | '''
This is a dummy file for me to get started making an Ising model. I'll get this 2-D Ising running, then generalize.
'''
import argparse
from itertools import izip
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
sns.set()
def run_ising(N, d, K, J,h, n_steps, plot = False):
'''
... | mit |
nicholaschris/landsatpy | stuff.py | 1 | 1864 | import cloud_detection_new as cloud_detection
from matplotlib import pyplot as plt
import views
from skimage import exposure
nir = cloud_detection.get_nir()[0:600,2000:2600]
red = cloud_detection.get_red()[0:600,2000:2600]
green = cloud_detection.get_green()[0:600,2000:2600]
blue = cloud_detection.get_blue()[0:600,200... | mit |
Monika319/EWEF-1 | Cw2Rezonans/Karolina/Oscyloskop/OscyloskopZ5W2.py | 1 | 1312 | # -*- 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_05f_p2.txt"]
for NazwaPliku in files:
print NazwaPliku
Plik=open(NazwaPliku)
#print DeltaT
... | gpl-2.0 |
nddsg/TreeDecomps | xplodnTree/tdec/b2CliqueTreeRules.py | 1 | 3569 | #!/usr/bin/env python
__author__ = 'saguinag' + '@' + 'nd.edu'
__version__ = "0.1.0"
##
## fname "b2CliqueTreeRules.py"
##
## TODO: some todo list
## VersionLog:
import net_metrics as metrics
import pandas as pd
import argparse, traceback
import os, sys
import networkx as nx
import re
from collections import deque,... | mit |
apache/spark | python/pyspark/sql/functions.py | 14 | 161861 | #
# 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 |
Charence/stk-code | tools/batch.py | 16 | 3189 | from matplotlib import pyplot
from os import listdir
def is_numeric(x):
try:
float(x)
except ValueError:
return False
return True
avg_lap_time = {}
avg_pos = {}
avg_speed = {}
avg_top = {}
total_rescued = {}
tests = len(listdir('../../batch'))-1
for file in listdir('... | gpl-3.0 |
belltailjp/scikit-learn | sklearn/decomposition/base.py | 313 | 5647 | """Principal Component Analysis Base Classes"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Kyle Kastner <kastnerkyle@gmail.com>
#
# Licen... | bsd-3-clause |
tosolveit/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
caseyclements/bokeh | bokeh/compat/mplexporter/exporter.py | 32 | 12403 | """
Matplotlib Exporter
===================
This submodule contains tools for crawling a matplotlib figure and exporting
relevant pieces to a renderer.
"""
import warnings
import io
from . import utils
import matplotlib
from matplotlib import transforms
from matplotlib.backends.backend_agg import FigureCanvasAgg
clas... | bsd-3-clause |
harlowja/networkx | examples/drawing/knuth_miles.py | 50 | 2994 | #!/usr/bin/env python
"""
An example using networkx.Graph().
miles_graph() returns an undirected graph over the 128 US cities from
the datafile miles_dat.txt. The cities each have location and population
data. The edges are labeled with the distance betwen the two cities.
This example is described in Section 1.1 in ... | bsd-3-clause |
jblackburne/scikit-learn | sklearn/neural_network/rbm.py | 46 | 12291 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
abonil91/ncanda-data-integration | scripts/redcap/scoring/ctq/__init__.py | 1 | 3092 | #!/usr/bin/env python
##
## Copyright 2016 SRI International
## See COPYING file distributed along with the package for the copyright and license terms.
##
import pandas
import Rwrapper
#
# Variables from surveys needed for CTQ
#
# LimeSurvey field names
lime_fields = [ "ctq_set1 [ctq1]", "ctq_set1 [ctq2]", "ct... | bsd-3-clause |
jorik041/scikit-learn | sklearn/linear_model/randomized_l1.py | 95 | 23365 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
jingxiang-li/kaggle-yelp | model/level3_model_rf.py | 1 | 5669 | from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.calibration import CalibratedClassifierCV
from sklearn.metrics import f1_score
import... | mit |
jreback/pandas | pandas/io/formats/html.py | 2 | 23192 | """
Module for formatting output data in HTML.
"""
from textwrap import dedent
from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast
from pandas._config import get_option
from pandas._libs import lib
from pandas import MultiIndex, option_context
from pandas.io.common import is_url
fro... | bsd-3-clause |
modelkayak/python_signal_examples | energy_fft.py | 1 | 2685 | import numpy as np
import scipy
from matplotlib import pyplot as plt
from numpy import pi as pi
# Plotting logic switches
time_plot = True
freq_plot = True
# Oversample to make things look purty
oversample = 100
# Frequencies to simulate
f_min = 5 #[Hz]
f_max = 10 #[Hz]
f_list = np.arange(f_min,f_max) # Note: arange... | mit |
FrankTsui/robust_rescaled_svm | common.py | 1 | 1636 | import numpy as np
import matplotlib.pyplot as plt
def plot_decision_function(classifier, fea, gnd, title):
'''
plot the decision function in 2-d plane
classifiers: the svm models
fea: array like, shape = (smp_num, fea_num)
gnd: array like, shape = (smp_num,)
title: title ... | apache-2.0 |
JeanKossaifi/scikit-learn | sklearn/tree/tests/test_tree.py | 48 | 47506 | """
Testing for the tree module (sklearn.tree).
"""
import pickle
from functools import partial
from itertools import product
import platform
import numpy as np
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import coo_matrix
from sklearn.random_projection import sparse_rand... | bsd-3-clause |
srinathv/vispy | vispy/visuals/isocurve.py | 18 | 7809 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .line import LineVisual
from ..color import ColorArray
from ..color.colormap import _normalize, get_colormap
from ..g... | bsd-3-clause |
eljost/pysisyphus | deprecated/tests/test_dynamics/test_dynamics.py | 1 | 2531 | from matplotlib.patches import Circle
import matplotlib.pyplot as plt
import numpy as np
import pytest
from pysisyphus.calculators.AnaPot import AnaPot
from pysisyphus.dynamics.velocity_verlet import md
def test_velocity_verlet():
geom = AnaPot.get_geom((0.52, 1.80, 0))
x0 = geom.coords.copy()
v0 = .1 * ... | gpl-3.0 |
AtsushiSakai/PythonRobotics | PathPlanning/Eta3SplinePath/eta3_spline_path.py | 1 | 13649 | """
eta^3 polynomials planner
author: Joe Dinius, Ph.D (https://jwdinius.github.io)
Atsushi Sakai (@Atsushi_twi)
Ref:
- [eta^3-Splines for the Smooth Path Generation of Wheeled Mobile Robots]
(https://ieeexplore.ieee.org/document/4339545/)
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.i... | mit |
kaczla/PJN | src/Przecinki/scikit.py | 1 | 1048 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn.cross_validation import cross_val_predict
from sklearn import linear_model
from sklearn import datasets
X = []
Y = []
for line in sys.stdin:
line = line.rstrip()
X... | gpl-2.0 |
danforthcenter/plantcv | plantcv/plantcv/photosynthesis/analyze_fvfm.py | 2 | 5529 | # Fluorescence Analysis
import os
import cv2
import numpy as np
import pandas as pd
from plotnine import ggplot, geom_label, aes, geom_line
from plantcv.plantcv import print_image
from plantcv.plantcv import plot_image
from plantcv.plantcv import fatal_error
from plantcv.plantcv import params
from plantcv.plantcv impo... | mit |
linearregression/mpld3 | mpld3/__init__.py | 20 | 1109 | """
Interactive D3 rendering of matplotlib images
=============================================
Functions: General Use
----------------------
:func:`fig_to_html`
convert a figure to an html string
:func:`fig_to_dict`
convert a figure to a dictionary representation
:func:`show`
launch a web server to view... | bsd-3-clause |
chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/neighbors/base.py | 1 | 24541 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | apache-2.0 |
Vimos/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
pico12/trading-with-python | sandbox/spreadCalculations.py | 78 | 1496 | '''
Created on 28 okt 2011
@author: jev
'''
from tradingWithPython import estimateBeta, Spread, returns, Portfolio, readBiggerScreener
from tradingWithPython.lib import yahooFinance
from pandas import DataFrame, Series
import numpy as np
import matplotlib.pyplot as plt
import os
symbols = ['SPY','... | bsd-3-clause |
XiaoxiaoLiu/morphology_analysis | bigneuron/reestimate_radius.py | 1 | 1506 | __author__ = 'xiaoxiaol'
__author__ = 'xiaoxiaol'
# run standardize swc to make sure swc files have one single root, and sorted, and has the valide type id ( 1~4)
import matplotlib.pyplot as plt
import seaborn as sb
import os
import os.path as path
import numpy as np
import pandas as pd
import platform
import sys
imp... | gpl-3.0 |
siutanwong/scikit-learn | examples/text/document_clustering.py | 230 | 8356 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
COL-IU/XLSearch | xlsearch_train.py | 1 | 5042 | import sys
import pickle
import os
import getopt
from time import ctime
import numpy as np
usage = '''
USAGE: python xlsearch_train.py -l [path to xlsearch library]
-p [parameter file]
-o [output file]'''
(pairs, args) = getopt.getopt(sys.argv[1:], 'l:p:... | mit |
Sumith1896/sympy | sympy/utilities/runtests.py | 4 | 78928 | """
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 |
gauravmm/Remote-Temperature-Monitor | utilities/colormap/colormaps.py | 28 | 50518 | # New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and the colormaps in it are released under the CC0 license /
# public domain dedication. We would appreciate credit if you use or
# redistribute these colormaps, but do not impose any legal r... | mit |
meduz/scikit-learn | examples/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
timkpaine/lantern | tests/plot/test_plot.py | 1 | 1272 | from mock import patch
import matplotlib
matplotlib.use('Agg')
class TestConfig:
def setup(self):
pass
# setup() before each test method
def teardown(self):
pass
# teardown() after each test method
@classmethod
def setup_class(cls):
pass
# setup_class... | apache-2.0 |
PrashntS/scikit-learn | examples/decomposition/plot_faces_decomposition.py | 103 | 4394 | """
============================
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 |
cbmoore/statsmodels | docs/source/plots/graphics_gofplots_qqplot.py | 38 | 1911 | # -*- coding: utf-8 -*-
"""
Created on Sun May 06 05:32:15 2012
Author: Josef Perktold
editted by: Paul Hobson (2012-08-19)
"""
from scipy import stats
from matplotlib import pyplot as plt
import statsmodels.api as sm
#example from docstring
data = sm.datasets.longley.load()
data.exog = sm.add_constant(data.exog, pre... | bsd-3-clause |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/event_handling/zoom_window.py | 1 | 2014 | """
===========
Zoom Window
===========
This example shows how to connect events in one window, for example, a mouse
press, to another figure window.
If you click on a point in the first window, the z and y limits of the
second will be adjusted so that the center of the zoom in the second
window will be the x,y coord... | mit |
cwu2011/seaborn | seaborn/timeseries.py | 6 | 13239 | """Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .palettes import c... | bsd-3-clause |
zak-k/cis | cis/test/plot_tests/idiff.py | 3 | 2350 | #!/usr/bin/env python
# (C) British Crown Copyright 2010 - 2014, Met Office
#
# This file was heavily influenced by a similar file in the iris package.
"""
Provides "diff-like" comparison of images.
Currently relies on matplotlib for image processing so limited to PNG format.
"""
from __future__ import (absolute_imp... | gpl-3.0 |
vermouthmjl/scikit-learn | sklearn/metrics/classification.py | 1 | 69294 | """Metrics to assess performance on classification task given class prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramf... | bsd-3-clause |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/decomposition/plot_sparse_coding.py | 1 | 4054 | """
===========================================
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... | mit |
ChrisBeaumont/brut | bubbly/hyperopt.py | 2 | 2563 | """
A simple interface for random exploration of hyperparameter space
"""
import random
import numpy as np
from scipy import stats
from sklearn.metrics import auc
from sklearn import metrics as met
class Choice(object):
"""Randomly select from a list"""
def __init__(self, *choices):
self._choices = ... | mit |
Scaravex/clue-hackathon | clustering/time_profile_cluster.py | 2 | 1438 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 19 11:21:47 2017
@author: mskara
"""
import pandas as pd
import matplotlib.pyplot as plt
from src.pre_process import load_binary
def create_profile_for_symptoms(df, date_range=15):
profiles = {}
for symptom in symptoms:
temp = df[df['symptom'... | apache-2.0 |
zuku1985/scikit-learn | sklearn/utils/tests/test_multiclass.py | 58 | 14316 |
from __future__ import division
import numpy as np
import scipy.sparse as sp
from itertools import product
from sklearn.externals.six.moves import xrange
from sklearn.externals.six import iteritems
from scipy.sparse import issparse
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sp... | bsd-3-clause |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/compat/numpy/__init__.py | 3 | 2213 | """ support numpy compatiblitiy across versions """
import re
import numpy as np
from distutils.version import LooseVersion
from pandas.compat import string_types, string_and_binary_types
# numpy versioning
_np_version = np.__version__
_nlv = LooseVersion(_np_version)
_np_version_under1p8 = _nlv < '1.8'
_np_version_... | agpl-3.0 |
dpinney/omf | omf/solvers/VB.py | 1 | 29740 | import pandas as pd
import pulp
import numpy as np
from numpy import *
class VirtualBattery(object):
""" Base class for abstraction. """
def __init__(self, ambient_temp, capacitance, resistance, rated_power, COP, deadband, setpoint, tcl_number):
# C :thermal capacitance
# R : thermal resistance... | gpl-2.0 |
etkirsch/scikit-learn | sklearn/datasets/species_distributions.py | 198 | 7923 | """
=============================
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/apps/redlist/details/3038/0>`_... | bsd-3-clause |
ominux/scikit-learn | examples/cluster/plot_adjusted_for_chance_measures.py | 1 | 4105 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... | bsd-3-clause |
percyfal/snakemakelib-core | snakemakelib/plot/bokeh/color.py | 1 | 1126 | # Copyright (C) 2015 by Per Unneberg
import math
import pandas.core.common as com
from bokeh.palettes import brewer as bokeh_brewer
from .palettes import brewer as snakemakelib_brewer
import logging
logger = logging.getLogger(__name__)
MINSIZE = 3
MAXSIZE = 9 # FIXME: some palettes have 9 as max, some 11
brewer = b... | mit |
eegroopm/pyLATTICE | gui/pyLATTICE.py | 1 | 74321 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pyLATTICE is...
"""
from __future__ import division #necessary for python2
from __future__ import unicode_literals
# define authorship information
__authors__ = ['Evan Groopman', 'Thomas Bernatowicz']
__author__ = ','.join(__authors__)
__credits__... | gpl-2.0 |
najmacherrad/master_thesis | Waltz/plotcomparaisons_waltz.py | 1 | 7577 | # Waltz
# Compare results between wild type and mutant
# coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import csv
from scipy import stats
from pylab import plot, show, savefig, xlim, figure, \
hold, ylim, legend, boxplot, setp, axes
import pylab
from numpy import *... | mit |
satishgoda/bokeh | examples/plotting/file/unemployment.py | 46 | 1846 | from collections import OrderedDict
import numpy as np
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.models import HoverTool
from bokeh.sampledata.unemployment1948 import data
# Read in the data with pandas. Convert the year column to string
data['Year'] = [str(x) for x in data['Y... | bsd-3-clause |
tyler-abbot/psid_py | setup.py | 1 | 2486 | """A setup module for psidPy
Based on the pypa sample project.
A tool to download data and build psid panels based on psidR by Florian Oswald.
See:
https://github.com/floswald/psidR
https://github.com/tyler-abbot/psidPy
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
her... | mit |
gfyoung/pandas | pandas/tests/indexes/common.py | 2 | 28221 | import gc
from typing import Type
import numpy as np
import pytest
from pandas._libs import iNaT
from pandas.errors import InvalidIndexError
from pandas.core.dtypes.common import is_datetime64tz_dtype
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
CategoricalInde... | bsd-3-clause |
helloworldajou/webserver | demos/classifier_webcam.py | 4 | 7059 | #!/usr/bin/env python2
#
# Example to run classifier on webcam stream.
# Brandon Amos & Vijayenthiran
# 2016/06/21
#
# Copyright 2015-2016 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a ... | apache-2.0 |
roxyboy/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 261 | 4490 | import unittest
import sys
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less, assert_equal
from sklearn.mixture.tests.test_gmm import GMMTester
from sklearn.externals.s... | bsd-3-clause |
pp-mo/iris | lib/iris/quickplot.py | 2 | 9074 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
High-level plotting extensions to :mod:`iris.plot`.
These routines work much like their :mod:`iris.plot` counterparts, but... | lgpl-3.0 |
igabriel85/dmon-adp | misc/keras_test.py | 1 | 1530 | import numpy
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasClassifier
from keras.utils import np_utils
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
from sklearn.preprocessing import Lab... | apache-2.0 |
MalkIPP/ipp_work | ipp_work/simulations/ir_marg_rate.py | 1 | 8481 | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify... | agpl-3.0 |
ResByte/graph_slam | scripts/robot.py | 1 | 1487 | #!/usr/bin/env python
import roslib
import rospy
import sys
from geometry_msgs.msg import Twist
import numpy as np
from nav_msgs.msg import Odometry
from tf.transformations import euler_from_quaternion
import matplotlib.pyplot as plt
from sensor_msgs.msg import PointCloud2
import sensor_msgs.point_cloud2 as pc2
imp... | gpl-2.0 |
ywcui1990/nupic.research | projects/vehicle-control/agent/run_sm.py | 6 | 7819 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
zmlabe/IceVarFigs | Scripts/SeaSurfaceTemperatures/plot_ersst5.py | 1 | 5197 | """
Plot selected years of monthly ERSSTv5 global data
Website : https://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v5/netcdf/
Author : Zachary M. Labe
Date : 22 July 2017
"""
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid
import numpy a... | mit |
RachitKansal/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
tawsifkhan/scikit-learn | sklearn/linear_model/omp.py | 127 | 30417 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... | bsd-3-clause |
rahiel/shellstats | shellstats.py | 1 | 3629 | # -*- coding: utf-8 -*-
from __future__ import division
from os import getenv
from os.path import isfile
from sys import exit
import click
@click.command()
@click.option("--n", default=10, help="How many commands to show.")
@click.option("--plot", is_flag=True, help="Plot command usage in pie chart.")
@click.option(... | mit |
cbertinato/pandas | pandas/tests/frame/test_axis_select_reindex.py | 1 | 44030 | from datetime import datetime
import numpy as np
import pytest
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import (
Categorical, DataFrame, Index, MultiIndex, Series, date_range, isna)
from pandas.tests.frame.common import TestData
import pandas.util.testing as tm
from pandas.uti... | bsd-3-clause |
lpeska/BRDTI | netlaprls.py | 1 | 2811 | '''
We base the NetLapRLS implementation on the one from PyDTI project, https://github.com/stephenliu0423/PyDTI, changes were made to the evaluation procedure
[1] Xia, Zheng, et al. "Semi-supervised drug-protein interaction prediction from heterogeneous biological spaces." BMC systems biology 4.Suppl 2 (2010): S6.
De... | gpl-2.0 |
mick-d/nipype | tools/make_examples.py | 10 | 3014 | #!/usr/bin/env python
"""Run the py->rst conversion and run all examples.
This also creates the index.rst file appropriately, makes figures, etc.
"""
from __future__ import print_function, division, unicode_literals, absolute_import
from builtins import open
from past.builtins import execfile
# -----------------------... | bsd-3-clause |
poryfly/scikit-learn | sklearn/kernel_ridge.py | 155 | 6545 | """Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression."""
# Authors: Mathieu Blondel <mathieu@mblondel.org>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
import numpy as np
from .base import BaseEstimator, RegressorMixin
from .metrics.pairwise import pairwise... | bsd-3-clause |
angelmtenor/IDSFC | L1_intro/H_olympics_medal_points.py | 1 | 1606 | import numpy as np
from pandas import DataFrame
def numpy_dot():
"""
Imagine a point system in which each country is awarded 4 points for each
gold medal, 2 points for each silver medal, and one point for each
bronze medal.
Using the numpy.dot function, create a new dataframe called
'oly... | mit |
oiertwo/vampyr | pdftoexcel.py | 1 | 8194 | __author__ = 'oier'
import os
import numpy as np
from data.parameters import true_params
from data.parameters import false_params
import distance as dist
import numpy as np
def pdftotext(path):
os.system("pdftotext {data}".format(data=path))
return(path.replace(".pdf",".txt"))
import pandas as pd
def parse(p... | mit |
wrightni/OSSP | segment.py | 1 | 6298 | # title: Watershed Transform
# author: Nick Wright
# adapted from: Justin Chen, Arnold Song
import numpy as np
import gc
import warnings
from skimage import filters, morphology, feature, img_as_ubyte
from scipy import ndimage
from ctypes import *
from lib import utils
# For Testing:
from skimage import segmentation
i... | mit |
abhishekgahlot/scikit-learn | examples/applications/topics_extraction_with_nmf.py | 106 | 2313 | """
========================================================
Topics extraction with Non-Negative Matrix Factorization
========================================================
This is a proof of concept application of Non Negative Matrix
Factorization of the term frequency matrix of a corpus of documents so
as to extra... | bsd-3-clause |
saketkc/statsmodels | tools/backport_pr.py | 30 | 5263 | #!/usr/bin/env python
"""
Backport pull requests to a particular branch.
Usage: backport_pr.py branch [PR]
e.g.:
python tools/backport_pr.py 0.13.1 123
to backport PR #123 onto branch 0.13.1
or
python tools/backport_pr.py 1.x
to see what PRs are marked for backport that have yet to be applied.
Copied fr... | bsd-3-clause |
RachitKansal/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
duolinwang/MusiteDeep | MusiteDeep/train_general.py | 1 | 4521 | import sys
import os
import pandas as pd
import numpy as np
import argparse
def main():
parser=argparse.ArgumentParser(description='MusiteDeep custom training tool for general PTM prediction.')
parser.add_argument('-input', dest='inputfile', type=str, help='training data in fasta format. Sites f... | gpl-2.0 |
rmhyman/DataScience | Lesson1/IntroToPandas.py | 1 | 1976 | import pandas as pd
'''
The following code is to help you play with the concept of Series in Pandas.
You can think of Series as an one-dimensional object that is similar to
an array, list, or column in a database. By default, it will assign an
index label to each item in the Series ranging from 0 to N, where N... | mit |
neale/CS-program | 434-MachineLearning/final_project/linearClassifier/sklearn/__init__.py | 27 | 3086 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | unlicense |
WarrenWeckesser/scipy | scipy/interpolate/fitpack.py | 16 | 26807 | __all__ = ['splrep', 'splprep', 'splev', 'splint', 'sproot', 'spalde',
'bisplrep', 'bisplev', 'insert', 'splder', 'splantider']
import warnings
import numpy as np
# These are in the API for fitpack even if not used in fitpack.py itself.
from ._fitpack_impl import bisplrep, bisplev, dblint
from . import _f... | bsd-3-clause |
jeffninghan/tracker | OCR_test/ocr_test.py | 1 | 1285 | import numpy as np
import cv2
from matplotlib import pyplot as plt
# test algorithm to recognize digits using kNN
# source: http://docs.opencv.org/trunk/doc/py_tutorials/py_ml/py_knn/py_knn_opencv/py_knn_opencv.html
img = cv2.imread('../data/digits.png')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# Now we split the... | mit |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.py | 1 | 28321 | """
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... | mit |
iemejia/beam | sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py | 5 | 4390 | #
# 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 |
hlin117/statsmodels | examples/python/regression_plots.py | 33 | 9585 |
## Regression Plots
from __future__ import print_function
from statsmodels.compat import lzip
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.formula.api import ols
### Duncan's Prestige Dataset
#### Load the Data
# We can use a utility function... | bsd-3-clause |
etkirsch/scikit-learn | examples/model_selection/grid_search_text_feature_extraction.py | 253 | 4158 | """
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the do... | bsd-3-clause |
karthiks1995/dejavu | dejavu/fingerprint.py | 15 | 5828 | import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import (generate_binary_structure,
iterate_structure, binary_erosion)
import hashlib
from operator import itemgetter
IDX... | mit |
sunyihuan326/DeltaLab | shuwei_fengge/practice_one/model/tt.py | 1 | 3958 | # coding:utf-8
'''
Created on 2017/12/8.
@author: chk01
'''
import scipy.io as scio
# data = scio.loadmat(file)
# from sklearn.model_selection import train_test_split
#
# print(data['X'].shape)
# print(data['Y'].shape)
# X_train, X_test, Y_train, Y_test = train_test_split(data['X'], data['Y'], test_size=0.2)
# print(... | mit |
timcera/mettoolbox | mettoolbox/pet.py | 1 | 10467 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import warnings
from typing import Optional, Union
import numpy as np
import pandas as pd
import typic
from solarpy import declination
from tstoolbox import tsutils
from . import meteolib, utils
warnings.filterwarnings("ignore... | bsd-3-clause |
krahman/BuildingMachineLearningSystemsWithPython | ch04/build_lda.py | 1 | 2472 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from __future__ import print_function
try:
import nltk.corpus
except ImportError:
print("nltk n... | mit |
olologin/scikit-learn | examples/linear_model/plot_sgd_iris.py | 286 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
ishanic/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 162 | 9771 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises_regexp
... | bsd-3-clause |
achabotl/pambox | setup.py | 1 | 3387 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import codecs
import os
import re
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding ... | bsd-3-clause |
hmendozap/auto-sklearn | autosklearn/metalearning/metafeatures/plot_metafeatures.py | 1 | 20297 | from __future__ import print_function
import argparse
import cPickle
import itertools
import os
import StringIO
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
try:
from sklearn.manifold import TSNE
from sklearn.metrics.pairwise import P... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.