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 |
|---|---|---|---|---|---|
rauljim/power-pcap-analyzer | many_cdf_power.py | 1 | 1959 | from matplotlib import pyplot
import csv
import os
POWER_FREQ = 5
output_filename = 'many_power_cdf.png'
EXPERIMENT_LABEL_TIMESTAMPS = (
('wifi baseline (304)', '201306201525', 'k:'),#131430'),
('wifi leecher (326)', '201306201300', 'k--'),#191050'),
('wifi peer (333)', '201306201415', 'k-'),#... | apache-2.0 |
kayarre/Tools | hist/fast_march_all.py | 1 | 15348 | #!/usr/bin/env python
import SimpleITK as sitk
#import sys
import os
import utils
import tifffile as tiff
import utils
import itk
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import copy
# HAVE_NUMPY = True
# try:
# import numpy
# except ImportError:
# HAVE_NUMPY = False
# def _get_itk... | bsd-2-clause |
rahul-c1/scikit-learn | examples/plot_kernel_approximation.py | 262 | 8004 | """
==================================================
Explicit feature map approximation for RBF kernels
==================================================
An example illustrating the approximation of the feature map
of an RBF kernel.
.. currentmodule:: sklearn.kernel_approximation
It shows how to use :class:`RBFSa... | bsd-3-clause |
yongfuyang/vnpy | vn.trader/ctaAlgo/strategyAtrRsi.py | 3 | 11522 | # encoding: UTF-8
"""
一个ATR-RSI指标结合的交易策略,适合用在股指的1分钟和5分钟线上。
注意事项:
1. 作者不对交易盈利做任何保证,策略代码仅供参考
2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装
3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略
"""
from ctaBase import *
from ctaTemplate import CtaTemplate
import talib
import numpy as np
###################... | mit |
rhum1s/pgmap | pgmap/pg.py | 1 | 4614 | # -*- coding:utf-8 -*-
# R. Souweine, 2015
import psycopg2 as pg
from psycopg2.extensions import AsIs
import pandas.io.sql as psql
import geopandas as gpd
from config import Cfg
class Pg():
def __init__(self, config_file):
"""
:param config_file: The .ini type configuration text file.
"""... | gpl-2.0 |
pablormier/yabox | yabox/problems/base.py | 1 | 8156 | # -*- coding: utf-8 -*-
from time import time
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
# Default configuration
contourParams = dict(
zdir='z',
alpha=0.5,
zorder=1,
antialiased=True,
cmap=cm.PuRd_r
)
surfaceParams = dict(
rstride=1,
cstride=1,
linewi... | apache-2.0 |
warmspringwinds/scikit-image | doc/examples/plot_join_segmentations.py | 3 | 1965 | """
==========================================
Find the intersection of two segmentations
==========================================
When segmenting an image, you may want to combine multiple alternative
segmentations. The `skimage.segmentation.join_segmentations` function
computes the join of two segmentations, in wh... | bsd-3-clause |
nicolasm/lastfm-export | lfmpandas/artist_counts.py | 1 | 2309 | from datetime import datetime
import pandas
from queries.artist_counts import get_artist_counts_query_overall, \
get_artist_counts_query_year
from lfmdb.lfmdb import select
from lfmconf.lfmconf import get_lastfm_conf
conf = get_lastfm_conf()
start_year = conf['lastfm']['service']['startYear']
now = datetime.now(... | mit |
jbusecke/mitgcm_surface_tracer | mitgcm_surface_tracer/tracer_visualization.py | 1 | 10450 | import matplotlib
matplotlib.use('Agg')
import datetime
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
from .tracer_processing import tracer_engine
def QC_reset_plot(ds_di, ds_sn, tr_engine, cut_time, tr_num, ylim=None):
"""Produces passive tracer reset QC plots.
PARAMETERS
-------... | mit |
toobaz/pandas | pandas/tests/indexing/test_coercion.py | 1 | 36750 | import itertools
import numpy as np
import pytest
import pandas.compat as compat
import pandas as pd
import pandas.util.testing as tm
###############################################################
# Index / Series common tests which may trigger dtype coercions
######################################################... | bsd-3-clause |
arbuz001/sms-tools | lectures/07-Sinusoidal-plus-residual-model/plots-code/envelope-approx.py | 22 | 2887 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, hanning, triang, blackmanharris, resample
import math
import sys, os, time
from scipy.fftpack import fft, ifft
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import utilFunction... | agpl-3.0 |
IndraVikas/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 182 | 1743 | """
=======================================================
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 |
bert9bert/statsmodels | statsmodels/sandbox/examples/example_crossval.py | 33 | 2232 |
import numpy as np
from statsmodels.sandbox.tools import cross_val
if __name__ == '__main__':
#A: josef-pktd
import statsmodels.api as sm
from statsmodels.api import OLS
#from statsmodels.datasets.longley import load
from statsmodels.datasets.stackloss import load
from statsmodels.iolib.tab... | bsd-3-clause |
loli/semisupervisedforests | sklearn/feature_extraction/image.py | 32 | 17167 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | bsd-3-clause |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/sklearn/metrics/setup.py | 299 | 1024 | import os
import os.path
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("metrics", parent_package, top_path)
cblas_libs, blas_info = get_blas_info()
if os.name ==... | gpl-2.0 |
sahilTakiar/spark | python/pyspark/ml/clustering.py | 3 | 50292 | #
# 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 |
shenzebang/scikit-learn | examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py | 252 | 3490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
==============================================================================
Gaussian Processes classification example: exploiting the probabilistic output
==============================================================================
A two-dimensional regression exerci... | bsd-3-clause |
rafaelwerneck/kuaa | train_test_methods/stratified_k_fold/plugin_stratified_k_fold.py | 1 | 3826 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of Kuaa.
#
# Kuaa is a framework for the automation of machine learning experiments.
#
# It provides a workflow-based standardized environment for easy evaluation of
# feature d... | gpl-3.0 |
semiautomaticgit/SemiAutomaticClassificationPlugin | spectralsignature/spectralsignatureplot.py | 1 | 52494 | # -*- coding: utf-8 -*-
'''
/**************************************************************************************************************************
SemiAutomaticClassificationPlugin
The Semi-Automatic Classification Plugin for QGIS allows for the supervised classification of remote sensing images,
The Se... | gpl-3.0 |
civisanalytics/civis-python | civis/civis.py | 1 | 14803 | from functools import lru_cache
import logging
import warnings
import civis
from civis.resources import generate_classes_maybe_cached
from civis._utils import get_api_key
from civis._deprecation import deprecate_param
log = logging.getLogger(__name__)
RETRY_CODES = [429, 502, 503, 504]
RETRY_VERBS = ['HEAD', 'TRACE... | bsd-3-clause |
gundramleifert/exp_tf | models/lp/bdlstm_lp_v17.py | 1 | 14186 | '''
Author: Tobi and Gundram
'''
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops.rnn import bidirectional_rnn
from util.LoaderUtil import read_image_list, get_list_vals
from random impo... | apache-2.0 |
lin-credible/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 |
cg31/tensorflow | tensorflow/examples/learn/iris_run_config.py | 86 | 2087 | # 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 |
WarrenWeckesser/scikits-image | skimage/viewer/viewers/core.py | 33 | 13265 | """
ImageViewer class for viewing and interacting with images.
"""
import numpy as np
from ... import io, img_as_float
from ...util.dtype import dtype_range
from ...exposure import rescale_intensity
from ..qt import QtWidgets, Qt, Signal
from ..widgets import Slider
from ..utils import (dialogs, init_qtapp, figimage, ... | bsd-3-clause |
GuessWhoSamFoo/pandas | pandas/tests/scalar/timedelta/test_formats.py | 9 | 1068 | # -*- coding: utf-8 -*-
import pytest
from pandas import Timedelta
@pytest.mark.parametrize('td, expected_repr', [
(Timedelta(10, unit='d'), "Timedelta('10 days 00:00:00')"),
(Timedelta(10, unit='s'), "Timedelta('0 days 00:00:10')"),
(Timedelta(10, unit='ms'), "Timedelta('0 days 00:00:00.010000')"),
... | bsd-3-clause |
xzh86/scikit-learn | sklearn/neighbors/approximate.py | 128 | 22351 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
nickgentoo/scikit-learn-graph | scripts/cross_validation_not_nested_from_matrix.py | 1 | 1476 | import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '',''))
import numpy as np
from skgraph import datasets
from sklearn import svm
from skgraph.datasets import ioskgraph
import sys
#"sys.path.append('..\\..\\Multiple Kernel Learning\\Framework')"
if len(sys.argv)<4:
sys.exit("python cross_... | gpl-3.0 |
Sentdex/pygta5 | 2. train_model.py | 1 | 2639 | import numpy as np
from grabscreen import grab_screen
import cv2
import time
import os
import pandas as pd
from tqdm import tqdm
from collections import deque
from models import inception_v3 as googlenet
from random import shuffle
FILE_I_END = 1860
WIDTH = 480
HEIGHT = 270
LR = 1e-3
EPOCHS = 30
MODEL_NAME = ''
PREV... | gpl-3.0 |
edhuckle/statsmodels | statsmodels/sandbox/km_class.py | 31 | 11748 | #a class for the Kaplan-Meier estimator
from statsmodels.compat.python import range
import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
class KAPLAN_MEIER(object):
def __init__(self, data, timesIn, groupIn, censoringIn):
raise RuntimeError('Newer version of Kaplan-Meier class available... | bsd-3-clause |
blink1073/scikit-image | skimage/io/tests/test_plugin.py | 24 | 3393 | from contextlib import contextmanager
from numpy.testing import assert_equal, raises
from skimage import io
from skimage.io import manage_plugins
io.use_plugin('pil')
priority_plugin = 'pil'
def setup_module():
manage_plugins.use_plugin('test') # see ../_plugins/test_plugin.py
def teardown_module():
io... | bsd-3-clause |
elkingtonmcb/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
shahankhatch/scikit-learn | sklearn/calibration.py | 137 | 18876 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
Geosyntec/pynsqd | pynsqd/dataAccess.py | 2 | 4530 | import os
import sys
import warnings
from pkg_resources import resource_filename
import numpy as np
import pandas
import wqio
__all__ = ['NSQData']
class NSQData(object):
""" Class representing the National Stormwater Quality Dataset.
Parameters
----------
datapath : string, optional.
Opt... | mit |
mehdidc/scikit-learn | examples/svm/plot_weighted_samples.py | 69 | 1942 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
jbloomlab/dms_tools2 | tests/test_batch_prefs.py | 1 | 3406 | """Tests ``dms2_batch_prefs``.
Written by Jesse Bloom."""
import sys
import os
import unittest
import subprocess
import random
import numpy
import pandas
class test_batch_prefs(unittest.TestCase):
"""Runs ``dms2_batch_bcsubamp`` on test data using ``--method bayesian``."""
METHOD = 'bayesian'
def se... | gpl-3.0 |
TomAugspurger/pandas | pandas/core/groupby/base.py | 1 | 4658 | """
Provide basic components for groupby. These definitions
hold the whitelist of methods that are exposed on the
SeriesGroupBy and the DataFrameGroupBy objects.
"""
import collections
from pandas.core.dtypes.common import is_list_like, is_scalar
OutputKey = collections.namedtuple("OutputKey", ["label", "position"])
... | bsd-3-clause |
gogrean/PyXel | pyxel/prof.py | 2 | 13240 | import numpy as np
import matplotlib.pyplot as plt
from .utils import rotate_point, bin_pix2arcmin, get_bkg_exp
from .messages import ErrorMessages
from .image import Image
class Region(object):
def get_bin_vals(self, counts_img, bkg_img,
exp_img, pixels_in_bin, only_net_cts=False):
"""Calculate ... | gpl-3.0 |
bayesimpact/sf-homelessness | clean.py | 1 | 11253 | import pandas as pd
import numpy as np
import dateutil
import networkx as nx
ADULT_AGE = 18
def get_hmis_cp():
"""
Pull in relevant CSVs from `../data/`, merge them, clean them, and return a tuple containing the cleaned HMIS data
and the cleaned Connecting Point data.
"""
# get raw dataframes
... | mit |
pyrocko/kite | src/quadtree.py | 1 | 35440 | import numpy as num
import time
from hashlib import sha1
from pyrocko import guts
from pyrocko import orthodrome as od
from .util import Subject, property_cached, derampMatrix
class QuadNode(object):
""" A node (or *tile*) in held by :class:`~kite.Quadtree`. Each node in the
tree hold a back reference to the... | gpl-3.0 |
astroclark/bhextractor | bin/libbhex_posteriors.py | 1 | 9464 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 James Clark <james.clark@ligo.org>
#
# 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
# the Free Software Foundation; either version 2 of the License, or
#... | gpl-2.0 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/pandas/io/html.py | 9 | 26806 | """:mod:`pandas.io.html` is a module containing functionality for dealing with
HTML IO.
"""
import os
import re
import numbers
import collections
import warnings
from distutils.version import LooseVersion
import numpy as np
from pandas.io.common import _is_url, urlopen, parse_url, _validate_header_arg
from pandas.... | gpl-2.0 |
mfatihaktas/q_sim | arepeat_models.py | 1 | 44746 | import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
import matplotlib.pyplot as plot
import matplotlib.cm as cm # cm.rainbow
import sys, pprint, random, math, numpy, getopt, itertools, mpmath, textwrap
from rvs import *
from patch import *
def plot_... | mit |
hugobuddel/orange3 | Orange/evaluation/testing.py | 1 | 21200 | import numpy as np
import sklearn.cross_validation as skl_cross_validation
from Orange.data import Table
__all__ = ["Results", "CrossValidation", "LeaveOneOut", "TestOnTrainingData",
"ShuffleSplit", "TestOnTestData", "sample"]
class Results:
"""
Class for storing predictions in model testing.
... | gpl-3.0 |
RichHelle/data-science-from-scratch | first-edition/code/recommender_systems.py | 60 | 6291 | from __future__ import division
import math, random
from collections import defaultdict, Counter
from linear_algebra import dot
users_interests = [
["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"],
["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"],
["Python", "scikit-learn", "sci... | unlicense |
humm/dmpbbo | src/bbo/plotting/plotUpdateSummary.py | 2 | 4764 | import sys
import numpy
import matplotlib.pyplot as plt
from pylab import *
import numpy as np
import os
import matplotlib.pyplot as pl
from matplotlib.patches import Ellipse
import time
#from matplotlib import animation
# From https://github.com/dfm/... | gpl-2.0 |
oew1v07/scikit-image | skimage/viewer/canvastools/base.py | 43 | 3877 | import numpy as np
from matplotlib import lines
__all__ = ['CanvasToolBase', 'ToolHandles']
def _pass(*args):
pass
class CanvasToolBase(object):
"""Base canvas tool for matplotlib axes.
Parameters
----------
manager : Viewer or PlotPlugin.
Skimage viewer or plot plugin object.
on_m... | bsd-3-clause |
deepmind/deepmind-research | sketchy/dataset_example.py | 1 | 1480 | # Lint as: python3
# Copyright 2020 DeepMind Technologies Limited.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
meilinger/firecares | firecares/firestation/views.py | 1 | 37580 | import json
import ogr
import os
import osr
import pandas as pd
import shutil
import urllib
import uuid
from django.views.generic import DetailView, ListView, TemplateView, View
from django.shortcuts import get_object_or_404, redirect
from django.contrib import messages
from django.contrib.auth.decorators import permis... | mit |
wanderknight/tushare | test/storing_test.py | 40 | 1729 | # -*- coding:utf-8 -*-
import os
from sqlalchemy import create_engine
from pandas.io.pytables import HDFStore
import tushare as ts
def csv():
df = ts.get_hist_data('000875')
df.to_csv('c:/day/000875.csv',columns=['open','high','low','close'])
def xls():
df = ts.get_hist_data('000875')
#直接保存
df.t... | bsd-3-clause |
hugobowne/scikit-learn | sklearn/metrics/regression.py | 7 | 17365 | """Metrics to assess performance on regression task
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.gramfort@inria.fr>
# Ma... | bsd-3-clause |
nok/sklearn-porter | examples/estimator/classifier/GaussianNB/java/basics_imported.pct.py | 1 | 1247 | # %% [markdown]
# # sklearn-porter
#
# Repository: [https://github.com/nok/sklearn-porter](https://github.com/nok/sklearn-porter)
#
# ## GaussianNB
#
# Documentation: [sklearn.naive_bayes.GaussianNB](http://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html)
# %%
import sys
sys.path.append('... | mit |
goodfeli/pylearn2 | pylearn2/optimization/test_batch_gradient_descent.py | 44 | 6402 | from __future__ import print_function
from pylearn2.optimization.batch_gradient_descent import BatchGradientDescent
import theano.tensor as T
from pylearn2.utils import sharedX
import numpy as np
from theano.compat.six.moves import xrange
from theano import config
from theano.printing import min_informative_str
def t... | bsd-3-clause |
xuleiboy1234/autoTitle | tensorflow/tensorflow/contrib/timeseries/examples/lstm.py | 17 | 9460 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
liangz0707/scikit-learn | examples/text/mlcomp_sparse_document_classification.py | 292 | 4498 | """
========================================================
Classification of text documents: using a MLComp dataset
========================================================
This is an example showing how the scikit-learn can be used to classify
documents by topics using a bag-of-words approach. This example uses
a s... | bsd-3-clause |
kcrandall/Kaggle_Mercedes_Manufacturing | spark/experiements/reza/random_forest.py | 1 | 5051 | # imports
import h2o
import numpy as np
import pandas as pd
from h2o.estimators.gbm import H2OGradientBoostingEstimator
from h2o.estimators.random_forest import H2ORandomForestEstimator
from h2o.grid.grid_search import H2OGridSearch
import sys
from operator import add
from pyspark import SparkContext
from pyspark.sql... | mit |
robogen/CMS-Mining | RunScripts/es_testermain.py | 1 | 20641 | from elasticsearch import Elasticsearch
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.dates import AutoDateLocator, AutoDateFormatter
import numpy as np
import datetime as dt
import math
import json
import time
with open('sites.json', 'r+') as txt:
sitesArray ... | mit |
jcurbelo/networkx | doc/make_gallery.py | 35 | 2453 | """
Generate a thumbnail gallery of examples.
"""
from __future__ import print_function
import os, glob, re, shutil, sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot
import matplotlib.image
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCa... | bsd-3-clause |
JPFrancoia/scikit-learn | sklearn/utils/estimator_checks.py | 3 | 58667 | 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 |
shakamunyi/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py | 26 | 6490 | # 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 |
albahnsen/CostSensitiveClassification | costcla/utils/cross_validation.py | 1 | 56426 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
i... | bsd-3-clause |
weixuanfu/tpot | tpot/metrics.py | 1 | 2625 | # -*- coding: utf-8 -*-
"""This file is part of the TPOT library.
TPOT was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Weixuan Fu (weixuanf@upenn.edu)
- Daniel Angell (dpa34@drexel.edu)
- and many more generous open source contributors
TPOT is f... | lgpl-3.0 |
thomasbarillot/DAQ | eTOF/TOFAcqTDC_GUI.py | 1 | 38213 | import scipy.io as sio
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui, uic
import numpy as np
import sys
import os
import pandas as pd
import thread
import threading
#import sqlite3
import time
import datetime
import ctypes
from TDC_DAQ import TDC_DAQ as DAQ
from SCTDC_DAQ import SCTDC_DAQ as SCT... | mit |
henridwyer/scikit-learn | sklearn/learning_curve.py | 110 | 13467 | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | bsd-3-clause |
huongttlan/bokeh | bokeh/compat/mplexporter/renderers/vincent_renderer.py | 64 | 1922 | import warnings
from .base import Renderer
from ..exporter import Exporter
class VincentRenderer(Renderer):
def open_figure(self, fig, props):
self.chart = None
self.figwidth = int(props['figwidth'] * props['dpi'])
self.figheight = int(props['figheight'] * props['dpi'])
def draw_line(... | bsd-3-clause |
mcgee/ns-3 | 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 |
jmportilla/keras | tests/manual/check_callbacks.py | 82 | 7540 | import numpy as np
import random
import theano
from keras.models import Sequential
from keras.callbacks import Callback
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.regularizers import l2
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.utils import np_utils... | mit |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/scipy/misc/common.py | 27 | 12883 | """
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from __future__ import division, print_function, absolute_import
import numpy
import numpy as np
from numpy import (exp, log, asarray, arange, newaxis, hstack, product, array,
zeros, eye, poly1d, r_, sum, ... | mit |
Y-oHr-N/kenchi | kenchi/outlier_detection/statistical.py | 1 | 20643 | import numpy as np
from sklearn.cluster import affinity_propagation
from sklearn.covariance import GraphicalLasso
from sklearn.mixture import GaussianMixture
from sklearn.neighbors import KernelDensity
from sklearn.utils.validation import check_is_fitted
from .base import BaseOutlierDetector
from ..plotting import plo... | bsd-3-clause |
hlin117/scikit-learn | examples/svm/plot_svm_regression.py | 120 | 1520 | """
===================================================================
Support Vector Regression (SVR) using linear and non-linear kernels
===================================================================
Toy example of 1D regression using linear, polynomial and RBF kernels.
"""
print(__doc__)
import numpy as np
... | bsd-3-clause |
tectronics/mwavepy | doc/sphinx/sphinxext/docscrape_sphinx.py | 154 | 7759 | import re, inspect, textwrap, pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring, config=config)
... | gpl-3.0 |
nightjean/Deep-Learning | tensorflow/examples/learn/iris.py | 35 | 1654 | # 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 |
tkaitchuck/nupic | external/linux64/lib/python2.6/site-packages/matplotlib/contour.py | 69 | 42063 | """
These are classes to support contour plotting and
labelling for the axes class
"""
from __future__ import division
import warnings
import matplotlib as mpl
import numpy as np
from numpy import ma
import matplotlib._cntr as _cntr
import matplotlib.path as path
import matplotlib.ticker as ticker
import matplotlib.cm... | gpl-3.0 |
planetarymike/IDL-Colorbars | IDL_py_test/063_CB-YlGn.py | 1 | 8397 | from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
cm_data = [[1., 1., 0.898039],
[1., 1., 0.894118],
[0.996078, 1., 0.886275],
[0.996078, 1., 0.882353],
[0.996078, 1., 0.87451],
[0.996078, 1., 0.870588],
[0.992157, 0.996078, 0.862745],
[0.992157, 0.996078, 0.858824],
[0.992157, 0.996078, ... | gpl-2.0 |
baldwint/circa | circa/monitor.py | 1 | 8155 | from __future__ import division
import wx
import os
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
from matplotlib import ticker as mticker
from matplotlib import transforms as mtransforms
import numpy as n
from time import sleep, time
import threading
from collec... | mit |
buguen/pylayers | pylayers/simul/tests/test_DLR.py | 3 | 1225 | import mayavi.mlab as mlab
from pylayers.simul.link import *
from pylayers.antprop.rays import *
from pylayers.antprop.channel import *
from pylayers.antprop.signature import *
import pylayers.util.pyutil as pyu
from pylayers.gis.layout import *
from pylayers.util.project import *
import pylayers.signal.bsignal as bs
f... | lgpl-3.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/sklearn/decomposition/tests/test_kernel_pca.py | 74 | 8472 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | mit |
DGrady/pandas | pandas/tests/series/test_indexing.py | 3 | 88140 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import pytest
from datetime import datetime, timedelta
from numpy import nan
import numpy as np
import pandas as pd
import pandas._libs.index as _index
from pandas.core.dtypes.common import is_integer, is_scalar
from pandas import (Index, Series, DataFrame, isna,
... | bsd-3-clause |
michaelneuder/image_quality_analysis | bin/nets/wip/ms_ssim_nets/cxs_net.py | 1 | 9163 | #!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import matplotlib as mpl
import pandas as pd
import numpy as np
mpl.use('Agg')
import time
import matplotlib.pyplot as plt
def convolve_inner_layers(x, W, b):
'''
inner layers of network --- tanh activation
'''
... | mit |
terkkila/scikit-learn | examples/neighbors/plot_digits_kde_sampling.py | 251 | 2022 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... | bsd-3-clause |
alolou/adr | src/maxent_nblcr.py | 1 | 2933 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from collections import Counter
from sklearn.datasets import load_svmlight_files
from sklearn.linear_model import LogisticRegression
# from TextUtility import TextUtility
def tokenize(sentence, grams):
words = TextUtility.text_to_wordlist(sen... | gpl-2.0 |
macks22/scikit-learn | examples/svm/plot_separating_hyperplane.py | 294 | 1273 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | bsd-3-clause |
keskival/wavenet_synth | process.py | 1 | 1617 | #!/usr/bin/python
import traceback
from scipy.io import wavfile
import tensorflow as tf
import numpy as np
import random
import json
import itertools
import math
import time
import matplotlib.pyplot as plt
import params
import model
import train
import argparse
print params.parameters
parser = argparse.ArgumentPa... | mit |
aflag/captcha-study | train.py | 1 | 1908 | # Copyright (C) 2012 Rafael Cunha de Almeida <rafael@kontesti.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | mit |
accpy/accpy | accpy/visualize/plot.py | 1 | 31360 | # -*- coding: utf-8 -*-
''' accpy.visualize.plot
author: felix.kramer(at)physik.hu-berlin.de
'best' : 0, (only implemented for axes legends)
'upper right' : 1,
'upper left' : 2,
'lower left' : 3,
'lower right' : 4,
'right' : 5,
'center left' : 6,
'center right' : 7,
'lower center' : 8,
'upper... | gpl-3.0 |
murali-munna/scikit-learn | examples/applications/plot_stock_market.py | 227 | 8284 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
anurag313/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
mhvk/astropy | astropy/visualization/wcsaxes/patches.py | 2 | 7667 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import warnings
from matplotlib.patches import Polygon
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.coordinates.representation import UnitSphericalRepresentation, SphericalRepresentation
from as... | bsd-3-clause |
ScienceStacks/CellBioControl | Analysis/data_plotter.py | 1 | 1599 | '''General purpose plotting for models.'''
import numpy as np
import matplotlib.pyplot as plt
import math
TIME_VAR = "time"
class DataPlotter(object):
"""
Provides plots for data sources.
The data source must provide the DataProvider interface.
getVariable(variable_name) - returns np.array
(Raises ... | mit |
weikang9009/giddy | giddy/directional.py | 2 | 13811 | """
Directional Analysis of Dynamic LISAs
"""
__author__ = "Sergio J. Rey <sjsrey@gmail.com>"
__all__ = ["Rose"]
import warnings
import numpy as np
from libpysal import weights
from libpysal.common import requires as _requires
_POS8 = np.array([1, 1, 0, 0, 1, 1, 0, 0])
_POS4 = np.array([1, 0, 1, 0])
_NEG8 = 1 - _PO... | bsd-3-clause |
Geosyntec/pycvc | pycvc/summary.py | 2 | 23511 | import os
import csv
from functools import partial
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.lines as mlines
import matplotlib.ticker as mticker
import matplotlib.gridspec as gridspec
import pandas
import seaborn.apionly as seaborn
import wqio
from wqio imp... | bsd-3-clause |
woozzu/pylearn2 | pylearn2/scripts/papers/jia_huang_wkshp_11/evaluate.py | 44 | 3208 | from __future__ import print_function
from optparse import OptionParser
import warnings
try:
from sklearn.metrics import classification_report
except ImportError:
classification_report = None
warnings.warn("couldn't find sklearn.metrics.classification_report")
try:
from sklearn.metrics import confusion... | bsd-3-clause |
cameronlai/ml-class-python | skeletons/ex2/ex2_sklearn.py | 1 | 2402 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
from ex2 import *
## Machine Learning Online Class - Exercise 2: Logistic Regression with sci-kit learn
# Instructions
# ------------
#
# This file contains code that helps you get started on the
# linear exercise. You will need ... | mit |
ajenhl/tacl | tacl/jitc.py | 1 | 19580 | import csv
import io
import json
import logging
import os
import pandas as pd
from . import constants
from .colour import generate_colours
from .report import Report
from .results import Results
from .statistics_report import StatisticsReport
# Data headers.
BASE_WORK = 'base_work'
COMMON = 'common' # Text in comm... | gpl-3.0 |
fredrikw/scipy | scipy/interpolate/ndgriddata.py | 5 | 7232 | """
Convenience interface to N-D interpolation
.. versionadded:: 0.9
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \
CloughTocher2DInterpolator, _ndim_coords_from_arrays
from scipy.spatial import cKDTree
_... | bsd-3-clause |
edhuckle/statsmodels | statsmodels/base/wrapper.py | 9 | 4398 | import inspect
import functools
import numpy as np
from statsmodels.compat.python import get_function_name, iteritems
class ResultsWrapper(object):
"""
Class which wraps a statsmodels estimation Results class and steps in to
reattach metadata to results (if available)
"""
_wrap_attrs = {}
_wra... | bsd-3-clause |
ClusterHQ/eliot | eliot/tests/test_dask.py | 1 | 7381 | """Tests for eliot.dask."""
from unittest import TestCase, skipUnless
from ..testing import capture_logging, LoggedAction, LoggedMessage
from .. import start_action, log_message
try:
import dask
from dask.bag import from_sequence
from dask.distributed import Client
import dask.dataframe as dd
imp... | apache-2.0 |
wolfier/incubator-airflow | airflow/contrib/hooks/bigquery_hook.py | 1 | 63825 | # -*- 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 |
dimkal/mne-python | mne/viz/tests/test_utils.py | 12 | 2643 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
import os.path as op
import warnings
import numpy as np
from nose.tools import assert_true, assert_raises
from numpy.testing import assert_allclose
from mne.viz.utils import compare_fiff, _fake_click
from mne.viz impor... | bsd-3-clause |
alexeyum/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 50 | 2733 | """
=========================
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... | bsd-3-clause |
rs2/pandas | pandas/tests/tools/test_to_timedelta.py | 1 | 6724 | from datetime import time, timedelta
import numpy as np
import pytest
import pandas as pd
from pandas import Series, TimedeltaIndex, isna, to_timedelta
import pandas._testing as tm
class TestTimedeltas:
def test_to_timedelta(self):
result = to_timedelta(["", ""])
assert isna(result).all()
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.