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 |
|---|---|---|---|---|---|
ningchi/scikit-learn | benchmarks/bench_plot_lasso_path.py | 301 | 4003 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
aabadie/scikit-learn | sklearn/linear_model/tests/test_perceptron.py | 378 | 1815 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_raises
from sklearn.utils import check_random_state
from sklearn.datasets import load_iris
from sklearn.linear_model import Pe... | bsd-3-clause |
lordkman/burnman | burnman/anisotropy.py | 5 | 17005 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
# GPL v2 or later.
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import matplotlib.p... | gpl-2.0 |
Equitable/trump | trump/test/test_orm_exceptions.py | 2 | 5688 | from trump.orm import Symbol, SetupTrump, SymbolManager, ConversionManager, \
SymbolLogEvent
from trump.reporting.objects import TrumpReport
from trump.templating.templates import GoogleFinanceFT, YahooFinanceFT,\
SimpleExampleMT, CSVFT, FFillIT, FeedsMatchVT, DateExistsVT, PctChangeMT
import p... | bsd-3-clause |
pdebuyl/cg_md_polymerization | code/write_tabulated_potential.py | 1 | 1301 | from __future__ import print_function, division
import numpy as np
N = 2001
eps = 0.1
rc = 2.**(1./6.)
r = np.linspace(0, 2*rc, N+2)[1:-1]
support = (r>=rc)
def LJ(r):
rm6 = r**(-6)
return 4*rm6*(rm6-1)+1
def F_LJ(r):
return 24*(2*r**(-13)-r**(-7))
def FPRIME_LJ(r):
return -24*(26*r**(-14)-7*r**(... | bsd-3-clause |
Vimos/scikit-learn | examples/decomposition/plot_faces_decomposition.py | 42 | 4843 | """
============================
Faces dataset decompositions
============================
This example applies to :ref:`olivetti_faces` different unsupervised
matrix decomposition (dimension reduction) methods from the module
:py:mod:`sklearn.decomposition` (see the documentation chapter
:ref:`decompositions`) .
"""... | bsd-3-clause |
maxlikely/scikit-learn | examples/svm/plot_custom_kernel.py | 4 | 1524 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print(__doc__)
import numpy as np
import pylab as pl
from sklearn import svm, datasets
# import some data to play with... | bsd-3-clause |
rnowling/pop-gen-models | bernoulli_nb/bnb_analysis.py | 1 | 1534 | import sys
from sklearn.naive_bayes import BernoulliNB as BNB
import matplotlib.pyplot as plt
import numpy as np
def read_variants(flname):
fl = open(flname)
markers = []
individuals = []
population_ids = []
population = -1
for ln in fl:
if "Marker" in ln:
if len(individuals) == 0:
continue
marker ... | apache-2.0 |
kdebrab/pandas | pandas/tests/indexing/test_panel.py | 3 | 7475 | import pytest
from warnings import catch_warnings
import numpy as np
from pandas.util import testing as tm
from pandas import Panel, date_range, DataFrame
class TestPanel(object):
def test_iloc_getitem_panel(self):
with catch_warnings(record=True):
# GH 7189
p = Panel(np.arange(... | bsd-3-clause |
rodorad/spark-tk | regression-tests/sparktkregtests/testcases/dicom/dicom_drop_keyword_test.py | 11 | 10522 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
OLAPLINE/TM1py | TM1py/Utils/Utils.py | 1 | 24149 | import collections
import json
import re
import sys
import warnings
import pandas as pd
if sys.version[0] == '2':
import httplib as http_client
else:
import http.client as http_client
REGEX_OBJECT_NAMES = re.compile(r"(?<!\()(?<!eq )'(?!\)|\Z)")
def get_all_servers_from_adminhost(adminhost='localhost'):
... | mit |
jaredweiss/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... | gpl-3.0 |
gkioxari/RstarCNN | lib/attr_data_layer/minibatch.py | 1 | 5157 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
# --------------------------------------------------------
# R*CNN
# Wri... | bsd-2-clause |
jpvmm/DLearningExp | fuzzy.py | 1 | 4518 |
#Fuzzy Algorithm to mark calcifications in mammography
#I'm using Mandani Defuzzification
#FutureBox Analytics
from __future__ import division
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as p
from skimage.io import imread
from skimage.measure import label, regionprops
from skimage.exposure i... | gpl-3.0 |
scollis/AGU_2016 | cluster/profile_mpi0/ipython_notebook_config.py | 4 | 20006 | # Configuration file for ipython-notebook.
c = get_config()
#------------------------------------------------------------------------------
# NotebookApp configuration
#------------------------------------------------------------------------------
# NotebookApp will inherit config from: BaseIPythonApplication, Appli... | bsd-3-clause |
EricSB/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/__init__.py | 69 | 2179 | from geo import AitoffAxes, HammerAxes, LambertAxes
from polar import PolarAxes
from matplotlib import axes
class ProjectionRegistry(object):
"""
Manages the set of projections available to the system.
"""
def __init__(self):
self._all_projection_types = {}
def register(self, *projections)... | agpl-3.0 |
Unidata/MetPy | v0.10/_downloads/f519a0be081a0d4c118047bc8501e53f/GINI_Water_Vapor.py | 12 | 1765 | # Copyright (c) 2015,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
GINI Water Vapor Imagery
========================
Use MetPy's support for GINI files to read in a water vapor satellite image and plot the
data using CartoPy.
"""
import ca... | bsd-3-clause |
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price | data/06 cvs/dataGrapher.py | 14 | 1426 | from ast import literal_eval
import matplotlib.pyplot as plt
p = [line.rstrip('\n') for line in open("positive.txt")]
n = [line.rstrip('\n') for line in open("negative.txt")]
a = [line.rstrip('\n') for line in open("all.txt")]
# stock closing prices from Nov 3 to Dec 3 (weedends/holidays given same price as ... | mit |
fornaxco/Mars-Express-Challenge | preprocessing/prepare_dmop.py | 1 | 4220 | # -*- coding: utf-8 -*-
"""
@author: fornax
"""
from __future__ import print_function, division
import os
import re
import time
import numpy as np
import pandas as pd
os.chdir(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.append(os.path.dirname(os.getcwd()))
import prepare_data1 as prep
DATA_PATH = os.path.j... | bsd-3-clause |
yarikoptic/pystatsmodels | statsmodels/iolib/tests/test_table.py | 3 | 6854 | import numpy as np
import unittest
from statsmodels.iolib.table import SimpleTable, default_txt_fmt
from statsmodels.iolib.table import default_latex_fmt
from statsmodels.iolib.table import default_html_fmt
import pandas
from statsmodels.regression.linear_model import OLS
ltx_fmt1 = default_latex_fmt.copy()
html_fmt1 ... | bsd-3-clause |
dsm054/pandas | pandas/tests/indexes/test_range.py | 1 | 36514 | # -*- coding: utf-8 -*-
from datetime import datetime
from itertools import combinations
import operator
import numpy as np
import pytest
from pandas.compat import PY3, range, u
import pandas as pd
from pandas import Float64Index, Index, Int64Index, RangeIndex, Series, isna
import pandas.util.testing as tm
from .t... | bsd-3-clause |
raghavrv/scikit-learn | examples/decomposition/plot_pca_vs_fa_model_selection.py | 59 | 4523 | """
===============================================================
Model selection with Probabilistic PCA and Factor Analysis (FA)
===============================================================
Probabilistic PCA and Factor Analysis are probabilistic models.
The consequence is that the likelihood of new data can be u... | bsd-3-clause |
cybernet14/scikit-learn | sklearn/utils/tests/test_testing.py | 107 | 4210 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... | bsd-3-clause |
alekz112/statsmodels | statsmodels/tsa/statespace/tests/test_sarimax.py | 6 | 49508 | """
Tests for SARIMAX models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
import warnings
from statsmodels.tsa.statespace import sarimax, tools
from statsmodels.tsa import arima_model as arima
from .r... | bsd-3-clause |
stuliveshere/SimplePyRay | src/prac1/toolbox/conv_test.py | 2 | 1043 | import scipy.ndimage as sp
from scipy.signal import fftconvolve
import numpy as np
import toolbox
import matplotlib.pyplot as pylab
import cProfile
def numpy_style(wavelet, workspace):
toolbox.conv(workspace, wavelet)
return workspace
def scipy_style(wavelet, workspace):
workspace['trace'] = sp.convolve1d(wor... | gpl-2.0 |
ndingwall/scikit-learn | examples/svm/plot_svm_nonlinear.py | 34 | 1136 | """
==============
Non-linear SVM
==============
Perform binary classification using non-linear SVC
with RBF kernel. The target to predict is a XOR of the
inputs.
The color map illustrates the decision function learned by the SVC.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn imp... | bsd-3-clause |
liyazhe/AML-Project2 | samr/predictor.py | 1 | 10429 | """
SAMR main module, PhraseSentimentPredictor is the class that does the
prediction and therefore one of the main entry points to the library.
"""
from collections import defaultdict
from sklearn.linear_model import SGDClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from skle... | bsd-3-clause |
pulinagrawal/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/rcsetup.py | 69 | 23344 | """
The rcsetup module contains the default values and the validation code for
customization using matplotlib's rc settings.
Each rc setting is assigned a default value and a function used to validate any
attempted changes to that setting. The default values and validation functions
are defined in the rcsetup module, ... | agpl-3.0 |
bougui505/SOM | application/learn.py | 1 | 4007 | #!/usr/bin/env python
"""
author: Guillaume Bouvier
email: guillaume.bouvier@ens-cachan.org
creation date: 01 10 2013
license: GNU GPL
Please feel free to use and modify this, but keep the above information.
Thanks!
"""
import matplotlib.pyplot
import IO
import numpy
import itertools
import scipy.spatial
impo... | gpl-2.0 |
lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/indexes/test_multi.py | 3 | 110796 | # -*- coding: utf-8 -*-
import re
import warnings
from datetime import timedelta
from itertools import product
import pytest
import numpy as np
import pandas as pd
from pandas import (CategoricalIndex, DataFrame, Index, MultiIndex,
compat, date_range, period_range)
from pandas.compat import PY... | mit |
matthew-brett/draft-statsmodels | scikits/statsmodels/sandbox/stats/stats_dhuard.py | 1 | 9630 | '''
from David Huard's scipy sandbox, also attached to a ticket and
in the matplotlib-user mailinglist (links ???)
Notes
=====
out of bounds interpolation raises exception and wouldn't be completely
defined ::
>>> scoreatpercentile(x, [0,25,50,100])
Traceback (most recent call last):
...
raise ValueError("A va... | bsd-3-clause |
iismd17/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 248 | 2903 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
jhonatanoliveira/pgmpy | pgmpy/sampling/base.py | 2 | 16349 | from warnings import warn
import numpy as np
from pgmpy import HAS_PANDAS
from pgmpy.utils import _check_1d_array_object, _check_length_equal
if HAS_PANDAS:
import pandas
class BaseGradLogPDF(object):
"""
Base class for evaluating gradient log of probability density function/ distribution
Classes ... | mit |
tmerrick1/spack | var/spack/repos/builtin/packages/py-cycler/package.py | 5 | 1609 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
nomadcube/scikit-learn | examples/ensemble/plot_adaboost_multiclass.py | 354 | 4124 | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | bsd-3-clause |
plissonf/scikit-learn | examples/mixture/plot_gmm_sin.py | 248 | 2747 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
pprett/statsmodels | statsmodels/examples/example_functional_plots.py | 4 | 1329 | '''Functional boxplots and rainbow plots
see docstrings for an explanation
Author: Ralf Gommers
'''
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
#Load the El Nino dataset. Consists of 60 years worth of Pacific Ocean sea
#surface temperature data.
data = sm.datasets.elnino.load... | bsd-3-clause |
shaunstanislaus/ibis | scripts/create_test_data_archive.py | 5 | 3631 | #! /usr/bin/env python
# Copyright 2014 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
hsaputra/tensorflow | tensorflow/python/estimator/inputs/queues/feeding_functions.py | 10 | 18972 | # 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 |
timestocome/Test-stock-prediction-algorithms | NeuralNetworks/Reinforcement_tf.py | 1 | 7250 |
# http://github.com
# Working through MEAP Machine Learning w/ TensorFlow Book
# added a few things to their sample code
# first pass stock estimates using random policy reinforcement learning
# Unimpressed - tried various look back time and other parameters
# still does about the same as random guesses but with... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/matplotlib/tests/test_arrow_patches.py | 5 | 4275 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison
import matplotlib.patches as mpatches
def draw_arrow(ax, t, r):
ax.annotate('', xy=(0.5, 0.5 + r), xy... | mit |
niknow/py_sphere_Voronoi | docs/conf.py | 2 | 8750 | # -*- coding: utf-8 -*-
#
# py_sphere_Voronoi documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 26 09:58:03 2014.
#
# 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 f... | mit |
pp-mo/iris | docs/iris/example_code/Oceanography/atlantic_profiles.py | 2 | 3469 | """
Oceanographic profiles and T-S diagrams
=======================================
This example demonstrates how to plot vertical profiles of different
variables in the same axes, and how to make a scatter plot of two
variables. There is an oceanographic theme but the same techniques are
equally applicable to atmosph... | lgpl-3.0 |
CrazyGuo/bokeh | bokeh/crossfilter/plotting.py | 42 | 8763 | from __future__ import absolute_import
import numpy as np
import pandas as pd
from bokeh.models import ColumnDataSource, BoxSelectTool
from ..plotting import figure
def cross(start, facets):
"""Creates a unique combination of provided facets.
A cross product of an initial set of starting facets with a new se... | bsd-3-clause |
rajat1994/scikit-learn | examples/svm/plot_svm_regression.py | 249 | 1451 | """
===================================================================
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 |
peterwilletts24/Monsoon-Python-Scripts | heat_flux/heat_flux_latent_latex.py | 1 | 3582 | """
Loop through multiple pickle files of averaged etc data, plot and save
"""
import os, sys
import glob
# import itertools
import matplotlib
#matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
#from matplotlib import rc
#from matplotlib.font_manager import FontProperties
#from matplo... | mit |
GeraldLoeffler/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/__init__.py | 69 | 28184 | """
This is an object-orient plotting library.
A procedural interface is provided by the companion pylab module,
which may be imported directly, e.g::
from pylab import *
or using ipython::
ipython -pylab
For the most part, direct use of the object-oriented library is
encouraged when programming rather tha... | agpl-3.0 |
Chilipp/psy-simple | tests/test_colors.py | 1 | 2006 | """Test the :mod:`psy_simple.colors` module"""
import six
import unittest
import _base_testing as bt
import matplotlib.pyplot as plt
import psy_simple.colors as psyc
class TestShowColormaps(unittest.TestCase):
"""Test the :func:`psy_simple.colors.show_colormaps` function"""
def setUp(self):
plt.close... | gpl-2.0 |
takuya1981/sms-tools | lectures/03-Fourier-properties/plots-code/convolution-1.py | 24 | 1341 | import matplotlib.pyplot as plt
import numpy as np
import time, os, sys
from scipy.fftpack import fft, ifft, fftshift
import math
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import utilFunctions as UF
import dftModel as DF
(fs, x) = UF.wavread('../../../soun... | agpl-3.0 |
briehl/narrative | src/biokbase/narrative/tests/test_viewers.py | 1 | 5395 | import unittest
import biokbase.auth
from . import util
"""
Tests for the viewer module
"""
__author__ = "James Jeffryes <jjeffryes@mcs.anl.gov>"
@unittest.skip("Skipping clustergrammer-based tests")
class ViewersTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.attribute_set_ref = ... | mit |
procoder317/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
magne-max/zipline-ja | tests/pipeline/test_technical.py | 1 | 12348 | from __future__ import division
from nose_parameterized import parameterized
from six.moves import range
import numpy as np
import pandas as pd
import talib
from zipline.lib.adjusted_array import AdjustedArray
from zipline.pipeline.data import USEquityPricing
from zipline.pipeline.factors import (
BollingerBands,... | apache-2.0 |
PatrickOReilly/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_scalability.py | 85 | 5728 | """
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... | bsd-3-clause |
kudkudak/r2-learner | scripts/fit_elms.py | 2 | 1343 | import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from sklearn.grid_search import GridSearchCV, ParameterGrid
import numpy as np
from multiprocessing import Pool
from fit_models import extern_k_fold
from data_api import *
from elm import ELM
import time
import traceback
n_jobs = 8
params ... | mit |
lorenzo-desantis/mne-python | examples/forward/plot_make_forward.py | 20 | 2669 | """
======================================================
Create a forward operator and display sensitivity maps
======================================================
Sensitivity maps can be produced from forward operators that
indicate how well different sensor types will be able to detect
neural currents from diff... | bsd-3-clause |
abhiatgithub/shogun-toolbox | examples/undocumented/python_modular/graphical/multiclass_qda.py | 26 | 3294 | """
Shogun demo
Fernando J. Iglesias Garcia
"""
import numpy as np
import matplotlib as mpl
import pylab
import util
from scipy import linalg
from modshogun import QDA
from modshogun import RealFeatures, MulticlassLabels
# colormap
cmap = mpl.colors.LinearSegmentedColormap('color_classes',
{'red': [(0, 1, 1),
... | gpl-3.0 |
andybrnr/QuantEcon.py | quantecon/models/solow/model.py | 7 | 38654 | r"""
======================
The Solow Growth Model
======================
The following summary of the [solow1956] model of economic growth
largely follows [romer2011].
Assumptions
===========
The production function
----------------------------------------------
The [solow1956] model of economic growth focuses on ... | bsd-3-clause |
chenhh/PySPPortfolio | PySPPortfolio/pysp_portfolio/best.py | 1 | 23298 | # -*- coding: utf-8 -*-
"""
Authors: Hung-Hsin Chen <chenhh@par.cse.nsysu.edu.tw>
License: GPL v2
"""
from __future__ import division
from time import time
import os
import numpy as np
import pandas as pd
from pyomo.environ import *
from PySPPortfolio.pysp_portfolio import *
from base_model import (PortfolioReportMix... | gpl-3.0 |
pconrad/pconrad.github.io | markdown_generator/talks.py | 199 | 4000 |
# coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i... | mit |
ARM-software/lisa | setup.py | 1 | 4918 | #! /usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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/l... | apache-2.0 |
saltastro/pysalt | slottools/slotview.py | 1 | 5716 | ################################# LICENSE ##################################
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) #
# All rights reserved. #
# #
# Redistribu... | bsd-3-clause |
bluescarni/hyperion | docs/tutorials/scripts/quantity_cartesian_viz.py | 2 | 1323 | import numpy as np
import matplotlib.pyplot as plt
from hyperion.model import ModelOutput
from hyperion.util.constants import pc
# Read in the model
m = ModelOutput('quantity_cartesian.rtout')
# Extract the quantities
g = m.get_quantities()
# Get the wall positions in pc
xw, yw = g.x_wall / pc, g.y_wall / pc
# Mak... | bsd-2-clause |
iamshang1/Projects | Basic_ML/Classifier_Comparison/classifier_comparison.py | 1 | 12994 | import numpy as np
import pandas as pd
import zipfile
import gzip, cPickle
from sklearn.datasets import load_digits
from sklearn.preprocessing import scale
from sklearn.cross_validation import train_test_split
from sklearn.multiclass import OneVsRestClassifier
from sklearn.linear_model import LogisticRegression
from sk... | mit |
AIML/scikit-learn | examples/svm/plot_svm_margin.py | 318 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
JsNoNo/scikit-learn | sklearn/manifold/setup.py | 99 | 1243 | import os
from os.path import join
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("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
mne-tools/mne-tools.github.io | 0.17/_downloads/02155f3698f69db680e9687427ff5123/plot_decoding_csp_eeg.py | 8 | 5516 | """
===========================================================================
Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)
===========================================================================
Decoding of motor imagery applied to EEG data decomposed using CSP.
Here the classifier... | bsd-3-clause |
abinashpanda/pgmpy | pgmpy/estimators/HillClimbSearch.py | 1 | 8361 | #!/usr/bin/env python
from itertools import permutations
import networkx as nx
from pgmpy.estimators import StructureEstimator, K2Score
from pgmpy.models import BayesianModel
class HillClimbSearch(StructureEstimator):
def __init__(self, data, scoring_method=None, **kwargs):
"""
Class for heurist... | mit |
ArnaudBelcour/liasis | pbsea/preprocessing.py | 1 | 5695 | #!/usr/bin/env python3
import os
import pandas as pa
import pronto
import urllib.request
from gzip import GzipFile
from lxml import etree
def preprocessing_files(object_to_analyze, name_path_file_interest, name_path_file_reference):
'''
Function creating a dataframe from two files, compatible with PandasBase... | gpl-3.0 |
quheng/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 |
huongttlan/statsmodels | statsmodels/sandbox/tsa/fftarma.py | 30 | 16438 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 19:53:25 2009
Author: josef-pktd
generate arma sample using fft with all the lfilter it looks slow
to get the ma representation first
apply arma filter (in ar representation) to time series to get white noise
but seems slow to be useful for fast estimation for nobs=1... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/arrays/categorical/test_missing.py | 1 | 5589 | import collections
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import Categorical, DataFrame, Index, Series, isna
import pandas._testing as tm
class TestCategoricalMissing:
def test_na_flags_int_categories(self):
# #1457
... | bsd-3-clause |
mhdella/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 |
mantidproject/mantid | qt/applications/workbench/workbench/plotting/figuremanager.py | 3 | 22835 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/numpy/linalg/linalg.py | 11 | 75845 | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | gpl-2.0 |
jad-b/mlsl | mlsl/dataset.py | 1 | 2738 | """
dataset
=======
Utilities for loading and saving datasets.
These tools may much more freely leverage existing work in libraries such as
Pandas, Scipy, Numpy, etc. then the actual machine learning algorithms do.
As their concern is getting the data to a consumable state, I don't feel it
necessary to intentionally r... | gpl-3.0 |
lokeshpancharia/BuildingMachineLearningSystemsWithPython | ch03/rel_post_20news.py | 24 | 3903 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import sklearn.datasets
import scipy as sp
new_post = \
"""Disk drive problems. Hi, I have a probl... | mit |
khkaminska/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 267 | 6813 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... | bsd-3-clause |
oxmcvusd/jieba | test/extract_topic.py | 65 | 1463 | import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv)<2:
print("usage: extract_topic.py di... | mit |
Aufuray/ross-sea-project | app/models/image_nd.py | 1 | 3950 | import os
import sys
import numpy as np
from matplotlib import pyplot as plt
from tools import data
class ImageND(object):
SENSOR = None
def __init__(self, filename, dimensions=3):
if dimensions < 3:
print "The image doesn't have the minimum of 3 dimensions"
sys.exit(1)
... | mit |
waternova/random-forest-viz | data/export.py | 1 | 3475 | import numpy as np
from sklearn.tree import _tree
def export_json(decision_tree, out_file=None, feature_names=None):
"""Export a decision tree in JSON format.
This function generates a JSON representation of the decision tree,
which is then written into `out_file`. Once exported, graphical renderings
... | gpl-3.0 |
ctk3b/mdtraj | mdtraj/testing/testing.py | 5 | 8311 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Kyle A Beauchamp
#
# MDTraj is... | lgpl-2.1 |
jalexvig/tensorflow | tensorflow/contrib/eager/python/examples/rnn_colorbot/rnn_colorbot.py | 14 | 13765 | # 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... | apache-2.0 |
rgommers/scipy | scipy/integrate/_quad_vec.py | 12 | 20691 | import sys
import copy
import heapq
import collections
import functools
import numpy as np
from scipy._lib._util import MapWrapper
class LRUDict(collections.OrderedDict):
def __init__(self, max_size):
self.__max_size = max_size
def __setitem__(self, key, value):
existing_key = (key in self)... | bsd-3-clause |
ablifedev/ABLIRC | ABLIRC/bin/Dataclean/stat_uniq_tag.py | 1 | 10331 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
####################################################################################
### Copyright (C) 2015-2019 by ABLIFE
####################################################################################
#########################################################... | mit |
lsiemens/iprocess-projects | psipy/analytic.py | 1 | 5194 | ####
#
# Copyright (c) 2015, Luke Siemens
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | bsd-3-clause |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/svm/plot_svm_anova.py | 1 | 2024 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature selection before running a
SVC (support vector classifier) to improve the classification scores.
"""
print(__doc_... | mit |
mugizico/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 259 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
meaton00/class_project | fixtures/test3D.py | 1 | 2994 | import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca(projection='3d')
#x-axis is zone occupancy, a surrogate measure for vehicle density
density = [2.6,2.090909091,1.75,1.666666667,1.555555556,1.5,\
1.5,1,1.166666667,1,1,0.5,1,1.333333333,1.2... | mit |
RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/mixture/gmm.py | 5 | 26774 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import numpy as np
from scipy i... | bsd-3-clause |
idlead/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 |
vorwerkc/pymatgen | pymatgen/apps/battery/plotter.py | 5 | 7178 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides plotting capabilities for battery related applications.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ =... | mit |
mvcsantos/QGIS | python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py | 5 | 9868 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QGISAlgorithmProvider.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... | gpl-2.0 |
abeyer/anki | oldanki/graphs.py | 20 | 14438 | # -*- coding: utf-8 -*-
# Copyright: Damien Elmes <oldanki@ichi2.net>
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
"""\
Graphs of deck statistics
==============================
"""
__docformat__ = 'restructuredtext'
import os, sys, time
import oldanki.stats
from oldanki.lang import _
... | agpl-3.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/py-deeptools/package.py | 3 | 2155 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
dingocuster/scikit-learn | sklearn/neighbors/tests/test_dist_metrics.py | 230 | 5234 | import itertools
import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from nose import SkipTest
def dist_func(x1, x2, p):
return np.sum((x1 - x2) ** p) ** (1. / p)
de... | bsd-3-clause |
vshtanko/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 |
FEPanalysis/alchemical-analysis-OLD | alchemical_analysis/alchemical_analysis.py | 1 | 58462 | #!/usr/bin/env python
######################################################################
# Alchemical Analysis: An open tool implementing some recommended practices for analyzing alchemical free energy calculations
# Copyright 2011-2015 UC Irvine and the Authors
#
# Authors: Pavel Klimovich, Michael Shirts and Dav... | lgpl-2.1 |
networks-lab/tidyextractors | tidyextractors/base_extractor.py | 1 | 13072 | # *********************************************************************************************
# Copyright (C) 2017 Joel Becker, Jillian Anderson, Steve McColl and Dr. John McLevey
#
# This file is part of the tidyextractors package developed for Dr John McLevey's Networks Lab
# at the University of Waterloo. For mor... | gpl-3.0 |
ccurtis7/brain-diffusion | brain_diffusion/experiments/04_03_18_diffusion_in_slices/200nm/histogram_utils.py | 13 | 2229 | import numpy as np
import numpy.ma as ma
import scipy.stats as stat
import random
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.stats as stat
def histogram_by_video(SMfilename, xlabel='Log Diffusion Coefficient Dist', ylabel='Trajectory Count', fps=100.02, frames=651,
y_... | bsd-2-clause |
hargup/WIGI-website | plots/gender_by_language.py | 2 | 3335 | from __future__ import print_function
from collections import OrderedDict
from numpy import max, min
import pandas as pd
from bokeh.plotting import figure
from bokeh.models import (HoverTool,
ColumnDataSource,
NumeralTickFormatter)
from .utils import write_plot, rea... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.