repo_name
stringlengths
7
79
path
stringlengths
4
179
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
959
798k
license
stringclasses
15 values
jm-begon/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
cfe-lab/MiCall
release_test_compare.py
1
29035
""" Compare result files in shared folder with previous release. """ from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import csv from collections import namedtuple, defaultdict from concurrent.futures.process import ProcessPoolExecutor from difflib import Differ from enum import IntEnum from functools...
agpl-3.0
wzbozon/statsmodels
statsmodels/sandbox/tests/test_predict_functional.py
29
12873
from statsmodels.sandbox.predict_functional import predict_functional import numpy as np import pandas as pd import statsmodels.api as sm from numpy.testing import dec # If true, the output is written to a multi-page pdf file. pdf_output = False try: import matplotlib.pyplot as plt import matplotlib have_...
bsd-3-clause
billy-inn/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
dougalsutherland/skl-groups
docs/conf.py
1
8992
# -*- coding: utf-8 -*- # # skl-groups documentation build configuration file, created by # sphinx-quickstart on Mon Jun 9 15:38:37 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
bsd-3-clause
vantares/trading-with-python
lib/qtpandas.py
77
7937
''' Easy integration of DataFrame into pyqt framework Copyright: Jev Kuznetsov Licence: BSD ''' from PyQt4.QtCore import (QAbstractTableModel,Qt,QVariant,QModelIndex,SIGNAL) from PyQt4.QtGui import (QApplication,QDialog,QVBoxLayout, QHBoxLayout, QTableView, QPushButton, QWidget,QTabl...
bsd-3-clause
12AngryMen/votca-scripts
xtp/xtp_Molpol_pattern.py
2
2265
#!/usr/bin/env python import sqlite3 import sys import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import os import os.path import numpy.linalg as lg import argparse as ap parser=ap.ArgumentParser(description="reads in pdb or gro file and creates a molpol pattern from it") parser.add_argument(...
apache-2.0
GuessWhoSamFoo/pandas
pandas/tests/indexes/multi/test_get_set.py
1
15757
# -*- coding: utf-8 -*- import numpy as np import pytest from pandas.compat import range import pandas as pd from pandas import CategoricalIndex, Index, MultiIndex import pandas.util.testing as tm def assert_matching(actual, expected, check_dtype=False): # avoid specifying internal representation # as muc...
bsd-3-clause
fabriziocosta/EDeN
setup.py
2
3484
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os import sys import subprocess import re from setuptools import setup from setuptools.command.sdist import sdist as _sdist from setuptools.command.install import install as _install VERSION_PY = """ # This file...
mit
eickenberg/sklearn-theano
sklearn_theano/sandbox/logistic_regression.py
9
1526
import numpy as np from theano import tensor as T import theano from sklearn.datasets import make_classification from sklearn.cross_validation import train_test_split from sklearn.metrics import classification_report rng = np.random.RandomState(1999) X, y = make_classification(n_samples=400, n_features=25, n_informati...
bsd-3-clause
inasio/Inverse-Sierpinski
hex-sierpinsky.py
1
4984
import pylab as pb import numpy as np import matplotlib.pyplot as plt #from pycallgraph import PyCallGraph #from pycallgraph.output import GraphvizOutput from time import time def plot_triangle(x,y): #side = 2*np.sqrt((x[1]-x[0])**2 + (y[1]-y[0])**2) #side = 1 - np.sqrt(x[1]**2 + y[1]**2) side = 0.2 pb...
mit
datapythonista/pandas
pandas/tests/indexing/multiindex/test_iloc.py
3
4837
import numpy as np import pytest from pandas import ( DataFrame, MultiIndex, Series, ) import pandas._testing as tm @pytest.fixture def simple_multiindex_dataframe(): """ Factory function to create simple 3 x 3 dataframe with both columns and row MultiIndex using supplied data or random d...
bsd-3-clause
harisbal/pandas
pandas/io/formats/style.py
2
44025
""" Module for applying conditional formatting to DataFrames and Series. """ from functools import partial from itertools import product from contextlib import contextmanager from uuid import uuid1 import copy from collections import defaultdict, MutableMapping try: from jinja2 import ( PackageLoader, Envi...
bsd-3-clause
BiaDarkia/scikit-learn
sklearn/ensemble/tests/test_base.py
36
5277
""" Testing for the base module (sklearn.ensemble.base). """ # Authors: Gilles Louppe # License: BSD 3 clause import numpy as np from numpy.testing import assert_equal from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_tr...
bsd-3-clause
mbayon/TFG-MachineLearning
venv/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
gnuradio/gnuradio
gr-fec/python/fec/polar/channel_construction_awgn.py
2
8128
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Based on 2 papers: [1] Ido Tal, Alexander Vardy: 'How To Construct Polar Codes', 2013 for an in-depth description of a widely used algorithm for channel construction. [2] Harish Vangala, Eman...
gpl-3.0
rongzh/unbiased-pscale
code/Jamieson1982Analysis/eval_Pt_eos.py
1
9546
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import scipy.optimize as optimize from scipy.interpolate import interp1d import collections from eos_mod import MGD_PowerLaw,debye_fun,Ptot_powerlaw,press_vinet def set_dic(a): param_d['V0'] = a[0] param_d['K0'] = a[1] param_d['K0p'] ...
mit
elhuhdron/emdrp
neon3/data/parseEMdata.py
1
111047
# The MIT License (MIT) # # Copyright (c) 2016 Paul Watkins, National Institutes of Health / NINDS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without lim...
mit
stargaser/astropy
astropy/visualization/tests/test_histogram.py
5
2349
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_allclose try: import matplotlib.pyplot as plt HAS_PLT = True except ImportError: HAS_PLT = False try: import scipy # noqa HAS_SCIPY = True except ImportError: HAS_SCIPY = False import pytest im...
bsd-3-clause
georgid/sms-tools
lectures/9-Sound-description/plots-code/mfcc.py
25
1103
import numpy as np import matplotlib.pyplot as plt import essentia.standard as ess M = 1024 N = 1024 H = 512 fs = 44100 spectrum = ess.Spectrum(size=N) window = ess.Windowing(size=M, type='hann') mfcc = ess.MFCC(numberCoefficients = 12) x = ess.MonoLoader(filename = '../../../sounds/speech-male.wav', sampleRate = fs)(...
agpl-3.0
qifeigit/scikit-learn
examples/cluster/plot_digits_linkage.py
369
2959
""" ============================================================================= Various Agglomerative Clustering on a 2D embedding of digits ============================================================================= An illustration of various linkage option for agglomerative clustering on a 2D embedding of the di...
bsd-3-clause
sperfu/DeepInteract-for-CircRNA-Disease-Inference-
DeepInteract_new.py
1
23513
# -*- coding: utf-8 -*- ###THEANO_FLAGS=mode=FAST_RUN,device=gpu0,floatX=float32 python import numpy as np import os import matplotlib.pyplot as plt from sklearn import svm, grid_search from sklearn.preprocessing import LabelEncoder from sklearn.svm import LinearSVC from sklearn.ensemble import RandomForestClassifier f...
gpl-3.0
gfyoung/pandas
pandas/tests/generic/test_generic.py
2
16480
from copy import copy, deepcopy import numpy as np import pytest from pandas.core.dtypes.common import is_scalar from pandas import DataFrame, Series import pandas._testing as tm # ---------------------------------------------------------------------- # Generic types test cases class Generic: @property de...
bsd-3-clause
zaxliu/deepnap
experiments/kdd-exps/experiment_message_2016-6-13_G5_BUF2_FR20_1_legacy.py
1
4370
# System built-in modules import time from datetime import datetime import sys import os from multiprocessing import Pool # Project dependency modules import pandas as pd pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment import lasagne # Project modules sys.path.append('...
bsd-3-clause
devanshdalal/scikit-learn
sklearn/svm/tests/test_bounds.py
49
2386
import warnings import numpy as np from scipy import sparse as sp from sklearn.svm.bounds import l1_min_c from sklearn.svm import LinearSVC from sklearn.linear_model.logistic import LogisticRegression from sklearn.utils.testing import assert_true, raises from sklearn.utils.testing import assert_raise_message dense...
bsd-3-clause
SEMCOG/synthpop
synthpop/ipf/ipf.py
3
2483
import numpy as np import pandas as pd def calculate_constraints( marginals, joint_dist, tolerance=1e-3, max_iterations=1000): """ Calculate constraints on household or person classes using single category marginals and the observed class proportions in a population sample. Constraints ar...
bsd-3-clause
zihua/scikit-learn
sklearn/mixture/gmm.py
11
32100
""" Gaussian Mixture Models. This implementation corresponds to frequentist (non-Bayesian) formulation of Gaussian Mixture Models. """ # Author: Ron Weiss <ronweiss@gmail.com> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Bertrand Thirion <bertrand.thirion@inria.fr> # Important note for the deprec...
bsd-3-clause
chaxor/Spectro
Spectro.py
1
42248
## Spectro ## ======= ## This program analyzes UV-VIS absorption spectra from aqueous surfactant suspended dispersions of carbon nanotubes. ## It does so by fitting absorption profile models from the literature with a linear regression at each step of a non-linear regression fitting of the background (amorphous carb...
gpl-3.0
IshankGulati/scikit-learn
examples/neighbors/plot_lof.py
30
1939
""" ================================================= Anomaly detection with Local Outlier Factor (LOF) ================================================= This example presents the Local Outlier Factor (LOF) estimator. The LOF algorithm is an unsupervised outlier detection method which computes the local density deviat...
bsd-3-clause
jm-begon/scikit-learn
sklearn/metrics/tests/test_ranking.py
75
40883
from __future__ import division, print_function import numpy as np from itertools import product import warnings from scipy.sparse import csr_matrix from sklearn import datasets from sklearn import svm from sklearn import ensemble from sklearn.datasets import make_multilabel_classification from sklearn.random_projec...
bsd-3-clause
pygeo/pycmbs
docs/source/figures/fig_portraet.py
1
1116
# -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ from pycmbs.plots import GlecklerPlot import matplotlib.pyplot as plt # this is just an artificial example illustrating principle usage of the # Portraet diagram fig...
mit
taknevski/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py
62
3960
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mirnylab/cooler
cooler/create/_create.py
1
40902
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division from datetime import datetime from six.moves import map from pandas.api.types import is_categorical, is_integer import os.path as op import pandas as pd import numpy as np import posixpath import tempfile import warnings import h5p...
bsd-3-clause
hippke/TTV-TDV-exomoons
create_figures/create_figure_4a.py
1
7168
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations. Credit for part of the source is given to https://github.com/akuchling/50-examples/blob/master/gravity.rst Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License """ import numpy import math import matplotlib.pylab as plt...
mit
Adai0808/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
143
22295
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises...
bsd-3-clause
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/matplotlib/tests/test_compare_images.py
15
3854
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import os import shutil from nose.tools import assert_equal, assert_not_equal, assert_almost_equal from matplotlib.testing.compare import compare_images from matplotlib.testing.decorators import _...
gpl-2.0
kobejean/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
39
12688
# 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
sriharshams/mlnd
smartcab/smartcab/simulator.py
11
25158
########################################### # Suppress matplotlib user warnings # Necessary for newer version of matplotlib import warnings warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib") ########################################### import os import time import random import importlib i...
apache-2.0
christos-tsotskas/PhD_post_processing
src/post_process.py
1
4796
''' Created on 19 Sep 2016 @author: Christos ''' import numpy as np import matplotlib.pyplot as plt class ComparisonPlot(object): __Visualisers = None def __init__(self, Visualisers): self.__Visualisers = Visualisers print 'received:'+ str( len(self.__Visualisers)) + " ...
mit
wdm0006/categorical_encoding
category_encoders/leave_one_out.py
1
11527
"""Leave one out coding""" import numpy as np import pandas as pd from sklearn.base import BaseEstimator, TransformerMixin import category_encoders.utils as util from sklearn.utils.random import check_random_state __author__ = 'hbghhy' class LeaveOneOutEncoder(BaseEstimator, TransformerMixin): """Leave one out c...
bsd-3-clause
GoogleCloudPlatform/keras-idiomatic-programmer
zoo/datasets_c.py
1
5732
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
vtsuperdarn/davitpy
davitpy/models/raydarn/rt.py
1
45736
# Copyright (C) 2012 VT SuperDARN Lab # Full license can be found in LICENSE.txt """Ray-tracing raydarn module This module runs the raytracing code Classes ------------------------------------------------------- rt.RtRun run the code rt.Scatter store and process modeled backscatter rt.Edens store and process ...
gpl-3.0
sarahgrogan/scikit-learn
examples/cluster/plot_lena_segmentation.py
271
2444
""" ========================================= Segmenting the picture of Lena in regions ========================================= This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous regions. This procedure (spe...
bsd-3-clause
IssamLaradji/scikit-learn
sklearn/setup.py
24
2991
import os from os.path import join import warnings def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError import numpy libraries = [] if os.name == 'posix': libraries.appe...
bsd-3-clause
kanchenxi04/vnpy-app
vn.trader/ctaAlgo/strategy_MACD_v05.py
2
31502
# encoding: UTF-8 # 首先写系统内置模块 from datetime import datetime, timedelta, date from time import sleep # 其次,导入vnpy的基础模块 import sys # sys.path.append('C:\\vnpy_1.5\\vnpy-master\\vn.trader') sys.path.append('../') from vtConstant import EMPTY_STRING, EMPTY_INT, DIRECTION_LONG, DIRECTION_SHORT, OFFSET_OPEN, STATUS_CANCELL...
mit
gnieboer/tensorflow
tensorflow/python/client/notebook.py
109
4791
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
eladnoor/equilibrator-api
pathways_cmd.py
1
1031
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Oct 1 13:24:15 2017 @author: noore """ import argparse import logging from equilibrator_api import Pathway from matplotlib.backends.backend_pdf import PdfPages import pandas as pd if __name__ == '__main__': parser = argparse.ArgumentParser( ...
mit
aasensio/magnetographCorrection
doPlotNew.py
1
5228
import numpy as np import matplotlib.pyplot as pl import brewer2mpl from scipy.integrate import simps from scipy.stats import linregress dat = np.load('posterior.npz') pB, normaliz, B, sigmas, fluxes = dat['arr_0'], dat['arr_1'], dat['arr_2'], dat['arr_3'], dat['arr_4'] labels = [r'2 Mx cm$^{-2}$',r'5 Mx cm$^{-2}$',r...
mit
pulinagrawal/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/texmanager.py
69
16818
""" This module supports embedded TeX expressions in matplotlib via dvipng and dvips for the raster and postscript backends. The tex and dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between sessions Requirements: * latex * \*Agg backends: dvipng * PS backend: latex w/ psfrag, dvips, and Gh...
agpl-3.0
strawlab/drosophila_eye_map
drosophila_eye_map/inspect_weightmap.py
1
8586
# -*- coding: utf-8 -*- # Copyright (c) 2005-2008, California Institute of Technology # Copyright (c) 2017, Albert-Ludwigs-Universität Freiburg # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # ...
bsd-2-clause
pacoqueen/ginn
extra/install/ipython2/ipython-5.10.0/IPython/core/shellapp.py
1
16462
# encoding: utf-8 """ A mixin for :class:`~IPython.core.application.Application` classes that launch InteractiveShell instances, load extensions, etc. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import from __future__ import ...
gpl-2.0
zzcclp/spark
python/pyspark/pandas/missing/window.py
16
5201
# # 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
ningchi/scikit-learn
sklearn/tests/test_kernel_approximation.py
244
7588
import numpy as np from scipy.sparse import csr_matrix from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_array_almost_equal, assert_raises from sklearn.utils.testing import assert_less_equal from ...
bsd-3-clause
apache-spark-on-k8s/spark
python/pyspark/sql/dataframe.py
3
70232
# # 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
dials/dials
command_line/cluster_unit_cell.py
1
3086
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1 import os import iotbx.mtz import iotbx.phil from cctbx import crystal from xfel.clustering.cluster import Cluster from xfel.clustering.cluster_groups import unit_cell_info import dials.util from dials.util.options import OptionParser, flatten_exper...
bsd-3-clause
khkaminska/scikit-learn
sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
kambysese/mne-python
examples/stats/plot_cluster_stats_evoked.py
18
3021
""" ======================================================= Permutation F-test on sensor data with 1D cluster level ======================================================= One tests if the evoked response is significantly different between conditions. Multiple comparison problem is addressed with cluster level permuta...
bsd-3-clause
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/numpy/lib/function_base.py
3
115310
__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_chkfin...
mit
CChengz/dot.r
workspace/fits/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/amil/WEB-INF/files/map_outputs/20150208230724GLVL/map_gen.py
11
6786
#!/usr/bin/env python """ Created on Feb 4, 2015 @author: Cheng Zeng, University of Aberdeen """ import os.path import matplotlib as mpl mpl.use('Agg') import numpy as np import matplotlib.pyplot as plt from matplotlib.mlab import griddata from matplotlib.colors import from_levels_and_colors import mplleaflet def ...
apache-2.0
chenyyx/scikit-learn-doc-zh
examples/zh/svm/plot_svm_anova.py
33
2024
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature selection before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc_...
gpl-3.0
gef756/statsmodels
statsmodels/examples/ex_emplike_1.py
34
3682
""" This is a basic tutorial on how to conduct basic empirical likelihood inference for descriptive statistics. If matplotlib is installed it also generates plots. """ from __future__ import print_function import numpy as np import statsmodels.api as sm print('Welcome to El') np.random.seed(634) # No significance o...
bsd-3-clause
benoitsteiner/tensorflow-opencl
tensorflow/contrib/learn/python/learn/estimators/dnn_test.py
19
60823
# 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
grundgruen/zipline
zipline/utils/tradingcalendar_tse.py
17
10125
# # 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
aetilley/scikit-learn
examples/classification/plot_classification_probability.py
242
2624
""" =============================== Plot classification probability =============================== Plot the classification probability for different classifiers. We use a 3 class dataset, and we classify it with a Support Vector classifier, L1 and L2 penalized logistic regression with either a One-Vs-Rest or multinom...
bsd-3-clause
xdnian/pyml
code/ch03/share.py
2
1904
import numpy as np from matplotlib.colors import ListedColormap import matplotlib.pyplot as plt import warnings def versiontuple(v): return tuple(map(int, (v.split(".")))) def plot_decision_regions(X, y, classifier, test_idx=None, resolution=0.02, xlabel='', ylabel='', title=''): # setup marker generator and...
mit
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/build/lib.linux-i686-2.7/numpy/lib/npyio.py
9
65323
__all__ = ['savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt', 'recfromtxt', 'recfromcsv', 'load', 'loads', 'save', 'savez', 'savez_compressed', 'packbits', 'unpackbits', 'fromregex', 'DataSource'] import numpy as np import format import sys import os import re import sys import itertoo...
mit
luigift/pybrain
examples/rl/environments/linear_fa/bicycle.py
26
14462
from __future__ import print_function """An attempt to implement Randlov and Alstrom (1998). They successfully use reinforcement learning to balance a bicycle, and to control it to drive to a specified goal location. Their work has been used since then by a few researchers as a benchmark problem. We only implement th...
bsd-3-clause
yask123/scikit-learn
examples/svm/plot_custom_kernel.py
171
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
shaoguangleo/code-for-blog
2008/wx_mpl_dynamic_graph.py
13
11139
""" This demo demonstrates how to draw a dynamic mpl (matplotlib) plot in a wxPython application. It allows "live" plotting as well as manual zooming to specific regions. Both X and Y axes allow "auto" or "manual" settings. For Y, auto mode sets the scaling of the graph to see all the data points. For X, auto mode m...
unlicense
rohanp/scikit-learn
sklearn/cluster/bicluster.py
66
19850
"""Spectral biclustering algorithms. Authors : Kemal Eren License: BSD 3 clause """ from abc import ABCMeta, abstractmethod import numpy as np from scipy.sparse import dia_matrix from scipy.sparse import issparse from . import KMeans, MiniBatchKMeans from ..base import BaseEstimator, BiclusterMixin from ..external...
bsd-3-clause
GeoMop/PythonOCC_Examples
src/interpolate_bezier-cubic-filter.py
1
2192
import numpy as np from numpy.linalg import inv import matplotlib.pyplot as plt import sys eps = sys.float_info.epsilon # Coordinates of points P=[P_{1}, P_{2}, ..., P_{n}] x = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0]) y = np.array([3.1, 3.1, 3.1, 3.1, 3.1, 3.1, ...
gpl-2.0
tomlof/scikit-learn
sklearn/linear_model/tests/test_omp.py
76
7752
# Author: Vlad Niculae # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equa...
bsd-3-clause
nicolas998/Op_Alarmas
02_Codigos/alarmas.py
1
6511
#!/usr/bin/env python import os import pandas as pd from wmf import wmf import numpy as np import glob ######################################################################## # VARIABLES GLOBALES ruta_store = None ruta_store_bck = None ######################################################################## # ...
gpl-3.0
denniszollo/mavlink
pymavlink/tools/mavgpslag.py
43
3446
#!/usr/bin/env python ''' calculate GPS lag from DF log ''' import sys, time, os from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--plot", action='store_true', default=False, help="plot errors") parser.add_argument("--minspeed", type=float, default=6, help="minimu...
lgpl-3.0
yl565/statsmodels
statsmodels/examples/ex_lowess.py
34
2827
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:26:06 2011 Author: Chris Jordan Squire extracted from test suite by josef-pktd """ from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm lowess = sm.nonparametric.lowess # this is just to check dire...
bsd-3-clause
hitszxp/scikit-learn
examples/linear_model/plot_multi_task_lasso_support.py
249
2211
#!/usr/bin/env python """ ============================================= Joint feature selection with multi-task Lasso ============================================= The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected features to be the same across tasks. This example simulates...
bsd-3-clause
brad-kaiser/spark
examples/src/main/python/sql/arrow.py
13
3997
# # 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
amaggi/bda
plotall_distributions.py
1
1517
import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm, beta NPTS = 100 COLS = ['red', 'orange', 'yellow', 'green', 'blue', 'violet'] # normal distribution mu_vals = [-1, 0, +1] sig_vals = [0.5, 1, 2] fig, axes = plt.subplots(1, 2) plt.sca(axes[0]) n_vals = len(mu_vals) for i in xrange(n_v...
gpl-2.0
dhuang/incubator-airflow
airflow/hooks/dbapi_hook.py
2
9351
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
Ecogenomics/GroopM
groopm/ellipsoid.py
1
15293
#!/usr/bin/python ############################################################################### # # # ellipsoid.py # # ...
gpl-3.0
toastedcornflakes/scikit-learn
sklearn/linear_model/tests/test_bayes.py
299
1770
# 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
MJuddBooth/pandas
pandas/core/frame.py
1
295066
# pylint: disable=E1101 # pylint: disable=W0212,W0703,W0622 """ DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to...
bsd-3-clause
gef756/statsmodels
statsmodels/sandbox/examples/bayesprior.py
33
7003
# # This script examines the predictive prior densities of two local level # models given the same priors for parameters that appear to be the same. # Reference: Del Negro and Schorfheide. try: import pymc pymc_installed = 1 except: print("pymc not imported") pymc_installed = 0 from scipy.stats import ...
bsd-3-clause
loli/semisupervisedforests
examples/manifold/plot_compare_methods.py
259
4031
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
Og192/Python
sklearnLearning/statisticalAndSupervisedLearning/adaboost.py
2
2852
print(__doc__) # Author: Noel Dawe <noel.dawe@gmail.com> # # License: BSD 3 clause from sklearn.externals.six.moves import zip import matplotlib.pyplot as plt from sklearn.datasets import make_gaussian_quantiles from sklearn.ensemble import AdaBoostClassifier from sklearn.metrics import accuracy_score from sklearn....
gpl-2.0
kknox/clBLAS
src/scripts/perf/plotPerformance.py
16
12286
# ######################################################################## # Copyright 2013 Advanced Micro Devices, 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.apach...
apache-2.0
bikong2/scikit-learn
examples/applications/plot_species_distribution_modeling.py
254
7434
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
samthor/intellij-community
python/helpers/pydev/pydevd.py
9
99805
#IMPORTANT: pydevd_constants must be the 1st thing defined because it'll keep a reference to the original sys._getframe from __future__ import nested_scopes # Jython 2.1 support import pydev_monkey_qt from pydevd_utils import save_main_module import pydevd_utils pydev_monkey_qt.patch_qt() import traceback from pyde...
apache-2.0
jeplus/jEPlus
scripts/scatter_plot_3.py
1
2402
from collections import defaultdict import re import csv # to get data from the file import matplotlib.pyplot as plt # to make the plot def load_data(filename, *keys): result = defaultdict(list) with open(filename, 'r') as f: # initialise the file handle reader = csv.DictReader(f, skipinitialspace=Tru...
gpl-3.0
stwunsch/gnuradio
gr-filter/examples/channelize.py
58
7003
#!/usr/bin/env python # # Copyright 2009,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
jjx02230808/project0223
sklearn/metrics/tests/test_classification.py
20
50188
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import la...
bsd-3-clause
sbxzy/pygks
pygks/ui_isoinn.py
1
8603
from . import isoinn2 from pygraph.classes.graph import graph from pygraph.algorithms.minmax import cut_tree from pygraph.algorithms.accessibility import connected_components from .utils import __dict_reverse as dict_reverse import itertools import time from numpy import array,sum,sqrt class data_block: """This is...
bsd-3-clause
JFriel/honours_project
networkx/doc/make_gallery.py
35
2453
""" Generate a thumbnail gallery of examples. """ from __future__ import print_function import os, glob, re, shutil, sys import matplotlib matplotlib.use("Agg") import matplotlib.pyplot import matplotlib.image from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCa...
gpl-3.0
kjordahl/xray
doc/conf.py
3
13424
# -*- coding: utf-8 -*- # # xray documentation build configuration file, created by # sphinx-quickstart on Thu Feb 6 18:57:54 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
apache-2.0
ghortiz-pena/BrownDwarfModel
Model.py
1
3987
def header(f_name): from numpy import pi f = open(f_name) line = f.readline() l = line.split() while l[0] == "#": line = f.readline() l = line.split() n = int(l[0]) distr = l[1] line = f.readline() l = line.split() P = int(l[0]) B = float(l[1]) beta = floa...
mit
wazeerzulfikar/scikit-learn
examples/linear_model/plot_sgd_penalties.py
124
1877
""" ============== 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
meteorcloudy/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_test.py
30
60826
# 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
SenGonzo/ia_tools
Analysis_sketchpad.py
1
3517
import pandas as pd import Attack_Calc as atk def data_input(): # import and fold data df = pd.read_csv('input_data/units.csv') # df = df[(df['faction'] == 'scum')] # df = df[(df['single model health'] >= 5)] df.sort_values(by=['name'], ascending=[True], inplace=True) rez_df = pd...
mit
dilawar/moose-full
moose-examples/_travis/test_all_scripts.py
2
2516
#!/usr/bin/python """test_all_scripts.py: This script tests scripts in this repository. """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2015, Dilawar Singh and NCBS Bangalore" __credits__ = ["NCBS Bangalore"] __license__ = "GNU GPL" __version__ = "1.0...
gpl-2.0
abimannans/scikit-learn
sklearn/utils/tests/test_estimator_checks.py
202
3757
import scipy.sparse as sp import numpy as np import sys from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.testing import assert_raises_regex, assert_true from sklearn.utils.estimator_checks import check_estimator from sklearn.utils....
bsd-3-clause