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 |
|---|---|---|---|---|---|
lancezlin/ml_template_py | lib/python2.7/site-packages/sklearn/metrics/cluster/unsupervised.py | 15 | 10182 | """Unsupervised evaluation metrics."""
# Authors: Robert Layton <robertlayton@gmail.com>
# Arnaud Fouchet <foucheta@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ...utils import check_X_y
fro... | mit |
AlexaVillaume/AGN-Disks | agn_disks.py | 1 | 5100 | '''
INPUT:
Spectral Energy Distribution
OUTPUT:
Temperature structure and new SED
Plot of input and calculated SED
'''
import sys
import numpy as np
import matplotlib.pyplot as plt
from astropy import units as u
light_speed = 2.9979e8 # m s^-1
planck_c = 6.626e-34 # J s
boltzmann_c = 1.38e-23 # J K^... | apache-2.0 |
pnedunuri/scikit-learn | sklearn/linear_model/least_angle.py | 61 | 54324 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... | bsd-3-clause |
bmya/addons-yelizariev | sugarcrm_migration/import_kashflow.py | 16 | 21779 | # -*- coding: utf-8 -*-
import logging
_logger = logging.getLogger(__name__)
from openerp.exceptions import except_orm
try:
import MySQLdb
import MySQLdb.cursors
from pandas import merge, DataFrame
except ImportError:
pass
from openerp.addons.import_framework.import_base import import_base
from openerp... | lgpl-3.0 |
wanggang3333/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
anntzer/scikit-learn | sklearn/metrics/_scorer.py | 2 | 29635 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`~sklearn.model_selection.GridSearchCV` or
:func:`sklearn.model_selection.cross_val_score` as the ``scoring``
pa... | bsd-3-clause |
RobertABT/heightmap | build/matplotlib/examples/user_interfaces/embedding_in_wx2.py | 9 | 2706 | #!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with the new
toolbar - comment out the setA_toolbar line for no toolbar
"""
# Used to guarantee to use at least Wx2.8
import wxversion
wxversion.ensureMinimal('2.8')
from numpy import arange, sin, pi
import matplotlib
# uncomment the f... | mit |
jaehyuk/High-Frequency-Trading-Model-with-IB | params/strategy_parameters.py | 7 | 1981 | """
Author: James Ma
Email stuff here: jamesmawm@gmail.com
"""
from datetime import datetime
import pandas as pd
import datetime as dt
class StrategyParameters:
def __init__(self, evaluation_time_secs, resample_interval_secs):
self.resample_interval_secs = resample_interval_secs
self.__evaluation... | mit |
LohithBlaze/scikit-learn | sklearn/metrics/__init__.py | 214 | 3440 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
scr4t/rep | tests/test_metrics.py | 3 | 2858 | from __future__ import division, print_function, absolute_import
import numpy
from rep.report import metrics
__author__ = 'Alex Rogozhnikov'
def test_optimal_metrics(size=1000):
prediction = numpy.random.random(size=size)
random_labels = numpy.random.choice(2, size=size)
def ams_like(s, b):
ret... | apache-2.0 |
djgagne/scikit-learn | examples/model_selection/plot_precision_recall.py | 249 | 6150 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
alexeyum/scikit-learn | examples/linear_model/plot_ransac.py | 73 | 1859 | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | bsd-3-clause |
boompieman/iim_project | project_python2/lib/python2.7/site-packages/IPython/core/magics/basic.py | 5 | 21633 | """Implementation of basic magic functions."""
from __future__ import print_function
import io
import sys
from pprint import pformat
from IPython.core import magic_arguments, page
from IPython.core.error import UsageError
from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes
from IPython.uti... | gpl-3.0 |
mbalasso/mynumpy | numpy/fft/fftpack.py | 9 | 39261 | """
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... | bsd-3-clause |
JeromeRisselin/PRJ-medtec_sigproc | echopen-leaderboard/ENV/share/doc/networkx-1.11/examples/graph/atlas.py | 30 | 2769 | #!/usr/bin/env python
"""
Atlas of all graphs of 6 nodes or less.
"""
# Author: Aric Hagberg (hagberg@lanl.gov)
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as ... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/external/qt_for_kernel.py | 12 | 3192 | """ Import Qt in a manner suitable for an IPython kernel.
This is the import used for the `gui=qt` or `matplotlib=qt` initialization.
Import Priority:
if Qt has been imported anywhere else:
use that
if matplotlib has been imported and doesn't support v2 (<= 1.0.1):
use PyQt4 @v1
Next, ask QT_API env variabl... | gpl-3.0 |
buchbend/astrolyze | build/lib.linux-x86_64-2.7/astrolyze/sed/sed.py | 2 | 26066 | # Copyright (C) 2012, Christof Buchbender
# BSD Licencse
import sys
import os
import numpy as np
import astropy.io.fits
import matplotlib.pyplot as plt
from generaltools import log_tools
import astrolyze.maps.main as main
import astrolyze.maps.fits as fits
import astrolyze.maps.gildas as gildas
import astrolyze.maps.... | bsd-3-clause |
stylianos-kampakis/scikit-learn | sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | bsd-3-clause |
gem/oq-hazardlib | openquake/hmtk/plotting/seismicity/catalogue_plots.py | 1 | 13750 | #!/usr/bin/env python
"""
Collection of tools for plotting descriptive statistics of a catalogue
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm, Normalize
from math import log10
from openquake.hmtk.seismicity.occurrence.utils import get_completeness_counts
# Def... | agpl-3.0 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/examples/user_interfaces/interactive2.py | 9 | 10400 | #!/usr/bin/env python
from __future__ import print_function
# GTK Interactive Console
# (C) 2003, Jon Anderson
# See www.python.org/2.2/license.html for
# license details.
#
import gtk
import gtk.gdk
import code
import os, sys
import pango
import __builtin__
import __main__
banner = """GTK Interactive Python ... | mit |
andyr0id/PyGFNN | examples/afnn/example1P.py | 1 | 3858 | #!/usr/bin/env python
__author__ = 'Andrew J. Lambert, andy@andyroid.co.uk'
"""
example1
A one layer network driven with a sinusoidal input. Several parameter
sets are provided for experimentation with different types of intrinsic
oscillator dynamics.
"""
from pybrain import IdentityConnection
from pygfnn import AbsP... | gpl-2.0 |
IntelLabs/hpat | examples/series/rolling/series_rolling_sum.py | 1 | 1798 | # *****************************************************************************
# 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 |
yanlend/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 244 | 2496 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
uvacw/tcst | overlap.py | 1 | 4911 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Script to determine overlap based on
cosine distance and levenshtein distance
STILL NEEDS SOME MODFIFICATION AND DOCUMENTATION TO BE REUSABLSE
'''
import datetime
import csv
from collections import defaultdict
import sys
import unicodedata
import scipy as sp
import ... | gpl-3.0 |
mjescobar/RF_Estimation | STA/sta/sta_1.py | 2 | 24123 | #!/usr/bin/env python
#============================================================
# STA FAST CHAIN
# SPIKE TRIGGERED AVERAGE (STA) ALGORITHM FAST VERSION
# Do STA for a list of Unit Cells.
# AASTUDILLO ABRIL 2014
# 29 ABRIL2014
#
# This script use as stimuli ensemble a mat file containing
# the stimuli in its true di... | gpl-2.0 |
bjlittle/iris | docs/gallery_code/general/plot_custom_file_loading.py | 1 | 12486 | """
Loading a Cube From a Custom File Format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example shows how a custom text file can be loaded using the standard Iris
load mechanism.
The first stage in the process is to define an Iris :class:`FormatSpecification
<iris.io.format_picker.FormatSpecification>` for the fil... | lgpl-3.0 |
proyan/sot-torque-control | python/dynamic_graph/sot/torque_control/identification/pos_ctrl/compress_stairs_data.py | 2 | 8996 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 23 09:02:21 2015
@author: adelpret
q.shape"""
import numpy as np
import matplotlib.pyplot as plt
import plot_utils as plut
from hrp2_motors_parameters import *
FOLDER_ID = 5;
EST_DELAY = 40; ''' delay introduced by the estimation in number of samples '''
JOINT_ID = ... | gpl-3.0 |
lycopoda/pyquan2 | gui2.py | 1 | 5737 | #!/usr/bin/python
import os, sys, calibrate, quantify, normalize, analyse
from tkinter import *
import matplotlib.pyplot as plt
class Pyquan(Tk):
def __init__(self, parent):
Tk.__init__(self, parent)
self.parent = parent
self.initialize()
self._projectname = None
self.mainm... | gpl-2.0 |
ulisespereira/PereiraBrunel2016 | figure7/functions.py | 1 | 2514 | import numpy as np
import math as mt
import matplotlib.pyplot as plt
#This are a the parameters of the simulation
#parameters single neuron
n=10 #n pop
tau=10. #timescale of populations
nu=1. #slope tf
theta=0. #lower thres tf
uc=1. # upper thres tf
# transfer functions
a1=2.
b1=0.5
a1_inh=3.2
b1_inh=0.15
#paramet... | gpl-2.0 |
rupakc/Kaggle-Compendium | Random Acts of Pizza/PizzaCombinedModel.py | 1 | 8053 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 31 23:03:00 2015
Defines the data model for Random Acts of Pizza
@author: Rupak Chakraborty
"""
import pandas as pd
import numpy as np
import math
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble impo... | mit |
kubeflow/pipelines | components/XGBoost/Predict/component.py | 1 | 1456 | from kfp.components import InputPath, OutputPath, create_component_from_func
def xgboost_predict(
data_path: InputPath('CSV'), # Also supports LibSVM
model_path: InputPath('XGBoostModel'),
predictions_path: OutputPath('Predictions'),
label_column: int = None,
):
'''Make predictions using a trained... | apache-2.0 |
vibhorag/scikit-learn | examples/ensemble/plot_gradient_boosting_regularization.py | 355 | 2843 | """
================================
Gradient Boosting regularization
================================
Illustration of the effect of different regularization strategies
for Gradient Boosting. The example is taken from Hastie et al 2009.
The loss function used is binomial deviance. Regularization via
shrinkage (``lear... | bsd-3-clause |
ElDeveloper/scikit-learn | examples/neural_networks/plot_mlp_alpha.py | 17 | 4088 | """
================================================
Varying regularization in Multi-layer Perceptron
================================================
A comparison of different values for regularization parameter 'alpha' on
synthetic datasets. The plot shows that different alphas yield different
decision functions.
A... | bsd-3-clause |
subutai/htmresearch | projects/learning_location/dordek.py | 4 | 4384 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2018, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
JPFrancoia/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 |
lenovor/scikit-learn | examples/linear_model/plot_polynomial_interpolation.py | 251 | 1895 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
treycausey/scikit-learn | sklearn/feature_extraction/tests/test_feature_hasher.py | 32 | 2869 | from __future__ import unicode_literals
import numpy as np
from sklearn.feature_extraction import FeatureHasher
from nose.tools import assert_raises, assert_true
from numpy.testing import assert_array_equal, assert_equal
def test_feature_hasher_dicts():
h = FeatureHasher(n_features=16)
assert_equal("dict",... | bsd-3-clause |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/doc/conf.py | 1 | 6483 | # -*- coding: utf-8 -*-
#
# Matplotlib documentation build configuration file, created by
# sphinx-quickstart on Fri May 2 12:33:25 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pick... | mit |
ashhher3/scikit-learn | sklearn/tests/test_pipeline.py | 17 | 12512 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from skle... | bsd-3-clause |
rgayon/plaso | utils/plot_memory_usage.py | 1 | 2126 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to plot memory usage from profiling data.
This script requires the matplotlib and numpy Python modules.
"""
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import glob
import os
import sys
import numpy # pylint: ... | apache-2.0 |
ast0815/likelihood-machine | docs/examples/PD/do_uproot.py | 2 | 1704 | from six import print_
from remu import binning
from remu import plotting
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 10)
px = np.random.randn(1000)*20
py = np.random.randn(1000)*20
pz = np.random.randn(1000)*20
df = pd.DataFrame({'px': px, 'py': py, 'pz': pz})
with open("df.txt", 'w') as ... | mit |
AlexRobson/scikit-learn | sklearn/tests/test_lda.py | 77 | 6258 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert... | bsd-3-clause |
alexrudy/Cauldron | ah_bootstrap.py | 31 | 36163 | """
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | bsd-3-clause |
mkrapp/semic | f2py/test.py | 1 | 3188 | import numpy as np
import matplotlib.pyplot as plt
import SurfacePhysics as sp
# read data
pre = 'transect'
forc = np.loadtxt('../example/data/'+pre+'_input.txt')
vali = np.loadtxt('../example/data/'+pre+'_output.txt')
var_names = ['tsurf', 'alb', 'swnet', 'smb', 'melt', 'acc', 'shf', 'lhf']
nx = forc.shape[1]/len(... | mit |
maxalbert/blaze | blaze/server/tests/test_server.py | 6 | 13361 | from __future__ import absolute_import, division, print_function
import pytest
pytest.importorskip('flask')
from base64 import b64encode
import datashape
import numpy as np
from datetime import datetime
from pandas import DataFrame
from toolz import pipe
from odo import odo
from blaze.utils import example
from blaz... | bsd-3-clause |
vortex-ape/scikit-learn | examples/ensemble/plot_gradient_boosting_quantile.py | 392 | 2114 | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
import matplotlib.pyplot as plt
from skle... | bsd-3-clause |
MIT-LCP/wfdb-python | wfdb/plot/plot.py | 1 | 30588 | import matplotlib.pyplot as plt
import numpy as np
import os
import pdb
from wfdb.io.record import Record, rdrecord
from wfdb.io._header import float_types
from wfdb.io._signal import downround, upround
from wfdb.io.annotation import Annotation
def plot_items(signal=None, ann_samp=None, ann_sym=None, fs=None,
... | mit |
cosminbasca/cysparql | cysparql/draw.py | 1 | 11416 | #
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# 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 a... | apache-2.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/pandas/stats/ols.py | 7 | 39955 | """
Ordinary least squares regression
"""
# pylint: disable-msg=W0201
from pandas.compat import zip, range, StringIO
from itertools import starmap
from pandas import compat
import numpy as np
from pandas.core.api import DataFrame, Series, isnull
from pandas.core.base import StringMixin
from pandas.core.common import... | mit |
mayblue9/bokeh | bokeh/server/blaze/config.py | 29 | 2291 | from __future__ import absolute_import
import logging
import warnings
from os.path import dirname, join
import numpy as np
import pandas as pd
from blaze import resource
import bokeh.server.tests
log = logging.getLogger(__name__)
qty=10000
gauss = {'oneA': np.random.randn(qty),
'oneB': np.random.randn(qt... | bsd-3-clause |
Achuth17/scikit-learn | examples/plot_multilabel.py | 87 | 4279 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
gavrieltal/opencog | opencog/embodiment/Monitor/emotion_space_browser.py | 17 | 8987 | import numpy as np
import zmq
import json
import matplotlib as mpl
from matplotlib.figure import Figure
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationTo... | agpl-3.0 |
bigaidream-projects/drmad | cpu_ver/hyperserver/experimentResult/meta30/initial_mnist.py | 1 | 8583 | """Runs for paper"""
import sys
import os
project_dir = os.environ['EXPERI_PROJECT_PATH']
sys.path.append(project_dir)
sys.path.append(project_dir+"/hyperParamServerSubSet")
sys.path.append(project_dir+"/library")
sys.path.append(project_dir+"/library/autogradwithbay")
sys.path.append(project_dir+"/library/hypergrad")
... | mit |
azogue/esiosdata | tests/test_pvpc_plots.py | 1 | 2211 | # -*- coding: utf-8 -*-
"""
Test Cases para datos de PVPC
"""
import os
from unittest import TestCase
class TestsPVPCPlots(TestCase):
"""Tests para el almacén local de datos de PVPC."""
def test_plots_matplotlib(self):
"""Test de plots de datos de PVPC."""
import matplotlib
matplotli... | mit |
vincentadam87/gatsby-hackathon-seizure | code/python/seizures/preprocessing/data_explore.py | 1 | 1826 | import os,sys
import scipy.io, scipy.signal
import numpy as np
from matplotlib import pyplot as plt
path = '/home/vincent/Documents/Gatsby_hackathon/data/'
dir = os.path.realpath(path)
if dir not in sys.path:
sys.path.insert(0, dir)
dir = os.path.realpath(path)
if dir not in sys.path:
sys.path.insert(0, dir)... | bsd-2-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sklearn/metrics/metrics.py | 2 | 33408 | """Utilities to evaluate the predictive performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better
Function named as *_loss return a scalar value to minimize: the lower the
better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel... | agpl-3.0 |
Hiyorimi/scikit-image | doc/examples/segmentation/plot_segmentations.py | 10 | 4040 | """
====================================================
Comparison of segmentation and superpixel algorithms
====================================================
This example compares three popular low-level image segmentation methods. As
it is difficult to obtain good segmentations, and the definition of "good"
oft... | bsd-3-clause |
anurag313/scikit-learn | sklearn/metrics/tests/test_score_objects.py | 138 | 14048 | import pickle
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.testing import assert_true
from sklearn.utils.testing im... | bsd-3-clause |
alongwithyou/auto-sklearn | autosklearn/models/holdout_evaluator.py | 5 | 2302 | from autosklearn.data.split_data import split_data
from autosklearn.models.evaluator import Evaluator, calculate_score
from autosklearn.constants import *
class HoldoutEvaluator(Evaluator):
def __init__(self, Datamanager, configuration, with_predictions=False,
all_scoring_functions=False, seed=1... | bsd-3-clause |
liyi193328/seq2seq | seq2seq/contrib/estimator.py | 1 | 55534 | # 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 |
mblondel/scikit-learn | examples/calibration/plot_calibration.py | 225 | 4795 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
ConeyLiu/spark | python/pyspark/sql/udf.py | 2 | 19914 | #
# 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 |
jrversteegh/softsailor | deps/scipy-0.10.0b2/scipy/stats/morestats.py | 5 | 46011 | # Author: Travis Oliphant, 2002
#
# Further updates and enhancements by many SciPy developers.
#
import math
import statlib
import stats
from stats import find_repeats
import distributions
from numpy import isscalar, r_, log, sum, around, unique, asarray
from numpy import zeros, arange, sort, amin, amax, any, where, ... | gpl-3.0 |
vibhorag/scikit-learn | sklearn/utils/tests/test_seq_dataset.py | 93 | 2471 | # Author: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.seq_dataset import ArrayDataset, CSRDataset
from sklearn.datasets import load_iris
from numpy.testing import assert_array_equal
from nose.tools import assert_equal
iris =... | bsd-3-clause |
xwolf12/scikit-learn | examples/model_selection/plot_train_error_vs_test_error.py | 349 | 2577 | """
=========================
Train error vs Test error
=========================
Illustration of how the performance of an estimator on unseen data (test data)
is not the same as the performance on training data. As the regularization
increases the performance on train decreases while the performance on test
is optim... | bsd-3-clause |
IshankGulati/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 28 | 17934 | import numpy as np
import scipy.sparse as sp
import numbers
from scipy import linalg
from sklearn.decomposition import NMF, non_negative_factorization
from sklearn.decomposition import nmf # For testing internals
from scipy.sparse import csc_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.te... | bsd-3-clause |
jseabold/scikit-learn | sklearn/tests/test_isotonic.py | 230 | 11087 | import numpy as np
import pickle
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert_equal,
... | bsd-3-clause |
jayshonzs/ESL | SupervisedBasic/regression_classify.py | 1 | 1587 | '''
Created on 2014-4-29
@author: xiajie
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
def loaddata():
data1 = np.genfromtxt('sdata1.txt')
data2 = np.genfromtxt('sdata2.txt')
return data1, data2
def cookdata(data1, data2):
X = np.concatenate((data1, data2), axis... | mit |
rrohan/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
neuroinformatics/bah2015_registration | vtk_test/draw_segmentation.py | 1 | 1493 | import vtk
import matplotlib.cm as cm
###############################################################################
# read polydata file
#
segs = []
segs_mapper = []
segs_actor = []
seg_fileformat = '/media/nebula/data/bah/vtk/seg%05d.vtk'
for i in range(1, 39):
segs.append(vtk.vtkPolyDataReader())
segs[-1]... | mit |
tridge/ardupilot | Tools/LogAnalyzer/tests/TestOptFlow.py | 32 | 14968 | from LogAnalyzer import Test,TestResult
import DataflashLog
from math import sqrt
import numpy as np
import matplotlib.pyplot as plt
class TestFlow(Test):
'''test optical flow sensor scale factor calibration'''
#
# Use the following procedure to log the calibration data. is assumed that the optical flow ... | gpl-3.0 |
stefangri/s_s_productions | PHY341/161122_Viskosimeter/Messdaten/auswertung.py | 1 | 7819 | import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
import math
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
#variabel_1,variabel_2=np.genfromtxt('name.txt',unpack=True)
fallzeit_kleine_kugel, fallzeit_große_kugel = np.genfromtxt('fallzeit_raumtemp.txt',unpac... | mit |
Codefans-fan/odoo | addons/resource/faces/timescale.py | 170 | 3902 | ############################################################################
# Copyright (C) 2005 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free software; you can redistribute it and/or modify
# ... | agpl-3.0 |
lucidfrontier45/scikit-learn | sklearn/linear_model/randomized_l1.py | 2 | 22118 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD Style.
import itertools
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import issparse
from scipy import sparse
from scipy.inte... | bsd-3-clause |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/matplotlib/testing/jpl_units/Duration.py | 12 | 6736 | #===========================================================================
#
# Duration
#
#===========================================================================
"""Duration module."""
#===========================================================================
# Place all imports after here.
#
from __future_... | apache-2.0 |
lucabaldini/pyxpe | pyxpe/simulation/xpetrack.py | 1 | 16331 | #!/usr/bin/env python
# Copyright (C) 2007--2016 the X-ray Polarimetry Explorer (XPE) team.
#
# For the license terms see the file LICENSE, distributed along with this
# software.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published... | gpl-3.0 |
krebeljk/openInjMoldSim | tutorials/test/taitEq/analyze.py | 1 | 1952 | #!/usr/bin/python
#import scipy
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import rc
import re
# from math import pi
# from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
# import sys
# rc('text', usetex=True)
def tait(T, p):
b1m = 9.76e-4
b2m = 5... | gpl-3.0 |
louispotok/pandas | pandas/tests/series/test_arithmetic.py | 1 | 34639 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import operator
from decimal import Decimal
import numpy as np
import pytest
from pandas import Series, Timestamp, Timedelta, Period, NaT
from pandas._libs.tslibs.period import IncompatibleFrequency
import pandas as pd
import pandas.util.testing as tm
... | bsd-3-clause |
ychfan/tensorflow | tensorflow/contrib/distributions/python/ops/mixture.py | 13 | 18780 | # 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 |
nberliner/SRVis | lib/readLocalisations.py | 1 | 7517 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | gpl-3.0 |
skonto/spark | python/pyspark/sql/pandas/utils.py | 12 | 2634 | #
# 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 |
luo66/scikit-learn | sklearn/feature_extraction/image.py | 263 | 17600 | """
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 |
elkingtonmcb/scikit-learn | sklearn/ensemble/tests/test_base.py | 284 | 1328 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
from numpy.testing import assert_equal
from nose.tools import assert_true
from sklearn.utils.testing import assert_raise_message
from sklearn.datasets import load_iris
from sklearn.ensemble import BaggingCla... | bsd-3-clause |
imatge-upc/trecvid-2015 | scripts/python/save_feats.py | 1 | 9636 | import numpy as np
import pandas as pd
import os
import argparse
import time
import pickle
from rcnn import Detector
from get_params import get_params
import sys
params = get_params()
NUM_OUTPUT = 4096
CROP_MODES = ['list', 'selective_search']
COORD_COLS = ['ymin', 'xmin', 'ymax', 'xmax']
MODEL = params['caffe_path'... | mit |
ben-hopps/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/text.py | 69 | 55366 | """
Classes for including text in a figure.
"""
from __future__ import division
import math
import numpy as np
from matplotlib import cbook
from matplotlib import rcParams
import artist
from artist import Artist
from cbook import is_string_like, maxdict
from font_manager import FontProperties
from patches import bbox... | agpl-3.0 |
ChanderG/scikit-learn | sklearn/metrics/__init__.py | 214 | 3440 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
davidwhogg/DiffractionMicroscopy | code/toyproblems/twodimage.py | 1 | 8207 | """
This file is part of the DiffractionMicroscopy project.
Copyright 2016 David W. Hogg (NYU, SCDA).
This piece of code does nothing related to diffraction.
It only shows that you can reconstruct an image from small numbers of
photons taken in exoposures at unknown orientations.
# issues
- Should we apply the rotati... | mit |
potash/scikit-learn | examples/tree/plot_iris.py | 86 | 1965 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sklearn/feature_selection/tests/test_selector_mixin.py | 3 | 1492 | import numpy as np
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true
from sklearn.utils.testing import assert_less
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import SGDClassifier
from sklearn.svm import LinearSVC
iri... | agpl-3.0 |
balazssimon/ml-playground | udemy/lazyprogrammer/deep-reinforcement-learning-python/atari/dqn_theano.py | 1 | 10655 | # https://deeplearningcourses.com/c/deep-reinforcement-learning-in-python
# https://www.udemy.com/deep-reinforcement-learning-in-python
from __future__ import print_function, division
from builtins import range
# Note: you may need to update your version of future
# sudo pip install -U future
import copy
import gym
im... | apache-2.0 |
adammenges/statsmodels | docs/source/conf.py | 27 | 11559 | # -*- coding: utf-8 -*-
#
# statsmodels documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 22 11:17:58 2011.
#
# 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 |
HappyFaceGoettingen/HappyFaceCore | modules/CMSPhedexDataExtract.py | 1 | 15003 | # -*- coding: utf-8 -*-
import hf, lxml, logging, datetime
from sqlalchemy import *
import json
from string import strip
import time
class CMSPhedexDataExtract(hf.module.ModuleBase):
config_keys = {
'link_direction': ("transfers 'from' or 'to' you", 'to'),
'time_range': ('set timerange in hour... | apache-2.0 |
sarahgrogan/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 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/mpl_toolkits/axes_grid1/mpl_axes.py | 10 | 5045 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import matplotlib.axes as maxes
from matplotlib.artist import Artist
from matplotlib.axis import XAxis, YAxis
class SimpleChainedObjects(object):
def __init__(self, objects):
... | apache-2.0 |
xiafan68/socialtsquery | script/draw/plot2axis_in_use.py | 1 | 23034 | # encoding:utf8
from itertools import cycle
import itertools
import json
from optparse import OptionParser
import os
import re
from symbol import factor
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.pyplot import xticks
from matplotlib.font_manager import path
from array import ar... | apache-2.0 |
ywcui1990/nupic.research | projects/sequence_prediction/discrete_sequences/plotSequenceLengthExperiment.py | 12 | 6654 | #!/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 |
vipmunot/Data-Analysis-using-Python | Decision Trees/Introduction to random forests-144.py | 1 | 6686 | ## 2. Ensemble models ##
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import roc_auc_score
columns = ["age", "workclass", "education_num", "marital_status", "occupation", "relationship", "race", "sex", "hours_per_week", "native_country"]
clf = DecisionTreeClassifier(random_state=1, min_sample... | mit |
Naereen/notebooks | datachallenges/mangaki_09-17/Data_Challenge__Mangaki__September_2017.py | 1 | 7537 |
# coding: utf-8
# # Table of Contents
# <p><div class="lev1 toc-item"><a href="#Data-Challenge-:-Mangaki---September-2017" data-toc-modified-id="Data-Challenge-:-Mangaki---September-2017-1"><span class="toc-item-num">1 </span>Data Challenge : Mangaki - September 2017</a></div><div class="lev2 toc-item"><a... | mit |
jameshensman/GPy | GPy/plotting/matplot_dep/Tango.py | 8 | 8127 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import matplotlib as mpl
from matplotlib import pyplot as pb
import sys
#sys.path.append('/home/james/mlprojects/sitran_cluster/')
#from switch_pylab_backend import *
#this stuff isn;t really Tango relat... | bsd-3-clause |
CDNoyes/EDL-Py | EntryGuidance/PDPlot.py | 1 | 1591 | import numpy as np
import matplotlib.pyplot as plt
def Plots(df_list, labels, show=True, figsize=(16, 7)):
for label, df in zip(labels, df_list):
Plot(df, show=False, figsize=figsize, label=label)
if show:
plt.show()
def Plot(df, show=False, figsize=(16, 7), label=""):
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.