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 |
|---|---|---|---|---|---|
archman/phantasy | phantasy/tools/impact_model.py | 1 | 8243 | # encoding: UTF-8
"""
Implement phytool command 'impact-model'.
"""
from __future__ import print_function
import os
import sys
import logging
import traceback
import shutil
from argparse import ArgumentParser
import matplotlib.pyplot as plt
from phantasy.library.lattice.impact import OUTPUT_MODE_END
from phantasy... | bsd-3-clause |
codorkh/infratopo | topo_input_files/alps/alp_profile.py | 1 | 1997 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 8 14:36:32 2016
@author: dgreen
"""
# alp_profile.py
# PLotting the alpine profile, chosen to give a relatively 'up and over' profile
# from the coordinates 44.27N 10.60E
# Load in the data
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def r... | mit |
odyaka341/nmrglue | examples/plotting/2d_boxes/plot_assignments.py | 10 | 1327 | #! /usr/bin/env python
# Create contour plots of a spectrum with each peak in limits.in labeled
import nmrglue as ng
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm
# plot parameters
cmap = matplotlib.cm.Blues_r # contour map (colors to use for contours)
contour_start = 30000 # contou... | bsd-3-clause |
cbertinato/pandas | pandas/core/groupby/generic.py | 1 | 59632 | """
Define the SeriesGroupBy and DataFrameGroupBy
classes that hold the groupby interfaces (and some implementations).
These are user facing as the result of the ``df.groupby(...)`` operations,
which here returns a DataFrameGroupBy object.
"""
from collections import OrderedDict, abc, namedtuple
import copy
from func... | bsd-3-clause |
Yanakz/Caption | coco.py | 1 | 15261 | __author__ = 'tylin'
__version__ = '1.0.1'
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Ple... | mit |
IFDYS/IO_MPI | view_result.py | 1 | 6681 | #!/usr/bin/env python
from numpy import *
from matplotlib.pyplot import *
import matplotlib.pylab as pylab
import os
import time
import re
import obspy.signal
from scipy import signal
def read_slice(fname):
with open(fname) as fslice:
slice_nx,slice_ny,slice_nz = fslice.readline().split()
slice_x =... | gpl-2.0 |
xwolf12/scikit-learn | examples/linear_model/plot_iris_logistic.py | 283 | 1678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... | bsd-3-clause |
zorojean/scikit-learn | sklearn/covariance/graph_lasso_.py | 127 | 25626 | """GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import warnings
import operator
import sys
import time
import numpy as np
from scipy import linalg
from .empirical_covariance_ im... | bsd-3-clause |
erjerison/adaptability | github_submission/detect_qtls_make_table_2_5_2016.py | 1 | 13517 | import matplotlib.pylab as pt
import numpy
import matplotlib.cm as cm
import scipy.stats
from qtl_detection_one_trait import detect_qtls_one_envt
from qtl_detection_one_trait import detect_qtls_above_fitness
from qtl_detection_one_trait import detect_qtls_with_epistasis
from qtl_detection_one_trait import detect... | mit |
alexeyum/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 |
Kruehlio/XSspec | spectrum.py | 1 | 24396 | #!/usr/bin/env python
import os
import pyfits
import numpy as np
from matplotlib import rc
from matplotlib.patheffects import withStroke
from scipy import interpolate, constants
from analysis.functions import (blur_image, ccmred)
from utils.astro import (airtovac, vactoair, absll, emll, isnumber, getebv, binspec)
fr... | mit |
hdmetor/scikit-learn | sklearn/ensemble/tests/test_forest.py | 20 | 35216 | """
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import product
import numpy as np
from scipy.sparse import csr_... | bsd-3-clause |
sniemi/SamPy | sandbox/src1/pviewer/plot1d.py | 1 | 39992 | #!/usr/bin/env python
from Tkinter import *
import Pmw
import AppShell
import sys, os
import string
from plotAscii import xdisplayfile
from tkSimpleDialog import Dialog
from pylab import *
#from fit import *
import MLab
colors = ['b','g','r','c','m','y','k','w']
linestyles = ['-','--','-.',':','.-.','-,']
symbols =... | bsd-2-clause |
kimasx/smapp-toolkit | examples/plot_user_per_day_histogram.py | 2 | 3653 | """
Script makes users-per-day histogram going N days back.
Usage:
python plot_user_per_day_histograms.py -s smapp.politics.fas.nyu.edu -p 27011 -u smapp_readOnly -w SECRETPASSWORD -d USElection2016Hillary --days 10 --output-file hillary.png
@jonathanronen 2015/4
"""
import pytz
import argparse
import numpy as n... | gpl-2.0 |
weidel-p/nest-simulator | pynest/examples/spatial/grid_iaf_oc.py | 12 | 1781 | # -*- coding: utf-8 -*-
#
# grid_iaf_oc.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, or... | gpl-2.0 |
IshankGulati/scikit-learn | benchmarks/bench_plot_neighbors.py | 101 | 6469 | """
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker
from sklearn import neighbors, datasets
def get_data(N, D, dataset='dense'):
if dataset == 'dense':
np.random.seed(0)
... | bsd-3-clause |
herilalaina/scikit-learn | benchmarks/bench_lasso.py | 111 | 3364 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
jayflo/scikit-learn | sklearn/feature_selection/tests/test_rfe.py | 209 | 11733 | """
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris,... | bsd-3-clause |
dharmasam9/moose-core | python/rdesigneur/rmoogli.py | 1 | 6252 | # -*- coding: utf-8 -*-
#########################################################################
## rdesigneur0_4.py ---
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2014 Upinder S. Bhalla. and NCBS
## It is made available under the terms of th... | gpl-3.0 |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/series/indexing/test_loc.py | 2 | 4378 | import numpy as np
import pytest
import pandas as pd
from pandas import Series, Timestamp
from pandas.util.testing import assert_series_equal
@pytest.mark.parametrize("val,expected", [(2 ** 63 - 1, 3), (2 ** 63, 4)])
def test_loc_uint64(val, expected):
# see gh-19399
s = Series({2 ** 63 - 1: 3, 2 ** 63: 4})
... | apache-2.0 |
juliusbierk/scikit-image | doc/ext/plot2rst.py | 13 | 20439 | """
Example generation from python files.
Generate the rst files for the examples by iterating over the python
example files. Files that generate images should start with 'plot'.
To generate your own examples, add this extension to the list of
``extensions``in your Sphinx configuration file. In addition, make sure th... | bsd-3-clause |
tosolveit/scikit-learn | examples/linear_model/plot_logistic_path.py | 349 | 1195 | #!/usr/bin/env python
"""
=================================
Path with L1- Logistic Regression
=================================
Computes path on IRIS dataset.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from datetime import datetime
import numpy as np
import... | bsd-3-clause |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py | 30 | 4727 | # 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... | gpl-3.0 |
sumspr/scikit-learn | examples/plot_kernel_ridge_regression.py | 230 | 6222 | """
=============================================
Comparison of kernel ridge regression and SVR
=============================================
Both kernel ridge regression (KRR) and SVR learn a non-linear function by
employing the kernel trick, i.e., they learn a linear function in the space
induced by the respective k... | bsd-3-clause |
dursobr/Pythics | pythics/start.py | 1 | 27005 | # -*- coding: utf-8 -*-
#
# Copyright 2008 - 2019 Brian R. D'Urso
#
# This file is part of Python Instrument Control System, also known as Pythics.
#
# Pythics 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, e... | gpl-3.0 |
billy-inn/scikit-learn | sklearn/linear_model/ransac.py | 191 | 14261 | # coding: utf-8
# Author: Johannes Schönberger
#
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone
from ..utils import check_random_state, check_array, check_consistent_length
from ..utils.random import sample_without_replacement
from ..utils.valid... | bsd-3-clause |
cjermain/numpy | numpy/doc/creation.py | 118 | 5507 | """
==============
Array Creation
==============
Introduction
============
There are 5 general mechanisms for creating arrays:
1) Conversion from other Python structures (e.g., lists, tuples)
2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros,
etc.)
3) Reading arrays from disk, either from... | bsd-3-clause |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/pandas/tests/test_panel.py | 7 | 93726 | # -*- coding: utf-8 -*-
# pylint: disable=W0612,E1101
from datetime import datetime
import operator
import nose
import numpy as np
import pandas as pd
from pandas.types.common import is_float_dtype
from pandas import (Series, DataFrame, Index, date_range, isnull, notnull,
pivot, MultiIndex)
from... | apache-2.0 |
rajul/mne-python | examples/decoding/plot_linear_model_patterns.py | 13 | 3098 | """
===============================================================
Linear classifier on sensor data with plot patterns and filters
===============================================================
Decoding, a.k.a MVPA or supervised machine learning applied to MEG and EEG
data in sensor space. Fit a linear classifier wi... | bsd-3-clause |
nagyistoce/kaggle-galaxies | try_convnet_cc_multirotflip_3x69r45_shareddense.py | 7 | 17280 | import numpy as np
# import pandas as pd
import theano
import theano.tensor as T
import layers
import cc_layers
import custom
import load_data
import realtime_augmentation as ra
import time
import csv
import os
import cPickle as pickle
from datetime import datetime, timedelta
# import matplotlib.pyplot as plt
# plt.i... | bsd-3-clause |
cpcloud/arrow | python/pyarrow/serialization.py | 2 | 7287 | # 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 |
enakai00/ml4se | scripts/02-square_error.py | 1 | 3206 | # -*- coding: utf-8 -*-
#
# 誤差関数(最小二乗法)による回帰分析
#
# 2015/04/22 ver1.0
#
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
from numpy.random import normal
#------------#
# Parameters #
#------------#
N=10 # サンプルを取得する位置 x の個数
M=[0,1,3,9] # 多項式の次数
... | gpl-2.0 |
mattilyra/scikit-learn | examples/decomposition/plot_incremental_pca.py | 175 | 1974 | """
===============
Incremental PCA
===============
Incremental principal component analysis (IPCA) is typically used as a
replacement for principal component analysis (PCA) when the dataset to be
decomposed is too large to fit in memory. IPCA builds a low-rank approximation
for the input data using an amount of memo... | bsd-3-clause |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/mne/viz/utils.py | 6 | 30185 | """Utility functions for plotting M/EEG data
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# ... | bsd-3-clause |
Kebniss/TalkingData-Mobile-User-Demographics | src/features/make_training_set.py | 1 | 1578 | import os
import numpy as np
import pandas as pd
from os import path
from scipy import sparse, io
from scipy.sparse import csr_matrix, hstack
from dotenv import load_dotenv, find_dotenv
dotenv_path = find_dotenv()
load_dotenv(dotenv_path)
FEATURES_DATA_DIR = os.environ.get("FEATURES_DIR")
# MAKE SPARSE FEATURES ----... | mit |
cbertinato/pandas | pandas/tests/series/test_combine_concat.py | 1 | 15498 | from datetime import datetime
import numpy as np
from numpy import nan
import pytest
import pandas as pd
from pandas import DataFrame, DatetimeIndex, Series, date_range
import pandas.util.testing as tm
from pandas.util.testing import assert_frame_equal, assert_series_equal
class TestSeriesCombine:
def test_app... | bsd-3-clause |
sertansenturk/tomato | src/tomato/joint/alignedpitchfilter.py | 1 | 10166 | # Copyright 2015 - 2018 Sertan Şentürk
#
# This file is part of tomato: https://github.com/sertansenturk/tomato/
#
# tomato is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), either version 3 of the ... | agpl-3.0 |
DJArmstrong/autovet | Features/old/Centroiding/scripts/old/detrend_centroid_external.py | 2 | 12683 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 25 14:57:36 2016
@author:
Maximilian N. Guenther
Battcock Centre for Experimental Astrophysics,
Cavendish Laboratory,
JJ Thomson Avenue
Cambridge CB3 0HE
Email: mg719@cam.ac.uk
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
from astropy.s... | gpl-3.0 |
nguyentu1602/statsmodels | statsmodels/sandbox/distributions/examples/ex_mvelliptical.py | 34 | 5169 | # -*- coding: utf-8 -*-
"""examples for multivariate normal and t distributions
Created on Fri Jun 03 16:00:26 2011
@author: josef
for comparison I used R mvtnorm version 0.9-96
"""
from __future__ import print_function
import numpy as np
import statsmodels.sandbox.distributions.mv_normal as mvd
from numpy.testi... | bsd-3-clause |
bnaul/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 11 | 25871 | """
Todo: cross-check the F-value with stats model
"""
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
import pytest
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_array_almost_e... | bsd-3-clause |
liberatorqjw/scikit-learn | sklearn/tests/test_isotonic.py | 12 | 7545 | 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
from sklearn.utils.testing import assert_warns_message, assert_no_warnings
d... | bsd-3-clause |
EPFL-LCSB/pytfa | pytfa/redgem/debugging.py | 1 | 1995 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: redgem
:platform: Unix, Windows
:synopsis: RedGEM Algorithm
.. moduleauthor:: pyTFA team
Debugging
"""
from cobra import Reaction
from pandas import Series
def make_sink(met, ub=100, lb=0):
rid = 'sink_' + met.id
try:
# if the sin... | apache-2.0 |
sgenoud/scikit-learn | sklearn/decomposition/nmf.py | 5 | 16879 | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# Author: Anthony Di Franco (original Python and NumPy port)
# License: BSD
from __future__ import di... | bsd-3-clause |
asoliveira/NumShip | scripts/plot/brl-ace-r-cg-plt.py | 1 | 2098 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#É adimensional?
adi = False
#É para salvar as figuras(True|False)?
save = True
#Caso seja para salvar, qual é o formato desejado?
formato = 'jpg'
#Caso seja para salvar, qual é o diretório que devo salvar?
dircg = 'fig-sen'
#Caso seja para salvar, qual é o nome do arquivo... | gpl-3.0 |
GuessWhoSamFoo/pandas | pandas/tests/scalar/period/test_period.py | 1 | 52625 | from datetime import date, datetime, timedelta
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import iNaT, period as libperiod
from pandas._libs.tslibs.ccalendar import DAYS, MONTHS
from pandas._libs.tslibs.frequencies import INVALID_FREQ_ERR_MSG
from pandas._libs.tslibs.parsing import DatePars... | bsd-3-clause |
phobson/bokeh | examples/models/anscombe.py | 1 | 2996 | from __future__ import print_function
import numpy as np
import pandas as pd
from bokeh.util.browser import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.layouts import gridplot
from bokeh.models.glyphs import Circle, Line
from bokeh.models import ColumnDataSource, Grid, Linear... | bsd-3-clause |
tum-pbs/PhiFlow | phi/vis/_widgets/_widgets_gui.py | 1 | 13128 | import asyncio
import sys
import time
import traceback
import warnings
from contextlib import contextmanager
from math import log10
import ipywidgets as widgets
from IPython import get_ipython
from IPython.display import display
from ipywidgets import HBox, VBox
from ipywidgets.widgets.interaction import show_inline_m... | mit |
pratapvardhan/scikit-learn | sklearn/datasets/lfw.py | 31 | 19544 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/computation/tests/test_eval.py | 1 | 70198 | #!/usr/bin/env python
# flake8: noqa
import warnings
import operator
from itertools import product
from distutils.version import LooseVersion
import nose
from nose.tools import assert_raises
from numpy.random import randn, rand, randint
import numpy as np
from numpy.testing import assert_allclose
from numpy.testing... | mit |
liuwenf/moose | python/mooseutils/VectorPostprocessorReader.py | 8 | 7773 | import os
import glob
import pandas
import bisect
from MooseDataFrame import MooseDataFrame
import message
class VectorPostprocessorReader(object):
"""
A Reader for MOOSE VectorPostprocessor data.
Args:
pattern[str]: A pattern of files (for use with glob) for loading.
MOOSE outputs VectorPost... | lgpl-2.1 |
ebachelet/pyLIMA | pyLIMA/microlsimulator.py | 1 | 13901 | import numpy as np
import astropy
from astropy.coordinates import SkyCoord, EarthLocation, AltAz, get_sun, get_moon
from astropy.time import Time
import matplotlib.pyplot as plt
from pyLIMA import microlmodels
from pyLIMA import microltoolbox
from pyLIMA import telescopes
from pyLIMA import event
from pyLIMA import m... | gpl-3.0 |
LabMagUBO/StoneX | concepts/energy_landscape/energy_landscape.py | 1 | 7356 | #!/opt/local/bin/ipython-3.4
# -*- coding: utf-8 -*-
import sys
import numpy as np
import numpy.ma as ma
import scipy.ndimage as nd
from scipy import optimize
from matplotlib import pyplot as pl
# Fonction
def new_plot():
fig = pl.figure()
return fig, fig.add_subplot(111, aspect='equal')
def draw(Z, axe):
... | gpl-3.0 |
CodeMonkeyJan/hyperspy | hyperspy/_signals/signal1d.py | 1 | 56343 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
rmetzger/flink | flink-python/pyflink/table/table_environment.py | 2 | 89253 | ################################################################################
# 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... | apache-2.0 |
kernc/scikit-learn | examples/model_selection/randomized_search.py | 44 | 3253 | """
=========================================================================
Comparing randomized search and grid search for hyperparameter estimation
=========================================================================
Compare randomized search and grid search for optimizing hyperparameters of a
random forest.
... | bsd-3-clause |
zbanga/trading-with-python | lib/interactivebrokers.py | 77 | 18140 | """
Copyright: Jev Kuznetsov
Licence: BSD
Interface to interactive brokers together with gui widgets
"""
import sys
# import os
from time import sleep
from PyQt4.QtCore import (SIGNAL, SLOT)
from PyQt4.QtGui import (QApplication, QFileDialog, QDialog, QVBoxLayout, QHBoxLayout, QDialogButtonBox,
... | bsd-3-clause |
architecture-building-systems/CityEnergyAnalyst | cea/plots/demand/energy_balance.py | 2 | 12475 |
import plotly.graph_objs as go
from plotly.offline import plot
from cea.plots.variable_naming import LOGO, COLOR, NAMING
import cea.plots.demand
import pandas as pd
import numpy as np
__author__ = "Gabriel Happle"
__copyright__ = "Copyright 2018, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Gab... | mit |
alphacsc/alphacsc | examples/csc/plot_simulate_csc.py | 1 | 3484 | """
=============================
Vanilla CSC on simulated data
=============================
This example demonstrates `vanilla` CSC on simulated data.
Note that `vanilla` CSC is just a special case of alphaCSC with alpha=2.
"""
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Tom Dupre La Tour <to... | bsd-3-clause |
plaidml/plaidml | networks/keras/examples/reuters_mlp_relu_vs_selu.py | 1 | 5648 | '''Compares self-normalizing MLPs with regular MLPs.
Compares the performance of a simple MLP using two
different activation functions: RELU and SELU
on the Reuters newswire topic classification task.
# Reference:
Klambauer, G., Unterthiner, T., Mayr, A., & Hochreiter, S. (2017).
Self-Normalizing Neural Networks.... | apache-2.0 |
ChanderG/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 261 | 4490 | import unittest
import sys
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less, assert_equal
from sklearn.mixture.tests.test_gmm import GMMTester
from sklearn.externals.s... | bsd-3-clause |
OshynSong/scikit-learn | examples/neighbors/plot_classification.py | 287 | 1790 | """
================================
Nearest Neighbors Classification
================================
Sample usage of Nearest Neighbors classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColorm... | bsd-3-clause |
GbalsaC/bitnamiP | venv/share/doc/networkx-1.7/examples/graph/atlas.py | 20 | 2637 | #!/usr/bin/env python
"""
Atlas of all graphs of 6 nodes or less.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2004 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx... | agpl-3.0 |
rhiever/tpot | tests/one_hot_encoder_tests.py | 2 | 12412 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2014, Matthias Feurer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this li... | lgpl-3.0 |
madjelan/scikit-learn | examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py | 218 | 3893 | """
==============================================
Feature agglomeration vs. univariate selection
==============================================
This example compares 2 dimensionality reduction strategies:
- univariate feature selection with Anova
- feature agglomeration with Ward hierarchical clustering
Both metho... | bsd-3-clause |
nest/nest-simulator | pynest/examples/glif_cond_neuron.py | 14 | 9655 | # -*- coding: utf-8 -*-
#
# glif_cond_neuron.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 Licens... | gpl-2.0 |
cauchycui/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
dsquareindia/scikit-learn | sklearn/pipeline.py | 13 | 30670 | """
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
# License: BSD
from collections import defaultdict... | bsd-3-clause |
TakayukiSakai/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 5 | 8987 | # 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 |
pavel-paulau/perfreports | perfreports/plotter.py | 1 | 1221 | import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams.update({'font.size': 5})
matplotlib.rcParams.update({'lines.linewidth': 0.5})
matplotlib.rcParams.update({'lines.marker': '.'})
matplotlib.rcParams.update({'lines.markersize': 3})
matplotlib.rcParams.update({'lines.linestyle': 'None'})
matplotlib.rcParams.upda... | apache-2.0 |
dopplershift/MetPy | src/metpy/io/gini.py | 1 | 17130 | # Copyright (c) 2015,2016,2017,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools to process GINI-formatted products."""
import contextlib
from datetime import datetime
from enum import Enum
from io import BytesIO
from itertools import rep... | bsd-3-clause |
louispotok/pandas | pandas/tests/indexes/timedeltas/test_timedelta_range.py | 3 | 3021 | import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas.tseries.offsets import Day, Second
from pandas import to_timedelta, timedelta_range
class TestTimedeltas(object):
def test_timedelta_range(self):
expected = to_timedelta(np.arange(5), unit='D')
resu... | bsd-3-clause |
shangwuhencc/scikit-learn | examples/ensemble/plot_gradient_boosting_regression.py | 227 | 2520 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the Boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... | bsd-3-clause |
google-research/google-research | automl_zero/generate_datasets.py | 1 | 11970 | # 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 |
ProkopHapala/SimpleSimulationEngine | python/pyMolecular/plotUtils.py | 1 | 1362 |
import numpy as np
import matplotlib.pyplot as plt
from elements import ELEMENTS
from matplotlib import collections as mc
def plotAtoms( es, xs, ys, scale=0.9, edge=True, ec='k', color='w' ):
'''
sizes = [ ELEMENTS[ int(ei) ][7]*scale for ei in es ]
colors = [ '#%02x%02x%02x' %(ELEMENTS[ int(ei) ][8])... | mit |
annayqho/TheCannon | presentations/madrid_meeting/madrid_talk.py | 1 | 1579 | import numpy as np
import pyfits
import matplotlib.pyplot as plt
from matplotlib import rc
rc('text', usetex=True)
rc('font', family='serif')
apstar_file = 'apStar-r5-2M07101078+2931576.fits'
file_in = pyfits.open(apstar_file)
flux = file_in[1].data[0,:]
err = file_in[2].data[0,:]
bad = err > 4.5
flux_masked = flux[... | mit |
Winand/pandas | pandas/core/computation/ops.py | 15 | 15900 | """Operator classes for eval.
"""
import operator as op
from functools import partial
from datetime import datetime
import numpy as np
from pandas.core.dtypes.common import is_list_like, is_scalar
import pandas as pd
from pandas.compat import PY3, string_types, text_type
import pandas.core.common as com
from pandas.... | bsd-3-clause |
sho-87/python-machine-learning | ANN/xor.py | 1 | 2575 | # XOR gate. ANN with 1 hidden layer
import numpy as np
import theano
import theano.tensor as T
import matplotlib.pyplot as plt
# Set inputs and correct output values
inputs = [[0,0], [1,1], [0,1], [1,0]]
outputs = [0, 0, 1, 1]
# Set training parameters
alpha = 0.1 # Learning rate
training_iterations = 50000
hidden_... | mit |
ViDA-NYU/data-polygamy | sigmod16/performance-evaluation/nyc-urban/pruning/pruning.py | 1 | 5741 | # Copyright (C) 2016 New York University
# This file is part of Data Polygamy which is released under the Revised BSD License
# See file LICENSE for full license details.
import os
import sys
import math
import matplotlib
matplotlib.use('Agg')
matplotlib.rc('font', family='sans-serif')
import matplotlib.pyplot as plt
... | bsd-3-clause |
LeeYiFang/Carkinos | src/cv.py | 1 | 2729 | from pathlib import Path
import pandas as pd
import numpy as np
import django
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'Carkinos.settings.local'
django.setup()
from probes.models import Dataset,Platform,Sample,CellLine,ProbeID
root=Path('../').resolve()
u133a_path=root.joinpath('src','raw','Affy_U133A_probe_i... | mit |
ryklith/pyltesim | plotting/JSACplot.py | 1 | 2333 | #!/usr/bin/env python
''' Recreates the central JSAC plot: Data rate per user vs supply power consumption.
File: JSACplot.py
'''
__author__ = "Hauke Holtkamp"
__credits__ = "Hauke Holtkamp"
__license__ = "unknown"
__version__ = "unknown"
__maintainer__ = "Hauke Holtkamp"
__email__ = "h.holtkamp@gmail.com"
__status... | gpl-2.0 |
pgm/StarCluster | utils/scimage_12_04.py | 20 | 17216 | #!/usr/bin/env python
"""
This script is meant to be run inside of a ubuntu cloud image available at
uec-images.ubuntu.com::
$ EC2_UBUNTU_IMG_URL=http://uec-images.ubuntu.com/precise/current
$ wget $EC2_UBUNTU_IMG_URL/precise-server-cloudimg-amd64.tar.gz
or::
$ wget $EC2_UBUNTU_IMG_URL/precise-server-clo... | gpl-3.0 |
jendap/tensorflow | tensorflow/contrib/learn/python/learn/estimators/kmeans.py | 27 | 11083 | # 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 |
georgetown-analytics/housing-risk | code/prediction/run_dc_models.py | 1 | 2169 |
import run_models
import pickle
import pandas
def get_dc_decisions_table():
database_connection = run_models.data_utilities.database_management.get_database_connection('database')
query_path = "select_dc_buildings.sql"
file = open(query_path, 'r')
query_text = file.read()
file.close()
query... | mit |
NeuroDataDesign/seelviz | Tony/scripts/atlasregiongraphWithLabels.py | 2 | 3220 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from __future__ import print_function
__author__ = 'seelviz'
from plotly.offline import download_plotlyjs
from plotly.graph_objs import *
from plotly import tools
import plotly
import os
#os.chdir('C:/Users/L/Documents/Homework/BME/Neuro Data I/Data/')
import csv,gc # ga... | apache-2.0 |
krischer/LASIF | lasif/window_selection.py | 1 | 36635 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Window selection algorithm.
This module aims to provide a window selection algorithm suitable for
calculating phase misfits between two seismic waveforms.
The main function is the select_windows() function. The selection process is a
multi-stage process. Initially all... | gpl-3.0 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/pandas/io/tests/json/test_ujson.py | 7 | 56342 | # -*- coding: utf-8 -*-
from unittest import TestCase
try:
import json
except ImportError:
import simplejson as json
import math
import nose
import platform
import sys
import time
import datetime
import calendar
import re
import decimal
from functools import partial
from pandas.compat import range, zip, Strin... | apache-2.0 |
deepfield/ibis | ibis/tests/all/test_temporal.py | 1 | 10827 | import sys
import pytest
import warnings
from pytest import param
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import ibis
import ibis.expr.datatypes as dt
import ibis.tests.util as tu
from ibis.tests.backends import MapD
from ibis.pandas.execution.temporal import day_name
@pytest.mark... | apache-2.0 |
sonnyhu/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 20 | 3180 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
psychopy/versions | psychopy/app/themes/_themes.py | 1 | 42072 | import os
import subprocess
import sys
import wx
import wx.lib.agw.aui as aui
import wx.stc as stc
from psychopy.localization import _translate
from wx import py
import keyword
import builtins
from pathlib import Path
from psychopy import prefs
from psychopy import logging
import psychopy
from ...experiment import com... | gpl-3.0 |
bert9bert/statsmodels | statsmodels/tsa/arima_process.py | 4 | 30886 | '''ARMA process and estimation with scipy.signal.lfilter
2009-09-06: copied from try_signal.py
reparameterized same as signal.lfilter (positive coefficients)
Notes
-----
* pretty fast
* checked with Monte Carlo and cross comparison with statsmodels yule_walker
for AR numbers are close but not identical to yule... | bsd-3-clause |
pklaus/Arduino-Logger | ADC_Simulation.py | 1 | 1447 | #!/usr/bin/env python
### Script for Python
### Helps to size the serial reference resistors when using
### an NTC to measure temperatures with an ADC.
from __future__ import division
from matplotlib import pyplot as plt
import numpy as np
from munch import Munch
import pdb; pdb.set_trace()
# Properties of the NTC... | gpl-3.0 |
BrandoJS/Paparazzi_vtol | sw/airborne/test/ahrs/ahrs_utils.py | 4 | 5157 | #! /usr/bin/env python
# $Id$
# Copyright (C) 2011 Antoine Drouin
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# an... | gpl-2.0 |
pranjan77/pyms | Display/Class.py | 7 | 10046 | """
Class to Display Ion Chromatograms and TIC
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005-2012 Vladi... | gpl-2.0 |
JoshuaMichaelKing/MyLearning | learn-python2.7/keras/neural_network_demo.py | 1 | 2698 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import pandas as pd
from keras.models import Sequential
from keras.layers.core import Dense, Activation
__version__ = '0.0.1'
__license__ = 'MIT... | mit |
felixekn/Team04_MicrobeControllers | Documentation/Calibration/calibration_plot.py | 1 | 2687 | from scipy import stats as st
from matplotlib import pyplot as pp
import matplotlib.patches as mpatches
import matplotlib as mpl
from matplotlib.ticker import Locator
import numpy as np
import operator
import csv
import collections
import math
import copy
# Figure - Rapid Optical Density Calibration Plot
# RODD = [... | mit |
sameersingh/ml-discussions | week5/mltools/datagen.py | 2 | 4366 | import numpy as np
from numpy import loadtxt as loadtxt
from numpy import asarray as arr
from numpy import asmatrix as mat
from numpy import atleast_2d as twod
from scipy.linalg import sqrtm
################################################################################
## Methods for creating / sampling synthetic... | apache-2.0 |
manashmndl/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 249 | 1563 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
shangwuhencc/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
DSLituiev/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 37 | 12559 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
ianatpn/nupictest | external/linux32/lib/python2.6/site-packages/matplotlib/fontconfig_pattern.py | 72 | 6429 | """
A module for parsing and generating fontconfig patterns.
See the `fontconfig pattern specification
<http://www.fontconfig.org/fontconfig-user.html>`_ for more
information.
"""
# Author : Michael Droettboom <mdroe@stsci.edu>
# License : matplotlib license (PSF compatible)
# This class is defined here because it m... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.