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
morganics/bayesianpy
bayesianpy/reader.py
1
7533
from bayesianpy.jni import bayesServer from bayesianpy.jni import jp import pandas as pd import dask.dataframe as dd import numpy as np from typing import List import asyncio import logging class Creatable: def create(self): pass class CreatableWithDf: def create(self, df:pd.DataFrame): pass ...
apache-2.0
TuKo/brainiak
brainiak/fcma/mvpa_voxelselector.py
2
4407
# Copyright 2016 Intel Corporation # # 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...
apache-2.0
mugizico/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
230
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
JT5D/scikit-learn
examples/ensemble/plot_adaboost_multiclass.py
7
3621
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
bsd-3-clause
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/core/computation/ops.py
15
15900
"""Operator classes for eval. """ import operator as op from functools import partial from datetime import datetime import numpy as np from pandas.core.dtypes.common import is_list_like, is_scalar import pandas as pd from pandas.compat import PY3, string_types, text_type import pandas.core.common as com from pandas....
mit
tverbrug/openWEC
Run/openWEC_WS.py
1
76610
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'openWECv2.ui' # # Created: Wed May 06 10:39:04 2015 # by: PyQt4 UI code generator 4.9.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui from matplotlib.backends import qt_compat from matplotlib...
gpl-3.0
AnasGhrab/scikit-learn
sklearn/ensemble/partial_dependence.py
251
15097
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
bsd-3-clause
paris-saclay-cds/ramp-workflow
rampwf/utils/scoring.py
1
5037
# coding: utf-8 """ Scoring utilities """ import numpy as np import pandas as pd from .pretty_print import IS_COLOR_TERM from .pretty_print import print_warning def reorder_df_scores(df_scores, score_types): """Reorder scores according to the order in score_types. Parameters ---------- df_scores : p...
bsd-3-clause
taotaocoule/stock
spider/data/stock_flow.py
1
3578
# 个股净流入:http://nufm.dfcfw.com/EM_Finance2014NumericApplication/JS.aspx/JS.aspx?type=ct&st=(FFRank)&sr=1&p=1&ps=10000&js=[(x)]&token=894050c76af8597a853f5b408b759f5d&cmd=C._AB&sty=DCFFITAM&rt=50602335 # 板块净流入 import urllib.request import pandas as pd import json class Stock_Flow(object): """docstring for Stoc...
mit
IntelPNI/brainiak
brainiak/factoranalysis/tfa.py
7
30560
# Copyright 2016 Intel Corporation # # 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...
apache-2.0
aewhatley/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
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/statistics/boxplot_demo.py
1
8516
""" ======== Boxplots ======== Visualizing boxplots with matplotlib. The following examples show off how to visualize boxplots with Matplotlib. There are many options to control their appearance and the statistics that they use to summarize the data. """ import matplotlib.pyplot as plt import numpy as np from matplo...
mit
hadim/spindle_tracker
spindle_tracker/tracker/cost_function/brownian.py
2
4804
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np import pandas as pd from scipy.spatial.distance import cdist from . import AbstractCostFunction from .gap_close import Abs...
bsd-3-clause
phenopolis/phenopolis
views/__init__.py
3
59475
#flask import from flask import Flask from flask import session from flask.ext.session import Session from flask import Response from flask import stream_with_context from flask import request from flask import make_response from flask import request from flask import send_file from flask import g from flask import red...
mit
ywcui1990/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/delaunay/testfuncs.py
72
20890
"""Some test functions for bivariate interpolation. Most of these have been yoinked from ACM TOMS 792. http://netlib.org/toms/792 """ import numpy as np from triangulate import Triangulation class TestData(dict): def __init__(self, *args, **kwds): dict.__init__(self, *args, **kwds) self.__dict__ ...
agpl-3.0
skuschel/postpic
examples/kspace-test-2d.py
1
9839
#!/usr/bin/env python # coding: utf-8 # In[1]: import sys def download(url, file): import urllib3 import shutil import os if os.path.isfile(file): return True try: urllib3.disable_warnings() http = urllib3.PoolManager() print('downloading {:} ...'.format(file)) ...
gpl-3.0
LiuVII/Machine_learning_and_AI
Sentiment_Analysis/cnn.py
1
7322
# Code based on source: https://github.com/dennybritz/cnn-text-classification-tf from __future__ import print_function import tensorflow as tf from tensorflow.contrib import learn import pandas as pd import numpy as np import math import time import os import datetime import data_helpers from sklearn.metrics import a...
mit
mjirik/imtools
imtools/uiThreshold.py
1
29690
# -*- coding: utf-8 -*- """ Purpose: (CZE-ZCU-FAV-KKY) Liver medical project Author: Pavel Volkovinsky, Miroslav Jirik Email: volkovinsky.pavel@gmail.com Created: 2012/11/08 Copyright: (c) Pavel Volkovinsky """ import sys sys.path.append("../src/") sys.path.append("../extern/") import loggin...
mit
googledatalab/pydatalab
tests/ml/summary_tests.py
2
3980
# Copyright 2017 Google Inc. 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 applicable law or agreed ...
apache-2.0
metatier/kaggle-titanic
KaggleAux/predict.py
6
3114
import numpy as np from pandas import DataFrame from patsy import dmatrices def get_dataframe_intersection(df, comparator1, comparator2): """ Return a dataframe with only the columns found in a comparative dataframe. Parameters ---------- comparator1: DataFrame DataFrame to preform compar...
apache-2.0
robintw/scikit-image
doc/examples/plot_line_hough_transform.py
14
4465
r""" ============================= Straight line Hough transform ============================= The Hough transform in its simplest form is a `method to detect straight lines <http://en.wikipedia.org/wiki/Hough_transform>`__. In the following example, we construct an image with a line intersection. We then use the Ho...
bsd-3-clause
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/mixture/tests/test_gmm.py
44
20880
# Important note for the deprecation cleaning of 0.20 : # All the functions and classes of this file have been deprecated in 0.18. # When you remove this file please remove the related files # - 'sklearn/mixture/dpgmm.py' # - 'sklearn/mixture/gmm.py' # - 'sklearn/mixture/test_dpgmm.py' import unittest import copy impor...
mit
sebotic/WikidataIntegrator
wikidataintegrator/wdi_core.py
1
157222
import copy import datetime import json import logging import os import re import time import warnings from collections import defaultdict from typing import List import pandas as pd import requests from pyshex import ShExEvaluator from rdflib import Graph from shexer.shaper import Shaper from wikidataintegrator.wdi_...
agpl-3.0
wilsonkichoi/zipline
zipline/protocol.py
3
4172
# # 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
cybernet14/scikit-learn
examples/svm/plot_svm_kernels.py
329
1971
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM-Kernels ========================================================= Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially useful when the data-points are not linearly sep...
bsd-3-clause
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/mpl_toolkits/mplot3d/art3d.py
8
23462
#!/usr/bin/python # art3d.py, original mplot3d version by John Porter # Parts rewritten by Reinier Heeres <reinier@heeres.eu> # Minor additions by Ben Axelrod <baxelrod@coroware.com> ''' Module containing 3D artist code and functions to convert 2D artists into 3D versions which can be added to an Axes3D. ''' from __fu...
gpl-2.0
pianomania/scikit-learn
sklearn/utils/tests/test_murmurhash.py
79
2849
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from sklearn.utils.testing import ...
bsd-3-clause
inclement/vispy
examples/basics/plotting/mpl_plot.py
14
1579
# -*- coding: utf-8 -*- # vispy: testskip # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/tests/groupby/test_function.py
1
38953
from string import ascii_lowercase import numpy as np import pytest from pandas.compat import product as cart_product from pandas.errors import UnsupportedFunctionCall import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, Timestamp, compat, date_range, isna) import pandas.core.nanops as ...
bsd-3-clause
ii0/pybrain
pybrain/tools/neuralnets.py
26
13763
# Neural network data analysis tool collection. Makes heavy use of the logging module. # Can generate training curves during the run (from properly setup IPython and/or with # TkAgg backend and interactive mode - see matplotlib documentation). __author__ = "Martin Felder" __version__ = "$Id$" from pylab import ion, fi...
bsd-3-clause
arokem/scipy
scipy/signal/_arraytools.py
2
7555
""" Functions for acting on a axis of an array. """ from __future__ import division, print_function, absolute_import import numpy as np def axis_slice(a, start=None, stop=None, step=None, axis=-1): """Take a slice along axis 'axis' from 'a'. Parameters ---------- a : numpy.ndarray The array ...
bsd-3-clause
zingale/pyro2
examples/multigrid/mg_test_vc_constant.py
1
3887
#!/usr/bin/env python3 """ Test the variable coefficient MG solver with a CONSTANT coefficient problem -- the same one from the multigrid class test. This ensures we didn't screw up the base functionality here. We solve:: u_xx + u_yy = -2[(1-6x**2)y**2(1-y**2) + (1-6y**2)x**2(1-x**2)] u = 0 on the boundary ...
bsd-3-clause
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/testing/jpl_units/StrConverter.py
23
5293
#=========================================================================== # # StrConverter # #=========================================================================== """StrConverter module containing class StrConverter.""" #=========================================================================== # Place al...
mit
russel1237/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
159
10196
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
chibbargroup/CentralRepository
FLOURescence/Source/Plotter.py
2
4165
import pandas as pd import numpy as np from os import listdir, mkdir from os.path import isfile, join, isdir, split, dirname import matplotlib.pyplot as plt #Rename the headers for all the files def Rename_Spectra_Labels (spectra_dir, header_file): print("Working...one moment please") header = pd.read_csv(header_fil...
mit
DmitryOdinoky/sms-tools
lectures/07-Sinusoidal-plus-residual-model/plots-code/LPC.py
24
1191
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, triang, blackmanharris, resample import math import sys, os, time from scipy.fftpack import fft, ifft import essentia.standard as ess sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../softwar...
agpl-3.0
ecatkins/data
us-weather-history/visualize_weather.py
36
4799
import matplotlib.pyplot as plt import pandas as pd from datetime import datetime ''' This is an example to generate the Philadelphia, PA weather chart. If you want to make the chart for another city, you will have to modify this code slightly to read that city's data in, change the title, and likely change the y-axi...
mit
michelrobijns/vortexpanelmethod
vpm.py
1
5903
#!/usr/bin/python3 """ vpm.py Created: 12/28/2014 Author: Michel Robijns This file is part of vortexpanelmethod which is released under the MIT license. See the file LICENSE or go to http://opensource.org/licenses/MIT for full license details. TODO: Add description """ from math import * import numpy as np import ...
mit
stylianos-kampakis/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
jonyroda97/redbot-amigosprovaveis
lib/matplotlib/axis.py
2
85455
""" Classes for the ticks and x and y axis """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib import rcParams import matplotlib.artist as artist from matplotlib.artist import allow_rasterization import matplotlib.cbook as cbook f...
gpl-3.0
rseubert/scikit-learn
sklearn/manifold/isomap.py
36
7119
"""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
akshayparopkari/phylotoast
bin/core_overlap_plot.py
2
11734
#!/usr/bin/env python # coding: utf-8 """ Given a set of core microbiome files, create a matching set of ovelapping barplots that visualize which species belong to each core microbiome. """ from __future__ import absolute_import, division, print_function import ast import argparse from collections import Counter, Orde...
mit
pochoi/SHTOOLS
examples/python/ClassInterface/WindowExample.py
2
1379
#!/usr/bin/env python """ This script tests the python class interface """ from __future__ import division from __future__ import print_function # standard imports: import os import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt # import shtools: sys.path.append(os.path.join(os.path....
bsd-3-clause
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/sklearn/preprocessing.py
2
29089
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD from collections import Sequence import numpy as np import scipy.sparse as sp from .utils import check_arrays, array2d from .utils import wa...
agpl-3.0
fyffyt/scikit-learn
examples/linear_model/plot_ols.py
220
1940
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
thouska/spotpy
spotpy/examples/dds/__init__.py
10
1478
# -*- coding: utf-8 -*- ''' Copyright (c) 2015 by Tobias Houska This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: Tobias Houska :paper: Houska, T., Kraft, P., Chamorro-Chavez, A. and Breuer, L.: SPOTting Model Parameters Using a Ready-Made Python Package, PLoS ONE, 10(12), e0145180, doi:...
mit
tkerola/chainer
examples/glance/glance.py
8
2876
# Note for contributors: # This example code is referred to from "Chainer at a Glance" tutorial. # If this file is to be modified, please also update the line numbers in # `docs/source/glance.rst` accordingly. import chainer as ch from chainer import datasets import chainer.functions as F import chainer.links as L fro...
mit
ibm-cds-labs/pixiedust
pixiedust/display/app/pixieapp.py
1
22966
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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/licens...
apache-2.0
0x0all/nupic
examples/opf/tools/sp_plotter.py
8
15763
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
gpl-3.0
BanditCat/tfstocks
emnist.py
1
10133
#antialias graph import getsdata DIM = getsdata.DIM TRAIN_DIR = "/home/banditcat/tfmuse/train/" TRAIN_FILE = "t" STOCK_DIR = getsdata.STOCK_DIR PATCH_SIZE = 5 L1_FEATURES = 32 L2_FEATURES = 64 DENSE_FEATURES = 1024 BATCH_SIZE = 50 STEPS = 15 NUM_STOCKS = 3 GOOD_TICKER_THRESHHOLD = 0 BAD_TICKER_THRESHHOLD = -1 POINT...
apache-2.0
bnaul/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
23
1223
""" ========================================= 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
benoitsteiner/tensorflow-opencl
tensorflow/examples/learn/text_classification.py
8
6685
# 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
lbishal/scikit-learn
sklearn/metrics/tests/test_regression.py
272
6066
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
daniestevez/jupyter_notebooks
dslwp/demtrack.py
1
7938
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import xarray from astropy.time import Time import astropy.io import pymap3d import datetime from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() # Digital elevation model (DEM) available at http://pds-ge...
gpl-3.0
blink1073/scikit-image
doc/examples/edges/plot_contours.py
30
1247
""" =============== Contour finding =============== ``skimage.measure.find_contours`` uses a marching squares method to find constant valued contours in an image. Array values are linearly interpolated to provide better precision of the output contours. Contours which intersect the image edge are open; all others ar...
bsd-3-clause
Horta/limix
limix/stats/_pca.py
1
1401
# TODO: normalise this documentation def pca(X, ncomp): r"""Principal component analysis. Parameters ---------- X : array_like Data. ncomp : int Number of components. Returns ------- dict - **components** (*array_like*): first components ordered by exp...
apache-2.0
swharden/SWHLab
doc/uses/EPSCs-and-IPSCs/smooth histogram method/10.py
1
3441
""" MOST OF THIS CODE IS NOT USED ITS COPY/PASTED AND LEFT HERE FOR CONVENIENCE """ import os import sys # in case our module isn't installed (running from this folder) if not os.path.abspath('../../../') in sys.path: sys.path.append('../../../') # helps spyder get docs import swhlab import swhlab.common as cm i...
mit
dlebauer/plantcv
lib/plantcv/fluor_fvfm.py
1
6264
### Fluorescence Analysis import os import cv2 import numpy as np import matplotlib #if not os.getenv('DISPLAY'): # matplotlib.use('Agg') from matplotlib import pyplot as plt from matplotlib import cm as cm from matplotlib import colors as colors from matplotlib import colorbar as colorbar import pylab as pl from . i...
gpl-2.0
alexanian/uwaterloo-igem-2015
models/targeting/genome_simulation.py
4
8108
import datetime import matplotlib.pyplot as plt import os import random import make_video from genome_csv import results_to_csv, csv_to_dict, map_genome_events, map_target_events from genome_plot import genome_plot_polar, plot_states from init_genome_camv import init_genome_camv, init_targets_all_domains, init_targets...
mit
idlead/scikit-learn
examples/ensemble/plot_gradient_boosting_quantile.py
392
2114
""" ===================================================== Prediction Intervals for Gradient Boosting Regression ===================================================== This example shows how quantile regression can be used to create prediction intervals. """ import numpy as np import matplotlib.pyplot as plt from skle...
bsd-3-clause
arabenjamin/scikit-learn
sklearn/semi_supervised/label_propagation.py
128
15312
# coding=utf8 """ Label propagation in the context of this module refers to a set of semisupervised classification algorithms. In the high level, these algorithms work by forming a fully-connected graph between all points given and solving for the steady-state distribution of labels at each point. These algorithms per...
bsd-3-clause
olologin/scikit-learn
benchmarks/bench_mnist.py
44
6801
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
gfyoung/pandas
pandas/core/dtypes/base.py
1
13214
""" Extend pandas with custom array types. """ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type, Union import numpy as np from pandas._typing import DtypeObj from pandas.errors import AbstractMethodError from pandas.core.dtypes.generic import ABCDataFrame, ABCIn...
bsd-3-clause
gfyoung/pandas
pandas/tests/tseries/offsets/test_business_day.py
1
14564
""" Tests for offsets.BDay """ from datetime import date, datetime, timedelta import numpy as np import pytest from pandas._libs.tslibs.offsets import ApplyTypeError, BDay, BMonthEnd, CDay from pandas.compat import np_datetime64_compat from pandas import DatetimeIndex, _testing as tm, read_pickle from pandas.tests.t...
bsd-3-clause
mikebenfield/scikit-learn
sklearn/ensemble/tests/test_forest.py
9
43013
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import combinations from itertools import product import numpy ...
bsd-3-clause
leppa/home-assistant
homeassistant/components/smappee/__init__.py
3
12173
"""Support for Smappee energy monitor.""" from datetime import datetime, timedelta import logging import re from requests.exceptions import RequestException import smappy import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME import homeassistant.helpers.config_validation as ...
apache-2.0
edmunoz/aed
proyecto_aed_fb/create_graph.py
1
3757
import MySQLdb as mdb import networkx as nx import matplotlib.pyplot as plt import community def connect_db(): connection = mdb.connect('108.167.133.34', 'connie_usr_aed', 'SK5CTTs8zXV9', 'connie_facebook') return connection def get_cursor(connect): cursor = connect.cursor() return cursor def get_...
apache-2.0
laurent-george/bokeh
bokeh/compat/bokeh_renderer.py
6
16979
"Supporting objects and functions to convert Matplotlib objects into Bokeh." #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.t...
bsd-3-clause
kdebrab/pandas
pandas/tests/frame/test_repr_info.py
6
17679
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime, timedelta import re import sys import textwrap from numpy import nan import numpy as np import pytest from pandas import (DataFrame, Series, compat, option_context, date_range, period_range, Categorical)...
bsd-3-clause
DonBeo/statsmodels
statsmodels/examples/ex_generic_mle.py
32
16462
from __future__ import print_function import numpy as np from scipy import stats import statsmodels.api as sm from statsmodels.base.model import GenericLikelihoodModel data = sm.datasets.spector.load() data.exog = sm.add_constant(data.exog, prepend=False) # in this dir probit_mod = sm.Probit(data.endog, data.exog) ...
bsd-3-clause
lhilt/scipy
scipy/fft/_basic.py
2
54035
from scipy._lib.uarray import generate_multimethod, Dispatchable import numpy as np def _x_replacer(args, kwargs, dispatchables): """ uarray argument replacer to replace the transform input array (``x``) """ if len(args) > 0: return (dispatchables[0],) + args[1:], kwargs kw = kwargs.copy()...
bsd-3-clause
binghongcha08/pyQMD
QMC/MC_exchange/permute4d/dissipation/5.0/en.py
15
1291
import numpy as np import pylab as plt import matplotlib.pyplot as plt import matplotlib as mpl #data = np.genfromtxt(fname='/home/bing/dissipation/energy.dat') data = np.genfromtxt(fname='energy.dat') fig, (ax1,ax2) = plt.subplots(ncols=1, nrows=2, sharex=True) #font = {'family' : 'ubuntu', # 'weight' : ...
gpl-3.0
ephes/scikit-learn
sklearn/utils/metaestimators.py
283
2353
"""Utilities for meta-estimators""" # Author: Joel Nothman # Andreas Mueller # Licence: BSD from operator import attrgetter from functools import update_wrapper __all__ = ['if_delegate_has_method'] class _IffHasAttrDescriptor(object): """Implements a conditional property using the descriptor protocol. ...
bsd-3-clause
zehpunktbarron/iOSMAnalyzer
scripts/c5_tag_completeness_accom.py
1
12548
# -*- coding: utf-8 -*- #!/usr/bin/python2.7 #description :This file creates a plot: Calculates the development of the tag-completeness [%] of all "accomodation & gastronomy" POIs #author :Christopher Barron @ http://giscience.uni-hd.de/ #date :19.01.2013 #version :0.1 #usage ...
gpl-3.0
argentumproject/electrum-arg
plugins/plot/qt.py
1
3557
from PyQt4.QtGui import * from electrum_arg.plugins import BasePlugin, hook from electrum_arg.i18n import _ import datetime from electrum_arg.util import format_satoshis from electrum_arg.bitcoin import COIN try: import matplotlib.pyplot as plt import matplotlib.dates as md from matplotlib.patches import...
mit
billy-inn/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
huobaowangxi/scikit-learn
sklearn/datasets/svmlight_format.py
114
15826
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause
antgonza/qiime
qiime/make_2d_plots.py
6
23462
#!/usr/bin/env python # File created on 09 Feb 2010 # file make_2d_plots.py __author__ = "Jesse Stombaugh and Micah Hamady" __copyright__ = "Copyright 2011, The QIIME Project" # remember to add yourself __credits__ = ["Jesse Stombaugh", "Jose Antonio Navas Molina"] __license__ = "GPL" __version__ = "1.9.1-dev" __maint...
gpl-2.0
antoinecarme/pyaf
tests/bugs/issue_106/insurance_exog.py
1
1208
import numpy as np import pandas as pd import pyaf.ForecastEngine as autof # example from https://otexts.org/fpp2/lagged-predictors.html df = pd.read_csv("https://raw.githubusercontent.com/antoinecarme/TimeSeriesData/master/fpp2/insurance.csv") df.info() (lTimeVar , lSigVar , lExogVar) = ("Index", "Quotes" , "TV.adv...
bsd-3-clause
alexchao56/sklearn-theano
sklearn_theano/datasets/asirra.py
8
2952
"""Dataset loading utilities for asirra dataset.""" # Authors: Kyle Kastner # License: BSD 3 Clause import os import numpy as np from PIL import Image import tarfile from glob import glob from sklearn.externals.joblib import Memory from sklearn.datasets.base import Bunch from .base import download, get_dataset_dir ...
bsd-3-clause
donlnz/nonconformist
setup.py
1
1178
#!/usr/bin/env python from distutils.core import setup import nonconformist setup( name = 'nonconformist', packages = ['nonconformist'], version = nonconformist.__version__, description = 'Python implementation of the conformal prediction framework.', author = 'Henrik Linusson', author_email = 'henrik.linusson@...
mit
maropu/spark
python/pyspark/sql/tests/test_dataframe.py
4
41251
# # 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
alisidd/tensorflow
tensorflow/examples/learn/text_classification_character_cnn.py
30
4292
# 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
IssamLaradji/scikit-learn
sklearn/linear_model/tests/test_logistic.py
19
22876
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.util...
bsd-3-clause
paladin74/neural-network-animation
matplotlib/_cm.py
15
94005
""" Nothing here but dictionaries for generating LinearSegmentedColormaps, and a dictionary of these dictionaries. Documentation for each is in pyplot.colormaps() """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np _binary_data = { ...
mit
ishay2b/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
34
12484
# 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
ZENGXH/scikit-learn
examples/exercises/plot_cv_digits.py
232
1206
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
bnaul/scikit-learn
sklearn/datasets/_species_distributions.py
11
8726
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/details/3038/0>`_ , the Bro...
bsd-3-clause
darshanthaker/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py
69
43991
from __future__ import division import os, sys def fn_name(): return sys._getframe(1).f_code.co_name try: import gobject import gtk; gdk = gtk.gdk import pango except ImportError: raise ImportError("Gtk* backend requires pygtk to be installed.") pygtk_version_required = (2,2,0) if gtk.pygtk_version <...
agpl-3.0
yavalvas/yav_com
build/matplotlib/lib/mpl_examples/pylab_examples/demo_text_path.py
9
4470
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt from matplotlib.image import BboxImage import numpy as np from matplotlib.transforms import IdentityTransform import matplotlib.patches as mpatches from matplotlib.offsetbox import AnnotationBbox,\ AnchoredOffsetbox, AuxTransformBox from matplotlib.cbook...
mit
arokem/scipy
scipy/integrate/quadrature.py
1
31441
from __future__ import division, print_function, absolute_import import functools import numpy as np import math import types import warnings # trapz is a public function for scipy.integrate, # even though it's actually a NumPy function. from numpy import trapz from scipy.special import roots_legendre from scipy.spec...
bsd-3-clause
ben-hopps/nupic
examples/opf/clients/hotgym/prediction/one_gym/nupic_output.py
32
6059
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
fengzhyuan/scikit-learn
examples/model_selection/plot_roc_crossval.py
247
3253
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
mlhhu2017/identifyDigit
r.weishaupt/mnist_utils.py
1
4405
# Import required packages import numpy as np; import idx2numpy as idx; import matplotlib.pyplot as plt; def loadset(data, labels): """ Loads data and labels from given paths. Arguments: data [string] -- Path to data file labels [string] -- Path to labels file Return: [2-tuple:np....
mit
saiwing-yeung/scikit-learn
examples/ensemble/plot_voting_probas.py
316
2824
""" =========================================================== Plot class probabilities calculated by the VotingClassifier =========================================================== Plot the class probabilities of the first sample in a toy dataset predicted by three different classifiers and averaged by the `VotingC...
bsd-3-clause
mkery/CS349-roads
tripmatching/rdp_trip.py
1
4074
import numpy as np import sys import matplotlib.pyplot as pyplot """ edited 4/25 to fit trip default numpy format If you import a trip and then add a 3rd column to the trip that is time, when this runs the time field is kept... a bit hacky but works. """ def distance(x0, y0, x1, y1): return ((x1-x0)**2 + (y1-y0)*...
mit
iismd17/scikit-learn
benchmarks/bench_20newsgroups.py
377
3555
from __future__ import print_function, division from time import time import argparse import numpy as np from sklearn.dummy import DummyClassifier from sklearn.datasets import fetch_20newsgroups_vectorized from sklearn.metrics import accuracy_score from sklearn.utils.validation import check_array from sklearn.ensemb...
bsd-3-clause
joplen/svgplotlib
svgplotlib/TEX/Model.py
2
29467
#!/usr/bin/python # -*- coding: utf-8 -*- # TeX-LIKE BOX MODEL # The following is based directly on the document 'woven' from the # TeX82 source code. This information is also available in printed # form: # # Knuth, Donald E.. 1986. Computers and Typesetting, Volume B: # TeX: The Program. Addison-Wesley Profes...
bsd-3-clause
LangmuirSim/langmuir
LangmuirPython/analyze/gather.py
2
2521
# -*- coding: utf-8 -*- """ gather.py ========= .. argparse:: :module: gather :func: create_parser :prog: gather.py .. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com> """ import langmuir as lm import pandas as pd import itertools import argparse import os desc = """ Gather the output of a series of ...
gpl-2.0
ActiveState/code
recipes/Python/578242_Artificial_Neuroglial_Network_ANGN_/recipe-578242.py
1
29104
from operator import itemgetter, attrgetter import math from math import copysign from random import * import timeit from timeit import Timer as t from matplotlib.pyplot import * from numpy import * def sigmoid (x): return math.tanh(x) class NN: # ni,nh,no = n of input (i), hidden (h) and output (o) nodes # ai,...
mit