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 |
|---|---|---|---|---|---|
qbuat/rootpy | rootpy/plotting/contrib/plot_corrcoef_matrix.py | 1 | 11638 | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
__all__ = [
'plot_corrcoef_matrix',
]
def plot_corrcoef_matrix(data, fields, output_name,
weights=None,
repeat_weights=0... | gpl-3.0 |
quchunguang/test | testpy/testnetworkx.py | 1 | 1098 | #!/usr/bin/env python
'''
Demos for networkx package
'''
import networkx as nx
import matplotlib.pyplot as plt
from networkx.algorithms import approximation as approx
print '\nCreate graph...'
G = nx.Graph()
G.add_node(11)
G.add_nodes_from([12, 13])
G.add_node("spam")
G.add_nodes_from("spam")
H = nx.path_graph(10)
G.... | mit |
gurcani/zpdgen | plot_itg_jykim94.py | 1 | 1715 | import numpy as np
import matplotlib.pyplot as plt
import gpdf as gp
from scipy.optimize import root
etai=2.5
LnbyR=0.2
rbyR=0.18
kpar=0.1
tau=1.0
def epsfun(v):
om=v[0]+1j*v[1]
omsi=-ky
omdi=2*omsi*LnbyR
za=-om/omdi
zb=-np.sqrt(2)*kpar/omdi
b=ky**2
i10=gp.Inm(za,zb,b,1,0)
i12=gp.Inm(z... | gpl-3.0 |
tschaume/pymatgen | pymatgen/io/gaussian.py | 1 | 58767 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements input and output processing from Gaussian.
"""
import re
import numpy as np
import warnings
from pymatgen.core.operations import SymmOp
from pymatgen import Element, Molecule, Comp... | mit |
lhilt/scipy | scipy/signal/filter_design.py | 1 | 159755 | """Filter design.
"""
from __future__ import division, print_function, absolute_import
import math
import operator
import warnings
import numpy
import numpy as np
from numpy import (atleast_1d, poly, polyval, roots, real, asarray,
resize, pi, absolute, logspace, r_, sqrt, tan, log10,
... | bsd-3-clause |
evanbiederstedt/RRBSfun | trees/chrom_scripts/cll_chr07.py | 1 | 8245 | import glob
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 50) # print all rows
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
cw154 = glob.glob("binary_position_RRBS_cw154*")
trito = glob.glob("binary_position_RRBS_trito_pool*")
print(len(... | mit |
andrewnc/scikit-learn | sklearn/semi_supervised/label_propagation.py | 71 | 15342 | # 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 |
rickdberg/database | iodp_age_depth_scraper.py | 1 | 1340 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 13 13:51:08 2017
@author: rickdberg
Web scraper for downloading IODP age-depth data files (Exp 317-355)
Must first manually download each "List of Assets" from IODP LIMS DESC Reports web portal with "workbook" and "fossil" selected
"""
import requests
import numpy as n... | mit |
hendrikwout/pynacolada | pynacolada/apply_func_experimental.py | 1 | 43083 | import numpy as np
import math
import xarray as xr
import os
import netCDF4 as nc4
import pandas as pd
from tqdm import tqdm
import tempfile
import logging
logging.basicConfig(level=logging.DEBUG)
def apply_func(func,xarrays,dims_apply, method_dims_no_apply='outer',filenames_out = None, attributes = None,maximum_input... | gpl-3.0 |
ElDeveloper/scikit-learn | benchmarks/bench_sparsify.py | 323 | 3372 | """
Benchmark SGD prediction time with dense/sparse coefficients.
Invoke with
-----------
$ kernprof.py -l sparsity_benchmark.py
$ python -m line_profiler sparsity_benchmark.py.lprof
Typical output
--------------
input data sparsity: 0.050000
true coef sparsity: 0.000100
test data sparsity: 0.027400
model sparsity:... | bsd-3-clause |
xuewei4d/scikit-learn | examples/ensemble/plot_voting_regressor.py | 17 | 2723 | """
=================================================
Plot individual and voting regression predictions
=================================================
.. currentmodule:: sklearn
A voting regressor is an ensemble meta-estimator that fits several base
regressors, each on the whole dataset. Then it averages the indiv... | bsd-3-clause |
godfreyduke/deep-learning | image-classification/helper.py | 155 | 5631 | import pickle
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelBinarizer
def _load_label_names():
"""
Load the label names from file
"""
return ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
def load_cfar10_batch(ci... | mit |
smblance/ggplot | ggplot/components/legend.py | 12 | 8634 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.patches import Rectangle
from matplotlib.offsetbox import AnchoredOffsetbox, TextArea, DrawingArea, HPacker, VPacker
from collections import defaultdict
import matplotlib.lines as mlines
import ... | bsd-2-clause |
maxisi/gwsumm | gwsumm/plot/builtin.py | 1 | 33208 | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of GWSumm.
#
# GWSumm is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | gpl-3.0 |
ollitapa/VTT-Raytracer | python_source/plotAllDetector.py | 1 | 1291 | #
# Copyright 2015 VTT Technical Research Center of Finland
#
# 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 applicabl... | apache-2.0 |
chenyyx/scikit-learn-doc-zh | examples/zh/cluster/plot_dbscan.py | 39 | 2534 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... | gpl-3.0 |
huzq/scikit-learn | sklearn/impute/_knn.py | 3 | 11743 | # Authors: Ashim Bhattarai <ashimb9@gmail.com>
# Thomas J Fan <thomasjpfan@gmail.com>
# License: BSD 3 clause
import numpy as np
from ._base import _BaseImputer
from ..utils.validation import FLOAT_DTYPES
from ..metrics import pairwise_distances_chunked
from ..metrics.pairwise import _NAN_METRICS
from ..neig... | bsd-3-clause |
Bismarrck/pymatgen | pymatgen/phonon/plotter.py | 6 | 15693 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
import logging
from collections import OrderedDict
import numpy as np
from monty.json import jsanitize
from pymatgen.phonon.bandstructure impo... | mit |
bikong2/scikit-learn | sklearn/datasets/tests/test_20news.py | 280 | 3045 | """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 |
brian-team/brian2cuda | dev/benchmarks/results_2017_04_05_complete_after_talk/run_speed_test_script.py | 1 | 15078 | import os
import shutil
import glob
import subprocess
import sys
# run tests without X-server
import matplotlib
matplotlib.use('Agg')
# pretty plots
import seaborn
import time
import datetime
import cPickle as pickle
from brian2 import *
from brian2.tests.features import *
from brian2.tests.features.base import *
f... | gpl-2.0 |
elsonidoq/fito | fito/model/scikit_learn.py | 1 | 2734 | from fito import PrimitiveField
from fito.model.model import Model, ModelParameter
from sklearn.linear_model import LinearRegression as SKLinearRegression
from sklearn.linear_model import LogisticRegression as SKLogisticRegression
from sklearn.ensemble import GradientBoostingClassifier as SKGradientBoostingClassifier
... | mit |
SANDAG/spandex | spandex/targets/tests/test_synthesis.py | 2 | 22238 | import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pytest
from spandex.targets import synthesis as syn
@pytest.fixture
def seed(request):
current = np.random.get_state()
def fin():
np.random.set_state(current)
request.addfinalizer(fin)
np.random.seed(0)
@pytes... | bsd-3-clause |
GuessWhoSamFoo/pandas | pandas/tests/io/msgpack/test_obj.py | 2 | 2545 | # coding: utf-8
import pytest
from pandas.io.msgpack import packb, unpackb
class DecodeError(Exception):
pass
class TestObj(object):
def _arr_to_str(self, arr):
return ''.join(str(c) for c in arr)
def bad_complex_decoder(self, o):
raise DecodeError("Ooops!")
def _decode_complex(... | bsd-3-clause |
fionapigott/Data-Science-45min-Intros | support-vector-machines-101/rbf-circles.py | 26 | 1504 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Josh Montague"
__license__="MIT License"
import sys
import json
import numpy as np
import matplotlib.pyplot as plt
try:
import seaborn as sns
except ImportError as e:
sys.stderr.write("seaborn not installed. Using default matplotlib templates.")
from sk... | unlicense |
Tastalian/pymanoid | pymanoid/misc.py | 3 | 8076 | #!/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 |
Dziolas/invenio | modules/webstat/lib/webstat_engine.py | 14 | 105690 | ## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011, 2013 CERN.
##
## Invenio 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, or (at your option) any ... | gpl-2.0 |
frank-tancf/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
jacksarick/My-Code | Python/pi/piguessandgreen.py | 1 | 1249 | #!/usr/bin/python
from __future__ import division
import matplotlib.pyplot as plt
from pylab import savefig
from random import randint
from time import time
filelocation = "/Users/jack.sarick/Desktop/Program/Python/pi/"
filename = filelocation + "pianswer.txt"
temppoint = []
temparray = []
loopcounter = 0
k50, k10, k5... | mit |
HelgeDMI/trollvalidation | trollvalidation/validations/ice_conc_configuration.py | 1 | 4662 | import os
import datetime
import pandas as pd
# for OSI-450 validation
YEARS_OF_INTEREST = range(1972, 2016)
# for OSI-401 validation
# YEARS_OF_INTEREST = [1996]
VALIDATION_ID = 'OSI450'
CSV_HEADER = ['reference_time', 'run_time', 'total_bias', 'ice_bias',
'water_bias', 'total_stddev', 'ice_stddev', 'wa... | apache-2.0 |
trendelkampschroer/PyEMMA | pyemma/plots/plots2d.py | 1 | 4320 |
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source... | bsd-2-clause |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/matplotlib/compat/subprocess.py | 12 | 1817 | """
A replacement wrapper around the subprocess module, with a number of
work-arounds:
- Provides a stub implementation of subprocess members on Google App Engine
(which are missing in subprocess).
- Use subprocess32, backport from python 3.2 on Linux/Mac work-around for
https://github.com/matplotlib/matplotlib/iss... | gpl-3.0 |
cheind/py-motmetrics | motmetrics/tests/test_mot.py | 1 | 8795 | # py-motmetrics - Metrics for multiple object tracker (MOT) benchmarking.
# https://github.com/cheind/py-motmetrics/
#
# MIT License
# Copyright (c) 2017-2020 Christoph Heindl, Jack Valmadre and others.
# See LICENSE file for terms.
"""Tests behavior of MOTAccumulator."""
from __future__ import absolute_import
from _... | mit |
amyecampbell/staNMF-Private | staNMF/staNMF.py | 1 | 16158 |
#!/usr/bin/env python
###########################
# Required Pacakges
##########################
import math
import random
import os
import sys
import warnings
import argparse
import collections
import csv
from timeit import default_timer as timer
import numpy as np
import pandas as pd
from scipy.stats import pearso... | bsd-3-clause |
jastarex/DeepLearningCourseCodes | 04_CNN_advances/cnn_mnist_simple.py | 1 | 6261 |
# coding: utf-8
# # 卷积神经网络示例与各层可视化
# In[1]:
import os
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
get_ipython().magic(u'matplotlib inline')
print ("当前TensorFlow版本为 [%s]" % (tf.__version__))
print ("所有包载入完毕")
# ## 载入 MNIST
#... | apache-2.0 |
UDST/activitysim | activitysim/core/test/test_orca.py | 2 | 34561 | # Orca
# Copyright (C) 2016 UrbanSim Inc.
# See full license in LICENSE.
import os
import tempfile
import tables
import pandas as pd
import pytest
from pandas.util import testing as pdt
from activitysim.core import orca
from activitysim.core import inject
from .utils_testing import assert_frames_equal
def setup_fu... | bsd-3-clause |
tatsuy/ardupilot | libraries/AP_Math/tools/geodesic_grid/plot.py | 110 | 2876 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This fi... | gpl-3.0 |
ysasaki6023/NeuralNetworkStudy | cifar02/Output/Ksize222_L5_1/train.py | 24 | 10142 | #!/usr/bin/env python
import argparse
import time
import numpy as np
import six
import os
import shutil
import chainer
from chainer import computational_graph
from chainer import cuda
import chainer.links as L
import chainer.functions as F
from chainer import optimizers
from chainer import serializers
from chainer.ut... | mit |
mengyun1993/RNN-binary | history code/rnn03.py | 1 | 26742 | """ 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 |
cpsnowden/ComputationalNeurodynamics | Exercise_1/IzNeuronDemo.py | 2 | 1533 | """
Computational Neurodynamics
Exercise 1
Simulates Izhikevich's neuron model using the Euler method.
Parameters for regular spiking, fast spiking and bursting
neurons extracted from:
http://www.izhikevich.org/publications/spikes.htm
(C) Murray Shanahan et al, 2015
"""
import numpy as np
import matplotlib.pyplot a... | gpl-3.0 |
jlegendary/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 |
perrygeo/geopandas | geopandas/geoseries.py | 8 | 10052 | from functools import partial
from warnings import warn
import numpy as np
from pandas import Series, DataFrame
from pandas.core.indexing import _NDFrameIndexer
from pandas.util.decorators import cache_readonly
import pyproj
from shapely.geometry import box, shape, Polygon, Point
from shapely.geometry.collection impor... | bsd-3-clause |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/inset_locator.py | 10 | 18698 | """
A collection of functions and objects for creating or placing inset axes.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib import docstring
import six
from matplotlib.offsetbox import AnchoredOffsetbox
from matplotlib.patches import Pa... | gpl-3.0 |
scarrazza/smpdf | src/smpdflib/actions.py | 1 | 19601 | # -*- coding: utf-8 -*-
"""
Created on Mon May 4 18:58:08 2015
@author: zah
"""
#TODO: Call this 'actionlib' and move actual actions to another module.
import os
import os.path as osp
import re
import shutil
from collections import OrderedDict
import textwrap
import inspect
class ActionError(Exception):
pass
c... | gpl-2.0 |
larsoner/mne-python | examples/forward/plot_forward_sensitivity_maps.py | 14 | 4139 | """
.. _ex-sensitivity-maps:
================================================
Display sensitivity maps for EEG and MEG sensors
================================================
Sensitivity maps can be produced from forward operators that
indicate how well different sensor types will be able to detect
neural currents f... | bsd-3-clause |
and2egg/philharmonic | philharmonic/simulator/simulator.py | 1 | 12233 | """The philharmonic simulator.
Traces geotemporal input data, asks the scheduler to determine actions
and simulates the outcome of the schedule.
(_)(_)
/ \ ssssssimulator
/ | /
/ \ * |
... | gpl-3.0 |
njase/numpy | numpy/core/tests/test_multiarray.py | 6 | 246246 | from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
import ctypes
import os
import gc
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decima... | bsd-3-clause |
JT5D/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 4 | 14254 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
fr... | bsd-3-clause |
conversationai/conversationai-models | experiments/tf_trainer/tf_cnn/finetune.py | 1 | 2504 | """Experiments with many_communities dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import nltk
import os
import pandas as pd
import tensorflow as tf
from tf_trainer.common import base_model
from tf_trainer.common import model_trainer
from tf_... | apache-2.0 |
dhwang99/statistics_introduction | learning/linear_regression.py | 1 | 2960 | #encoding: utf8
import numpy as np
import pdb
from scipy.stats import f as f_stats
import matplotlib.pyplot as plt
from data_loader import load_data
'''
sub: 使用的特征列编号
'''
def leasq(X_train, Y_train, X_test, Y_test, sub=None):
'''
X = X_train
Y = Y_train
X.T(Y - X*beta_hat) = 0
beta_hat = inv(X.T*... | gpl-3.0 |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | 21 | 54488 | # 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 |
eduardoftoliveira/qt_scripts | scripts/draw_PES.py | 2 | 3836 | #!/usr/bin/env python
import matplotlib as mpl
from matplotlib import pyplot as plt
import argparse
def add_adiabatic_map_to_axis(axis, style, energies, color):
""" add single set of energies to plot """
# Energy horizontal decks
x = style['START']
for energy in energies:
axis.plot([x, x+styl... | gpl-3.0 |
evgchz/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 31 | 3340 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
tejasckulkarni/hydrology | ch_616/ch_616_daily_wb.py | 2 | 28030 | __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
from datetime import timedelta
import scipy as sp
import meteolib as met
from bisect import bisect_left
imp... | gpl-3.0 |
nguyentu1602/statsmodels | statsmodels/graphics/tests/test_correlation.py | 31 | 1112 | import numpy as np
from numpy.testing import dec
from statsmodels.graphics.correlation import plot_corr, plot_corr_grid
from statsmodels.datasets import randhie
try:
import matplotlib.pyplot as plt
have_matplotlib = True
except:
have_matplotlib = False
@dec.skipif(not have_matplotlib)
def test_plot_cor... | bsd-3-clause |
mattilyra/scikit-learn | sklearn/cluster/__init__.py | 364 | 1228 | """
The :mod:`sklearn.cluster` module gathers popular unsupervised clustering
algorithms.
"""
from .spectral import spectral_clustering, SpectralClustering
from .mean_shift_ import (mean_shift, MeanShift,
estimate_bandwidth, get_bin_seeds)
from .affinity_propagation_ import affinity_propagati... | bsd-3-clause |
pradeepnazareth/NS-3-begining | src/core/examples/sample-rng-plot.py | 3 | 1350 | # -*- Mode:Python; -*-
# /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRA... | gpl-2.0 |
DimensionalScoop/kautschuk | AP_SS16/601/PythonSkript.py | 1 | 13520 | ##################################################### Import system libraries ######################################################
import matplotlib as mpl
mpl.rcdefaults()
mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc'))
import matplotlib.pyplot as plt
import numpy as np
import scipy.constants as c... | mit |
robclewley/fovea | examples/saddle_manifold/pp_func.py | 1 | 22970 | from __future__ import division, absolute_import, print_function
# itertools, operator used for _filter_consecutive function
import itertools, operator
import os
from PyDSTool import *
from PyDSTool.errors import PyDSTool_ValueError
from PyDSTool.ModelContext import *
from PyDSTool.utils import findClosestPointIndex
f... | bsd-3-clause |
Srisai85/scikit-learn | sklearn/tests/test_common.py | 127 | 7665 | """
General tests for all estimators in sklearn.
"""
# Authors: Andreas Mueller <amueller@ais.uni-bonn.de>
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
from __future__ import print_function
import os
import warnings
import sys
import pkgutil
from sklearn.externals.six import PY3
fr... | bsd-3-clause |
jjx02230808/project0223 | examples/applications/wikipedia_principal_eigenvector.py | 233 | 7819 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
TitasNandi/Summer_Project | yodaqa/data/ml/fbpath/fbpathtrain.py | 3 | 4280 | """
Service routines for training a Naive Bayes classifier to predict which
Freebase property paths would match answers given the question features.
"""
from __future__ import print_function
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.preprocessing import MultiLabelBinarizer
... | apache-2.0 |
h2educ/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 249 | 1563 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
waterponey/scikit-learn | sklearn/semi_supervised/label_propagation.py | 39 | 16726 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semi-supervised classification algorithms. At a 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 perf... | bsd-3-clause |
pypot/scikit-learn | sklearn/linear_model/tests/test_base.py | 120 | 10082 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.... | bsd-3-clause |
trogdorsey/data_hacking | dga_detection/dga_model_gen.py | 6 | 13951 |
''' Build models to detect Algorithmically Generated Domain Names (DGA).
We're trying to classify domains as being 'legit' or having a high probability
of being generated by a DGA (Dynamic Generation Algorithm). We have 'legit' in
quotes as we're using the domains in Alexa as the 'legit' set.
'''
import o... | mit |
Endika/omim | tools/python/city_radius.py | 53 | 4375 | import sys, os, math
import matplotlib.pyplot as plt
from optparse import OptionParser
cities = []
def strip(s):
return s.strip('\t\n ')
def load_data(path):
global cities
f = open(path, 'r')
lines = f.readlines()
f.close();
for l in lines:
if l.startswith('#'):
c... | apache-2.0 |
chenyyx/scikit-learn-doc-zh | examples/en/gaussian_process/plot_gpr_prior_posterior.py | 36 | 2900 | """
==========================================================================
Illustration of prior and posterior Gaussian process for different kernels
==========================================================================
This example illustrates the prior and posterior of a GPR with different
kernels. Mean, st... | gpl-3.0 |
sgenoud/scikit-learn | sklearn/utils/graph.py | 5 | 4663 | """
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD
import numpy as np
from scipy import sparse
from .graph_shortest_path imp... | bsd-3-clause |
delijati/pysimiam-simulator | gui/qt_plotwindow.py | 1 | 2079 | from PyQt4 import QtGui
from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt
import sys
import numpy
from random import random
mplPlotWindow = None
qwtPlotWindow = None
pqgPlotWindow = None
PlotWindow = None
def use_qwt_backend():
global PlotWindow, qwtPlotWindow
if qwtPlotWindow is None:
qwtPlotWindow... | gpl-2.0 |
daskol/ml-cipher-cracker | bigram_model-Copy0 (1).py | 3 | 10635 |
# coding: utf-8
# In[15]:
import numpy as np
import math
import matplotlib.pyplot as plt
import random
from numpy.random import rand
# read text
# In[1]:
def read_text_words(filename, wordsnumber):
with open(filename) as f:
X = f.readlines()
wordsnumber = len(X)
X = ''.join(X)
... | mit |
StupidTortoise/personal | python/fig_code/svm_gui.py | 47 | 11549 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | gpl-2.0 |
google-research/google-research | kobe/eval_main.py | 1 | 17362 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
manashmndl/scikit-learn | sklearn/utils/tests/test_random.py | 230 | 7344 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from scipy.misc import comb as combinations
from numpy.testing import assert_array_almost_equal
from sklearn.utils.random import sample_without_replacement
from sklearn.utils.random import random_choice_csc
from sklearn.utils.testing import ... | bsd-3-clause |
MehranMirkhan/ai_system | models/rcnn2.py | 1 | 4969 |
"""
2d Restricted Convolutional Neural Network
"""
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import models.model as md
import models.modules as ms
import utils.utils as ut
class RCNN2(md.Model):
def learn(self, x, y, rate=None):
c = self.classifier
o = c.optimizer
run_dict ... | mit |
SiggyF/dotfiles | .config/ipython/profile_default/ipython_config.py | 1 | 18950 | # Configuration file for ipython.
c = get_config()
#------------------------------------------------------------------------------
# InteractiveShellApp configuration
#------------------------------------------------------------------------------
# A Mixin for applications that start InteractiveShell instances.
#
#... | mit |
Garrett-R/scikit-learn | examples/feature_selection/plot_feature_selection.py | 249 | 2827 | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | bsd-3-clause |
eriklindernoren/Keras-GAN | cgan/cgan.py | 1 | 6521 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.c... | mit |
cosmonautd/turret | teleturret/modules/base.py | 1 | 21206 | """ Module for general conversation
"""
# Standard imports
import os
import sys
import datetime
# External imports
import cv2
import dlib
import scipy
import numpy
import skimage.exposure
import sklearn.cluster
import matplotlib
import matplotlib.pyplot as plt
# Project imports
import botkit.nlu
import botkit.answer... | apache-2.0 |
ChinaQuants/Finance-Python | PyFin/tests/POpt/testOptimizer.py | 2 | 11514 | # -*- coding: utf-8 -*-
u"""
Created on 2016-4-18
@author: cheng.li
"""
import os
import unittest
import numpy as np
import pandas as pd
from PyFin.POpt.Optimizer import portfolio_returns
from PyFin.POpt.Optimizer import OptTarget
from PyFin.POpt.Optimizer import portfolio_optimization
class TestOptimizer(unittest.... | mit |
mitschabaude/nanopores | scripts/pughpore/randomwalk/test/create_frame.py | 1 | 4358 | from matplotlib.ticker import FormatStrFormatter
import matplotlib
from matplotlib.lines import Line2D
import nanopores as nano
import nanopores.geometries.pughpore as pughpore
from nanopores.models.pughpore import polygon
from nanopores.models.pughpoints import plot_polygon
from mpl_toolkits.mplot3d import Axes3D
impo... | mit |
Obus/scikit-learn | sklearn/ensemble/__init__.py | 217 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
Xeralux/tensorflow | tensorflow/contrib/learn/python/learn/estimators/kmeans_test.py | 13 | 20278 | # 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 |
q1ang/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 68 | 43439 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
JackKelly/neuralnilm_prototype | scripts/e127.py | 2 | 4534 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... | mit |
yarikoptic/pystatsmodels | statsmodels/tsa/tests/test_stattools.py | 3 | 7864 | from statsmodels.tsa.stattools import (adfuller, acf, pacf_ols, pacf_yw,
pacf, grangercausalitytests,
coint, acovf)
from statsmodels.tsa.base.datetools import dates_from_range
import numpy as np
from numpy.testing import asser... | bsd-3-clause |
mnubo/smartobjects-python-client | smartobjects/restitution/__init__.py | 1 | 6325 | from datetime import datetime
class ResultSet(object):
def __init__(self, *args, **kwargs):
""" Contains the result of a search query """
if len(args) == 1 and isinstance(args[0], dict):
self._source = args[0]
elif not args and kwargs:
self._source = kwargs
... | mit |
tinchoa/catraca | processing-layer/working.py | 1 | 7276 |
import numpy as np
from pyspark.mllib.stat import Statistics
from pyspark.mllib.regression import LabeledPoint
from pyspark.mllib.util import MLUtils
from tempfile import NamedTemporaryFile
import sys
from sklearn.cluster import KMeans
'''
bin/spark-submit --master spark://master:7077 feature-selection.py <input dat... | gpl-2.0 |
datapythonista/pandas | pandas/tests/reshape/concat/test_append.py | 2 | 15147 | import datetime as dt
from datetime import datetime
from itertools import combinations
import dateutil
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
concat,
isna,
)
import pandas._testin... | bsd-3-clause |
RCand/maritima | Estado_de_mar.py | 1 | 12148 | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft
# from scipy.stats import rayleigh # Se podria utilizar tambien esta. Tiene formula: rayleigh.pdf(r) = r * exp(-r**2/2)
__author__ = "Riccardo Candeago, Ugr, E.T.S.I.C.C.P., aa. 2015/16"
### PARAME... | gpl-2.0 |
FrancescElies/bquery | bquery/ctable.py | 1 | 18008 | # internal imports
from bquery import ctable_ext
# external imports
import numpy as np
import bcolz
from collections import namedtuple
import os
from bquery.ctable_ext import \
SUM, COUNT, COUNT_NA, COUNT_DISTINCT, SORTED_COUNT_DISTINCT
class ctable(bcolz.ctable):
def cache_valid(self, col):
"""
... | bsd-3-clause |
lucasosouza/dataquest | myfirstforest.py | 26 | 4081 | """ Writing my first randomforest code.
Author : AstroDave
Date : 23rd September 2012
Revised: 15 April 2014
please see packages.python.org/milk/randomforests.html for more
"""
import pandas as pd
import numpy as np
import csv as csv
from sklearn.ensemble import RandomForestClassifier
# Data cleanup
# TRAIN DATA
tra... | mit |
joequant/zipline | zipline/examples/dual_ema_talib.py | 16 | 3247 | #!/usr/bin/env python
#
# 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 ... | apache-2.0 |
Ernestyj/PyStudy | finance/WeekTest/TestingSVM.py | 1 | 11313 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import talib
from pyalgotrade import strategy, plotter
from pyalgotrade.broker.backtesting import TradePercentage, Broker
from pyalgotrade.broker import Order
from pyalgotrade.barfeed import yahoofeed
... | apache-2.0 |
tim777z/seaborn | seaborn/utils.py | 19 | 15509 | """Small plotting-related utility functions."""
from __future__ import print_function, division
import colorsys
import warnings
import os
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.colors as mplcol
import matplotlib.pyplot as plt
from distutils.version import LooseVersion
pandas_... | bsd-3-clause |
moutai/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 |
olafhauk/mne-python | mne/viz/_brain/tests/test_brain.py | 1 | 28481 | # -*- coding: utf-8 -*-
#
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
# Oleh Kozynets <ok7mailbox@gmail.com>
#
# License: Simplified BSD
imp... | bsd-3-clause |
agentfog/qiime | scripts/print_qiime_config.py | 15 | 35150 | #!/usr/bin/env python
from __future__ import division
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Jens Reeder", "Dan Knights", "Antonio Gonzalez Pena",
"Justin Kuczynski", "Jai Ram Rideout", "Greg Caporaso",
"Emily TerAvest"]
__license__ ... | gpl-2.0 |
arasuarun/shogun | examples/undocumented/python_modular/graphical/metric_lmnn_objective.py | 26 | 2350 | #!/usr/bin/env python
def load_compressed_features(fname_features):
try:
import gzip
import numpy
except ImportError:
print 'Error importing gzip and/or numpy modules. Please, verify their installation.'
import sys
sys.exit(0)
# load features from a gz compressed file
file_features = gzip.GzipFile(fname... | gpl-3.0 |
musically-ut/numpy | numpy/lib/npyio.py | 42 | 71218 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core.multiarray import packbits, unpackbits
from ._ioto... | bsd-3-clause |
daodaoliang/bokeh | bokeh/charts/tests/test_data_adapter.py | 37 | 3285 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.