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 |
|---|---|---|---|---|---|
MMaus/mutils | fmalibs/integro.py | 1 | 28787 | #
# This integrator is a python port of the dopri5 integrator code described
# by: E. Hairer & G. Wanner
# Universite de Geneve, dept. de Mathematiques
# CH-1211 GENEVE 4, SWITZERLAND
# E-mail : HAIRER@DIVSUN.UNIGE.CH, WANNER@DIVSUN.UNIGE.CH
#
# The code is described in : E. Hairer, S.P. Norsett and G. Wanner, ... | gpl-2.0 |
macks22/scikit-learn | sklearn/linear_model/setup.py | 169 | 1567 | 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 |
RPGOne/scikit-learn | sklearn/tests/test_common.py | 5 | 9222 | """
General tests for all estimators in sklearn.
"""
# Authors: Andreas Mueller <amueller@ais.uni-bonn.de>
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
from __future__ import print_function
import os
import warnings
import sys
import re
import pkgutil
from sklearn.externals.six imp... | bsd-3-clause |
kdebrab/pandas | pandas/tests/series/indexing/test_indexing.py | 2 | 23618 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
""" test get/set & misc """
import pytest
from datetime import timedelta
import numpy as np
import pandas as pd
from pandas.core.dtypes.common import is_scalar
from pandas import (Series, DataFrame, MultiIndex,
Timestamp, Timedelta, Categorical)
... | bsd-3-clause |
nvoron23/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 57 | 8062 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | bsd-3-clause |
idlead/scikit-learn | benchmarks/bench_plot_approximate_neighbors.py | 244 | 6011 | """
Benchmark for approximate nearest neighbor search using
locality sensitive hashing forest.
There are two types of benchmarks.
First, accuracy of LSHForest queries are measured for various
hyper-parameters and index sizes.
Second, speed up of LSHForest queries compared to brute force
method in exact nearest neigh... | bsd-3-clause |
juliusf/Genetic-SRCPSP | tools/stat_inference/maximum_likelihood.py | 1 | 1695 | __author__ = 'jules'
import numpy as np
import deepThought.ORM.ORM as ORM
from scipy.optimize import fmin
from deepThought.stats.Pmf import MakePmfFromList
from deepThought.util import list_to_ccdf
import matplotlib.pyplot as plt
import pylab as pylab
def main():
job = ORM.deserialize("/tmp/output.pickle")
r... | mit |
mdhaber/scipy | scipy/interpolate/_fitpack_impl.py | 16 | 46842 | """
fitpack (dierckx in netlib) --- A Python-C wrapper to FITPACK (by P. Dierckx).
FITPACK is a collection of FORTRAN programs for curve and surface
fitting with splines and tensor product splines.
See
https://web.archive.org/web/20010524124604/http://www.cs.kuleuven.ac.be:80/cwis/research/nalag/resea... | bsd-3-clause |
kashif/scikit-learn | examples/classification/plot_lda_qda.py | 29 | 4952 | """
====================================================================
Linear and Quadratic Discriminant Analysis with confidence ellipsoid
====================================================================
Plot the confidence ellipsoids of each class and decision boundary
"""
print(__doc__)
from scipy import lin... | bsd-3-clause |
celiacintas/candela_maps | interpolation_maps/mapdata.py | 1 | 3792 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
from matplotlib.mlab import griddata
from scipy.interpolate import Rbf
from sklearn.gaussian_process import GaussianProcess
from statsmodels.tsa.stattools import acf
import matplotlib.pyplot as plt
import sys
class MapData(object):
... | gpl-2.0 |
zxtstarry/src | user/karl/rsf2numpy4.py | 5 | 1288 | #!/usr/bin/env python
import rsf.api as rsf
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import sys
import os
import c_m8r as c_rsf
import m8r
# next challenge is to get input file names from command line
# use Msfin.c as example
print "program name",sys.argv[0]
print "type sys.argv=",type(s... | gpl-2.0 |
NorfolkDataSci/presentations | 2018-01_chatbot/serverless-chatbots-workshop-master/LambdaFunctions/sentiment-analysis/nltk/sentiment/util.py | 7 | 30998 | # coding: utf-8
#
# Natural Language Toolkit: Sentiment Analyzer
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Pierpaolo Pantone <24alsecondo@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility methods for Sentiment Analysis.
"""
from copy import deepcopy
import codecs
imp... | mit |
erjerison/adaptability | github_submission/plot_figure3.py | 1 | 20369 | import matplotlib.pylab as pt
import numpy
import matplotlib.cm as cm
import qtl_detection_adaptability
from calculate_narrow_sense_heritability import narrow_sense_hsq
from calculate_narrow_sense_heritability import narrow_sense_hsq_replicates
from calculate_narrow_sense_heritability import rsq
from calcula... | mit |
INCF/pybids | bids/analysis/model_spec.py | 1 | 11942 | from abc import ABCMeta, abstractmethod
import pandas as pd
import numpy as np
from bids.variables import BIDSRunVariableCollection
from bids.utils import convert_JSON
def create_model_spec(collection, model):
kind = model.get('type', 'glm').lower()
SpecCls = {
'glm': GLMMSpec
}[kind]
return... | mit |
lancezlin/ml_template_py | lib/python2.7/site-packages/matplotlib/gridspec.py | 8 | 15715 | """
:mod:`~matplotlib.gridspec` is a module which specifies the location
of the subplot in the figure.
``GridSpec``
specifies the geometry of the grid that a subplot will be
placed. The number of rows and number of columns of the grid
need to be set. Optionally, the subplot layout parameter... | mit |
sanketloke/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 |
thunlp/OpenNE | src/openne/tadw.py | 1 | 4372 | from __future__ import print_function
import math
import numpy as np
from numpy import linalg as la
from sklearn.preprocessing import normalize
from .gcn.utils import *
class TADW(object):
def __init__(self, graph, dim, lamb=0.2):
self.g = graph
self.lamb = lamb
self.dim = int(dim/2)
... | mit |
jason-neal/companion_simulations | Notebooks/Fake_with_large_offsets.py | 1 | 5452 | # coding: utf-8
# In[ ]:
# Monitor fake detection processing etc.
# In[2]:
import matplotlib.pyplot as plt
import numpy as np
from spectrum_overload import Spectrum
from mingle.models.broadcasted_models import inherent_alpha_model
from mingle.utilities.chisqr import chi_squared
from mingle.utilities.phoenix_uti... | mit |
lamastex/scalable-data-science | db/2/2/063_DLbyABr_07-ReinforcementLearning.py | 2 | 25231 | # Databricks notebook source
# MAGIC %md
# MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
# MAGIC
# MAGIC This is used in a non-profit educational setting with kind permission of [Adam Breindel](https://www.linkedin.com/in/adbreind).
# MAGIC This is not licensed by ... | unlicense |
pompiduskus/scikit-learn | examples/feature_stacker.py | 246 | 1906 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | bsd-3-clause |
anirudhjayaraman/scikit-learn | sklearn/decomposition/tests/test_online_lda.py | 21 | 13171 | import numpy as np
from scipy.linalg import block_diag
from scipy.sparse import csr_matrix
from scipy.special import psi
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d,
_dirichlet_expect... | bsd-3-clause |
yl3dy/vmetf | task5.py | 1 | 3446 | #!/usr/bin/python3
from numpy import linspace, float64, copy, ones, empty, zeros, empty_like
import matplotlib.pyplot as plt
from tdma import TDMA_solve
from scipy.integrate import cumtrapz, odeint
from math import sqrt
# Physical parameters
NU = 0.1
# Modelic
# X
X_NODES = 100
X_MIN = 0
X_MAX = 1
X_VALS, DX = linspa... | mit |
adelomana/30sols | extra/coverage/figureMaker.py | 1 | 9094 | ###
### This script builds histograms from the coverage profile text files.
###
import sys,numpy
import matplotlib,matplotlib.pyplot
matplotlib.rcParams.update({'font.size':18,'font.family':'Arial','xtick.labelsize':14,'ytick.labelsize':14})
matplotlib.rcParams['pdf.fonttype']=42
def cdsBlockDefiner(genomicFeature):... | gpl-3.0 |
mne-tools/mne-python | examples/time_frequency/source_power_spectrum.py | 19 | 1959 | """
======================================================
Compute source power spectral density (PSD) in a label
======================================================
Returns an STC file containing the PSD (in dB) of each of the sources
within a label.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
... | bsd-3-clause |
MKLab-ITI/reveal-user-classification | reveal_user_classification/reveal/utility.py | 1 | 31544 | __author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import time
import json
import itertools
import datetime
import numpy as np
import scipy.sparse as spsp
from sklearn.preprocessing import normalize
import networkx as nx
from networkx.algorithms.link_analysis import pagerank_scipy
from collections import OrderedDict, ... | apache-2.0 |
Djabbz/scikit-learn | examples/svm/plot_svm_anova.py | 250 | 2000 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... | bsd-3-clause |
hagabbar/pycbc_copy | examples/distributions/spin_examples.py | 14 | 1894 | import matplotlib.pyplot as plt
import numpy
import pycbc.coordinates as co
from pycbc import distributions
# We can choose any bounds between 0 and pi for this distribution but in
# units of pi so we use between 0 and 1
theta_low = 0.
theta_high = 1.
# Units of pi for the bounds of the azimuthal angle which goes fro... | gpl-3.0 |
vortex-ape/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 33 | 10078 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
blubberdiblub/ham-demo | ham-demo.py | 1 | 17440 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import collections
import itertools
import numbers
import os.path
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
import PIL.Image as Image
i... | mit |
Sentient07/scikit-learn | examples/mixture/plot_gmm_selection.py | 95 | 3310 | """
================================
Gaussian Mixture Model Selection
================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in the ... | bsd-3-clause |
xiaoxiamii/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 |
thouska/spotpy | spotpy/examples/tutorial_nsgaii.py | 1 | 5650 | #!/usr/bin/env python
# coding: utf-8
# -*- coding: utf-8 -*-
'''
Copyright 2015 by Tobias Houska
This file is part of Statistical Parameter Estimation Tool (SPOTPY).
:author: Tobias Houska
This class holds example code how to use the nsgaii algorithm
'''
from __future__ import division, print_function
from __future... | mit |
brockk/clintrials | clintrials/util.py | 1 | 21299 | __author__ = 'Kristian Brock'
__contact__ = 'kristian.brock@gmail.com'
""" This module provides a home for all those useful bits-and-bobs that do not warrant their own module. """
from collections import OrderedDict, Iterable
from copy import copy
from datetime import datetime
from itertools import product
import nu... | gpl-3.0 |
bolkedebruin/airflow | scripts/perf/scheduler_ops_metrics.py | 2 | 7177 | # -*- 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 |
nmartensen/pandas | pandas/plotting/_compat.py | 11 | 1602 | # being a bit too dynamic
# pylint: disable=E1101
from __future__ import division
from distutils.version import LooseVersion
def _mpl_le_1_2_1():
try:
import matplotlib as mpl
return (str(mpl.__version__) <= LooseVersion('1.2.1') and
str(mpl.__version__)[0] != '0')
except Impo... | bsd-3-clause |
amueller/pystruct | pystruct/models/latent_node_crf.py | 1 | 23954 | ######################
# (c) 2012 Andreas Mueller <amueller@ais.uni-bonn.de>
# ALL RIGHTS RESERVED.
#
#
# Implements a CRF with arbitrary unobserved nodes.
# All unobserved nodes share the same state-space, which is separate from the
# observed states.
# Unobserved nodes don't have unary potentials currently (should th... | bsd-2-clause |
henrykironde/scikit-learn | examples/semi_supervised/plot_label_propagation_versus_svm_iris.py | 286 | 2378 | """
=====================================================================
Decision boundary of label propagation versus SVM on the Iris dataset
=====================================================================
Comparison for decision boundary generated on iris dataset
between Label Propagation and SVM.
This demon... | bsd-3-clause |
cainiaocome/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 143 | 22295 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
kubeflow/kfserving | python/alibiexplainer/tests/test_anchor_text.py | 1 | 1269 | # Copyright 2020 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
lscheinkman/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py | 69 | 24593 | # Todd Miller jmiller@stsci.edu
from __future__ import division
import os, sys, math
import Tkinter as Tk, FileDialog
import tkagg # Paint image to Tk photo blitter extension
from backend_agg import FigureCanvasAgg
import os.path
import matplotlib
from matplotlib.cbook import is_string_like
from ... | agpl-3.0 |
rexshihaoren/scikit-learn | sklearn/manifold/locally_linear.py | 206 | 25061 | """Locally Linear Embedding"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) INRIA 2011
import numpy as np
from scipy.linalg import eigh, svd, qr, solve
from scipy.sparse import eye, csr_matrix
from ..base import B... | bsd-3-clause |
davidenitti/ML | Sampling/kernel.py | 1 | 2377 | '''
Created on Jun 13, 2016
@author: davide
'''
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from sklearn.neighbors import KernelDensity
np.random.seed(1)
N = 20
X = np.concatenate((np.random.normal(0, 1, 0.3 * N),
np.random.normal(5, 1, 0.7 * N)))[:, np.newaxis... | gpl-3.0 |
ishanic/scikit-learn | examples/mixture/plot_gmm.py | 248 | 2817 | """
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians with EM
and variational Dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... | bsd-3-clause |
baojianzhou/DLReadingGroup | keras/examples/mnist_swwae.py | 4 | 7761 | '''Trains a stacked what-where autoencoder built on residual blocks on the
MNIST dataset. It exemplifies two influential methods that have been developed
in the past few years.
The first is the idea of properly 'unpooling.' During any max pool, the
exact location (the 'where') of the maximal value in a pooled re... | apache-2.0 |
aabadie/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 43 | 24671 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from numpy.testing import run_module_suite
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from... | bsd-3-clause |
mpelevina/context-eval | morph.py | 3 | 1192 | from spacy.en import English
from pandas import read_csv
STOPWORDS = "data/stopwords.csv"
def load_stoplist(fpath):
word_df = read_csv(fpath, sep="\t", quotechar=u"\0",doublequote=False, encoding='utf8', error_bad_lines=False)
voc = set(row["word"] for i, row in word_df.iterrows())
print "loaded %d stop... | apache-2.0 |
yonglehou/scikit-learn | sklearn/grid_search.py | 103 | 36232 | """
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... | bsd-3-clause |
pratapvardhan/pandas | pandas/tseries/holiday.py | 2 | 16232 | import warnings
from pandas import DateOffset, DatetimeIndex, Series, Timestamp
from pandas.compat import add_metaclass
from datetime import datetime, timedelta
from dateutil.relativedelta import MO, TU, WE, TH, FR, SA, SU # noqa
from pandas.tseries.offsets import Easter, Day
import numpy as np
def next_monday(dt):... | bsd-3-clause |
ScreamingUdder/mantid | scripts/FilterEvents/MplFigureCanvas.py | 3 | 1355 | #pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from PyQt4 import QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
class MplFigureCanvas(FigureCanvas):
""" A customized Qt widget for matpl... | gpl-3.0 |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/feature_selection/plot_feature_selection.py | 1 | 2845 | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | mit |
shaunstanislaus/pandashells | pandashells/lib/plot_lib.py | 7 | 4022 | #! /usr/bin/env python
import sys
import re
from pandashells.lib import module_checker_lib
module_checker_lib.check_for_modules(
['matplotlib', 'dateutil', 'mpld3', 'seaborn'])
from dateutil.parser import parse
import matplotlib as mpl
import pylab as pl
import seaborn as sns
import mpld3
def show(args):
... | bsd-2-clause |
boland1992/SeisSuite | build/lib/seissuite/spectrum/station_month_spectrum.py | 8 | 14156 | # -*- coding: utf-8 -*-
"""
Created on Fri July 6 11:04:03 2015
@author: boland
"""
import os
import glob
import scipy
import datetime
import numpy as np
import datetime as dt
import multiprocessing as mp
import matplotlib.pyplot as plt
from numpy.lib.stride_tricks import as_strided
from numpy.fft import rfft, irfft
... | gpl-3.0 |
NSasquatch/vocoder | thinkdsp (2).py | 2 | 37046 | """This file contains code used in "Think DSP",
by Allen B. Downey, available from greenteapress.com
Copyright 2013 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import array
import copy
import math
import numpy
import random
import scipy
... | cc0-1.0 |
pazagra/catkin_ws | src/Multimodal_Interaction/Offline_Learning/SVM.py | 1 | 3693 | from scipy.cluster.vq import *
from sklearn.preprocessing import Normalizer
from sklearn.svm import LinearSVC
from sklearn.externals import joblib
from sklearn.svm import *
from sklearn.metrics import *
from sklearn import linear_model
import matplotlib.pyplot as plt
import cv2
import os
import numpy as np
from sklearn... | gpl-3.0 |
weixuanfu/tpot | tests/test_config.py | 4 | 1262 | # -*- coding: utf-8 -*-
"""This file is part of the TPOT library.
TPOT was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Weixuan Fu (weixuanf@upenn.edu)
- Daniel Angell (dpa34@drexel.edu)
- and many more generous open source contributors
TPOT is f... | lgpl-3.0 |
leesavide/pythonista-docs | Documentation/matplotlib/mpl_examples/axes_grid/parasite_simple2.py | 16 | 1245 | import matplotlib.transforms as mtransforms
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.parasite_axes import SubplotHost
obs = [["01_S1", 3.88, 0.14, 1970, 63],
["01_S4", 5.6, 0.82, 1622, 150],
["02_S1", 2.4, 0.54, 1570, 40],
["03_S1", 4.1, 0.62, 2380, 170]]
fig = plt.figure()
... | apache-2.0 |
deepesch/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_scalability.py | 225 | 5719 | """
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... | bsd-3-clause |
opencog/opencog | scripts/make_benchmark_graphs.py | 56 | 3139 | #!/usr/bin/env python
# Requires matplotlib for graphing
# reads *_benchmark.csv files as output by atomspace_bm and turns them into
# graphs.
import csv
import numpy as np
import matplotlib.colors as colors
#import matplotlib.finance as finance
import matplotlib.dates as mdates
import matplotlib.ticker as mticker
i... | agpl-3.0 |
harshaneelhg/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 254 | 2253 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
robertdfrench/MonteCarlo-Integration | monte_carlo-parallel-plotting.py | 1 | 2837 | from mpi4py import MPI
import numpy
import scipy
import matplotlib.pyplot as pyplot
from matplotlib.patches import Circle
from scipy import integrate
def func(x) :
y = numpy.sin(x)
return y
def main() :
# MPI variables
size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()... | gpl-3.0 |
BorisJeremic/Real-ESSI-Examples | motion_one_component/Convolution_DRM_Propagation_Ormsby/python_plot_parameteric_study.py | 1 | 5748 | import scipy as sp
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import sys
import matplotlib.lines as lines
import h5py
from matplotlib.font_manager import FontProperties
import matplotlib.ticker as ticker
from scipy.fftpack import fft
axial_label_font = FontProperties()
axial_label_font.se... | cc0-1.0 |
jouyang3/FMCW | DSP/Radar_DSP/Python/animator.py | 1 | 1361 | import matplotlib.pyplot as pyplot
import matplotlib.animation as animation
import numpy
import sampler
FREQUENCY_RESOLUTION = 195.31
class Animator:
def __init__(self, mode = sampler.SERIAL_MODE):
self.sampler = sampler.SampleReader(mode)
self.figure = pyplot.figure()
xmin = -100e3
... | gpl-3.0 |
Odingod/mne-python | examples/connectivity/plot_mne_inverse_label_connectivity.py | 18 | 5910 | """
=========================================================================
Compute source space connectivity and visualize it using a circular graph
=========================================================================
This example computes the all-to-all connectivity between 68 regions in
source space based on... | bsd-3-clause |
rew4332/tensorflow | tensorflow/python/client/notebook.py | 33 | 4608 | # 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 |
rossonet/templateAr4k | noVNC-0.5.1/utils/json2graph.py | 46 | 6674 | #!/usr/bin/env python
'''
Use matplotlib to generate performance charts
Copyright 2011 Joel Martin
Licensed under MPL-2.0 (see docs/LICENSE.MPL-2.0)
'''
# a bar plot with errorbars
import sys, json, pprint
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
def usage... | lgpl-3.0 |
robin-lai/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
NDKoehler/DataScienceBowl2017_7th_place | dsb3_networks/lung_wings_segmentation/net/config.py | 1 | 2314 | from collections import defaultdict
from datetime import datetime
import json
import tensorflow as tf
import os, sys
import pandas as pd
#config dic
H = defaultdict(lambda: None)
#All possible config options:
H['optimizer'] = 'MomentumOptimizer'#'RMSPropOptimizer'
H['learning_rate'] = 0.001
H['momentum'] = 0.99 #0.99... | mit |
natj/bender | visualize_polar.py | 1 | 16041 | import numpy as np
import matplotlib as mpl
from pylab import *
from matplotlib import cm
##################################################
# plot values on image plane
def trans(mat):
#return np.flipud(mat.T) #trans
return np.flipud(mat).T #detrans
def detrans(mat):
return mat #detrans
#mask all 0... | mit |
APMonitor/applications | ASEE_Summer_School_2017/Demo1_Blending/Python/runblending.py | 1 | 4306 | # Run the blending process
# Martha Grover, July 6, 2017 (MATLAB)
# John Hedengren, July 14, 2017 (Python)
import numpy as np
from scipy.integrate import odeint
# Here is the playlist for the accompanying screencasts:
# https://www.youtube.com/playlist?list=PL4xAk5aclnUhb0tM6nypIATyxPRk0fB3L
# Following on the first... | apache-2.0 |
ctjacobs/pyqso | pyqso/world_map.py | 1 | 17087 | #!/usr/bin/env python3
# Copyright (C) 2013-2018 Christian Thomas Jacobs.
# This file is part of PyQSO.
# PyQSO 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... | gpl-3.0 |
Phil9l/cosmos | code/computational_geometry/src/jarvis_march/jarvis_march.py | 3 | 2360 | import matplotlib.pyplot as plt
import numpy as np
import math
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def equal(self, pt):
return self.x == pt.x and self.y == pt.y
def __str__(self):
return "(" + str(self.x) + "," + str(self.y) + ")"
def left_most_... | gpl-3.0 |
edlectrico/nltk_sentiment_analysis | tweets_sentiment_analysis/sentiment_train.py | 2 | 4995 | import nltk
import random
#from nltk.corpus import movie_reviews
from nltk.classify.scikitlearn import SklearnClassifier
import pickle
from sklearn.naive_bayes import MultinomialNB, BernoulliNB
from sklearn.linear_model import LogisticRegression, SGDClassifier
from sklearn.svm import SVC, LinearSVC, NuSVC
from nltk.cla... | gpl-2.0 |
zymsys/sms-tools | software/transformations_interface/harmonicTransformations_function.py | 20 | 5398 | block=False# function call to the transformation functions of relevance for the hpsModel
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import get_window
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
sys.path.append(os.path.join(os.path.di... | agpl-3.0 |
johankaito/fufuka | microblog/flask/venv/lib/python2.7/site-packages/scipy/stats/_distn_infrastructure.py | 6 | 112709 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy._lib.six import string_types, exec_
import sys
import keyword
import re
import inspect
import types
import warnings
from scipy.misc impor... | apache-2.0 |
wbbeyourself/cn-deep-learning | first-neural-network/Your_first_neural_network.py | 1 | 17207 |
# coding: utf-8
# # 你的第一个神经网络
#
# 在此项目中,你将构建你的第一个神经网络,并用该网络预测每日自行车租客人数。我们提供了一些代码,但是需要你来实现神经网络(大部分内容)。提交此项目后,欢迎进一步探索该数据和模型。
# In[1]:
get_ipython().magic('matplotlib inline')
get_ipython().magic("config InlineBackend.figure_format = 'retina'")
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
... | mit |
mikechan0731/tunnel_calculation | least_square_circle_demo.py | 1 | 1574 | import numpy as np
import pandas as pd
from scipy import optimize
from matplotlib import pyplot as plt, cm, colors
def calc_R(x,y, xc, yc):
""" calculate the distance of each 2D points from the center (xc, yc) """
return np.sqrt((x-xc)**2 + (y-yc)**2)
def f(c, x, y):
""" calculate the algebraic distance b... | apache-2.0 |
veltzer/demos-python | config/deps.py | 1 | 2720 | opt_python_version = '3.5'
packs = [
# python core
'python3',
'python3-doc',
'python3-examples',
'python{0}'.format(opt_python_version),
'python{0}-doc'.format(opt_python_version),
'python{0}-examples'.format(opt_python_version),
'python{0}-dev'.format(opt_python_version),
'python{0}... | gpl-3.0 |
lauringlab/variant_pipeline | bin/download.fastq.pipe.py | 1 | 3094 | import os
import os.path
import argparse
import shutil
import subprocess as s
import sys
import pandas as pd
parser = argparse.ArgumentParser(description='This is a wrapper to set up and run the bpipe pipeline that downloads fastq file from the SRA and names them accroding to a csv file that contains at least the hea... | apache-2.0 |
akrherz/iem | scripts/climodat/sync_coop_updates.py | 1 | 5022 | """COOP data gets corrected and whatnot.
We need to check the IEM Access database for any COOP sites with updated
data and then update the climodat database appropriately, ufff.
run from RUN_NOON.sh
"""
from pyiem.util import get_dbconn, logger
import pandas as pd
from pandas.io.sql import read_sql
from psycopg2.ext... | mit |
josesho/bootstrap_contrast | bootstrap_contrast/plot_tools.py | 2 | 4118 | import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from .misc_tools import merge_two_dicts
def halfviolin(v, half = 'right', color = 'k'):
for b in v['bodies']:
mVertical = np.mean(b.get_paths()[0].vertices[:, 0])
mHorizontal = np.mean(b.get_paths()[0].vertices[:, 1]... | mit |
aarondewindt/paparazzi_torrap | sw/airborne/test/math/compare_utm_enu.py | 77 | 2714 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import sys
import os
PPRZ_SRC = os.getenv("PAPARAZZI_SRC", "../../../..")
sys.path.append(PPRZ_SRC + "/sw/lib/python")
from pprz_math.geodetic import *
from pprz_math.algebra import DoubleRMat, DoubleEulers, DoubleVect3
from math ... | gpl-2.0 |
depet/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 4 | 2972 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import num... | bsd-3-clause |
huanzhang12/LightGBM | tests/python_package_test/test_sklearn.py | 1 | 7871 | # coding: utf-8
# pylint: skip-file
import math
import os
import unittest
import lightgbm as lgb
import numpy as np
from sklearn.base import clone
from sklearn.datasets import (load_boston, load_breast_cancer, load_digits,
load_svmlight_file)
from sklearn.externals import joblib
from skle... | mit |
dsullivan7/scikit-learn | sklearn/linear_model/ransac.py | 22 | 14007 | # 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 |
JizhouZhang/SDR | gr-filter/examples/fir_filter_ccc.py | 47 | 4019 | #!/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 |
yhenon/pyimgsaliency | pyimgsaliency/saliency.py | 1 | 6914 | import math
import sys
import operator
import networkx as nx
#import matplotlib.pyplot as plt
import numpy as np
import scipy.spatial.distance
import scipy.signal
import skimage
import skimage.io
from skimage.segmentation import slic
from skimage.util import img_as_float
from scipy.optimize import minimize
import pdb
... | apache-2.0 |
shusenl/scikit-learn | examples/plot_digits_pipe.py | 250 | 1809 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
jhamman/xarray | xarray/tests/test_units.py | 1 | 56991 | import operator
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from xarray.core import formatting
from xarray.core.npcompat import IS_NEP18_ACTIVE
pint = pytest.importorskip("pint")
DimensionalityError = pint.errors.DimensionalityError
unit_registry = pint.UnitRegistry()
Quantity = unit_r... | apache-2.0 |
mattgiguere/scikit-learn | sklearn/feature_selection/tests/test_base.py | 170 | 3666 | import numpy as np
from scipy import sparse as sp
from nose.tools import assert_raises, assert_equal
from numpy.testing import assert_array_equal
from sklearn.base import BaseEstimator
from sklearn.feature_selection.base import SelectorMixin
from sklearn.utils import check_array
class StepSelector(SelectorMixin, Ba... | bsd-3-clause |
3manuek/scikit-learn | sklearn/__init__.py | 154 | 3014 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
yousrabk/mne-python | tutorials/plot_cluster_stats_time_frequency.py | 16 | 5437 | """
.. _tut_stats_cluster_sensor_2samp_tfr:
=========================================================================
Non-parametric between conditions cluster statistic on single trial power
=========================================================================
This script shows how to compare clusters in time-fr... | bsd-3-clause |
jlegendary/scikit-learn | sklearn/linear_model/tests/test_coordinate_descent.py | 44 | 22866 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.utils.testing ... | bsd-3-clause |
kohr-h/odl | odl/contrib/solvers/spdhg/examples/ROF_1k2_primal.py | 2 | 15457 | # Copyright 2014-2019 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""An example of using the SPDHG algorithm t... | mpl-2.0 |
maryklayne/Funcao | sympy/physics/quantum/tests/test_circuitplot.py | 24 | 2071 | from sympy.physics.quantum.circuitplot import labeller, render_label, Mz, CreateOneQubitGate,\
CreateCGate
from sympy.physics.quantum.gate import CNOT, H, X, Z, SWAP, CGate, S, T
from sympy.external import import_module
from sympy.utilities.pytest import skip
mpl = import_module('matplotlib')
def test_render_lab... | bsd-3-clause |
Obus/scikit-learn | examples/cluster/plot_birch_vs_minibatchkmeans.py | 333 | 3694 | """
=================================
Compare BIRCH and MiniBatchKMeans
=================================
This example compares the timing of Birch (with and without the global
clustering step) and MiniBatchKMeans on a synthetic dataset having
100,000 samples and 2 features generated using make_blobs.
If ``n_clusters... | bsd-3-clause |
pylayers/pylayers | pylayers/antprop/examples/ex_uwban.py | 3 | 1342 | from pylayers.antprop.antenna import *
from pylayers.antprop.spharm import *
from pylayers.antprop.antvsh import *
from pylayers.util.pyutil import *
import matplotlib.pyplot as plt
from numpy import *
import matplotlib.pyplot as plt
import os
_filename = 'S1R2.mat'
A = Antenna(_filename,'ant/UWBAN/Matfile')
filename=... | mit |
Monika319/EWEF-1 | Cw2Rezonans/Karolina/BodePlotMultifileCewkaIBez.py | 1 | 1402 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import os
from matplotlib.ticker import MultipleLocator, FormatStrFormatter, FixedLocator
rc('font', family='Consolas')
from matplotlib.ticker import MultipleLocator, FormatStrFo... | gpl-2.0 |
tp81/openmicroscopy | components/tools/OmeroPy/test/unit/test_jvmcfg.py | 2 | 7569 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2015 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# 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... | gpl-2.0 |
cpcloud/ibis | ibis/bigquery/udf/tests/test_udf_execute.py | 1 | 6467 | import os
import pandas as pd
import pandas.util.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
from ibis.bigquery import udf # noqa: E402
pytest.importorskip('google.cloud.bigquery')
pytestmark = pytest.mark.bigquery
PROJECT_ID = os.environ.get('GOOGLE_BIGQUERY... | apache-2.0 |
AlCap23/Thesis | Python/Experiments/MIMO/titostudy_extern_TSum_H01_TIRAND.py | 1 | 11248 | """
Python programm to study the robustness of TITO systems.
Identitfies the system, computes the controller and analysis the controller using the state space - transfer function relation.
Computes the singular values.
Use this script from the terminal / console with
./python FILENAME.py --file_storage = FOLDERNAME
t... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.