repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
donbright/piliko | experiment/bernoulli/pythbernlem2.py | 1 | 1332 | from fractions import Fraction as Fract
import sys
# rational paramterization / approximation of bernoulli's lemniscate
# traditional form: ( x^2 + y^2 ) ^2 = 2*( x^2 - y^2 )
# chromogeometry form:
# x = (blueq/redq) / blueq( blueq/redq, greenq/redq )
# y = (greenq/redq) / blueq( blueq/redq, greenq/redq )
# where q =... | bsd-3-clause |
rsignell-usgs/notebook | OOI/from_ooi_json.py | 1 | 2291 |
# coding: utf-8
# # Convert OOI Parsed JSON to NetCDF file
# using CF-1.6, Discrete Sampling Geometry (DSG) conventions, **`featureType=timeSeries`**
# In[2]:
get_ipython().magic('matplotlib inline')
import json
import pandas as pd
import numpy as np
from pyaxiom.netcdf.sensors import TimeSeries
# In[6]:
infile... | mit |
jkthompson/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/mathtext.py | 69 | 101723 | r"""
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :ref:`mathtext-tutorial`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _p... | gpl-3.0 |
beepee14/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 72 | 25573 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
deeplycloudy/MetPy | metpy/plots/_mpl.py | 1 | 13169 | 'This module fills in for functionality that we have (or will) upstreamed into matplotlib'
# Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
# See if we should monkey-patch Barbs for better pivot
import matplotlib
if float(mat... | bsd-3-clause |
mayavanand/RMMAFinalProject | azimuth/predict.py | 1 | 21358 | import numpy as np
import sklearn
from sklearn.metrics import roc_curve, auc
import sklearn.metrics
import sklearn.cross_validation
import copy
import util
import time
import metrics as ranking_metrics
import models.regression
import models.ensembles
import models.DNN
import models.baselines
import multiprocessing
de... | bsd-3-clause |
pythonvietnam/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 162 | 7103 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
AlexanderFabisch/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
grantjenks/pyannote-core | pyannote/core/annotation.py | 1 | 39736 | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2014-2017 CNRS
# 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 limita... | mit |
shahankhatch/scikit-learn | examples/manifold/plot_compare_methods.py | 259 | 4031 | """
=========================================
Comparison of Manifold Learning methods
=========================================
An illustration of dimensionality reduction on the S-curve dataset
with various manifold learning methods.
For a discussion and comparison of these algorithms, see the
:ref:`manifold module... | bsd-3-clause |
oduwa/Wheat-Count | PicNumero/count.py | 2 | 1729 | import os, sys
import tqdm
from scipy import misc
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.color import rgb2gray
# Way to import from matplotlib without warning according to
# https://github.com/matplotlib/matplotlib/issues/5836#issuecomment-223997114
import warnings;
with warnings.catch_... | mit |
liangfok/controlit_demos | dreamer_controlit_demos/nodes/Demo2_ChangingObjectPositions.py | 1 | 31691 | #!/usr/bin/env python
'''
This uses both posture and orientation control.
'''
import sys, getopt # for getting and parsing command line arguments
import time
import math
import threading
import rospy
from std_msgs.msg import Float64, Float64MultiArray, MultiArrayDimension, Bool, Int32
import numpy as np
from sc... | lgpl-2.1 |
xiaoxiamii/scikit-learn | benchmarks/bench_sparsify.py | 323 | 3372 | """
Benchmark SGD prediction time with dense/sparse coefficients.
Invoke with
-----------
$ kernprof.py -l sparsity_benchmark.py
$ python -m line_profiler sparsity_benchmark.py.lprof
Typical output
--------------
input data sparsity: 0.050000
true coef sparsity: 0.000100
test data sparsity: 0.027400
model sparsity:... | bsd-3-clause |
IndraVikas/scikit-learn | examples/calibration/plot_compare_calibration.py | 241 | 5008 | """
========================================
Comparison of Calibration of Classifiers
========================================
Well calibrated classifiers are probabilistic classifiers for which the output
of the predict_proba method can be directly interpreted as a confidence level.
For instance a well calibrated (bi... | bsd-3-clause |
Vishruit/DDP_models | code/numpy_hist_eq.py | 1 | 2013 | from keras.models import Model, load_model
from keras.models import load_model
from keras.models import model_from_json
from keras.utils.io_utils import HDF5Matrix
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import cPickle, gzip, pickle, h5py
impor... | gpl-3.0 |
pyspace/pyspace | pySPACE/missions/nodes/decorators.py | 2 | 30475 | """
Define parameter distributions for pySPACE nodes.
"""
from __future__ import division
import abc
import copy
import numpy
from scipy import stats
try:
# noinspection PyPackageRequirements
from matplotlib import pyplot as plt
from matplotlib import ticker as mtick
except ImportError:
plt = None
... | bsd-3-clause |
CVML/scikit-learn | sklearn/feature_selection/tests/test_chi2.py | 221 | 2398 | """
Tests for chi2, currently the only feature selection function designed
specifically to work with sparse matrices.
"""
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
import scipy.stats
from sklearn.feature_selection import SelectKBest, chi2
from sklearn.feature_selection.univariate_selection im... | bsd-3-clause |
mlperf/inference_results_v0.7 | closed/Altos/code/dlrm/tensorrt/infer.py | 18 | 4431 | #! /usr/bin/env python3
# Copyright (c) 2020, NVIDIA CORPORATION. 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
#
# ... | apache-2.0 |
andrescodas/casadi | docs/examples/python/dae_collocation.py | 3 | 14838 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | lgpl-3.0 |
jeremiedecock/snippets | python/scikit_learn/datasets.py | 1 | 2684 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
# 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 withou... | mit |
dsm054/pandas | asv_bench/benchmarks/io/hdf.py | 4 | 5067 | import warnings
import numpy as np
from pandas import DataFrame, Panel, date_range, HDFStore, read_hdf
import pandas.util.testing as tm
from ..pandas_vb_common import BaseIO
class HDFStoreDataFrame(BaseIO):
def setup(self):
N = 25000
index = tm.makeStringIndex(N)
self.df = DataFrame({'f... | bsd-3-clause |
kevin-intel/scikit-learn | examples/neighbors/plot_nca_dim_reduction.py | 24 | 3839 | """
==============================================================
Dimensionality Reduction with Neighborhood Components Analysis
==============================================================
Sample usage of Neighborhood Components Analysis for dimensionality reduction.
This example compares different (linear) dimen... | bsd-3-clause |
bkahlert/seqan-research | raw/workshop13/workshop2013-data-20130926/trunk/extras/apps/ngs_roi/tool_shed/roi_details.py | 18 | 3825 | #!/usr/bin/env python
"""Generation of detailed ROI reports with larger plots.
This report generation works for hundred of ROIs.
"""
try:
import argparse
except ImportError:
import argparse26 as argparse
import math
import os.path
import sys
import Cheetah.Template
import matplotlib.pyplot as plt
import ngs... | mit |
sirikata/sirikata | tools/cdn/meshtool_progressive_analyze.py | 1 | 13953 | import list
import pprint
import sys
import os
import os.path
import urllib2
import shutil
from meshtool.filters import factory
from meshtool.filters.print_filters.print_render_info import getRenderInfo
import collada
import unicodedata
import math
import traceback
import itertools
from multiprocessing import Process, ... | bsd-3-clause |
ysekky/GPy | GPy/core/parameterization/variational.py | 6 | 10216 | '''
Created on 6 Nov 2013
@author: maxz
'''
import numpy as np
from .parameterized import Parameterized
from .param import Param
from paramz.transformations import Logexp, Logistic,__fixed__
class VariationalPrior(Parameterized):
def __init__(self, name='latent prior', **kw):
super(VariationalPrior, self... | bsd-3-clause |
sunzhxjs/JobGIS | lib/python2.7/site-packages/pandas/tests/test_common.py | 9 | 44081 | # -*- coding: utf-8 -*-
import collections
from datetime import datetime
import re
import nose
from nose.tools import assert_equal, assert_true
import numpy as np
import pandas as pd
from pandas.tslib import iNaT, NaT
from pandas import Series, DataFrame, date_range, DatetimeIndex, Timestamp, Float64Index
from pandas ... | mit |
sumanthjamadagni/OZ | WCA_Isotherms.py | 1 | 2071 | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import Potentials
import OZ_Functions
import matplotlib
from itertools import cycle
colors = ['red', 'blue', 'green', 'cyan', 'black', 'orange']
ColorCycler = cycle(colors)
FS = 18
matplotlib.rc('xtick', labelsize=FS)
matplotli... | gpl-3.0 |
gpfreitas/bokeh | bokeh/compat/mplexporter/tools.py | 75 | 1732 | """
Tools for matplotlib plot exporting
"""
def ipynb_vega_init():
"""Initialize the IPython notebook display elements
This function borrows heavily from the excellent vincent package:
http://github.com/wrobstory/vincent
"""
try:
from IPython.core.display import display, HTML
except I... | bsd-3-clause |
paulbrodersen/netgraph | netgraph/_utils.py | 1 | 11262 | #!/usr/bin/env python
import numpy as np
from scipy.interpolate import BSpline
def _save_cast_float_to_int(num):
if isinstance(num, (float, int)) and np.isclose(num, int(num)):
return int(num)
return num
def _get_unique_nodes(edges):
"""
Using numpy.unique promotes nodes to numpy.float/nump... | gpl-3.0 |
kashif/scikit-learn | sklearn/datasets/twenty_newsgroups.py | 35 | 13626 | """Caching loader for the 20 newsgroups text classification dataset
The description of the dataset is available on the official website at:
http://people.csail.mit.edu/jrennie/20Newsgroups/
Quoting the introduction:
The 20 Newsgroups data set is a collection of approximately 20,000
newsgroup documents,... | bsd-3-clause |
sniemi/SamPy | sandbox/src1/examples/rc_traits.py | 1 | 5746 | # Here is some example code showing how to define some representative
# rc properties and construct a matplotlib artist using traits.
# Because matplotlib ships with enthought traits already, you can run
# this script with just matplotlib. Unfortunately, we do not ship the
# ex UI component so you can't test that part... | bsd-2-clause |
MartinPyka/Pam-Utils | pamutils/nest_help.py | 1 | 3082 | """
Created on Wed Aug 20 17:06:00 2014
This is just a helping unit to collect all functions that I need to analyse
NEST-networks
@author: Martin Pyka
"""
import nest
import io
import csv
from matplotlib import pyplot
import numpy as np
def getEventsFromSpikeDetector(spike_detector, t_range=[0, float("inf")]):
... | gpl-2.0 |
mwillsey/crossbot | crossbot/commands/plot_wins.py | 1 | 5358 | import datetime
import sqlite3
import statistics
import numpy as np
import html, re
from collections import defaultdict, namedtuple
from itertools import cycle, groupby, count
from tempfile import NamedTemporaryFile
# don't use matplotlib gui
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
imp... | gpl-3.0 |
equialgo/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 84 | 7866 | # Important note for the deprecation cleaning of 0.20 :
# All the function and classes of this file have been deprecated in 0.18.
# When you remove this file please also remove the related files
# - 'sklearn/mixture/dpgmm.py'
# - 'sklearn/mixture/gmm.py'
# - 'sklearn/mixture/test_gmm.py'
import unittest
import sys
imp... | bsd-3-clause |
datapythonista/pandas | pandas/tests/groupby/test_groupby_subclass.py | 4 | 2682 | from datetime import datetime
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
@pytest.mark.parametrize(
"obj",
[
tm.SubclassedDataFrame({"A": np.arange(0, 10)}),
tm.SubclassedSeries(np.arange(0, 10), name="A"),
],
)
@pytest.... | bsd-3-clause |
kambysese/mne-python | mne/decoding/base.py | 4 | 19234 | """Base class copy from sklearn.base."""
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Romain Trachel <trachelr@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import time
im... | bsd-3-clause |
wanghaven/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/pylab.py | 70 | 10245 | """
This is a procedural interface to the matplotlib object-oriented
plotting library.
The following plotting commands are provided; the majority have
Matlab(TM) analogs and similar argument.
_Plotting commands
acorr - plot the autocorrelation function
annotate - annotate something in the figure
arrow ... | agpl-3.0 |
rohinkumar/galsurveystudy | Quasar_AP_Test.py | 1 | 3271 | import healpix_util as hu
import astropy as ap
import numpy as np
from astropy.io import fits
from astropy.table import Table
import astropy.io.ascii as ascii
from astropy.constants import c
import matplotlib.pyplot as plt
import math
import scipy.special as sp
dr12q=fits.open('/home/rohin/Desktop/healpix/DR12Q.fits')... | mit |
johanvdw/niche_vlaanderen | niche_vlaanderen/vegetation.py | 1 | 10006 | from __future__ import division
from pkg_resources import resource_filename
import numpy as np
import pandas as pd
import warnings
from .nutrient_level import NutrientLevel
from .acidity import Acidity
from .codetables import validate_tables_vegetation, check_codes_used
from .exception import NicheException
class V... | mit |
beiko-lab/gengis | bin/Lib/site-packages/matplotlib/backends/qt4_editor/formlayout.py | 3 | 21226 | # -*- coding: utf-8 -*-
"""
formlayout
==========
Module creating Qt form dialogs/layouts to edit various type of parameters
formlayout License Agreement (MIT License)
------------------------------------------
Copyright (c) 2009 Pierre Raybaut
Permission is hereby granted, free of charge, to any person
obtaining ... | gpl-3.0 |
kprestel/PyInvestment | pytech/fin/portfolio.py | 2 | 21447 | import logging
import queue
from abc import ABCMeta, abstractmethod
from datetime import datetime
from typing import Dict, List
import pandas as pd
import pytech.utils.dt_utils as dt_utils
from pytech.backtest.event import SignalEvent
from pytech.data.handler import DataHandler
from pytech.fin.asset.owned_asset impor... | mit |
lucashtnguyen/wqreports | setup.py | 3 | 1622 | # Setup script for the wqreports package
#
# Usage: python setup.py install
#
import os
from setuptools import setup, find_packages
DESCRIPTION = "wqreports: Create reports from data analyzed with wqio"
LONG_DESCRIPTION = DESCRIPTION
NAME = "wqreports"
VERSION = "0.1"
AUTHOR = "Lucas Nguyen (Geosyntec Consultants)"
AU... | bsd-3-clause |
shogun-toolbox/shogun | examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py | 2 | 3589 | # This software is distributed under BSD 3-clause license (see LICENSE file).
#
# Authors: Roman Votyakov
import itertools
import matplotlib.pyplot as plt
import numpy as np
def generate_toy_data(n_train=100, mean_a=np.asarray([0, 0]), std_dev_a=1.0, mean_b=3, std_dev_b=0.5):
# positive examples are distributed ... | bsd-3-clause |
fonnesbeck/geopandas | doc/source/conf.py | 8 | 7967 | # -*- coding: utf-8 -*-
#
# GeoPandas documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 15 08:08:14 2013.
#
# 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.
#
# A... | bsd-3-clause |
paulscherrerinstitute/pshell | src/main/assembly/script/Lib/jeputils.py | 1 | 4797 | ###################################################################################################
# Facade to JEP: Embedded Python
###################################################################################################
#Matplotlib won't work out of the box because it's default backend (Qt) uses signals, ... | gpl-3.0 |
bearing/dosenet-analysis | time_binning.py | 1 | 4929 | """This file takes a URL as a command line argument and saves the data
from the URL, then it bins the data by time and produces consistent
timestamps for the data points.
"""
__author__ = 'Sagnik Bhattacharya (github.com/sagnibak)'
import numpy as np
import pandas as pd
import argparse
from time import time
from dateti... | mit |
TaxIPP-Life/Til | til/utilisations/Compar_Destinie_Patrimoine/run.py | 2 | 4828 | # -*- coding:utf-8 -*-
'''
Ce programme compare la base Destinie et la base générée directement à partir de l'enquête patrimoine.
Les tables issues de Destinie et de Patrimoine doivent déjà avoir été créées
- data//data//Destinie//Patrimoine.py et data//data//Destinie//Destinie.py
Pour Patrimoine, ça ne sert... | gpl-3.0 |
schen496/auditory-hallucinations | extract_image_features/old_code/audio_extractionUnitTest.py | 1 | 2648 | from skimage import transform, color, io
import scipy.io as sio
import skvideo.io
import os
import numpy as np
import imageio
import matplotlib.pyplot as plt
import re
from skimage import transform, color, io
import warnings
from tqdm import tqdm
import h5py
import pickle
###########
### LOADING VIDEOS ###
video_dir =... | apache-2.0 |
ebilionis/py-best | papers/gpcorr/ko_run_smc.py | 1 | 1800 | """
Train the GP correlations model for KO with MCMC.
"""
import sys
sys.path.insert(0, '../..')
import numpy as np
from examples.ko import KOSolver
import model
import best
import pymc
import matplotlib.pyplot as plt
import mpi4py.MPI as mpi
import cPickle as pickle
if __name__ == '__main__':
# Set the sampling... | lgpl-3.0 |
ueshin/apache-spark | python/pyspark/pandas/indexes/datetimes.py | 15 | 24988 | #
# 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 |
nan86150/ImageFusion | lib/python2.7/site-packages/mpl_toolkits/axes_grid1/colorbar.py | 8 | 27927 | '''
Colorbar toolkit with two classes and a function:
:class:`ColorbarBase`
the base class with full colorbar drawing functionality.
It can be used as-is to make a colorbar for a given colormap;
a mappable object (e.g., image) is not needed.
:class:`Colorbar`
the derived class ... | mit |
Delosari/dazer | bin/lib/cloudy_library/Cloudy_Launcher3.py | 1 | 3449 | import pandas as pd
from numpy import log10 as nplog10, pi, power
from collections import OrderedDict
from cloudy_library.cloudy_methods import Cloudy_Tools
def import_popstar_data():
FilesFolder = '/home/vital/Dropbox/Astrophysics/Lore/... | mit |
ContextLab/hypertools | hypertools/tools/analyze.py | 1 | 2300 | #!/usr/bin/env python
from .reduce import reduce as reducer
from .align import align as aligner
from .normalize import normalize as normalizer
def analyze(data, normalize=None, reduce=None, ndims=None, align=None, internal=False):
"""
Wrapper function for normalize -> reduce -> align transformations.
Pa... | mit |
fredhusser/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 17 | 24947 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
madjelan/scikit-learn | examples/tree/plot_tree_regression.py | 206 | 1476 | """
===================================================================
Decision Tree Regression
===================================================================
A 1D regression with decision tree.
The :ref:`decision trees <tree>` is
used to fit a sine curve with addition noisy observation. As a result, it
learns ... | bsd-3-clause |
elkingtonmcb/scikit-learn | examples/ensemble/plot_forest_iris.py | 335 | 6271 | """
====================================================================
Plot the decision surfaces of ensembles of trees on the iris dataset
====================================================================
Plot the decision surfaces of forests of randomized trees trained on pairs of
features of the iris dataset.
... | bsd-3-clause |
ArteliaTelemac/PostTelemac | PostTelemac/meshlayer/caduc/posttelemac_util_animation.py | 1 | 14450 | # -*- coding: utf-8 -*-
# unicode behaviour
from __future__ import unicode_literals
# import numpy
import numpy as np
import matplotlib
# import matplotlib
# import PyQT
from PyQt4 import QtCore, QtGui
import qgis.utils
import qgis.core
# imports divers
import time
import os
import tempfile
import subprocess
import... | gpl-3.0 |
TimeWz667/Kamanian | example/Chapter 7.1 TB model.py | 1 | 8240 | import complexism as cx
import pandas as pd
import numpy as np
import numpy.random as rd
mat = pd.read_csv('../data/SimFM.csv')
ds = cx.DemographySex()
ds.load_birth_data(mat, i_year='Year', i_f='BirthF', i_m='BirthM')
ds.load_death_data(mat, i_year='Year', i_f='DeathF', i_m='DeathM')
ds.load_migration_data... | mit |
pv/scikit-learn | examples/applications/plot_species_distribution_modeling.py | 254 | 7434 | """
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | bsd-3-clause |
rvraghav93/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 79 | 2849 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from sklearn.utils.testing import ... | bsd-3-clause |
shangwuhencc/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 |
gandalf221553/CodeSection | compilare/avviacompilatore.py | 1 | 1302 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 15 16:30:29 2017
@author: Von Braun
"""
#import os
#a=os.getcwd()
#os.chdir("kivy-examples\\canvas")
import PyInstaller.__main__
print(dir())
#PyInstaller.__main__.run(["-y", "-w","circle.py"])
#os.chdir(a)
#import PyInstaller.__main__
PyInstaller.__main__... | mit |
tcstewar/nengo_plot | nengo_plot/time.py | 1 | 6056 | import core
import numpy
import matplotlib
import scipy.ndimage
import scipy.cluster
class Time(core.Plot):
def __init__(self, time, time_range=None, ylabel_rotation='vertical', **args):
core.Plot.__init__(self,**args)
self.time = time
self.xlim = time_range
self.ylabel_rotation = y... | gpl-2.0 |
virneo/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/_cm.py | 70 | 375423 | """
Color data and pre-defined cmap objects.
This is a helper for cm.py, originally part of that file.
Separating the data (this file) from cm.py makes both easier
to deal with.
Objects visible in cm.py are the individual cmap objects ('autumn',
etc.) and a dictionary, 'datad', including all of these objects.
"""
im... | agpl-3.0 |
arjoly/scikit-learn | sklearn/cross_decomposition/cca_.py | 209 | 3150 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:`User Guide <cross_decomposition>`.
Parameters
----------
n_components : int, (default 2).
numb... | bsd-3-clause |
smaegol/metaplasmid | plasflow/plasflow.py | 1 | 6241 | #!/usr/bin/env python
#######################################################################################
### ###
### PlasFlow 1.1 ###
### Copyright (C) 2017 Pawel... | gpl-3.0 |
jaredweiss/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/colorbar.py | 69 | 27260 | '''
Colorbar toolkit with two classes and a function:
:class:`ColorbarBase`
the base class with full colorbar drawing functionality.
It can be used as-is to make a colorbar for a given colormap;
a mappable object (e.g., image) is not needed.
:class:`Colorbar`
the derived class ... | gpl-3.0 |
olafhauk/mne-python | mne/viz/utils.py | 1 | 88098 | # -*- coding: utf-8 -*-
"""Utility functions for plotting M/EEG data."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Mainak Jas <mainak... | bsd-3-clause |
LouisePaulDelvaux/openfisca-france-data | openfisca_france_data/sources/utils.py | 4 | 2153 | # -*- 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 |
f3r/scikit-learn | sklearn/tests/test_pipeline.py | 29 | 15239 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn... | bsd-3-clause |
kiyoto/statsmodels | statsmodels/datasets/tests/test_utils.py | 26 | 1697 | import os
import sys
from statsmodels.datasets import get_rdataset, webuse, check_internet
from numpy.testing import assert_, assert_array_equal, dec
cur_dir = os.path.dirname(os.path.abspath(__file__))
def test_get_rdataset():
# smoke test
if sys.version_info[0] >= 3:
#NOTE: there's no way to test bo... | bsd-3-clause |
kirichoi/tellurium | spyder_mod/Spyder 3.3.0/spyder/app/mainwindow.py | 2 | 133996 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific PYthon Development EnviRonment
=====================================================
Developped and maintained by the Spyder Project
Contr... | apache-2.0 |
likelyzhao/mxnet | example/dec/dec.py | 15 | 7064 | # pylint: skip-file
from __future__ import print_function
import sys
import os
# code to automatically download dataset
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path = [os.path.join(curr_path, "../autoencoder")] + sys.path
import mxnet as mx
import numpy as np
import data
from scip... | apache-2.0 |
kevin-coder/tensorflow-fork | tensorflow/contrib/labeled_tensor/python/ops/ops.py | 6 | 46486 | # 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 |
arhik/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/blocking_input.py | 69 | 12119 | """
This provides several classes used for blocking interaction with figure windows:
:class:`BlockingInput`
creates a callable object to retrieve events in a blocking way for interactive sessions
:class:`BlockingKeyMouseInput`
creates a callable object to retrieve key or mouse clicks in a blocking way for int... | agpl-3.0 |
bzero/statsmodels | statsmodels/tools/grouputils.py | 25 | 22518 | # -*- coding: utf-8 -*-
"""Tools for working with groups
This provides several functions to work with groups and a Group class that
keeps track of the different representations and has methods to work more
easily with groups.
Author: Josef Perktold,
Author: Nathaniel Smith, recipe for sparse_dummies on scipy user ma... | bsd-3-clause |
RRShieldsCutler/clusterpluck | clusterpluck/scripts/mpi_collapse.py | 1 | 4106 | #!/usr/bin/env Python
import argparse
import sys
import numpy as np
import pandas as pd
import warnings
from clusterpluck.scripts.cluster_dictionary import build_cluster_map
from clusterpluck.scripts.orfs_in_common import generate_index_list
from clusterpluck.scripts.orfs_in_common import pick_a_cluster
from functools... | mit |
batterysim/esctoolbox-python | ocv_model/data.py | 1 | 3900 | """
Plot the data from the four A123 battery tests conducted at a range of
temperatures. Change the tc variable to view plots from the other test data.
For example, change the tc string to N05 to create plots for the CSV files
named A123_OCV_N05_S1, A123_OCV_N05_S2, A123_OCV_N05_S3, and A123_OCV_N05_S4.
"""
import mat... | mit |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/_vendor/tqdm/_tqdm.py | 6 | 46609 | """
Customisable progressbar decorator for iterators.
Includes a default (x)range iterator printing to stderr.
Usage:
>>> from tqdm import trange[, tqdm]
>>> for i in trange(10): #same as: for i in tqdm(xrange(10))
... ...
"""
from __future__ import absolute_import
# integer division / : float, // : int
from ... | apache-2.0 |
HolgerPeters/scikit-learn | sklearn/utils/fixes.py | 14 | 13240 | """Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# ... | bsd-3-clause |
mugizico/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 |
WesleyyC/Restaurant-Revenue-Prediction | Ari/testing_grounds/GradientBoost.py | 2 | 1338 | import numpy as np
import pandas as pd
from math import sqrt
from sklearn import ensemble
from sklearn.metrics import mean_squared_error
###############################################################################
# Load data
df_train = pd.read_csv("train_numerical_head.csv")
df_train.head()
feats = df_train.drop... | mit |
jluttine/bayespy | bayespy/inference/vmp/nodes/beta.py | 3 | 5230 | ################################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
A module for the beta distribution node
"""
import numpy as np
im... | mit |
datapythonista/pandas | pandas/tests/indexes/datetimes/methods/test_shift.py | 4 | 5476 | from datetime import datetime
import pytest
import pytz
from pandas.errors import NullFrequencyError
import pandas as pd
from pandas import (
DatetimeIndex,
Series,
date_range,
)
import pandas._testing as tm
START, END = datetime(2009, 1, 1), datetime(2010, 1, 1)
class TestDatetimeIndexShift:
# -... | bsd-3-clause |
krez13/scikit-learn | examples/svm/plot_svm_kernels.py | 329 | 1971 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM-Kernels
=========================================================
Three different types of SVM-Kernels are displayed below.
The polynomial and RBF are especially useful when the
data-points are not linearly sep... | bsd-3-clause |
imaculate/scikit-learn | examples/gaussian_process/plot_gpr_prior_posterior.py | 104 | 2878 | """
==========================================================================
Illustration of prior and posterior Gaussian process for different kernels
==========================================================================
This example illustrates the prior and posterior of a GPR with different
kernels. Mean, st... | bsd-3-clause |
marcocaccin/scikit-learn | sklearn/neighbors/nearest_centroid.py | 38 | 7356 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
reedessick/nmodelte | lib/nmode_plotting.py | 1 | 32700 | usage=""" written to provide basic plotting functions that are common to many investigations """
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
#plt.rcParams.update({"text.usetex":True})
import numpy as np
pi = np.pi
infty = np.infty
from numpy import linalg
#from scipy import linalg
import... | gpl-2.0 |
pv/scikit-learn | sklearn/metrics/pairwise.py | 104 | 42995 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck ... | bsd-3-clause |
nashmit/GMolModel | tests_inputs/lin_bead.py | 2 | 6158 | import sys, os, glob
import numpy as np
import scipy
import scipy.stats
import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
parser = argparse.ArgumentParser()
parser.add_argument('--dir', default=None,
help='Directory with input ... | gpl-3.0 |
kylerbrown/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 |
rabernat/xray | xarray/tests/test_formatting.py | 1 | 6103 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
from xarray.core import formatting
from xarray.core.pycompat import PY3
from . import TestCase, raises_regex
class TestFormatting(TestCase):
... | apache-2.0 |
astroML/astroML | examples/datasets/plot_sdss_filters.py | 5 | 1366 | """
SDSS Filters
------------
Download and plot the five SDSS filter bands along with a Vega spectrum.
This data is available on the SDSS website (filters) and on the STSci
website (Vega).
"""
# Author: Jake VanderPlas <vanderplas@astro.washington.edu>
# License: BSD
# The figure is an example from astroML: see http:... | bsd-2-clause |
hackthemarket/pystrat | sim_ml.py | 1 | 11376 | # driver for playing with sim & ml
# simple trading strategy simulator
import pandas as pd
from pandas.tools.plotting import autocorrelation_plot
from pandas.tools.plotting import scatter_matrix
import numpy as np
from scipy import stats
import sklearn
from sklearn import preprocessing as pp
import matplotlib as m... | gpl-3.0 |
RPGOne/scikit-learn | sklearn/manifold/isomap.py | 50 | 7515 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
mjafin/bcbio-nextgen | bcbio/rnaseq/sailfish.py | 1 | 9327 | import os
import bcbio.pipeline.datadict as dd
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio.utils import (file_exists, safe_makedir, is_gzipped, rbind, partition,
R_package_path, Rscript_cmd)
from bcbio.pipeline import config_utils, disam... | mit |
gfyoung/pandas | pandas/tests/extension/test_numpy.py | 1 | 16802 | """
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... | bsd-3-clause |
jpautom/scikit-learn | sklearn/decomposition/dict_learning.py | 20 | 46133 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
xuanyuanking/spark | python/pyspark/pandas/base.py | 3 | 55960 | #
# 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 |
phobson/statsmodels | statsmodels/sandbox/distributions/genpareto.py | 33 | 10406 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 12 14:59:03 2010
Warning: not tried out or tested yet, Done
Author: josef-pktd
"""
from __future__ import print_function
import numpy as np
from scipy import stats
from scipy.misc import comb
from scipy.stats.distributions import rv_continuous
from numpy import where, i... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.