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 |
|---|---|---|---|---|---|
douggeiger/gnuradio | gr-digital/examples/example_fll.py | 49 | 5715 | #!/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 |
nguyentu1602/statsmodels | statsmodels/tools/tests/test_pca.py | 25 | 13934 | from __future__ import print_function, division
from unittest import TestCase
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_raises
from numpy.testing.decorators import skipif
import pandas as pd
try:
import matplotlib.pyplot as plt
missing_matplotlib = Fal... | bsd-3-clause |
shansixiong/geosearch | geosearch/extract.py | 2 | 3972 | from bs4 import BeautifulSoup
import urllib.request
import re
import pandas as pd
import time
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
print('%r %2.2f sec' % \
(method.__name__, te - ts))
retu... | mit |
automl/paramsklearn | ParamSklearn/components/regression/decision_tree.py | 1 | 4321 | import numpy as np
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter, \
UnParametrizedHyperparameter, Constant
from ParamSklearn.components.base import \
P... | bsd-3-clause |
seba-1511/stockMarket | Scripts/plot.py | 2 | 1760 | #-*- coding: utf-8 -*-
import matplotlib.pyplot as uniquePyPlot
def plot(x, y, title='', xlabel='', ylabel=''):
uniquePyPlot.clf()
figure = uniquePyPlot
figure.scatter(x, y)
figure.title(title)
figure.xlabel(xlabel)
figure.ylabel(ylabel)
figure.autoscale(tight=True)
figure.grid()
f... | mit |
vivekmishra1991/scikit-learn | examples/decomposition/plot_ica_blind_source_separation.py | 349 | 2228 | """
=====================================
Blind source separation using FastICA
=====================================
An example of estimating sources from noisy data.
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 3 instruments playing simultaneously and 3 microphones
recording the mixed si... | bsd-3-clause |
jordancheah/zipline | tests/utils/test_factory.py | 34 | 2175 | #
# 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 law or agreed to in wr... | apache-2.0 |
tejasckulkarni/hydrology | ch_591/ch_591_ver_2_ daily.py | 2 | 39683 | __author__ = 'kiruba'
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import itertools
from spread import spread
from scipy.optimize import curve_fit
import math
from matplotlib import rc
import email.utils as eutils
import time
import datetime
from datetime import timedelta
import scipy as sp
i... | gpl-3.0 |
awacha/cct | cct/qtgui/core/plotimage/plotimage.py | 1 | 16195 | import datetime
import gc
import matplotlib.cm
import matplotlib.colors
import numpy as np
import sastool.io.credo_cct
import scipy.misc
from PyQt5 import QtWidgets, QtGui
from matplotlib.axes import Axes
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT
from matplotlib.figure impo... | bsd-3-clause |
redreamality/broca | examples/clustering.py | 3 | 1520 | """
This example demonstrates using broca with scikit-learn for clustering.
A multi-pipeline is assembled to try four different bag-of-words vectorizers, each
with a different tokenizer, and then compare their K-Means clustering results.
"""
from sklearn import metrics
from sklearn.cluster import KMeans
from broca.vec... | mit |
Akshay0724/scikit-learn | sklearn/linear_model/coordinate_descent.py | 3 | 81531 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | bsd-3-clause |
yanlend/scikit-learn | examples/ensemble/plot_forest_importances.py | 168 | 1793 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
joegomes/deepchem | contrib/atomicconv/feat/atomicnet_pdbbind_datasets.py | 8 | 4738 | """
PDBBind dataset loader.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import pandas as pd
from atomicnet_coordinates import ComplexNeighborListFragmentAtomicCoordinates
def load_pdbbind_labels(labels_file):
"""Loa... | mit |
magicknight/Observer | run.py | 1 | 8980 | #!/usr/bin/env python
import numpy as np
import os
from os import walk
from get_samples import get_hog_samples
from get_classifier import get_classifier
from get_location import get_location
from output import output
from os.path import join
from shutil import rmtree
from sklearn.externals import joblib as pickle
imp... | gpl-2.0 |
jorge2703/scikit-learn | sklearn/utils/multiclass.py | 83 | 12343 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | bsd-3-clause |
Aasmi/scikit-learn | sklearn/linear_model/tests/test_passive_aggressive.py | 121 | 6117 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.base import ClassifierMixin
from skle... | bsd-3-clause |
hugolouzada/ImpeachmentPrediction | Prediction/SplitTrainValid/getCompleteVoteData.py | 1 | 2023 | from random import random
from DataGathering.getNameList import getNameList
from DataGathering.getVoteData import getVoteData
from DataTransform import getSpeechSize, getLexicalDiversity, getAverageWordSize, getProperNamePresence, addTopDifferentWordsPresence
from sklearn.preprocessing import LabelEncoder
from sklearn... | gpl-3.0 |
tapomayukh/projects_in_python | clustering/hmm_taxel_based_foliage.py | 1 | 13968 | #!/usr/bin/env python
# Online haptic_map implementation
import pylab as pyl
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy as scp
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
import tf
import os
#import hrl_l... | mit |
B3AU/waveTree | examples/linear_model/plot_bayesian_ridge.py | 8 | 2553 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
scikit-hep/uproot | tests/test_issues.py | 1 | 22552 | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot3/blob/master/LICENSE
import sys
import pytest
import numpy
import uproot3
import awkward0
import uproot_methods.classes.TVector3
import uproot_methods.classes.TLorentzVector
class Test(object):
def test_issue21(self):
... | bsd-3-clause |
plotly/plotly.py | packages/python/chart-studio/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py | 2 | 1582 | """
test_plot_mpl:
==============
A module intended for use with Nose.
"""
from __future__ import absolute_import
import _plotly_utils.exceptions
from plotly import optional_imports
from chart_studio.plotly import plotly as py
from unittest import TestCase
import pytest
matplotlylib = optional_imports.get_module("... | mit |
natanielruiz/android-yolo | jni-build/jni/include/tensorflow/examples/skflow/iris_custom_model.py | 5 | 2554 | # 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 appl... | apache-2.0 |
nerdless/lifelines | lifelines/utils/__init__.py | 3 | 34875 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import warnings
from datetime import datetime
import numpy as np
from numpy.linalg import inv
import pandas as pd
from pandas import to_datetime
class StatError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(se... | mit |
moutai/scikit-learn | sklearn/feature_selection/variance_threshold.py | 123 | 2572 | # Author: Lars Buitinck
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstimator, SelectorMixin):
... | bsd-3-clause |
monsteredp/nemesys-qos | nemesys/netgraph.py | 9 | 3506 | #!/usr/bin/env python
# printing_in_wx.py
#
from collections import deque
from contabyte import Contabyte
from pcapper import Pcapper
from threading import Thread
import math
import matplotlib
import numpy
import socket
import time
import wx
SECONDS = 60
POINTS_PER_SECONDS = 1
SAMPLE_INTERVAL = 0.8
matplotlib.use('W... | gpl-3.0 |
HolgerPeters/scikit-learn | benchmarks/bench_glmnet.py | 111 | 3890 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
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... | bsd-3-clause |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/misopy/sashimi_plot/sashimi_plot.py | 1 | 10725 | # -*- mode: python; -*-
##
## sashimi_plot
##
## Utility for visualizing RNA-Seq densities along gene models and
## for plotting MISO output
##
import os
import sys
import glob
import matplotlib
# Use PDF backend
matplotlib.use("pdf")
from scipy import *
from numpy import *
import pysam
import shelve
import misopy
... | apache-2.0 |
mhue/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 234 | 12267 | # 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 |
Tastalian/openravepypy | pymanoid/models.py | 3 | 7028 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2020 Stephane Caron <stephane.caron@normalesup.org>
#
# This file is part of pymanoid <https://github.com/stephane-caron/pymanoid>.
#
# pymanoid is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public Lic... | gpl-3.0 |
c3s-magic/adaguc-services-esmvaltool-wps | processes/pretty-picture.py | 1 | 1942 | """
Example processing returning some image
"""
import logging
import os
import shutil
from pywps.Process.Process import WPSProcess
class Process(WPSProcess):
def __init__(self):
# init process
WPSProcess.__init__(self,
identifier="pretty-picture", #the same as th... | apache-2.0 |
ahwillia/PyNeuron-Toolbox | PyNeuronToolbox/channel_analysis.py | 1 | 2536 | def ivcurve(mechanism_name, i_type, vmin=-100, vmax=100, deltav=1, transient_time=50, test_time=50, rs=1, vinit=-665):
"""
Returns the (peak) current-voltage relationship for an ion channel.
Args:
mechanism_name = name of the mechanism (e.g. hh)
i_type = which current to monitor (e.g. ik, i... | mit |
jcl5m1/quadrotor_control | gyroplot.py | 1 | 3106 | import numpy as np
import matplotlib.pyplot as plt
import sys, os, serial, threading
import pygame
from pygame.locals import *
from collections import deque
red = pygame.Color(255,0,0)
green = pygame.Color(0,255,0)
yellow = pygame.Color(255,255,0)
cyan = pygame.Color(0,255,255)
blue = pygame.Color(0,0,255)
black = py... | apache-2.0 |
zhoushuaicode/machinelearning | classify.py | 1 | 1255 | import pandas as pd
import numpy as np
import operator
def classify(trainset,testset,k):
trainlabel=pd.DataFrame(trainset['class'])
#testlabel=pd.DataFrame(testset['class'])
trainfeatrue=trainset.drop('class',axis=1)
testfeature=testset.drop('class',axis=1)
result=list()
for i in list(testfeatur... | mit |
SciTools/iris | lib/iris/tests/unit/quickplot/test_contour.py | 5 | 1533 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the `iris.quickplot.contour` function."""
# Import iris.tests first so that some things can be initialised b... | lgpl-3.0 |
to266/hyperspy | hyperspy/drawing/_widgets/circle.py | 3 | 7415 | # -*- 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 |
rubikloud/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
sumspr/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 129 | 10192 | import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dis... | bsd-3-clause |
astocko/statsmodels | statsmodels/sandbox/distributions/otherdist.py | 33 | 10145 | '''Parametric Mixture Distributions
Created on Sat Jun 04 2011
Author: Josef Perktold
Notes:
Compound Poisson has mass point at zero
http://en.wikipedia.org/wiki/Compound_Poisson_distribution
and would need special treatment
need a distribution that has discrete mass points and contiuous range, e.g.
compound Pois... | bsd-3-clause |
elijah513/scikit-learn | examples/neighbors/plot_species_kde.py | 282 | 4059 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
untom/scikit-learn | examples/applications/face_recognition.py | 15 | 5394 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | bsd-3-clause |
pyannote/pyannote-audio | pyannote/audio/tasks/segmentation/segmentation.py | 1 | 17573 | # MIT License
#
# Copyright (c) 2020-2021 CNRS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | mit |
MartinDelzant/scikit-learn | examples/linear_model/plot_ridge_path.py | 254 | 1655 | """
===========================================================
Plot Ridge coefficients as a function of the regularization
===========================================================
Shows the effect of collinearity in the coefficients of an estimator.
.. currentmodule:: sklearn.linear_model
:class:`Ridge` Regressi... | bsd-3-clause |
jzt5132/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/IPython/lib/tests/test_latextools.py | 10 | 4076 | # encoding: utf-8
"""Tests for IPython.utils.path.py"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this s... | mit |
alvarofierroclavero/scikit-learn | examples/svm/plot_separating_hyperplane.py | 294 | 1273 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | bsd-3-clause |
ZenDevelopmentSystems/scikit-learn | sklearn/datasets/base.py | 196 | 18554 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import shutil
from os import environ
from os.pa... | bsd-3-clause |
jchodera/MSMs | shanson/mek-10488/msmbuilder-finding4/msmbuilder-finding4-mek.py | 2 | 2134 | import matplotlib
matplotlib.use('Agg')
from msmbuilder.dataset import dataset
from msmbuilder import msm, featurizer, utils, decomposition
import numpy as np
import mdtraj as md
import matplotlib.pyplot as plt
from glob import glob
import os
# Source directory for MEK simulations
source_directory = '/cbio/jclab/pr... | gpl-2.0 |
alexeyum/scikit-learn | benchmarks/bench_isotonic.py | 38 | 3047 | """
Benchmarks of isotonic regression performance.
We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.
The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.
This allows the scaling of the algorit... | bsd-3-clause |
Karel-van-de-Plassche/bokeh | bokeh/sampledata/tests/test_airports.py | 2 | 1951 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
jakobworldpeace/scikit-learn | examples/neighbors/plot_kde_1d.py | 60 | 5120 | """
===================================
Simple 1D Kernel Density Estimation
===================================
This example uses the :class:`sklearn.neighbors.KernelDensity` class to
demonstrate the principles of Kernel Density Estimation in one dimension.
The first plot shows one of the problems with using histogram... | bsd-3-clause |
lscheinkman/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/_mathtext_data.py | 69 | 57988 | """
font data tables for truetype and afm computer modern fonts
"""
# this dict maps symbol names to fontnames, glyphindex. To get the
# glyph index from the character code, you have to use get_charmap
"""
from matplotlib.ft2font import FT2Font
font = FT2Font('/usr/local/share/matplotlib/cmr10.ttf')
items = font.get_... | agpl-3.0 |
kevin-intel/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 19 | 3140 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess whether the opinion of the author is
positive or negative.
In this examples we will use a... | bsd-3-clause |
cauchycui/scikit-learn | examples/ensemble/plot_adaboost_hastie_10_2.py | 355 | 3576 | """
=============================
Discrete versus Real AdaBoost
=============================
This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates
the difference in performance between the discrete SAMME [2] boosting
algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate... | bsd-3-clause |
eg-zhang/scikit-learn | benchmarks/bench_glm.py | 297 | 1493 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... | bsd-3-clause |
Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/do/evolve/score.py | 1 | 5232 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | mit |
virneo/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 |
JorgeDeLosSantos/NanchiPlot | nanchi/uiaux.py | 1 | 25587 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import wx
import wx.html as html
import wx.grid as wxgrid
import wx.lib.floatbar as wxfb
import webbrowser
try:
import uibase as ui
import iodata as io
from _const_ import *
from util import isempty
except:
import nanchi.ui... | mit |
thilbern/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 17 | 6093 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... | bsd-3-clause |
ron1818/Singaboat_RobotX2016 | robotx_nav/nodes/color_totem_planner.py | 3 | 8561 | #!/usr/bin/env python
import random
import itertools
import rospy
from visualization_msgs.msg import MarkerArray, Marker
from geometry_msgs.msg import Point, Quaternion
import numpy as np
from sklearn.cluster import KMeans, DBSCAN
from sklearn import svm
import planner_utils
class ColorTotemPlanner(object):
""" fi... | gpl-3.0 |
NeurotechBerkeley/bci-course | lab5/lsl-record.py | 5 | 2841 | #!/usr/bin/env python
## code by Alexandre Barachant
import numpy as np
import pandas as pd
from time import time, strftime, gmtime
from optparse import OptionParser
from pylsl import StreamInlet, resolve_byprop
from sklearn.linear_model import LinearRegression
default_fname = ("data/data_%s.csv" % strftime("%Y-%m-%d-... | mit |
oesteban/seaborn | seaborn/timeseries.py | 4 | 15212 | """Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .palettes import c... | bsd-3-clause |
jpautom/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
HugoMartin78/bim-classifier | BIM_Classifier_TextOnly.py | 1 | 2963 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 19 14:07:37 2015
@author: Hugo
"""
import numpy
import re
from scipy.sparse import hstack
from scipy import sparse
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import... | gpl-3.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py | 8 | 2867 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
from matplotlib.externals.six import unichr
import os
import re
import signal
import sys
import matplotlib
from matplotlib.cbook import is_string_like
from matplotlib.back... | mit |
ltiao/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
themrmax/scikit-learn | examples/neighbors/plot_regression.py | 349 | 1402 | """
============================
Nearest Neighbors regression
============================
Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@... | bsd-3-clause |
juggernautone/trading-with-python | lib/functions.py | 76 | 11627 | # -*- coding: utf-8 -*-
"""
twp support functions
@author: Jev Kuznetsov
Licence: GPL v2
"""
from scipy import polyfit, polyval
import datetime as dt
#from datetime import datetime, date
from pandas import DataFrame, Index, Series
import csv
import matplotlib.pyplot as plt
import numpy as np
import p... | bsd-3-clause |
macks22/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 234 | 9928 | """
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 |
architecture-building-systems/CityEnergyAnalyst | cea/analysis/multicriteria/main.py | 2 | 5584 | """
Multi criteria decision analysis
"""
import pandas as pd
import cea.config
import cea.inputlocator
__author__ = "Jimeno A. Fonseca"
__copyright__ = "Copyright 2018, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Jimeno A. Fonseca", "Shanshan Hsieh", "Sreepathi Bhargava Krishna"]
__license__ =... | mit |
stuliveshere/SeismicProcessing2015 | prac2_student/toolbox/processing.py | 2 | 16997 | import numpy as np
from toolbox import io
import toolbox
import pylab
from scipy.signal import butter, lfilter, convolve2d
from scipy.interpolate import RectBivariateSpline as RBS
from scipy.interpolate import interp2d
from scipy.interpolate import interp1d
from scipy.interpolate import griddata
import matplotlib.patc... | mit |
hainm/statsmodels | statsmodels/tsa/base/datetools.py | 27 | 10629 | from statsmodels.compat.python import (lrange, lzip, lmap, string_types, callable,
asstr, reduce, zip, map)
import re
import datetime
from pandas import Period
from pandas.tseries.frequencies import to_offset
from pandas import datetools as pandas_datetools
import numpy as np
#NOTE: All... | bsd-3-clause |
robin-lai/scikit-learn | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
HeraclesHX/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 162 | 7103 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
degoldschmidt/pytrack-analysis | scripts/plot_trajectories.py | 2 | 5487 | from pytrack_analysis.profile import get_profile
from pytrack_analysis.database import Experiment
import pytrack_analysis.plot as plot
from pytrack_analysis import Multibench
import matplotlib.pyplot as plt
from pytrack_analysis.yamlio import read_yaml
from pytrack_analysis.array import rle
import seaborn as sns
import... | gpl-3.0 |
pmneila/morphsnakes | examples.py | 1 | 8158 |
import os
import logging
import numpy as np
from imageio import imread
import matplotlib
from matplotlib import pyplot as plt
import morphsnakes as ms
# in case you are running on machine without display, e.g. server
if os.environ.get('DISPLAY', '') == '':
logging.warning('No display found. Using non-interactiv... | bsd-3-clause |
ThomasMiconi/htmresearch | projects/sequence_prediction/continuous_sequence/plot_noisy_taxi_experiment.py | 12 | 5167 | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib as mpl
from plot import computeSquareDeviation
from plot import ExperimentResult
from plot import computeLikelihood
from nupic.encoders.scalar import ScalarEncoder as NupicScalarEncoder
mpl.rcParams['pdf.fonttype'] = 42
plt.... | agpl-3.0 |
PanDAWMS/panda-bigmon-core | core/grafana/StaginDSProgress.py | 1 | 6265 | from requests import post, get
from json import loads
from core.settings.local import GRAFANA as token
from django.http import JsonResponse
from core.libs.exlib import dictfetchall
from django.db import connection
from django.utils import timezone
from datetime import timedelta
from core.settings import defaultDatetime... | apache-2.0 |
DeplanckeLab/ASAP | R_Python/clustering_scanpy_opti.py | 1 | 8322 | # Imports
import sys
import os
import time
import h5py
import numpy as np
import loompy
import json
from scipy.sparse import issparse, coo_matrix, csr_matrix
from sklearn.metrics import pairwise_distances
from umap.umap_ import nearest_neighbors
from umap.umap_ import fuzzy_simplicial_set
# Arguments
loom_file = 'MISS... | gpl-3.0 |
Rhoana/rhoana | Renderer/blocking.py | 1 | 11629 | #-------------------------
#3d Renderer
#Daniel Miron
#7/5/2013
#
#-------------------------
import h5py
import numpy as np
import sys
import pickle
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
import arcball as arc
import matplotlib.pyplot as plt
import cv2
class Viewer:
def __ini... | mit |
jjx02230808/project0223 | sklearn/manifold/isomap.py | 229 | 7169 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
smartscheduling/scikit-learn-categorical-tree | examples/calibration/plot_calibration_curve.py | 225 | 5903 | """
==============================
Probability Calibration curves
==============================
When performing classification one often wants to predict not only the class
label, but also the associated probability. This probability gives some
kind of confidence on the prediction. This example demonstrates how to di... | bsd-3-clause |
ephes/scikit-learn | examples/model_selection/grid_search_text_feature_extraction.py | 253 | 4158 | """
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the do... | bsd-3-clause |
cbertinato/pandas | pandas/tests/test_take.py | 1 | 16636 | from datetime import datetime
import re
import numpy as np
import pytest
from pandas._libs.tslib import iNaT
import pandas.core.algorithms as algos
import pandas.util.testing as tm
@pytest.fixture(params=[True, False])
def writeable(request):
return request.param
# Check that take_nd works both with writeabl... | bsd-3-clause |
JRoehrig/GIRS | girs/feat/layers.py | 1 | 85451 | from __future__ import print_function
from builtins import zip
from builtins import str
from builtins import range
from past.builtins import basestring
from builtins import object
import os
import collections
import numpy as np
import pandas as pd
import datetime
from abc import ABCMeta
from osgeo import gdal, ogr, osr... | mit |
adamrvfisher/TechnicalAnalysisLibrary | IncrementalStrategyOptimizer.py | 1 | 8252 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 22 19:13:12 2018
@author: AmatVictoriaCuramIII
"""
#Drag w/ Increment
import numpy as np
import random as rand
import pandas as pd
import time as t
from DatabaseGrabber import DatabaseGrabber
from YahooGrabber import YahooGrabber
#Inputs - OHLC data
Tick... | apache-2.0 |
ElDeveloper/scikit-learn | sklearn/tests/test_kernel_approximation.py | 244 | 7588 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
bnaul/scikit-learn | examples/cross_decomposition/plot_compare_cross_decomposition.py | 17 | 4897 | """
===================================
Compare cross decomposition methods
===================================
Simple usage of various cross decomposition algorithms:
- PLSCanonical
- PLSRegression, with multivariate response, a.k.a. PLS2
- PLSRegression, with univariate response, a.k.a. PLS1
- CCA
Given 2 multivari... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/terminal/ipapp.py | 7 | 13910 | #!/usr/bin/env python
# encoding: utf-8
"""
The :class:`~IPython.core.application.Application` object for the command
line :command:`ipython` program.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import
from __future__ import ... | gpl-3.0 |
steffengraber/nest-simulator | pynest/examples/spatial/test_3d_gauss.py | 14 | 2306 | # -*- coding: utf-8 -*-
#
# test_3d_gauss.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, ... | gpl-2.0 |
sternb0t/django-pandas | setup.py | 2 | 1324 | from setuptools import setup, find_packages
long_description = (
open('README.rst').read() + '\n\n' +
open('CHANGES.rst').read()
)
MAJOR = 0
MINOR = 3
MICRO = 0
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
setup(
name='django-pandas',
version=VERSION,
description='Tools for working with pydata.p... | bsd-3-clause |
rvraghav93/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
solarjoe/numpy | numpy/lib/function_base.py | 3 | 169215 | from __future__ import division, absolute_import, print_function
import collections
import re
import sys
import warnings
import numpy as np
import numpy.core.numeric as _nx
from numpy.core import linspace, atleast_1d, atleast_2d, transpose
from numpy.core.numeric import (
ones, zeros, arange, concatenate, array, ... | bsd-3-clause |
gojira/tensorflow | tensorflow/contrib/training/python/training/feeding_queue_runner_test.py | 76 | 5052 | # 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 |
tomlof/scikit-learn | sklearn/datasets/tests/test_20news.py | 75 | 3266 | """Test the 20news downloader, if the data is available."""
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import SkipTest
from sklearn import datasets
def test_20news():
try:
data = dat... | bsd-3-clause |
lehai0609/ThinkStats2 | code/hinc.py | 67 | 1494 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import numpy as np
import pandas
import thinkplot
import thinkstats2
def Clean(s):... | gpl-3.0 |
aleksandr-bakanov/astropy | astropy/convolution/kernels.py | 6 | 33186 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import numpy as np
from .core import Kernel1D, Kernel2D, Kernel
from .utils import has_even_axis, raise_even_kernel_exception
from astropy.modeling import models
from astropy.modeling.core import Fittable1DModel, Fittable2DModel
from astropy... | bsd-3-clause |
lakshayg/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py | 52 | 69800 | # 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 |
btabibian/scikit-learn | sklearn/tree/tree.py | 11 | 50091 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | bsd-3-clause |
wlamond/scikit-learn | sklearn/linear_model/sag.py | 30 | 12959 | """Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import make_dataset
from .sag_fast import sag
from ..exceptions import ConvergenceWarning
from ..utils import check_arra... | bsd-3-clause |
fatadama/estimation | challenge_problem/trials_bifurcation/ukf_trials.py | 1 | 6860 | """@package ukf_trials
loads data, passes through UKF
"""
import numpy as np
import math
import matplotlib.pyplot as plt
import sys
import time
import scipy.stats as stats
sys.path.append('../')
import cp_dynamics
sys.path.append('../../filters/python/ukf')
import ukf
sys.path.append('../sim_data')
import generate_... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.