repo_name stringlengths 7 90 | path stringlengths 5 191 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 976 581k | license stringclasses 15
values |
|---|---|---|---|---|---|
ghorn/rawesome | studies/pendulum_collocation.py | 2 | 5071 | # Copyright 2012-2013 Greg Horn
#
# This file is part of rawesome.
#
# rawesome is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | lgpl-3.0 |
mne-tools/mne-python | mne/io/fiff/tests/test_raw_fiff.py | 4 | 72663 | # -*- coding: utf-8 -*-
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
from copy import deepcopy
from functools import partial
from io import BytesIO
import os
import os.path as op
import pathlib
import pickle
import shutil
imp... | bsd-3-clause |
taspinar/twitterscraper | examples/get_twitter_user_data.py | 1 | 1970 | from twitterscraper.query import query_user_info
import pandas as pd
from multiprocessing import Pool
import time
from IPython.display import display
global twitter_user_info
twitter_user_info=[]
def get_user_info(twitter_user):
"""
An example of using the query_user_info method
:param twitter_user: the... | mit |
bendudson/BOUT | tools/tokamak_grids/pyGridGen/geqdsk.py | 4 | 7335 | #!/usr/bin/env python
import re
import numpy
"""
@brief G-Eqdsk reader class
@version $Id$
Copyright © 2006-2008, Tech-X Corporation, Boulder, CO
See LICENSE file for conditions of use.
The official document describing g-eqdsk files:
http://fusion.gat.com/conferences/snowmass/working/mfe/physics/p3/equilibria/... | gpl-3.0 |
chapmanb/bcbio-nextgen | bcbio/qc/multiqc.py | 1 | 26725 | """High level summaries of samples and programs with MultiQC.
https://github.com/ewels/MultiQC
"""
import collections
import glob
import io
import json
import mimetypes
import os
import pandas as pd
import shutil
import numpy as np
from collections import OrderedDict
import pybedtools
import six
import toolz as tz
im... | mit |
GoogleCloudPlatform/ai-platform-samples | training/pytorch/structured/custom_containers/base/trainer/inputs.py | 1 | 5007 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the \"License\");
# you may not use this file except in compliance with the License.\n",
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
dhruve/spark | python/pyspark/sql/context.py | 11 | 23848 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
astocko/agpy | agpy/__init__.py | 5 | 1642 | """
====
agpy
====
The functions included below are the 'mature' codes from the agpy package.
.. moduleauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com>
"""
##from luminosity import luminosity
#import readcol as readcol_mod
from readcol import readcol
##from UCHIIfitter import HIIregion
import gaussfitter
from gaus... | mit |
reedessick/populations | plot.py | 1 | 23650 | #!/usr/bin/python
usage = """plots.py [--options] data.pkl"""
description = """ulot/analyze the results from main.py """
author = "R. Essick"
import os
import pickle
import numpy as np
import analytics
import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot as plt
from optparse import OptionParser
#=... | gpl-2.0 |
erramuzpe/C-PAC | CPAC/utils/create_fsl_model.py | 3 | 62821 | import os
import sys
import numpy as np
import csv
import yaml
def create_pheno_dict(gpa_fsl_yml):
def read_phenotypic(pheno_file, ev_selections, subject_id_label):
import csv
import numpy as np
ph = pheno_file
# Read in the phenotypic CSV file into a dictionary named pheno_dic... | bsd-3-clause |
tdsmith/labmisc | parse_eve.py | 1 | 1782 | #!/usr/bin/env python3
import sys
import numpy as np
import openpyxl as xl
import pandas as pd
ROW_DATA_STARTS = 41
ROW_ANALYTE_NAME = 39
def main(filename):
workbook = xl.load_workbook(filename)
ws = workbook.active
invisible_rows = [key for key in
sorted(ws.row_dimensions.keys()) if
... | mit |
nanophotonics/nplab | nplab/modelling/mie.py | 1 | 14557 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from builtins import range
import numpy as np
import requests
import matplotlib.pyplot as plt
from scipy.special import riccati_jn,riccati_yn
from nplab.utils.refractive_index_db import RefractiveIndexInfoDatabase
from mpl_to... | gpl-3.0 |
mortcanty/SARDocker | src/enlml.py | 1 | 8467 | #!/usr/bin/env python
#******************************************************************************
# Name: enlml.py
# Purpose:
# Estimation of ENL for polSAR covariance images
# using ML method with full covariance matrix (quad, dual or single)
# Anfinsen et al. (2009) IEEE TGARS 47(11), 3795-3809
# ... | mit |
themrmax/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 5 | 12516 | # 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 |
mwest1066/PrairieLearn | exampleCourse/questions/demoRandomPlot/server.py | 5 | 1490 | import matplotlib.pyplot as plt
import io
import random
import numpy
def file(data):
if data['filename']=='figure.png':
# Create the figure
x = numpy.linspace(-5,5)
f = data['params']['m']*x+data['params']['b']
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
plt.plot... | agpl-3.0 |
mtasende/Machine-Learning-Nanodegree-Capstone | recommender/agent_predictor.py | 1 | 9382 | import numpy as np
import random
import pandas as pd
import predictor.feature_extraction as fe
import utils.preprocessing as pp
BASE_DAYS = 112
class AgentPredictor(object):
""" Reinforcement learner. Will use Q learning, dyna Q, and some custom additions.
(Initially based on the template for the Machine Lea... | mit |
EmreAtes/spack | var/spack/repos/builtin/packages/pandaseq/package.py | 3 | 2109 | ##############################################################################
# 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 |
rjw57/openni-skeleton-export | examples/normalshade.py | 1 | 3466 | #!/usr/bin/env python
#
# An example script for shading user depth silhouettes with some simple "fake"
# shading.
"""
Usage:
normalshade.py (-h | --help)
normalshade.py [--verbose] <logfile> <frame-prefix>
Options:
-h, --help Show a brief usage summary.
-v, --verbose Increase verbosity of output... | apache-2.0 |
pablocarderam/genetargeter | gRNAScores/Rule_Set_2_scoring_v1/analysis/models/baselines.py | 1 | 3429 | from __future__ import print_function
from builtins import range
import numpy as np
import sklearn
from sklearn.svm import LinearSVC
from sklearn.linear_model import LogisticRegression
import sklearn.linear_model
def mean_on_fold(feature_sets, train, test, y, y_all, inputs, dim, dimsum, learn_options):
re... | mit |
sealhuang/brainCodingToolbox | braincode/vim2/rfencoding.py | 3 | 27156 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import numpy as np
import tables
from scipy import ndimage
from scipy.misc import imsave
import scipy.optimize as opt
from sklearn.cross_decomposition import PLSCanonical
from sklearn.linear_mode... | bsd-3-clause |
namccart/gnuradio | gr-digital/examples/example_timing.py | 49 | 9180 | #!/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 optio... | gpl-3.0 |
PredictiveScienceLab/cluster-opt-bgo | pydes/_core.py | 2 | 10321 | """
Global Optimization of Expensive Functions.
Author:
Ilias Bilionis
Date:
10/15/2014
01/29/2015
"""
__all__ = ['expected_improvement',
'fb_expected_improvement',
'expected_information_gain',
'minimize', 'maximize',
'plot_summary', 'plot_summary_2d']
impo... | mit |
saquiba2/numpy2 | numpy/core/code_generators/ufunc_docstrings.py | 14 | 90528 | """
Docstrings for generated ufuncs
The syntax is designed to look like the function add_newdoc is being
called from numpy.lib, but in this file add_newdoc puts the docstrings
in a dictionary. This dictionary is used in
numpy/core/code_generators/generate_umath.py to generate the docstrings
for the ufuncs in numpy.co... | bsd-3-clause |
kastman/lyman | lyman/visualizations.py | 1 | 27609 | from __future__ import division
from six import string_types
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy import ndimage, signal
import nibabel as nib
class Mosaic(object):
def __init__(self, anat, stat=None, mask=None, n_col=9, step=2,
... | bsd-3-clause |
kmather73/zipline | zipline/examples/pairtrade.py | 16 | 5197 | #!/usr/bin/env python
#
# Copyright 2013 Quantopian, 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 ... | apache-2.0 |
jmd-dk/concept | concept/tests/multigrid/analyze.py | 1 | 7114 | # This file has to be run in pure Python mode!
# Imports from the CO𝘕CEPT code
from commons import *
plt = get_matplotlib().pyplot
# Absolute path and name of the directory of this file
this_dir = os.path.dirname(os.path.realpath(__file__))
this_test = os.path.basename(this_dir)
masterprint(f'Analysing {this_test} ... | gpl-3.0 |
pb-pravin/data-science-from-scratch | code/linear_algebra.py | 49 | 3637 | # -*- coding: iso-8859-15 -*-
from __future__ import division # want 3 / 2 == 1.5
import re, math, random # regexes, math functions, random numbers
import matplotlib.pyplot as plt # pyplot
from collections import defaultdict, Counter
from functools import partial
#
# functions for working with vectors
#
def vector_... | unlicense |
zhuolinho/linphone | submodules/mswebrtc/webrtc/tools/cpu/cpu_mon.py | 6 | 2057 | #!/usr/bin/env python
#
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All... | gpl-2.0 |
theodoregoetz/colormap | cmap-generator.py | 1 | 19669 | import matplotlib as mpl
mpl.use('wxAgg')
import numpy as np
import warnings
import wx
from copy import copy
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.figure import Figure, SubplotParams
from numpy import random as r... | gpl-3.0 |
rbalda/neural_ocr | env/lib/python2.7/site-packages/mpl_toolkits/mplot3d/art3d.py | 7 | 25559 | #!/usr/bin/python
# art3d.py, original mplot3d version by John Porter
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
# Minor additions by Ben Axelrod <baxelrod@coroware.com>
'''
Module containing 3D artist code and functions to convert 2D
artists into 3D versions which can be added to an Axes3D.
'''
from __fu... | mit |
jwkanggist/EveryBodyTensorFlow | lab11_runTFcheckDropOut_spiraldata.py | 1 | 14842 | #-*- coding: utf-8 -*-
#! /usr/bin/env python
'''
#------------------------------------------------------------
filename: lab11_runTFcheckDropOut_spiraldata.py
This script wants to see how the Dropout technique can
mitigate Gradient Vanishing problem in
A Multi-Hidden Layers Fully Connected Neural Netw... | unlicense |
daniaki/Enrich2 | enrich2/libraries/barcodevariant.py | 1 | 8178 | # Copyright 2016-2017 Alan F Rubin, Daniel C Esposito
#
# This file is part of Enrich2.
#
# Enrich2 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) ... | gpl-3.0 |
jereze/scikit-learn | examples/plot_multioutput_face_completion.py | 330 | 3019 | """
==============================================
Face completion with a multi-output estimators
==============================================
This example shows the use of multi-output estimator to complete images.
The goal is to predict the lower half of a face given its upper half.
The first column of images sho... | bsd-3-clause |
ibmets/toptrumps | training.py | 1 | 5552 | # external dependencies
from sklearn import tree
from timeit import default_timer as timer
from random import randint, sample, shuffle
from os.path import isfile
import os
import csv
import pylru
# local dependencies
import bots
import decks
# how many can we fit into memory?
ML_MODEL_CACHE_SIZE = 50
# cache of prev... | mit |
dmnfarrell/mirnaseq | setup.py | 2 | 1729 | from setuptools import setup
import sys,os
inst_requires = ['numpy>=1.10',
'pandas>=0.20',
'seaborn>=0.7',
'scikit-learn>=0.23.2',
'pyfaidx>=0.5.4',
'pysam>=0.10.0',
'HTSeq>=0.6',
... | gpl-3.0 |
rmkoesterer/uga | uga/RunSnvplot.py | 1 | 32158 | ## Copyright (c) 2015 Ryan Koesterer GNU General Public License v3
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any l... | gpl-3.0 |
alekz112/statsmodels | statsmodels/examples/tsa/arma_plots.py | 33 | 2516 | '''Plot acf and pacf for some ARMA(1,1)
'''
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.tsa.arima_process as tsp
from statsmodels.sandbox.tsa.fftarma import ArmaFft as FftArmaProcess
import statsmodels.tsa.stattools as tss
from statsmodels.graphics.tsap... | bsd-3-clause |
mojoboss/scikit-learn | sklearn/neighbors/tests/test_nearest_centroid.py | 305 | 4121 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... | bsd-3-clause |
xiaohan2012/snpp | snpp/utils/matrix.py | 1 | 2902 | import numpy as np
from scipy.sparse import csr_matrix, issparse, dok_matrix, isspmatrix_dok
from sklearn.cross_validation import train_test_split
def indexed_entries(sparse_matrix):
"""
Args:
Return:
list of (row_id, col_id, value)
"""
if not isspmatrix_dok(sparse_matrix):
sparse... | mit |
equialgo/scikit-learn | sklearn/base.py | 7 | 19499 | """Base classes for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import copy
import warnings
import numpy as np
from scipy import sparse
from .externals import six
from .utils.fixes import signature
from . import __version__
###################################... | bsd-3-clause |
nikitasingh981/scikit-learn | sklearn/linear_model/passive_aggressive.py | 14 | 12060 | # Authors: Rob Zinkov, Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from .stochastic_gradient import BaseSGDRegressor
from .stochastic_gradient import DEFAULT_EPSILON
class PassiveAggressiveClassifier(BaseSGDClassifier):
"""Passive Aggressive Classifier
Read mor... | bsd-3-clause |
ashariati/rpg_svo | svo_analysis/src/svo_analysis/analyse_dataset.py | 17 | 1178 | # -*- coding: utf-8 -*-
import associate
import numpy as np
import matplotlib.pyplot as plt
import yaml
def loadDataset(filename):
file = open(filename)
data = file.read()
lines = data.replace(","," ").replace("\t"," ").split("\n")
D = np.array([[v.strip() for v in line.split(" ") if v.strip()!=""] for line i... | gpl-3.0 |
mkoledoye/mds_examples | core/mds.py | 2 | 22924 | '''
Multi-dimensional Scaling (MDS)
variant:
-- classical -> _smacof_single
-- anchored -> _smacof_with_anchors_single
-- MDS-RFID -> _smacof_with_distance_recovery_single
'''
from __future__ import division
import operator
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.... | mit |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/scipy/ndimage/filters.py | 24 | 42327 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 and the following d... | mit |
rgommers/statsmodels | statsmodels/examples/tsa/arma_plots.py | 33 | 2516 | '''Plot acf and pacf for some ARMA(1,1)
'''
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.tsa.arima_process as tsp
from statsmodels.sandbox.tsa.fftarma import ArmaFft as FftArmaProcess
import statsmodels.tsa.stattools as tss
from statsmodels.graphics.tsap... | bsd-3-clause |
asmitagupta/crowdsource-platform | fixtures/createJson.py | 6 | 2462 | __author__ = 'Megha'
# Script to transfer csv containing data about various models to json
# Input csv file constituting of the model data
# Output json file representing the csv data as json object
# Assumes model name to be first line
# Field names of the model on the second line
# Data seperated by __DELIM__
# Examp... | mit |
kaushiksk/DeepNLP | Training-Sessions/Session II - Word Embeddings/word2vec/run.py | 2 | 2166 | import random
import numpy as np
from cs224d.data_utils import *
import matplotlib.pyplot as plt
from word2vec import *
from sgd import *
# Reset the random seed to make sure that everyone gets the same results
random.seed(314)
dataset = StanfordSentiment()
tokens = dataset.tokens()
nWords = len(tokens)
# We are goi... | mit |
kaslusimoes/SummerSchool2016 | simulation-multiple-variations-random.py | 1 | 4619 | #! /bin/env python2
# coding: utf-8
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import random as rd
from pickle import dump
class Data:
def __init__(self):
self.m_list1 = []
self.m_list2 = []
N = 100
M = 100
MAX = N + M + 1
MAX_EDGE = 380
MAX_DEG = 450
ITERATIONS = 50... | apache-2.0 |
mhogg/BMDanalyse | BMDanalyse/MatplotlibWidget.py | 1 | 1608 | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Michael Hogg
# This file is part of BMDanalyse - See LICENSE.txt for information on usage and redistribution
# Fixes error in pyqtgraph when importing NavigationToolbar2QTAgg. This class is not available
# in matplotlib any longer (since version?)
from pyqtgraph.Qt impor... | mit |
andrewnc/scikit-learn | examples/linear_model/plot_sgd_comparison.py | 77 | 1820 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... | bsd-3-clause |
harisbal/pandas | pandas/core/indexing.py | 4 | 91629 | # pylint: disable=W0223
import textwrap
import warnings
import numpy as np
from pandas._libs.indexing import _NDFrameIndexerBase
from pandas.util._decorators import Appender
from pandas.errors import AbstractMethodError
import pandas.compat as compat
from pandas.compat import range, zip
from pandas.core.dtypes.comm... | bsd-3-clause |
jlramalheira/sudoku | tests/io_tests.py | 1 | 1224 | import unittest
import os.path
import math
import sudoku.io
import networkx as nx
import matplotlib.pyplot as plt
class IoTests(unittest.TestCase):
def test_read(self):
filepath = os.path.join(
os.path.dirname(__file__),
'../rsc/9/sample-1.sdk')
graph = sudoku.io.read(filep... | mit |
ppries/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 17 | 9144 | # 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 |
djgagne/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 68 | 43439 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
ahoyosid/scikit-learn | sklearn/preprocessing/tests/test_label.py | 48 | 18419 | import numpy as np
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.testing impor... | bsd-3-clause |
njustesen/coep-starcraft | broodwar_strategy_evolver/evolution/evolution_timing.py | 1 | 2950 | import numpy as np
import tqdm
from broodwar_strategy_evolver.starcraft.unit_repository import UnitRepository
from broodwar_strategy_evolver.starcraft.starcraft import Race, Type
from broodwar_strategy_evolver.starcraft.forward_model import ForwardModel, GameState
from broodwar_strategy_evolver.evolution.evolution impo... | gpl-3.0 |
alsrgv/tensorflow | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | 5 | 282544 | # 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 |
trevstanhope/agri-vision | agrivision.py | 1 | 27286 | """
Agri-Vision
Precision Agriculture and Soil Sensing Group (PASS)
McGill University, Department of Bioresource Engineering
IDEAS:
- Rotation compensation --> take Hough Line of plants to estimate row angle
"""
__author__ = 'Tsevor Stanhope'
__version__ = '2.01'
## Libraries
import cv2, cv
import serial
import pymo... | mit |
vrkrishn/FBHacks | src/Backend/VideoDB.py | 1 | 3435 | import numpy as np
from scipy.ndimage import gaussian_filter1d
class VideoSelect(object):
def smoothFeature(self, feature, sigma):
return gaussian_filter1d(feature, sigma)
def normalizeFeature(self, feature):
scale = np.max(feature) - np.min(feature)
return (feature - np.min(feature))/float(scale)
def ... | mit |
f3r/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
gph82/PyEMMA | pyemma/coordinates/clustering/interface.py | 1 | 13210 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either vers... | lgpl-3.0 |
chenyyx/scikit-learn-doc-zh | examples/zh/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | gpl-3.0 |
mhostetter/gnuradio | gr-filter/examples/fir_filter_fff.py | 47 | 4014 | #!/usr/bin/env python
#
# Copyright 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 option)
# ... | gpl-3.0 |
saketkc/statsmodels | statsmodels/tools/print_version.py | 23 | 7951 | #!/usr/bin/env python
from __future__ import print_function
from statsmodels.compat.python import reduce
import sys
from os.path import dirname
def safe_version(module, attr='__version__'):
if not isinstance(attr, list):
attr = [attr]
try:
return reduce(getattr, [module] + attr)
except Att... | bsd-3-clause |
simonelanucara/script | k_meam_multiple_raster.py | 1 | 1805 | import os
import glob
import gdal
import numpy as np
from sklearn import cluster
directory_to_check = "/home/jovyan/work/ClippingFeatures/" # Which directory do you want to start with?
def my_function(directory):
# get rasters' file names
fnames = glob.glob('*_max_values_ndvi.tif')
# read general properties of th... | gpl-3.0 |
Ginkgo-Biloba/Misc-Python | sklearn/SKLearn3KNNForR.py | 1 | 1126 | # coding = utf-8
"""
3.9 将 kNN 用于回归
http://git.oschina.net/wizardforcel/sklearn-cb/blob/master/3.md
"""
import numpy as np
from sklearn import datasets
iris = datasets.load_iris()
print(iris.feature_names)
x = iris.data[:, [0, 1]]
y = iris.data[:, 2]
# 使用线性回归做对比
from sklearn.linear_model import LinearRegression
lr = L... | gpl-3.0 |
GrumpyNounours/PySeidon | pyseidon/validationClass/valTable.py | 2 | 3469 | #!/usr/bin/python2.7
# encoding: utf-8
import pandas as pd
# Custom error
from pyseidon.utilities.pyseidon_error import PyseidonError
# ALTERNATE VERSION FOR ANDY
def valTable(struct, filename, vars, save_csv=False, debug=False, debug_plot=False):
'''
Takes validation data from the struct and saves it into a ... | agpl-3.0 |
BIDS-collaborative/EDAM | data/LH/meanshift.py | 1 | 4584 | import pandas as pd, numpy as np, warnings, sklearn
from sklearn.cluster import AffinityPropagation, DBSCAN, MeanShift, estimate_bandwidth
from sklearn.decomposition import PCA
from sklearn import metrics
import matplotlib.pyplot as plt
from itertools import cycle
def load_data(fileName, dropFirstColumn = True):
df =... | bsd-2-clause |
lavanyag9713/ml_lab_ecsc_306 | labwork/lab7/sci-learn/plot_pca_3d.py | 354 | 2432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | apache-2.0 |
LiaoPan/scikit-learn | sklearn/cluster/bicluster.py | 211 | 19443 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
BeiLuoShiMen/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py | 69 | 11729 | """
An agg http://antigrain.com/ backend
Features that are implemented
* capstyles and join styles
* dashes
* linewidth
* lines, rectangles, ellipses
* clipping to a rectangle
* output to RGBA and PNG
* alpha blending
* DPI scaling properly - everything scales properly (dashes, linewidths, etc)
* draw polygo... | agpl-3.0 |
rexshihaoren/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 182 | 1743 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
ankurankan/scikit-learn | sklearn/decomposition/__init__.py | 99 | 1331 | """
The :mod:`sklearn.decomposition` module includes matrix decomposition
algorithms, including among others PCA, NMF or ICA. Most of the algorithms of
this module can be regarded as dimensionality reduction techniques.
"""
from .nmf import NMF, ProjectedGradientNMF
from .pca import PCA, RandomizedPCA
from .incrementa... | bsd-3-clause |
BubuLK/sfepy | examples/diffusion/time_poisson_interactive.py | 2 | 9967 | #!/usr/bin/env python
"""
Transient Laplace equation (heat equation) with non-constant initial conditions
given by a function, using commands for interactive use.
The script allows setting various simulation parameters, namely:
- the diffusivity coefficient
- the max. initial condition value
- temperature field appro... | bsd-3-clause |
apache/spark | python/pyspark/sql/tests/test_pandas_udf.py | 22 | 10200 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
spallavolu/scikit-learn | benchmarks/bench_rcv1_logreg_convergence.py | 149 | 7173 | # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import matplotlib.pyplot as plt
import numpy as np
import gc
import time
from sklearn.externals.joblib import Memory
from sklearn.linear_model import (LogisticRegression, SGDClassifi... | bsd-3-clause |
theislab/scanpy | scanpy/tests/conftest.py | 1 | 2491 | import sys
from pathlib import Path
import matplotlib as mpl
mpl.use('agg')
from matplotlib import pyplot
from matplotlib.testing.compare import compare_images, make_test_filename
import pytest
import scanpy
scanpy.settings.verbosity = "hint"
# define this after importing scanpy but before running tests
IMPORTED ... | bsd-3-clause |
AlexisEidelman/Til | til/pgm/liam2of.py | 2 | 6000 | # -*- coding:utf-8 -*-
'''
Created on 25 Apr 2013
@author: alexis_e
'''
from pandas import HDFStore, merge, DataFrame
import numpy as np
import pdb
import time
import os
from til import __path__ as path_til
from utils import of_name_to_til, concatenated_ranges
def table_for_of(simulation, period=None, check_validit... | gpl-3.0 |
GGiecold/PySCUBA | setup.py | 1 | 2816 | #!/usr/bin/env python
# PySCUBA/setup.py
# Author: Gregory Giecold for the GC Yuan Lab
# Affiliation: Harvard University
# Contact: g.giecold@gmail.com, ggiecold@jimmy.harvard.edu
from codecs import open
from os import path
from setuptools import setup
exec(open(path.join('src', 'PySCUBA', '__version__.py')).r... | mit |
thientu/scikit-learn | sklearn/datasets/__init__.py | 176 | 3671 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... | bsd-3-clause |
m11s/MissionPlanner | Lib/site-packages/numpy/lib/npyio.py | 53 | 59490 | __all__ = ['savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt',
'recfromtxt', 'recfromcsv', 'load', 'loads', 'save', 'savez',
'savez_compressed', 'packbits', 'unpackbits', 'fromregex', 'DataSource']
import numpy as np
import format
import sys
import os
import sys
import itertools
import ... | gpl-3.0 |
mfjb/scikit-learn | sklearn/cross_validation.py | 10 | 62355 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/matplotlib/backends/wx_compat.py | 8 | 5224 | #!/usr/bin/env python
"""
A wx API adapter to hide differences between wxPython classic and phoenix.
It is assumed that the user code is selecting what version it wants to use,
here we just ensure that it meets the minimum required by matplotlib.
For an example see embedding_in_wx2.py
"""
from __future__ import (abso... | apache-2.0 |
jarn0ld/gnuradio | gr-dtv/examples/atsc_ctrlport_monitor.py | 21 | 6089 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is... | gpl-3.0 |
yunfanz/ReionBub | Choud14/TestESP.py | 1 | 9152 | import numpy as np, matplotlib.pyplot as p, scipy.special
import cosmolopy.perturbation as pb
import cosmolopy.density as cd
from scipy.integrate import quad, tplquad
import itertools
from scipy.interpolate import interp1d
from scipy.interpolate import RectBivariateSpline as RBS
import optparse, sys
from scipy.optimize... | mit |
luminescence/PolyLibScan | Analysis/job.py | 1 | 9716 | #import parser
import numpy as np
import pathlib2 as pl
import pandas as pd
import warnings
import plotting
import bayesModels as bayes
import itertools as it
import pymol_visualisation
import sim_run
import numerics as num_
import PolyLibScan.Database.db as DB
import PolyLibScan.Tools.config as cfg
warnings.filterwar... | mit |
shaneknapp/spark | python/pyspark/sql/tests/test_pandas_cogrouped_map.py | 20 | 9306 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
keflavich/scikit-image | doc/examples/plot_tinting_grayscale_images.py | 14 | 5336 | """
=========================
Tinting gray-scale images
=========================
It can be useful to artificially tint an image with some color, either to
highlight particular regions of an image or maybe just to liven up a grayscale
image. This example demonstrates image-tinting by scaling RGB values and by
adjustin... | bsd-3-clause |
intersense/cudaDMA-gw | src/examples/deprecated/saxpy_ratio/replot.py | 2 | 1096 |
import sys
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
def main():
import pickle
output = open('data.pkl', 'r')
data = pickle.load(output)
print data
lbl_sz = 12
styles = ['-','--',':']
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = ax1.twinx()
f... | apache-2.0 |
dgellis90/nipype | nipype/utils/config.py | 9 | 5668 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
'''
Created on 20 Apr 2010
logging options : INFO, DEBUG
hash_method : content, timestamp
@author: Chris Filo Gorgolewski
'''
from future import standard_library
standard_library.install_aliases()
from bu... | bsd-3-clause |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/examples/user_interfaces/embedding_in_tk.py | 3 | 1095 | #!/usr/bin/env python
import matplotlib
matplotlib.use('TkAgg')
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import Tkinter as Tk
import sys
root = Tk.Tk()
root.wm_title("Embedding in TK")
f = Figure... | gpl-2.0 |
LeiDai/meep_metamaterials | meep_utils.py | 1 | 40785 | #!/usr/bin/env python
#coding:utf8
"""
Here you can find various functions and classes that facilitate the work with python-meep.
I believe some of these functions ought to be implemented in the meep module.
Filip Dominec 2012-2013
"""
import numpy as np
import os, os.path, sys, subprocess, time
from scipy.constants i... | mit |
mmaelicke/scikit-gstat | skgstat/DirectionalVariogram.py | 1 | 29843 | """
Directional Variogram
"""
import numpy as np
from scipy.spatial.distance import pdist
from .Variogram import Variogram
from skgstat import plotting
from .MetricSpace import MetricSpace, MetricSpacePair
class DirectionalVariogram(Variogram):
"""DirectionalVariogram Class
Calculates a variogram of the sep... | mit |
pavanvidem/tools-iuc | tools/vsnp/vsnp_build_tables.py | 12 | 14719 | #!/usr/bin/env python
import argparse
import os
import re
import pandas
import pandas.io.formats.excel
from Bio import SeqIO
# Maximum columns allowed in a LibreOffice
# spreadsheet is 1024. Excel allows for
# 16,384 columns, but we'll set the lower
# number as the maximum. Some browsers
# (e.g., Firefox on Linux)... | mit |
yipenggao/moose | modules/tensor_mechanics/doc/tests/cosserat_glide.py | 13 | 1867 | #!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
def expected(y):
mu = 2.0
mu_c = 3.0
be = 0.6
bbb = 1.0
we = np.sqrt(2 * mu * mu_c / be / (mu + mu_c))
phi = bbb * np.sinh(we * y)
u = 2 * mu_c * bbb * (1 - np.cosh(we * y)) / we / (mu + mu_c)
... | lgpl-2.1 |
moutai/scikit-learn | sklearn/cluster/spectral.py | 25 | 18522 | # -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... | bsd-3-clause |
abimannans/scikit-learn | examples/gaussian_process/plot_gp_regression.py | 253 | 4054 | #!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
=========================================================
Gaussian Processes regression: basic introductory example
=========================================================
A simple one-dimensional regression exercise computed in two different ways:
1. A noise-free cas... | bsd-3-clause |
FBRTMaka/ooi-ui-services | ooiservices/app/uframe/windrose.py | 5 | 20440 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.4'
__author__ = 'Lionel Roubeyrie'
__mail__ = 'lionel.roubeyrie@gmail.com'
__license__ = 'CeCILL-B'
import matplotlib
import matplotlib.cm as cm
import numpy as np
from matplotlib.patches import Rectangle, Polygon
from matplotlib.ticker import ScalarForma... | apache-2.0 |
wanghaven/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 |
KarlTDebiec/Moldynplot | moldynplot/dataset/IREDTimeSeriesDataset.py | 2 | 7363 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# moldynplot.dataset.IREDTimeSeriesDataset.py
#
# Copyright (C) 2015-2017 Karl T Debiec
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license. See the LICENSE file for details.
"""
Represents iRED NMR relaxation ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.