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 |
|---|---|---|---|---|---|
NauIceLab/SpectralAnalysis | oldGTanalysis.py | 4 | 17389 | ##############################################################################
# Created by Garrett Thompson
# Graphical User Interface for Data Analysis
# Created at Northern Arizona University
# for use in the Astrophysical Ice Laboratory
# Advisors: Jennifer Hanley, Will Grundy, Henry Roe
# garrett.leland.thom... | mit |
paolodedios/tensorflow | tensorflow/python/estimator/inputs/pandas_io.py | 41 | 1293 | # Copyright 2018 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 |
fboers/jumeg | jumeg/decompose/fourier_ica_plot.py | 3 | 71131 | # Authors: Lukas Breuer <l.breuer@fz-juelich.de>
"""
----------------------------------------------------------------------
--- jumeg.decompose.fourier_ica_plot ---------------------------------
----------------------------------------------------------------------
autor : Lukas Breuer
email : l.breuer@fz-... | bsd-3-clause |
RTHMaK/RPGOne | scipy-2017-sklearn-master/notebooks/helpers.py | 3 | 5032 | import numpy as np
from collections import defaultdict
import os
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.feature_extraction import DictVectorizer
# Can also use pandas!
def process_titanic_line(line):
# Split line on "," to get fields without comma confusion
vals = line.strip().... | apache-2.0 |
spennihana/h2o-3 | h2o-py/tests/testdir_jira/pyunit_pubdev_5265.py | 2 | 2111 | import numpy as numpy
from pandas import DataFrame
import h2o
import warnings
from h2o.estimators import H2OGeneralizedLinearEstimator
from tests import pyunit_utils
def pubdev_5265():
training_data = {
'response': ['A', 'A', 'A', 'A', 'A',
'B', 'B', 'B', 'B', 'B', 'B',
... | apache-2.0 |
iiSeymour/pandashells | pandashells/test/p_df_test.py | 1 | 5654 | #! /usr/bin/env python
import os
import subprocess
import tempfile
from mock import patch, MagicMock
from unittest import TestCase
import pandas as pd
try:
from StringIO import StringIO
except ImportError: # pragma nocover
from io import StringIO
from pandashells.bin.p_df import (
needs_plots,
get_m... | bsd-2-clause |
vondrejc/FFTHomPy | examples/lowRankTensorApproximations/plots.py | 1 | 28051 | import pickle
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
from examples.lowRankTensorApproximations.fig_pars import set_labels, set_pars
os.nice(19)
def save_experiment_settings(kind_list, Ns, kinds, sol_rank_range_set, material_list,
data_folder='data_for_plot'):
... | mit |
wathen/PhD | MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/SplitMatrix/ScottTest/InverseTest/Step.py | 2 | 15238 | #!/usr/bin/python
# interpolate scalar gradient onto nedelec space
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
from dolfin import *
Print = PETSc.Sys.Print
# from MatrixOperations import *
import numpy as np
import PETScIO as IO
import common
import scipy
import scipy.io
import tim... | mit |
silky/sms-tools | lectures/05-Sinusoidal-model/plots-code/sine-analysis-synthesis.py | 22 | 1543 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
from scipy.fftpack import fft, ifft, fftshift
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
import ... | agpl-3.0 |
kendricktan/rarepepes | pix2pix/test.py | 1 | 1791 | import matplotlib as mpl
mpl.use('Agg')
import utils
import os
import time
import argparse
import torch
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from tqdm import tqdm
from options import TestOptions
from loader import Pepe... | mit |
HolgerPeters/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
IBT-FMI/SAMRI | samri/report/registration.py | 1 | 3792 | import hashlib
import multiprocessing as mp
import nibabel as nib
import pandas as pd
from os import path
from joblib import Parallel, delayed
from nipype.interfaces import ants, fsl
def measure_sim(image_path, reference,
substitutions=False,
mask='',
metric='MI',
radius_or_number_of_bins=8,
sampling_strategy='N... | gpl-3.0 |
yask123/scikit-learn | sklearn/linear_model/setup.py | 146 | 1713 | 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('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | bsd-3-clause |
mathialo/sigpy | sigpy/imaging.py | 1 | 3927 | def to_grayscale(img, mode="norm"):
""" convert color image to grayscale
Arguments:
img -- image
Keyword arguments:
mode -- what algorithm to use to calculate gray value. Avilable options are:
norm (standard), mean, max and min.
"""
from numpy import sqrt
if len(img.shape)... | mit |
jayflo/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
bundgus/python-playground | matplotlib-playground/examples/pylab_examples/demo_text_rotation_mode.py | 2 | 1427 | from mpl_toolkits.axes_grid1.axes_grid import ImageGrid
def test_rotation_mode(fig, mode, subplot_location):
ha_list = "left center right".split()
va_list = "top center baseline bottom".split()
grid = ImageGrid(fig, subplot_location,
nrows_ncols=(len(va_list), len(ha_list)),
... | mit |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/mpl_toolkits/exceltools.py | 10 | 3958 | """
Some io tools for excel -- requires xlwt
Example usage:
import matplotlib.mlab as mlab
import mpl_toolkits.exceltools as exceltools
r = mlab.csv2rec('somefile.csv', checkrows=0)
formatd = dict(
weight = mlab.FormatFloat(2),
change = mlab.FormatPercent(2),
cost = mlab.Fo... | bsd-3-clause |
NicovincX2/Python-3.5 | Statistiques/Estimation (statistique)/Régression/Gradient boosting/gradient_boosting_regression.py | 1 | 2287 | # -*- coding: utf-8 -*-
import os
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
#
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn import ensemble
from sklearn import datasets
from sklearn.utils import shuffle
from sklearn.metrics import mean_squared_error
#####... | gpl-3.0 |
hrjn/scikit-learn | examples/mixture/plot_concentration_prior.py | 16 | 5657 | """
========================================================================
Concentration Prior Type Analysis of Variation Bayesian Gaussian Mixture
========================================================================
This example plots the ellipsoids obtained from a toy dataset (mixture of three
Gaussians) fitte... | bsd-3-clause |
JohnGriffiths/nipype | nipype/algorithms/modelgen.py | 7 | 34756 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The modelgen module provides classes for specifying designs for individual
subject analysis of task-based fMRI experiments. In particular it also includes
algorithms for generating regressors for sparse... | bsd-3-clause |
ricket1978/ggplot | ggplot/components/loess.py | 13 | 1602 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
"""
loess(formula, data, weights, subset, na.action, model = FALSE,
span = 0.75, enp.target, degree = 2,
parametric = FALSE, drop.square = FALSE, normalize = TRUE,
family = c("gaussian", "symme... | bsd-2-clause |
yavalvas/yav_com | build/matplotlib/lib/mpl_examples/images_contours_and_fields/pcolormesh_levels.py | 6 | 1509 | """
Shows how to combine Normalization and Colormap instances to draw
"levels" in pcolor, pcolormesh and imshow type plots in a similar
way to the levels keyword argument to contour/contourf.
"""
import matplotlib.pyplot as plt
from matplotlib.colors import BoundaryNorm
from matplotlib.ticker import MaxNLocator
impor... | mit |
stuart-knock/bokeh | examples/glyphs/colors.py | 25 | 8920 | from __future__ import print_function
from math import pi
import pandas as pd
from bokeh.models import Plot, ColumnDataSource, FactorRange, CategoricalAxis, TapTool, HoverTool, OpenURL
from bokeh.models.glyphs import Rect
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.resources impor... | bsd-3-clause |
herilalaina/scikit-learn | sklearn/utils/estimator_checks.py | 1 | 75664 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
from scipy.stats import rankdata
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memor... | bsd-3-clause |
architecture-building-systems/CityEnergyAnalyst | cea/technologies/solar/photovoltaic.py | 1 | 39532 | """
Photovoltaic
"""
import os
import time
from itertools import repeat
from math import *
from multiprocessing import Pool
import numpy as np
import pandas as pd
from geopandas import GeoDataFrame as gdf
from scipy import interpolate
import cea.config
import cea.inputlocator
import cea.utilities.parallel
from cea.a... | mit |
mkukielka/oddt | oddt/scoring/functions/NNScore.py | 1 | 5160 | from __future__ import print_function
import sys
from os.path import dirname, isfile, join as path_join
import numpy as np
import warnings
from joblib import Parallel, delayed
from scipy.stats import pearsonr
from sklearn.metrics import r2_score
from oddt import random_seed
from oddt.utils import method_caller
from o... | bsd-3-clause |
hlin117/statsmodels | statsmodels/stats/tests/test_weightstats.py | 30 | 21864 | '''tests for weightstats, compares with replication
no failures but needs cleanup
update 2012-09-09:
added test after fixing bug in covariance
TODOs:
- I don't remember what all the commented out code is doing
- should be refactored to use generator or inherited tests
- still gaps in test coverage... | bsd-3-clause |
bearing/dosenet-analysis | Programming Lesson Modules/Module 6- Data Binning.py | 1 | 2232 | """
####Module 6- Data Binning
"""
import csv
import io
import urllib.request
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
url = 'http://radwatch.berkeley.edu/sites/default/files/dosenet/etch_roof.csv'
response = urllib.request.urlopen(url)
reader = csv.r... | mit |
raghavrv/scikit-learn | sklearn/tree/export.py | 16 | 18309 | """
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Trevor... | bsd-3-clause |
neale/CS-program | 434-MachineLearning/final_project/linearClassifier/sklearn/naive_bayes.py | 16 | 30329 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | unlicense |
henridwyer/scikit-learn | sklearn/linear_model/omp.py | 127 | 30417 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... | bsd-3-clause |
jreback/pandas | pandas/tests/arrays/boolean/test_arithmetic.py | 6 | 3586 | import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.arrays import FloatingArray
@pytest.fixture
def data():
return pd.array(
[True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False],
dtype="boolean",
)
@pytest.fi... | bsd-3-clause |
akrherz/iem | cgi-bin/request/isusm.py | 1 | 14930 | """Download interface for ISU-SM data."""
import datetime
from io import StringIO, BytesIO
import pandas as pd
import psycopg2.extras
from paste.request import parse_formvars
from pyiem.util import get_dbconn, c2f, mm2inch
EXL = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
MISSING = {"", "M", "... | mit |
fredrikw/scipy | scipy/integrate/quadrature.py | 33 | 28087 | from __future__ import division, print_function, absolute_import
import numpy as np
import math
import warnings
# trapz is a public function for scipy.integrate,
# even though it's actually a numpy function.
from numpy import trapz
from scipy.special.orthogonal import p_roots
from scipy.special import gammaln
from sc... | bsd-3-clause |
aswolf/xmeos | xmeos/test/test_models_thermal.py | 1 | 5279 | from __future__ import absolute_import, print_function, division, with_statement
from builtins import object
import numpy as np
import xmeos
from xmeos import models
from xmeos.models import core
import pytest
import matplotlib.pyplot as plt
import matplotlib as mpl
from abc import ABCMeta, abstractmethod
import copy
... | mit |
yyjiang/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 |
jmontgom10/Mimir_pyPol | 02b_buildStarAndNebulaMasks.py | 1 | 19696 | import os
import glob
import numpy as np
import warnings
from skimage import measure, morphology
from scipy import ndimage
from astropy.table import Table, Column
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.stats import gaussian_fwhm_to_sigma, sigma_clipped_stats
from astropy.convolu... | mit |
pkruskal/scikit-learn | sklearn/neighbors/base.py | 115 | 29783 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | bsd-3-clause |
INM-6/Python-Module-of-the-Week | session20_NEST/snakemake/scripts/simulateBrunel.py | 1 | 3959 | import argparse
import numpy as np
import matplotlib.pyplot as plt
import nest
# parse command line parameters
parser = argparse.ArgumentParser(description='Simulate a Brunel network.')
parser.add_argument('spikefile', type=str, help='output file (spikes)')
parser.add_argument('rasterfile', type=str, help='output fi... | mit |
phobson/statsmodels | statsmodels/datasets/utils.py | 1 | 11013 | from statsmodels.compat.python import (range, StringIO, urlopen,
HTTPError, URLError, lrange,
cPickle, urljoin, BytesIO, long)
import sys
import shutil
from os import environ
from os import makedirs
from os.path import expanduser
from os.path... | bsd-3-clause |
danny200309/BuildingMachineLearningSystemsWithPython | ch10/simple_classification.py | 21 | 2299 | # 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 mahotas as mh
import numpy as np
from glob import glob
from features import texture, color_hist... | mit |
zhonghualiu/FaST-LMM | fastlmm/association/score.py | 1 | 19728 | import numpy as NP
import scipy as sp
import scipy.linalg as LA
import numpy.linalg as nla
import os
import sys
import glob
sys.path.append("./../../pyplink")
from fastlmm.pyplink.plink import *
from pysnptools.util.pheno import *
from fastlmm.util.mingrid import *
#import pdb
import scipy.stats as ST
impo... | apache-2.0 |
idea4bsd/idea4bsd | python/helpers/pydev/pydevconsole.py | 1 | 17708 | '''
Entry point module to start the interactive console.
'''
from _pydev_imps._pydev_saved_modules import thread
start_new_thread = thread.start_new_thread
try:
from code import InteractiveConsole
except ImportError:
from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole
from code impo... | apache-2.0 |
KennyCandy/HAR | module45/CCCPCC_32_32.py | 2 | 18310 | # Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
# quoc_trinh
import tensorflow as tf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import metrics
import os
import sys
import datetime
# get current... | mit |
arabenjamin/scikit-learn | sklearn/utils/fixes.py | 133 | 12882 | """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 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/io/tests/test_excel.py | 1 | 44576 | # pylint: disable=E1101
from pandas.compat import u, range, map
from datetime import datetime, date
import os
import nose
from numpy import nan
import numpy as np
from pandas import DataFrame, Index, MultiIndex
from pandas.io.parsers import read_csv
from pandas.io.excel import (
ExcelFile, ExcelWriter, read_exc... | gpl-3.0 |
raghavrv/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
kdebrab/pandas | pandas/tests/reshape/merge/test_merge_index_as_string.py | 3 | 7108 | import numpy as np
import pytest
from pandas import DataFrame
from pandas.util import testing as tm
from pandas.util.testing import assert_frame_equal
@pytest.fixture
def df1():
return DataFrame(dict(
outer=[1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4],
inner=[1, 2, 3, 1, 2, 3, 4, 1, 2, 1, 2],
v1=np.... | bsd-3-clause |
zorroblue/scikit-learn | examples/ensemble/plot_random_forest_regression_multioutput.py | 29 | 2685 | """
============================================================
Comparing random forests and the multi-output meta estimator
============================================================
An example to compare multi-output regression with random forest and
the :ref:`multioutput.MultiOutputRegressor <multiclass>` meta-e... | bsd-3-clause |
INM-6/elephant | doc/conf.py | 2 | 11596 | # -*- coding: utf-8 -*-
#
# Elephant documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 5 17:11:26 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 file.
#
# Al... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/scipy/signal/ltisys.py | 13 | 123258 | """
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
from __future__ import division, print_function, absolute_import
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
# Apr 2011: Jeffrey Armstrong <jeff@approximatrix.co... | mit |
sunzhxjs/JobGIS | lib/python2.7/site-packages/pandas/tests/test_series.py | 9 | 288883 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import re
import sys
from datetime import datetime, timedelta
import operator
import string
from inspect import getargspec
from itertools import product, starmap
from distutils.version import LooseVersion
import warnings
import random
import nose
from numpy import nan... | mit |
IssamLaradji/scikit-learn | examples/classification/plot_digits_classification.py | 289 | 2397 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/matplotlib/delaunay/interpolate.py | 21 | 7262 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib._delaunay import compute_planes, linear_interpolate_grid
from matplotlib._delaunay import nn_interpolate_grid
from matplotlib._delaunay import nn_interpolate_unst... | apache-2.0 |
tobiasgehring/qudi | gui/colordefs.py | 3 | 59164 | # -*- coding: utf-8 -*-
"""
This file contains the Qudi GUI module utility classes.
Qudi 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.
Q... | gpl-3.0 |
hposborn/Namaste | namaste/run.py | 1 | 66119 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
:py:mod:`Namaste.py` - Single transit fitting code
-------------------------------------
'''
import numpy as np
import pylab as plt
import scipy.optimize as optimize
from os import sys, path
import datetime
import logging
import pandas as pd
import click
import emcee... | mit |
phoebe-project/phoebe2-docs | development/examples/distribution_constraints.py | 2 | 1988 | #!/usr/bin/env python
# coding: utf-8
# # Propagating Distributions through Constraints
#
# In this example script, we'll reproduce Figure 4 from the fitting release paper ([Conroy et al. 2020](http://phoebe-project.org/publications/2020Conroy+)).
#
# <img src="http://phoebe-project.org/images/figures/2020Conroy+_fi... | gpl-3.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/tests/indexes/datetimes/test_datetime.py | 3 | 31691 | import pytest
import numpy as np
from datetime import date, timedelta, time
import pandas as pd
import pandas.util.testing as tm
from pandas.compat import lrange
from pandas.compat.numpy import np_datetime64_compat
from pandas import (DatetimeIndex, Index, date_range, Series, DataFrame,
Timestamp,... | mit |
EderSantana/deeplivecoding | demo-rehearsal.py | 3 | 7905 |
# coding: utf-8
## Theano Basics
# In[1]:
from __future__ import print_function
import theano
import numpy as np
from theano import tensor as T
floatX = theano.config.floatX
# In[2]:
# Convention:
# uppercase: symbolic theano element or function
# lowercase: numpy array
W = T.vector('w')
X = T.matrix('X')
Y ... | mit |
PmagPy/PmagPy | programs/irmaq_magic.py | 2 | 6781 | #!/usr/bin/env python
import sys
import os
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmag as pmag
from pmagpy import contribution_builder as cb
import pmagpy.pmagplotlib as pmagplotlib
def main():
"""
NAME
irmaq_magic.py
DESCRIPTION
... | bsd-3-clause |
riveridea/gnuradio | gr-digital/examples/example_timing.py | 5 | 9211 | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | gpl-3.0 |
Srisai85/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
malmiron/incubator-airflow | airflow/hooks/base_hook.py | 1 | 3192 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
basauri89/TFM-online-sales | archivos .py/blender.py | 1 | 3309 | """
Simple blender para los valores de regresion deseados durante meses
"""
import numpy as np
from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor
import load_data
from sklearn.cross_validation import KFold
from sklearn.linear_model import Ridge, RidgeCV, LinearRegressio... | gpl-2.0 |
mattloper/opendr | opendr/test_sh.py | 1 | 4734 | #!/usr/bin/env python
# encoding: utf-8
"""
Author(s): Matthew Loper
See LICENCE.txt for licensing and contact information.
"""
from chumpy import Ch
import numpy as np
from chumpy.utils import row, col
from .lighting import SphericalHarmonics
import unittest
try:
import matplotlib.pyplot as plt
except:
from ... | mit |
NeuroDataDesign/seelviz | graphfiles/LukeGraphs/3dhtml/viz_3d_plotly.py | 1 | 2646 | from plotly.graph_objs import *
def get_brain_figure(g, atlas_data, plot_title=''):
"""
Returns the plotly figure object for vizualizing a 3d brain network.
g: igraph object of brain
atlas_data: pandas DataFrame containing the x,y,z coordinates of
each brain region
Example
-------
... | apache-2.0 |
phobson/mpl-probscale | docs/sphinxext/ipython_directive.py | 3 | 38140 | # -*- coding: utf-8 -*-
"""
Sphinx directive to support embedded IPython code.
This directive allows pasting of entire interactive IPython sessions, prompts
and all, and their code will actually get re-executed at doc build time, with
all prompts renumbered sequentially. It also allows you to input code as a pure
pyth... | bsd-3-clause |
henrykironde/scikit-learn | sklearn/svm/tests/test_svm.py | 116 | 31653 | """
Testing for Support Vector Machine module (sklearn.svm)
TODO: remove hard coded numerical results when possible
"""
import numpy as np
import itertools
from numpy.testing import assert_array_equal, assert_array_almost_equal
from numpy.testing import assert_almost_equal
from scipy import sparse
from nose.tools im... | bsd-3-clause |
maheshakya/scikit-learn | examples/applications/face_recognition.py | 42 | 5390 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | bsd-3-clause |
liangz0707/scikit-learn | sklearn/datasets/tests/test_rcv1.py | 322 | 2414 | """Test the rcv1 loader.
Skipped if rcv1 is not already downloaded to data_home.
"""
import errno
import scipy.sparse as sp
import numpy as np
from sklearn.datasets import fetch_rcv1
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing i... | bsd-3-clause |
JsNoNo/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
vikingMei/mxnet | example/ssd/detect/detector.py | 30 | 7112 | # 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 u... | apache-2.0 |
alistairlow/tensorflow | tensorflow/python/estimator/inputs/queues/feeding_queue_runner_test.py | 116 | 5164 | # 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 |
idlead/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
asimshankar/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 1 | 12795 | # Copyright 2015 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 |
droundy/deft | papers/histogram/figs/animate-dos.py | 1 | 5310 | #!/usr/bin/python2
import matplotlib, sys
if 'show' not in sys.argv:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy, time, os, glob, colors, argparse
matplotlib.rc('text', usetex=True)
import readnew
parser = argparse.ArgumentParser(description='Animate the entropy')
parser.add_argument('sub... | gpl-2.0 |
rlong011/trading-with-python | lib/extra.py | 77 | 2540 | '''
Created on Apr 28, 2013
Copyright: Jev Kuznetsov
License: BSD
'''
from __future__ import print_function
import sys
import urllib
import os
import xlrd # module for excel file reading
import pandas as pd
class ProgressBar:
def __init__(self, iterations):
self.iterations = iterations
... | bsd-3-clause |
miskopo/Logik | benchmark/run_benchmark.py | 1 | 2167 | import pandas as pd
from controller.controller_unit import Controller
from click import progressbar
class Benchmark:
def __init__(self, arg_parser):
self.results = pd.DataFrame(columns=['Solver name', 'Wins', 'Attempts'])
self.args = arg_parser
def __call__(self, *args, **kwargs):
self... | gpl-3.0 |
rupakc/Kaggle-Compendium | Las Vegas Trip Advisor Review/trip_baseline.py | 1 | 2617 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble import ExtraTreesClass... | mit |
cmoutard/mne-python | mne/stats/tests/test_cluster_level.py | 3 | 20442 | import os
import numpy as np
from numpy.testing import (assert_equal, assert_array_equal,
assert_array_almost_equal)
from nose.tools import assert_true, assert_raises
from scipy import sparse, linalg, stats
from mne.fixes import partial
import warnings
from mne.parallel import _force_serial
f... | bsd-3-clause |
lcpt/xc | verif/tests/materials/prestressing/test_layout2D_frictLoss_prestress_tendon.py | 1 | 3559 | # -*- coding: utf-8 -*-
'''Home made test to check the accuracy of the 2D spline interpolation to
be used in the layout of prestressing tendons and to check the calculation
of prestress losss due to firction.
'''
__author__= "Ana Ortega (AO_O) "
__copyright__= "Copyright 2016, AO_O"
__license__= "GPL"
__version__= "3... | gpl-3.0 |
ChanderG/scikit-learn | examples/cluster/plot_dbscan.py | 346 | 2479 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... | bsd-3-clause |
droundy/deft | papers/thesis-vischer/figs/ideal-gas.py | 1 | 1563 | from __future__ import division
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']})
matplotlib.rc('text', usetex=True)
# Constants
R=3.034E-10 #m, sphere radius for water
M=2.989E-23 #kg, water mass
qe =... | gpl-2.0 |
devanshdalal/scikit-learn | sklearn/linear_model/sag.py | 18 | 11273 | """Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import numpy as np
import warnings
from ..exceptions import ConvergenceWarning
from ..utils import check_array
from ..utils.extmath import row_norms
from .base import ... | bsd-3-clause |
peterwilletts24/Python-Scripts | plot_scripts/EMBRACE/plot_geopotential_dkbhu.py | 1 | 12746 | """
Load mean geopotential heights and plot in colour
"""
import os, sys
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
from mpl_toolkits.basemap import Basemap
import iris
import iris.analysis.cartography
import numpy as np
import imp
import h5py
import cartopy.crs as ccrs
import scipy.interpolate
... | mit |
IreneShivaei/specline | linefit.py | 1 | 11995 | import numpy as np
from astropy.io import fits
from astropy.wcs import WCS
from astropy.table import Table, Column
from glob import glob
import time
import multiprocessing as mp
import argparse
from astropy.cosmology import FlatLambdaCDM
#you can also use pre-defined parameters, e.g.: from astropy.cosmology import WMAP... | mit |
Silmathoron/nest-simulator | pynest/nest/lib/hl_api_spatial.py | 1 | 45069 | # -*- coding: utf-8 -*-
#
# hl_api_spatial.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License,... | gpl-2.0 |
DmitryYurov/BornAgain | Examples/python/fitting/ex02_AdvancedExamples/find_background.py | 2 | 2990 | """
Fitting example: looking for background and scale factors.
Real data contains some "unknown" background and scale factor.
In the fit we are trying to find cylinder radius and height,
scale and background factors.
"""
import numpy as np
from matplotlib import pyplot as plt
import bornagain as ba
from bornagain imp... | gpl-3.0 |
kaichogami/scikit-learn | sklearn/tests/test_kernel_approximation.py | 78 | 7586 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
trungnt13/scikit-learn | sklearn/pipeline.py | 162 | 21103 | """
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# Licence: BSD
from collections import defaultdict... | bsd-3-clause |
qiudebo/13learn | code/matplotlib/test_properties_layout.py | 1 | 2420 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
import matplotlib.patches as patches
if __name__ == '__main__':
# build a rectangle in axes coords
left, width = .25, .5
bottom, height = .25, .5
right = left + width
top = bottom + height
fig = plt.figure()
... | mit |
dborzov/fredholm | fredholm/self-consistent.py | 1 | 1695 | from numpy import log, pi, arange, exp
from scipy.optimize import brentq
import matplotlib.pyplot as plot
from matplotlib import rc
import equation
def diagram_sum(x, d):
return 4.*pi/log(d**2 *2.*x)
def diagram_sum_3body(x, d):
point=equation.equation(3.*x,'2D',20.,0.1,d)
point.solve()
g3=point.g3
... | mit |
mikebenfield/scikit-learn | sklearn/gaussian_process/kernels.py | 31 | 67169 | """Kernels for Gaussian process regression and classification.
The kernels in this module allow kernel-engineering, i.e., they can be
combined via the "+" and "*" operators or be exponentiated with a scalar
via "**". These sum and product expressions can also contain scalar values,
which are automatically converted to... | bsd-3-clause |
ngoix/OCRF | sklearn/ensemble/EvOutSe.py | 1 | 3267 | """Aggarwal and Yu evolutionary's algorithm."""
import os
import inspect
import numpy as np
from math import log, floor, ceil
from subprocess import call
class EvOutSe(object):
"""Aggarwal and Yu evolutionary's algorithm."""
def __init__(self, m=None, phi=None, k=None, s=None):
"""Construtor.
... | bsd-3-clause |
alfcrisci/word_cloud | doc/sphinxext/gen_rst.py | 17 | 33207 | """
Example generation for the python wordcloud project. Stolen from scikit-learn with modifications from PyStruct.
Generate the rst files for the examples by iterating over the python
example files.
Hacked to plot every example (not only those that start with 'plot').
"""
from time import time
import os
import shuti... | mit |
shoyer/xray | setup.py | 1 | 4181 | #!/usr/bin/env python
import sys
import versioneer
from setuptools import find_packages, setup
DISTNAME = 'xarray'
LICENSE = 'Apache'
AUTHOR = 'xarray Developers'
AUTHOR_EMAIL = 'xarray@googlegroups.com'
URL = 'https://github.com/pydata/xarray'
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'License :: OSI... | apache-2.0 |
google-research/google-research | moew/mnist.py | 1 | 8720 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
McIntyre-Lab/papers | newman_events_2017/python_workflow/programs/create_event_summaries.py | 1 | 10533 | #!/usr/bin/env python3
#######################################################################################################################
#
# DATE: 2018-04-16
# NAME: create_event_summaries.py
# AUTHOR: Jeremy R. B. Newman (jrbnewman@ufl.edu)
#
# DESCRIPTION: This script creates summaries for each event in the giv... | lgpl-3.0 |
ocefpaf/iris | docs/iris/example_code/Meteorology/COP_maps.py | 2 | 6435 | """
Global average annual temperature maps
======================================
Produces maps of global temperature forecasts from the A1B and E1 scenarios.
The data used comes from the HadGEM2-AO model simulations for the A1B and E1
scenarios, both of which were derived using the IMAGE Integrated Assessment
Model ... | lgpl-3.0 |
jblupus/PyLoyaltyProject | loyalty/resumes.py | 1 | 1906 | import json
from threading import Thread
from utils import HOME
import numpy as np
import pandas as pd
SUMMARY_PATH = HOME + '/Dropbox/Twitter/Summary/'
BASE_PATH = HOME + '/Dropbox/Twitter/'
class Resume(Thread):
def __init__(self, inputfile, outputfile):
super(Resume, self).__init__()
self... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.