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 |
|---|---|---|---|---|---|
moutai/scikit-learn | sklearn/manifold/t_sne.py | 22 | 34890 | # Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de>
# Author: Christopher Moody <chrisemoody@gmail.com>
# Author: Nick Travers <nickt@squareup.com>
# License: BSD 3 clause (C) 2014
# This is the exact and Barnes-Hut t-SNE implementation. There are other
# modifications of the algorithm:
# * Fast Optimi... | bsd-3-clause |
chenyyx/scikit-learn-doc-zh | examples/en/plot_multioutput_face_completion.py | 79 | 2986 | """
==============================================
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... | gpl-3.0 |
singleswitch/ticker | experiments/simulations/click_distr_disp.py | 1 | 15631 |
import pylab as p
import numpy as np
import sys
sys.path.append('../../')
sys.path.append('../')
from scipy.misc import factorial
from utils import Utils, DispSettings
import time
import matplotlib._cntr as cntr
import numpy.ma as ma
from click_distr import ClickDistribution
import scipy.stats.distributions as sd
fr... | mit |
trankmichael/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 |
adam-rabinowitz/ngs_analysis | gene_ontology/flyabse_go.py | 2 | 8249 | import collections
import gzip
def paragraph_generator(
path
):
# Create output variable
paragraph = []
# Open input file and loop through file
if path.endswith('.gz'):
openfunc = gzip.open
else:
openfunc = open
with openfunc(path) as infile:
for line in infi... | gpl-2.0 |
aflaxman/scikit-learn | sklearn/tests/test_metaestimators.py | 30 | 5040 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.utils.validation import... | bsd-3-clause |
mikelum/pyspeckit | pyspeckit/wrappers/fith2co.py | 2 | 6750 | """
===================
H2CO fitter wrapper
===================
Wrapper to fit formaldehyde spectra.
"""
from __future__ import print_function
from .. import spectrum
from ..spectrum import units
from matplotlib import pyplot
import copy
from astropy import units as u
from astropy.extern.six import iteritems
title_di... | mit |
Arn-O/kadenze-deep-creative-apps | session-5/libs/gif.py | 8 | 1801 | """Utility for creating a GIF.
Creative Applications of Deep Learning w/ Tensorflow.
Kadenze, Inc.
Copyright Parag K. Mital, June 2016.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def build_gif(imgs, interval=0.1, dpi=72,
save_gif=True, saveto='animat... | apache-2.0 |
ucd-cws/arcproject-wq-processing | arcproject/scripts/tests/test_gain_unittest.py | 1 | 2783 | import os
import unittest
from datetime import datetime
from arcproject.scripts import wq_gain
from arcproject.scripts import wqt_timestamp_match
import pandas
from pandas.util.testing import assert_frame_equal
base_path = os.path.split(os.path.abspath(__file__))[0]
class LoadGainWQ(unittest.TestCase):
def setUp(se... | mit |
thientu/scikit-learn | examples/gaussian_process/gp_diabetes_dataset.py | 223 | 1976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
========================================================================
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
========================================================================
In this example, we fit a Gaussian Process model onto... | bsd-3-clause |
brguez/TEIBA | src/python/germlineSrcElements_activityRate.py | 1 | 5501 | #!/usr/bin/env python
#coding: utf-8
#### FUNCTIONS ####
def header(string):
"""
Display header
"""
timeInfo = time.strftime("%Y-%m-%d %H:%M")
print '\n', timeInfo, "****", string, "****"
def subHeader(string):
"""
Display subheader
"""
timeInfo = time.strftime("%Y-%m-%... | gpl-3.0 |
mengyun1993/RNN-binary | rnn09.py | 1 | 27063 | """ Vanilla RNN
@author Graham Taylor
"""
import numpy as np
import theano
import theano.tensor as T
from sklearn.base import BaseEstimator
import logging
import time
import os
import datetime
import pickle as pickle
import math
import matplotlib.pyplot as plt
plt.ion()
mode = theano.Mode(linker='cvm')
#mode = '... | bsd-3-clause |
dymkowsk/mantid | scripts/HFIRPowderReduction/MplFigureCanvas.py | 3 | 19362 | #pylint: disable=invalid-name,too-many-public-methods,too-many-arguments,non-parent-init-called, too-many-branches
from __future__ import (absolute_import, division, print_function)
import os
import numpy as np
from PyQt4 import QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
fr... | gpl-3.0 |
cerrno/neurokernel | tests/test_pattern.py | 1 | 46030 | #!/usr/bin/env python
from unittest import main, TestCase
import numpy as np
import pandas as pd
import networkx as nx
from pandas.util.testing import assert_frame_equal, assert_index_equal, \
assert_series_equal
from neurokernel.pattern import Interface, Pattern
class test_interface(TestCase):
def setUp(se... | bsd-3-clause |
liyu1990/sklearn | doc/sphinxext/gen_rst.py | 106 | 40198 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
friedrichromstedt/matplotlayers | matplotlayers/backends/tk/figure_settings.py | 1 | 6205 | # Copyright (c) 2010 Friedrich Romstedt <friedrichromstedt@gmail.com>
# See also <www.friedrichromstedt.org> (if e-mail has changed)
#
# 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... | mit |
untom/scikit-learn | examples/manifold/plot_lle_digits.py | 181 | 8510 | """
=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================
An illustration of various embeddings on the digits dataset.
The RandomTreesEmbed... | bsd-3-clause |
cchio/deep-pwning | dpwn/utils/utils.py | 2 | 12261 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import errno
import gzip
import random
import tarfile
from six.moves import urllib
from six.moves import xrange
import numpy as np
import tensorflow as tf
import matplotlib
# Circumvent e... | mit |
aalto-trafficsense/regular-routes-server | pyfiles/prediction/pred_utils.py | 1 | 3224 | from numpy import *
from .FF import FF
def cdistance2metres(p1,p2):
from geopy.distance import vincenty
return vincenty(p1, p2).meters
def do_cluster(X, N_clusters=10):
"""
CLUSTERING: Create N_clusters clusters from the data
----------------------------------------
"""
from skl... | mit |
marl/jams | jams/display.py | 1 | 6670 | #!/usr/bin/env python
r'''
Display
-------
.. autosummary::
:toctree: generated/
display
display_multi
'''
from collections import OrderedDict
import json
import re
import six
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText
import mir_eval.display
fro... | isc |
mne-tools/mne-python | tutorials/epochs/50_epochs_to_data_frame.py | 10 | 6955 | """
.. _tut-epochs-dataframe:
Exporting Epochs to Pandas DataFrames
=====================================
This tutorial shows how to export the data in :class:`~mne.Epochs` objects to a
:class:`Pandas DataFrame <pandas.DataFrame>`, and applies a typical Pandas
:doc:`split-apply-combine <pandas:user_guide/groupby>` wo... | bsd-3-clause |
jkarnows/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
trankmichael/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 |
followyourheart/airflow | airflow/hooks/presto_hook.py | 37 | 2626 | from builtins import str
from pyhive import presto
from pyhive.exc import DatabaseError
from airflow.hooks.dbapi_hook import DbApiHook
import logging
logging.getLogger("pyhive").setLevel(logging.INFO)
class PrestoException(Exception):
pass
class PrestoHook(DbApiHook):
"""
Interact with Presto through ... | apache-2.0 |
DSLituiev/scikit-learn | sklearn/tests/test_random_projection.py | 141 | 14040 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
tionn/holo-at-on | code/get.py | 1 | 1360 | # -*- coding: utf-8 -*-
import os
import io
import urllib2
import string
from BeautifulSoup import BeautifulSoup
import pandas as pd
import sys
city_url = 'http://twblg.dict.edu.tw/holodict_new/index/xiangzhen_level1.jsp?county=1'
def extract_items(base_url):
html = urllib2.urlopen(base_url).read()
... | cc0-1.0 |
kaiserroll14/301finalproject | main/pandas/io/tests/test_data.py | 9 | 20115 | from __future__ import print_function
from pandas import compat
import warnings
import nose
from nose.tools import assert_equal
from datetime import datetime
import os
import numpy as np
import pandas as pd
from pandas import DataFrame, Timestamp
from pandas.util.testing import (assert_series_equal, assert_produces_wa... | gpl-3.0 |
mikelum/pyspeckit | pyspeckit/spectrum/fitters.py | 1 | 88070 | from __future__ import print_function
import matplotlib
import numpy as np
import copy
import re
import itertools
from astropy import log
from astropy import units as u
from astropy.extern.six.moves import xrange
from ..config import mycfg
from ..config import ConfigDescriptor as cfgdec
from . import units
from . impo... | mit |
vipmunot/Data-Analysis-using-Python | Storytelling Data Visualization/Visualizing Geographic Data-223.py | 1 | 2587 | ## 1. Geographic Data ##
import pandas as pd
airlines = pd.read_csv('airlines.csv')
airports = pd.read_csv('airports.csv')
routes = pd.read_csv('routes.csv')
print(airlines.iloc[0])
print(airports.iloc[0])
print(routes.iloc[0])
#What's the best way to link the data from these 3 different datasets together?
# We can li... | mit |
jaidevd/faciendum | dataprep.py | 1 | 4969 | # coding: utf-8
with open("sitting_judges.txt", "r") as fin:
data = fin.readlines()
data = [l.lstrip().rstrip() for l in data]
data = [l for l in data if l]
data[0]
data[1]
data[2]
data[3]
data[4]
data[5]
data[:-1:5]
ix = list(map(int, data[:-1:5]))
ix
data[1:-1:5]
names = _
data[2:-1:5]
get_ipython().magic('c... | mit |
waynenilsen/statsmodels | statsmodels/tools/data.py | 23 | 3369 | """
Compatibility tools for various data structure inputs
"""
from statsmodels.compat.python import range
import numpy as np
import pandas as pd
def _check_period_index(x, freq="M"):
from pandas import PeriodIndex, DatetimeIndex
if not isinstance(x.index, (DatetimeIndex, PeriodIndex)):
raise ValueErro... | bsd-3-clause |
anaviltripathi/pgmpy | pgmpy/tests/test_models/test_MarkovChain.py | 2 | 10974 | #!/usr/bin/env python3
import sys
import unittest
from pandas import DataFrame
from mock import patch, call
from pgmpy.factors import State
from pgmpy.models import MarkovChain as MC
from pgmpy.extern.six.moves import range, zip
class TestMarkovChain(unittest.TestCase):
def setUp(self):
self.variables =... | mit |
Pyomo/PyomoGallery | network_interdiction/max_flow/max_flow_interdict.py | 1 | 7939 | import pandas
import pyomo
import pyomo.opt
import pyomo.environ as pe
import logging
class MaxFlowInterdiction:
"""A class to compute max-flow interdictions."""
def __init__(self, nodefile, arcfile, attacks=0):
"""
All the files are CSVs with columns described below. Attacks is the number of... | bsd-2-clause |
mirams/PyHillFit | python/PyHillFit.py | 1 | 42057 | import matplotlib
"""I have found that these two lines are needed on *some* computers to prevent matplotlib figure windows from opening.
In general, I save the figures but do not actually open the matplotlib figure windows.
Try uncommenting this line if annoying unwanted figure windows open."""
matplotlib.use('Agg')
i... | bsd-3-clause |
liyatanggithub/futures | python/cal2.py | 1 | 2312 | #!/usr/bin/python
import string
import time
import matplotlib.pyplot as plt
FileName = raw_input("Please enter file name : ")
f = open(FileName, "r")
dataMat = [0]
Vertex = [[0],[0],[0]]
Aaa = 0
Bbb = 0
Ccc = 0
xMax = 10
yMin = 10000
yMax = 0
while True:
s=f.readline()
if s == "... | gpl-2.0 |
B3AU/waveTree | sklearn/neighbors/graph.py | 10 | 2847 | """Nearest Neighbors graph functions"""
# Author: Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause (C) INRIA, University of Amsterdam
from .base import KNeighborsMixin, RadiusNeighborsMixin
from .unsupervised import NearestNeighbors
def kneighbors_graph(X, n_neighbors, mode='connectivity'... | bsd-3-clause |
lazywei/scikit-learn | sklearn/tests/test_qda.py | 155 | 3481 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ignore_war... | bsd-3-clause |
mkomeichi/BuildingMLSystemsWithPython | ch02/seeds_knn_increasing_k.py | 24 | 1437 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
# Basic imports
from __future__ import print_function
import numpy as np
from matplotlib import pyplot ... | mit |
CCI-Tools/ect-core | cate/ops/plot_helpers.py | 2 | 11149 | # The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# 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 wi... | mit |
bkendzior/scipy | scipy/interpolate/fitpack2.py | 7 | 61855 | """
fitpack --- curve and surface fitting with splines
fitpack is based on a collection of Fortran routines DIERCKX
by P. Dierckx (see http://www.netlib.org/dierckx/) transformed
to double routines by Pearu Peterson.
"""
# Created by Pearu Peterson, June,August 2003
from __future__ import division, print_function, abs... | bsd-3-clause |
sangwook236/general-development-and-testing | sw_dev/python/rnd/test/probabilistic_graphical_model/gpflow/gpflow_bayesian_gplvm.py | 2 | 2398 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import numpy as np
#import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pods
import gpflow
from gpflow import kernels
#%matplotlib inline
# REF [site] >> https://gpflow.readthedocs.io/en/latest/notebooks/GPLVM.html
def bayesian_gplv... | gpl-2.0 |
marvinbernhardt/gromacstools | gromacstools/xvg.py | 1 | 3433 | import shlex
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from io import StringIO
def plot_data_header(data, header):
"""plots data and header. Does not work with all grace features!"""
data = np.array(data)
if header['type'].lower() == 'xy':
plt.figure(figsize=(10, 3))
... | gpl-3.0 |
eickenberg/scikit-learn | sklearn/ensemble/gradient_boosting.py | 1 | 55769 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
tom-klotz/ellipsoid-solvation | src/examples/ex1plot.py | 1 | 1520 | from numpy import *
from time import *
import numpy.random as rnd
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.patches import Ellipse
# First column should be ellipsoidal inside (converging)
# Second column should be spherical inside (diverging)
# T... | bsd-2-clause |
yuanagain/seniorthesis | venv/lib/python2.7/site-packages/matplotlib/tests/test_skew.py | 7 | 6965 | """
Testing that skewed axes properly work
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
from matplotlib.externals import six
from nose.tools import assert_true
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.testin... | mit |
ericdill/xray-vision | xray_vision/messenger/mpl/__init__.py | 6 | 5498 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | bsd-3-clause |
criffy/aflengine | analysis/misc/supercoach_regression.py | 1 | 2453 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 8 16:01:24 2018
@author: chrisstrods
"""
from scipy import stats
import numpy as np
import pandas as pd
from os.path import dirname, abspath
import matplotlib.pyplot as plt
d = dirname(dirname(abspath('__file__')))
matches = pd.read_csv(d + "/out... | gpl-3.0 |
immerrr/numpy | numpy/fft/fftpack.py | 2 | 41432 | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
rfft(a, n=None, axis=-1)
irfft(a, n=None, axis=-1)
hfft(a, n=None, axis=-1)
ihfft(a, n=None, axis=-1)
fftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
rfftn(a, s=None, axes=None)
irfftn(a, s=None, axes=None... | bsd-3-clause |
vibhatha/digitalocean_6 | scripts/kmeans_device_clustering.py | 11 | 4139 | import time
import readX1
import readY1
import writeX1
import writeY1
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import MiniBatchKMeans, KMeans
from sklearn.metrics.pairwise import pairwise_distances_argmin
from sklearn.datasets.samples_generator import make_blobs
########################... | mit |
catherinezucker/radfil | radfil/plot.py | 1 | 10924 | import numpy as np
import numbers
import matplotlib.colors as colors
import matplotlib.pyplot as plt
from astropy.wcs import WCS
from . import styles
def plotCuts(radobj, ax):
if hasattr(radobj, 'dictionary_cuts'):
dictionary_cuts = radobj.dictionary_cuts.copy()
else:
raise ValueError('Please... | gpl-3.0 |
suriyan/ethnicolr | ethnicolr/pred_fl_reg_name_five_cat.py | 1 | 4626 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import numpy as np
import pandas as pd
from keras.models import load_model
from keras.preprocessing import sequence
from pkg_resources import resource_filename
from .utils import column_exists, find_ngrams, fixup_columns
MODELFN = "models/fl_v... | mit |
aiguofer/bokeh | bokeh/core/compat/mplexporter/renderers/base.py | 16 | 14360 | import warnings
import itertools
from contextlib import contextmanager
import numpy as np
from matplotlib import transforms
from .. import utils
from .. import _py3k_compat as py3k
class Renderer(object):
@staticmethod
def ax_zoomable(ax):
return bool(ax and ax.get_navigate())
@staticmethod
... | bsd-3-clause |
evgchz/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 30 | 1812 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
schreiberx/sweet | benchmarks_sphere/paper_jrn_sl_exp/test_compare_wt_dt_vs_accuracy_galewsky_M256_6hours_l_n_vd/postprocessing_consolidate_prog_phi_pert.py | 8 | 6291 | #! /usr/bin/env python3
import sys
import math
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.timestepping_method'... | mit |
simongibbons/numpy | numpy/lib/npyio.py | 3 | 87121 | import sys
import os
import re
import functools
import itertools
import warnings
import weakref
import contextlib
from operator import itemgetter, index as opindex
from collections.abc import Mapping
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core import overrides
from numpy... | bsd-3-clause |
AnasGhrab/scikit-learn | examples/linear_model/plot_sgd_iris.py | 286 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
shaneknapp/spark | python/pyspark/pandas/tests/test_sql.py | 15 | 1979 | #
# 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 |
tatarbrot/foraging | world.py | 1 | 4635 | #!/usr/bin/env python
# import project classes
from food import *
from hive import *
from hive_com import *
# import other classes
from random import random as rand
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as cl
import matplotlib.cm as cm
from math import log
class World:
def _... | gpl-3.0 |
RachitKansal/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 230 | 4762 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
pligor/predicting-future-product-prices | 04_time_series_prediction/models/model_36_price_history_autoencoder.py | 1 | 25364 | from __future__ import division
import numpy as np
import tensorflow as tf
from cost_functions.huber_loss import huber_loss
from data_providers.data_provider_33_price_history_autoencoder import PriceHistoryAutoEncDataProvider
from interfaces.neural_net_model_interface import NeuralNetModelInterface
from mylibs.batch_n... | agpl-3.0 |
abhisg/scikit-learn | examples/decomposition/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... | bsd-3-clause |
aajtodd/zipline | zipline/finance/risk/cumulative.py | 17 | 17736 | #
# Copyright 2014 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 |
dsullivan7/scikit-learn | sklearn/learning_curve.py | 13 | 13351 | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import _check_cv
from .externals.joblib import Parallel, delayed
fr... | bsd-3-clause |
hhj0325/pystock | com/hhj/baihuabigdata/demo8.py | 1 | 1943 | """
page
222
225
226
227
"""
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.neighbors.nearest_centroid import NearestCentroid
from sklearn.naive_bayes import Multinomia... | apache-2.0 |
mattgiguere/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
rohit21122012/DCASE2013 | runs/2016/dnn2016med_antimfcc/src/evaluation.py | 56 | 43426 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import numpy
import sys
from sklearn import metrics
class DCASE2016_SceneClassification_Metrics():
"""DCASE 2016 scene classification metrics
Examples
--------
>>> dcase2016_scene_metric = DCASE2016_SceneClassification_Metrics(class_lis... | mit |
aflaxman/scikit-learn | examples/model_selection/plot_nested_cross_validation_iris.py | 46 | 4415 | """
=========================================
Nested versus non-nested cross-validation
=========================================
This example compares non-nested and nested cross-validation strategies on a
classifier of the iris data set. Nested cross-validation (CV) is often used to
train a model in which hyperparam... | bsd-3-clause |
danielecook/markdown-table-alfred | tabulate.py | 16 | 39088 | # -*- coding: utf-8 -*-
"""Pretty-print tabular data."""
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
from platform import python_version_tuple
import re
if python_version_tuple()[0] < "3":
from itertools import izip_longest
from functools ... | mit |
BryanCutler/spark | python/pyspark/pandas/plot/core.py | 1 | 41726 | #
# 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 |
MohammedWasim/scikit-learn | sklearn/utils/tests/test_extmath.py | 70 | 16531 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis Engemann <d.engemann@fz-juelich.de>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from scipy import stats
from sklearn.utils.testing import assert_eq... | bsd-3-clause |
marinkaz/orange3 | Orange/classification/mlp.py | 5 | 8444 | import numpy as np
from scipy.optimize import fmin_l_bfgs_b
from Orange.classification import Learner, Model
__all__ = ["MLPLearner"]
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
class MLPLearner(Learner):
"""Multilayer perceptron (feedforward neural network)
This model uses stochastic gradient de... | bsd-2-clause |
Saurabh7/shogun | examples/undocumented/python_modular/graphical/regression_gaussian_process_demo.py | 16 | 9323 | ###########################################################################
# Mean prediction from Gaussian Processes based on
# classifier_libsvm_minimal_modular.py
# plotting functions have been adapted from the pyGP library
# https://github.com/jameshensman/pyGP
######################################################... | mit |
mday299/MAVProxy | setup.py | 2 | 2663 | from setuptools import setup
version = "1.5.1"
setup(name='MAVProxy',
version=version,
zip_safe=True,
description='MAVProxy MAVLink ground station',
long_description='''A MAVLink protocol proxy and ground station. MAVProxy
is oriented towards command line operation, and is suitable for embeddi... | gpl-3.0 |
zephinzer/cs4243 | mac.lucaskanade.py | 1 | 2500 | #!/usr/bin/python
### Lucas Kanade
### dependencies
import os, sys
# may need to remove for windows systems
sys.path.append('/usr/local/lib/python2.7/site-packages')
import cv2, numpy as np
from matplotlib import pyplot
from macclickscaptor import ClicksCaptor
cap = cv2.VideoCapture('input-no-bg.avi');
cap2 = cv2.Vid... | mit |
jgliss/pyplis | pyplis/plumebackground.py | 1 | 48893 | # -*- coding: utf-8 -*-
#
# Pyplis is a Python library for the analysis of UV SO2 camera data
# Copyright (C) 2017 Jonas Gliss (jonasgliss@gmail.com)
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License a
# published by the Free Software Foundat... | gpl-3.0 |
russel1237/scikit-learn | examples/linear_model/plot_logistic_path.py | 349 | 1195 | #!/usr/bin/env python
"""
=================================
Path with L1- Logistic Regression
=================================
Computes path on IRIS dataset.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from datetime import datetime
import numpy as np
import... | bsd-3-clause |
cfei18/incubator-airflow | airflow/contrib/operators/hive_to_dynamodb.py | 21 | 4084 | # -*- 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 |
CVML/scikit-learn | examples/decomposition/plot_sparse_coding.py | 247 | 3846 | """
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... | bsd-3-clause |
mbayon/TFG-MachineLearning | DGS-Lirios/dgs-lirios-v0.py | 1 | 1867 | import numpy as np
import random
# m denotes the number of examples here, not the number of features
def gradientDescent(x, y, theta, alpha, m, numIterations):
xTrans = x.transpose()
for i in range(0, numIterations):
hypothesis = np.dot(x, theta) #dot() Dot product of two arrays
loss = hypothes... | mit |
winklerand/pandas | pandas/tests/test_base.py | 1 | 43469 | # -*- coding: utf-8 -*-
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import pytest
import numpy as np
import pandas as pd
import pandas.compat as compat
from pandas.core.dtypes.common import (
is_object_dtype, is_datetimetz,
needs_i8_conversion)
import pa... | bsd-3-clause |
astro-informatics/s2let | src/main/python/pys2let_test_directional.py | 1 | 4306 |
import healpy as hp
from pys2let import *
import math
import matplotlib.pyplot as plt
nside = 64
L = 128
J_min = 1
B = 3
N = 3 # Number of directions
spin = 0 # are we dealing with spin signals? set to 0 for temperature. if non-zero, plotting routines must be changed!
upsample = 1 # 1 means all scales at full resolut... | gpl-2.0 |
jbloom/phyloExpCM | src/plot.py | 1 | 12165 | """Module for making plots with *matplotlib*.
Written by Jesse Bloom.
Dependencies
----------------
This module requires:
* *matplotlib*
Functions defined in this module
-----------------------------------
* *PlotLogLvsNParams* : plots log likelihood versus number of parameters.
* *PlotYearVersusDistance* : plo... | gpl-3.0 |
dcherian/tools | ROMS/pmacc/tools/post_tools/rompy/trunk/rompy/plot_utils.py | 1 | 24251 | import datetime as dt
import time
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.axes import Axes
from matplotlib.colors import Normalize, ListedColormap, LinearSegmentedColormap, hsv_to_rgb
from matplotlib.cm import ScalarMappable
from ... | mit |
antoinecarme/pyaf | tests/multi_dimensional_engine/test_multi_dimensional_ozone.py | 1 | 1522 | from __future__ import absolute_import
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone()
df = b1.mPastData
#df.tail(10)
#df[:-10].tail()
#df[:-10:-1]
#df.describe()
lEngine = autof.cForecastEngine()
lEngine
H = b1.mHorizon;
d... | bsd-3-clause |
Icenowy/MissionPlanner | Lib/site-packages/numpy/lib/function_base.py | 53 | 108301 | __docformat__ = "restructuredtext en"
__all__ = ['select', 'piecewise', 'trim_zeros', 'copy', 'iterable',
'percentile', 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex',
'disp', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax',
'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'av... | gpl-3.0 |
lcy-seso/models | fluid/adversarial/tutorials/mnist_tutorial_fgsm.py | 2 | 4395 | """
FGSM tutorial on mnist using advbox tool.
FGSM method is non-targeted attack while FGSMT is targeted attack.
"""
import sys
sys.path.append("..")
import matplotlib.pyplot as plt
import numpy as np
import paddle.fluid as fluid
import paddle.v2 as paddle
from advbox.adversary import Adversary
from advbox.attacks.gr... | apache-2.0 |
devanshdalal/scikit-learn | benchmarks/bench_plot_lasso_path.py | 84 | 4005 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
annahs/atmos_research | RH_and_T_toluene_SOM_individ_cities.py | 1 | 9432 | import matplotlib.pyplot as plt
import numpy as np
from matplotlib import dates
from matplotlib import patches
import os
import pickle
from datetime import datetime
import time
from pprint import pprint
import sys
from datetime import timedelta
from mpl_toolkits.basemap import Basemap
night_start_time = 17
night_end_t... | mit |
mrshu/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 2 | 2021 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
RPGOne/Skynet | scikit-learn-0.18.1/examples/preprocessing/plot_function_transformer.py | 158 | 1993 | """
=========================================================
Using FunctionTransformer to select columns
=========================================================
Shows how to use a function transformer in a pipeline. If you know your
dataset's first principle component is irrelevant for a classification task,
you ca... | bsd-3-clause |
victorbergelin/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 222 | 3055 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
rajat1994/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 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/matplotlib/backends/backend_pdf.py | 2 | 89782 | # -*- coding: iso-8859-1 -*-
"""
A PDF matplotlib backend
Author: Jouni K Seppänen <jks@iki.fi>
"""
from __future__ import division, print_function
import codecs
import os
import re
import sys
import time
import warnings
import zlib
import numpy as np
if sys.version_info[0] >= 3:
from io import BytesIO
else:
... | mit |
aflaxman/scikit-learn | examples/mixture/plot_concentration_prior.py | 21 | 5695 | """
========================================================================
Concentration Prior Type Analysis of Variation Bayesian Gaussian Mixture
========================================================================
This example plots the ellipsoids obtained from a toy dataset (mixture of three
Gaussians) fitte... | bsd-3-clause |
intuition-io/intuition | tests/core/test_engine.py | 1 | 5491 | '''
Tests for intuition.core.engine
'''
import unittest
from nose.tools import raises, ok_, eq_, nottest
import pytz
import datetime as dt
import pandas as pd
import dna.errors
#from zipline.data.benchmarks import BenchmarkDataNotFoundError
import intuition.core.engine as engine
from intuition.errors import InvalidEng... | apache-2.0 |
pkruskal/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 157 | 13799 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... | bsd-3-clause |
victor-prado/broker-manager | broker-manager/Data.py | 1 | 3198 | import pandas as pd
import numpy as np
class Data():
"Class for manage the data base"
client_table = pd.read_csv('./DataBase/client.csv').set_index('id')
corporation_table = pd.read_csv('./DataBase/corporation.csv').set_index('id')
contract_table = pd.read_csv('./DataBase/contract.csv').set_index('i... | mit |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pandas/core/panel.py | 7 | 55818 | """
Contains data structures designed for manipulating panel (3-dimensional) data
"""
# pylint: disable=E1103,W0231,W0212,W0621
from __future__ import division
import numpy as np
import warnings
from pandas.core.dtypes.cast import (
infer_dtype_from_scalar,
maybe_cast_item)
from pandas.core.dtypes.common impor... | mit |
hrjn/scikit-learn | sklearn/tests/test_isotonic.py | 34 | 14159 | import warnings
import numpy as np
import pickle
import copy
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert... | bsd-3-clause |
MRSG-MRA/MRA | examples/analise/count_elements-alt.py | 4 | 4410 | #!/usr/bin/python
import sys
import matplotlib.pyplot as plt; plt.rcdefaults()
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)
plt.rcParams.update({'font.size': 12})
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mpl... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.