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 |
|---|---|---|---|---|---|
mihaelacr/pydeeplearn | code/similarity/similarityUtils.py | 3 | 18752 | """ Utils for the similarity experiments. """
__author__ = "Mihaela Rosca"
__contact__ = "mihaela.c.rosca@gmail.com"
from sklearn import cross_validation
import matplotlib.pyplot as plt
import itertools
import sys
# We need this to import other modules
sys.path.append("..")
from read.readfacedatabases import *
DEBU... | bsd-3-clause |
annoviko/pyclustering | pyclustering/tests/tests_runner.py | 1 | 2851 | """!
@brief Test runner for unit and integration tests in the project.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import enum
import sys
import unittest
import warnings
# Generate images without having a window appear.
import matplotlib
matplotli... | gpl-3.0 |
dmoliveira/networkx | examples/drawing/lanl_routes.py | 25 | 2042 | #!/usr/bin/env python
"""
Routes to LANL from 186 sites on the Internet.
This uses Graphviz for layout so you need PyGraphviz or Pydot.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2004-2015
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swar... | bsd-3-clause |
gef756/statsmodels | statsmodels/tsa/tests/test_tsa_tools.py | 19 | 9109 | '''tests for some time series analysis functions
'''
from statsmodels.compat.python import zip
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_equal
import statsmodels.api as sm
import statsmodels.tsa.stattools as tsa
import statsmodels.tsa.tsatools as tools
from statsmodels.tsa.tsatool... | bsd-3-clause |
farhaanbukhsh/sympy | sympy/physics/quantum/tests/test_circuitplot.py | 93 | 2065 | from sympy.physics.quantum.circuitplot import labeller, render_label, Mz, CreateOneQubitGate,\
CreateCGate
from sympy.physics.quantum.gate import CNOT, H, SWAP, CGate, S, T
from sympy.external import import_module
from sympy.utilities.pytest import skip
mpl = import_module('matplotlib')
def test_render_label():
... | bsd-3-clause |
Jimmy-Morzaria/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
ahoyosid/scikit-learn | sklearn/ensemble/forest.py | 5 | 60067 | """Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | bsd-3-clause |
aestrivex/mne-python | examples/inverse/plot_label_from_stc.py | 31 | 3963 | """
=================================================
Generate a functional label from source estimates
=================================================
Threshold source estimates and produce a functional label. The label
is typically the region of interest that contains high values.
Here we compare the average time ... | bsd-3-clause |
dinossimpson/pyspeckit | pyspeckit/spectrum/models/hcn.py | 2 | 5452 | """
====================
HCN Hyperfine Fitter
====================
This is an HCN fitter...
ref for line params: http://www.strw.leidenuniv.nl/~moldata/datafiles/hcn@hfs.dat
"""
import numpy as np
from .. import units
from . import fitter,model,modelgrid
import matplotlib.cbook as mpcb
import copy
try:
from astropy... | mit |
beiko-lab/gengis | bin/Lib/site-packages/matplotlib/backends/backend_mixed.py | 4 | 5593 | from __future__ import print_function
from matplotlib._image import frombuffer
from matplotlib.backends.backend_agg import RendererAgg
from matplotlib.tight_bbox import process_figure_for_rasterizing
class MixedModeRenderer(object):
"""
A helper class to implement a renderer that switches between
vector an... | gpl-3.0 |
yunfeilu/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 272 | 7798 | """
Test the fastica algorithm.
"""
import itertools
import warnings
import numpy as np
from scipy import stats
from nose.tools import assert_raises
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from skl... | bsd-3-clause |
Winand/pandas | pandas/plotting/_core.py | 1 | 99209 | # being a bit too dynamic
# pylint: disable=E1101
from __future__ import division
import warnings
import re
from collections import namedtuple
from distutils.version import LooseVersion
import numpy as np
from pandas.util._decorators import cache_readonly
from pandas.core.base import PandasObject
from pandas.core.dt... | bsd-3-clause |
tensorflow/tfx-addons | projects/examples/sklearn_penguins/penguin_pipeline_sklearn_gcp.py | 1 | 9675 | # Copyright 2021 Google LLC. 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 a... | apache-2.0 |
carrillo/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
randerzander/wellbook | etl/hive/cluster.py | 2 | 1557 | #!/pyenv/bin/python
import sys, json, numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.cluster import KMeans
x = []
f = open('cluster_input.txt')
lines = f.read().split('\n')
#for line in sys.stdin:
for idx, line in enumerate(lines[:-1]):
print idx
tokens = line.strip().split('\t')
points... | apache-2.0 |
ptrendx/mxnet | example/restricted-boltzmann-machine/binary_rbm_module.py | 9 | 7894 | # 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 u... | apache-2.0 |
meduz/scikit-learn | examples/ensemble/plot_forest_importances.py | 168 | 1793 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
bigdataelephants/scikit-learn | examples/applications/topics_extraction_with_nmf.py | 106 | 2313 | """
========================================================
Topics extraction with Non-Negative Matrix Factorization
========================================================
This is a proof of concept application of Non Negative Matrix
Factorization of the term frequency matrix of a corpus of documents so
as to extra... | bsd-3-clause |
NUAAXXY/globOpt | evaluation/readGraphProperties.py | 2 | 2823 | import packages.project as project
import packages.primitive as primitive
import packages.processing as processing
import packages.relationGraph as relgraph
import packages.io
import packages.utils as utils
import packages.colours as colours
import packages.orderedSet as orderedSet
import argparse
import matplotlib.pyp... | apache-2.0 |
burakbayramli/classnotes | chaos/chaos_10/ex7.1.2.py | 2 | 2442 | import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
from scipy.integrate import ode, odeint
fig0 = plt.figure(figsize=(10,10))
ax0 = plt.subplot2grid((2,2), (0,0))
ax1 = plt.subplot2grid((2,2), (1,1))
ax2 = plt.subplot2grid((2,2), (1,0))#, colspan=2)
ax3 = plt.subplot2grid((2,2), (0,1))
xx0... | gpl-3.0 |
materialsproject/pymatgen | pymatgen/analysis/defects/utils.py | 5 | 60008 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Utilities for defects module.
"""
import itertools
import logging
import math
import operator
from collections import defaultdict
from copy import deepcopy
import numpy as np
import pandas as pd
from mont... | mit |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/io/parser/parse_dates.py | 3 | 26812 | # -*- coding: utf-8 -*-
"""
Tests date parsing functionality for all of the
parsers defined in parsers.py
"""
from distutils.version import LooseVersion
from datetime import datetime, date
import pytest
import numpy as np
from pandas._libs.tslibs import parsing
from pandas._libs.lib import Timestamp
import pandas a... | apache-2.0 |
bskari/sparkfun-avc | analysis/plot_speeds.py | 1 | 2246 | """Plots the speed readings."""
#from dateutil import parser as dateparser
from matplotlib import pyplot
import collections
import datetime
import json
import sys
def main():
"""Main function."""
if sys.version_info.major <= 2:
print('Please use Python 3')
sys.exit(1)
if len(sys.argv) !=... | mit |
nonsk131/USRP2016 | generate_dataFrame_binary.py | 1 | 2341 | from isochrones.dartmouth import Dartmouth_Isochrone
from isochrones.utils import addmags
from isochrones.observation import ObservationTree
from isochrones.starmodel import StarModel
import numpy as np
import pandas as pd
dar = Dartmouth_Isochrone()
M1 = 1.
M2 = 0.7
age = np.log10(5e9)
feh = 0.0
distance = 200
AV = ... | mit |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/sklearn/cross_decomposition/tests/test_pls.py | 42 | 14294 | import numpy as np
from sklearn.utils.testing import (assert_equal, assert_array_almost_equal,
assert_array_equal, assert_true,
assert_raise_message)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_, CCA
def t... | mit |
giorgiop/scikit-learn | sklearn/tests/test_calibration.py | 15 | 11959 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
assert_greater, assert_almost_equal,
... | bsd-3-clause |
zeehio/pyms | Display/Class.py | 7 | 10046 | """
Class to Display Ion Chromatograms and TIC
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005-2012 Vladi... | gpl-2.0 |
rudy2707/StocksTrooper | src/server/stockstrooper/Stocks.py | 1 | 5689 | # -*- coding: utf-8 -*-
from datetime import datetime, timezone
import dateutil.relativedelta
from flask import jsonify
import json
import pandas as pd
from pandas_datareader import data, wb
from yahoo_finance import Share
class Stocks:
"""Stocks class
Using the yahoo_finance API and pandas to :
- ... | gpl-3.0 |
vortex-ape/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 44 | 2899 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from itert... | bsd-3-clause |
drandykass/fatiando | gallery/gridder/interpolate.py | 6 | 2505 | """
Interpolate irregular data
--------------------------
The functions :func:`fatiando.gridder.interp` and
:func:`fatiando.gridder.interp_at` offer convenient wrappers around
``scipy.interpolate.griddata``. The scipy function is more general and can
interpolate n-dimensional data. Our functions offer the convenience ... | bsd-3-clause |
abhishekgahlot/scikit-learn | examples/linear_model/plot_iris_logistic.py | 283 | 1678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... | bsd-3-clause |
jzt5132/scikit-learn | sklearn/tests/test_metaestimators.py | 226 | 4954 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
kentsommer/CSCI-5552-Project | plot.py | 1 | 1179 | #!/usr/bin/python
import datetime
import numpy as np
import matplotlib.pyplot as plt
now = datetime.datetime.now()
outpath = './maps/' + now.strftime("%Y-%m-%d %H:%M") + '.png'
with open("./data/odom/odomRun.txt") as od:
odomData = od.read()
with open("./data/features/featuresRun.txt") as fe:
featuresData =... | gpl-3.0 |
sgenoud/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 1 | 13196 | """
Todo: cross-check the F-value with stats model
"""
from sklearn.feature_selection import (chi2, f_classif, f_oneway, f_regression,
SelectPercentile, SelectKBest,
SelectFpr, SelectFdr, SelectFwe,
Gen... | bsd-3-clause |
justincassidy/scikit-learn | examples/model_selection/plot_precision_recall.py | 249 | 6150 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
moutai/scikit-learn | sklearn/feature_selection/rfe.py | 16 | 16420 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Vincent Michel <vincent.michel@inria.fr>
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
"""Recursive feature elimination for feature ranking"""
import numpy as np
from ..utils import check_X_y, safe_sqr
from ..utils.metaes... | bsd-3-clause |
foarsitter/decide-exchange-model | decide/model/observers/issue_development.py | 1 | 24383 | import copy
import csv
import math
import os
from collections import defaultdict, OrderedDict
from typing import List
import matplotlib
matplotlib.use("Qt5Agg")
import matplotlib.pyplot as plt
from decide.model.base import Issue
from .. import base
from .. import calculations
from ..observers import observer
clas... | gpl-3.0 |
abimannans/scikit-learn | examples/calibration/plot_compare_calibration.py | 241 | 5008 | """
========================================
Comparison of Calibration of Classifiers
========================================
Well calibrated classifiers are probabilistic classifiers for which the output
of the predict_proba method can be directly interpreted as a confidence level.
For instance a well calibrated (bi... | bsd-3-clause |
jdnz/qml-rg | Meeting 5/image_loader_Nielsen_buggy.py | 1 | 1601 | # -*- coding: utf-8 -*-
"""Created on Wed Mar 15 10:09:24 2017"""
import math
import os
from skimage import io
from skimage import transform as tf
from matplotlib import pyplot as plt
from skimage.transform import resize
import numpy as np
#----------------------------------------------------------------------------
#... | gpl-3.0 |
nicolasfauchereau/DeBaCl | debacl/utils.py | 1 | 21488 | ############################################
## Brian P. Kent
## debacl_utils.py
## Created: 20120718
## Updated: 20130625
## A library of helper functions for the DEnsity-BAsed CLustering (DeBaCl)
## package.
###########################################
##############
### SET UP ###
##############
"""
General utility ... | bsd-3-clause |
CallaJun/hackprince | indico/matplotlib/textpath.py | 11 | 16650 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import zip
import warnings
if six.PY3:
from urllib.parse import quote as urllib_quote
else:
from urllib import quote as urllib_quote
import numpy as ... | lgpl-3.0 |
FlyRanch/figurefirst | inkscape_extensions/0.x/tag_spinespec.py | 1 | 2548 | #!/usr/bin/env python
import sys
sys.path.append('/usr/share/inkscape/extensions') # or another path, as necessary
sys.path.append('/Applications/Inkscape.app/Contents/Resources/extensions')
sys.path.append('C:\Program Files\Inkscape\share\extensions')
#import xml.etree.ElementTree as ET
#ET.register_namespace('figuref... | mit |
pkruskal/scikit-learn | sklearn/feature_selection/__init__.py | 244 | 1088 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
manjunaths/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | 3 | 42938 | # 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 |
jm-begon/scikit-learn | sklearn/linear_model/logistic.py | 105 | 56686 | """
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
imp... | bsd-3-clause |
herilalaina/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
riscmaster/risc_maap | risc_visual/src/Ishmaalsplots.py | 2 | 2444 | #!/usr/bin/env python
'''======================================================
Created by: Ishmaal Erekson
Last updated: January 2015
File name: Ishmaalsplots.py
Organization: RISC Lab, Utah State University
======================================================'''
import roslib; roslib.load_ma... | bsd-2-clause |
marcocaccin/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
jungla/ICOM-fluidity-toolbox | Detectors/offline_advection/advect_particles_2Db.py | 1 | 4115 | import os, sys
import myfun
import numpy as np
import lagrangian_stats
import scipy.interpolate as interpolate
import csv
import matplotlib.pyplot as plt
import advect_functions
import fio
from intergrid import Intergrid
## READ archive (too many points... somehow)
# args: name, dayi, dayf, days
#label = 'm_25_2_512'... | gpl-2.0 |
kyleabeauchamp/pymbar | pymbar/tests/test_timeseries.py | 3 | 5513 | from pymbar import timeseries
from pymbar import testsystems
import numpy as np
from scipy import stats
from pymbar.utils_for_testing import eq, skipif
from six.moves import xrange
try:
import statsmodels.api as sm
HAVE_STATSMODELS = True
except ImportError as err:
HAVE_STATSMODELS = False
def generate_d... | lgpl-2.1 |
nickcdryan/rep | rep/metaml/factory.py | 3 | 14552 | """
**Factory** provides convenient way to train several classifiers on the same dataset.
These classifiers can be trained one-by-one in a single thread, or simultaneously
with IPython cluster or in several threads.
Also `Factory` allows comparison of several classifiers (predictions of which can be used in parallel)... | apache-2.0 |
mhdella/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 244 | 2496 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/pandas/plotting/_misc.py | 2 | 21130 | # being a bit too dynamic
# pylint: disable=E1101
from __future__ import division
import numpy as np
from pandas.util._decorators import deprecate_kwarg
from pandas.core.dtypes.missing import notna
from pandas.compat import range, lrange, lmap, zip
from pandas.io.formats.printing import pprint_thing
from pandas.plo... | mit |
michaelkirk/QGIS | python/plugins/processing/algs/qgis/MeanAndStdDevPlot.py | 2 | 3388 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MeanAndStdDevPlot.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
pcm17/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator.py | 3 | 53280 | # 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 |
chenyyx/scikit-learn-doc-zh | examples/en/classification/plot_lda.py | 142 | 2419 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | gpl-3.0 |
jdemel/gnuradio | gr-filter/examples/chirp_channelize.py | 3 | 6497 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from gnuradio import gr
from gnuradio impo... | gpl-3.0 |
duthchao/kaggle-galaxies | check_label_constraints.py | 7 | 2424 | """
This file evaluates all constraints on the training labels as stipulated on the 'decision tree' page, and reports when they are violated.
It uses only the source CSV file for the sake of reproducibility.
"""
import numpy as np
import pandas as pd
TOLERANCE = 0.00001 # 0.01 # only absolute errors greater than thi... | bsd-3-clause |
mikebenfield/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
davidgbe/scikit-learn | sklearn/datasets/tests/test_rcv1.py | 322 | 2414 | """Test the rcv1 loader.
Skipped if rcv1 is not already downloaded to data_home.
"""
import errno
import scipy.sparse as sp
import numpy as np
from sklearn.datasets import fetch_rcv1
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing i... | bsd-3-clause |
andreadelprete/pinocchio_inv_dyn | python/pinocchio_inv_dyn/multi_contact/equilibrium_extremum_LP.py | 1 | 10572 | import numpy as np
import pinocchio_inv_dyn.optimization.solver_LP_abstract as optim #import optim.getNewSolver, LP_status, LP_status_string
from pinocchio_inv_dyn.multi_contact.utils import compute_centroidal_cone_generators
from pinocchio_inv_dyn.sot_utils import crossMatrix
import time
import random
class Equilibri... | gpl-2.0 |
Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/do/evolve/original.py | 1 | 4611 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | mit |
santis19/tesina-fisica | Flexion/modelo-sintetico/3-inversion_raiz-0.4/inversion_raiz.py | 1 | 2688 | import numpy as np
import matplotlib.pyplot as plt
from funciones import *
"""
Vamos a llevar a cabo el siguiente modelo:
a) Partimos de conocer la anomalia de Bouguer de la zona de estudio.
b) Tomaremos como punto de partida para la inversion de la raiz, la
raiz que se obtiene con el algoritmo de Park... | gpl-2.0 |
plaes/numpy | doc/sphinxext/docscrape_sphinx.py | 1 | 7673 | import re, inspect, textwrap, pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring, config=config)
... | bsd-3-clause |
biocore-ntnu/pyranges | pyranges/get_fasta.py | 1 | 2447 |
import sys
import pyranges as pr
import pandas as pd
def get_fasta(gr, path):
"""Get fasta sequence.
Parameters
----------
gr : PyRanges
Coordinates.
path : str
Path to fasta file
Returns
-------
Series
Sequences, one per interval.
Note
----
... | mit |
Monal5031/algos | linear_regression/linear_regression.py | 7 | 4376 | """
Linear regression is the most basic type of regression commonly used for
predictive analysis. The idea is preety simple, we have a dataset and we have
a feature's associated with it. The Features should be choose very cautiously
as they determine, how much our model will be able to make future predictions.
We try t... | mit |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/examples/api/histogram_path_demo.py | 6 | 1464 | """
This example shows how to use a path patch to draw a bunch of
rectangles. The technique of using lots of Rectangle instances, or
the faster method of using PolyCollections, were implemented before we
had proper paths with moveto/lineto, closepoly etc in mpl. Now that
we have them, we can draw collections of regul... | gpl-2.0 |
cwu2011/scikit-learn | examples/applications/plot_prediction_latency.py | 234 | 11277 | """
==================
Prediction Latency
==================
This is an example showing the prediction latency of various scikit-learn
estimators.
The goal is to measure the latency one can expect when doing predictions
either in bulk or atomic (i.e. one by one) mode.
The plots represent the distribution of the pred... | bsd-3-clause |
chendaniely/spring_2016_cs_5854-PathLinker | src/02-calculate_closest_source_target.py | 1 | 3959 | import pandas as pd
import networkx as nx
import tqdm
import helper
def setup():
pathways = ["BDNF",
"EGFR1",
"IL1",
"IL2",
"IL3",
"IL6",
"IL-7",
"KitReceptor",
"Leptin",
... | gpl-3.0 |
ContinuumIO/dask | dask/dataframe/methods.py | 1 | 16043 | import warnings
import numpy as np
import pandas as pd
from pandas.api.types import is_categorical_dtype, union_categoricals
from tlz import partition
from .utils import (
is_series_like,
is_index_like,
is_dataframe_like,
PANDAS_GT_0250,
hash_object_dispatch,
group_split_dispatch,
)
from ..uti... | bsd-3-clause |
gem/oq-engine | openquake/calculators/multi_risk.py | 1 | 10041 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2021 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | agpl-3.0 |
dkluffy/dkluff-code | code/opencv/t1.py | 1 | 1496 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
import pdb
import sys
import os
from pymouse import PyMouse
m = PyMouse()
from PIL import ImageGrab as ig
#ig.grabclipboard()
#img_rgb = ig.grabclipboard()
img_rgb = ig.grab()
print "image size:",img_rgb.width,img_rgb.height
print... | apache-2.0 |
majkelx/astwro | astwro/timeseries/tests/test_fnpeaks.py | 1 | 2381 | # coding=utf-8
from __future__ import absolute_import, division, print_function
#import matplotlib.pyplot as plt
__metaclass__ = type
import numpy as np
from ..fnpeaks import *
class TestFNpeaks:
def setup_class(self):
self.N = 10
self.M = 1000
self.lc = np.random.normal(10, 0.5, (sel... | mit |
andrewjrobinson/FreeCAD_sf_master | src/Mod/Plot/plotSeries/TaskPanel.py | 1 | 12621 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it un... | lgpl-2.1 |
rlpy/rlpy | rlpy/Domains/PST.py | 1 | 27871 | """Persistent search and track mission domain."""
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import super
from future import standard_library
standard_library.install_aliases()
from builtins import r... | bsd-3-clause |
huongttlan/statsmodels | statsmodels/examples/ex_regressionplots.py | 34 | 4457 | # -*- coding: utf-8 -*-
"""Examples for Regression Plots
Author: Josef Perktold
"""
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.sandbox.regression.predstd import wls_prediction_std
import statsmodels.graphics.regressionplots ... | bsd-3-clause |
pypot/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
wileeam/airflow | docs/conf.py | 1 | 17910 | # flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# 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 un... | apache-2.0 |
Victorian-Bioinformatics-Consortium/nesoni | nesoni/graph_layout.py | 1 | 26014 |
from nesoni import grace
import numpy
from numpy import random, linalg
import gtk
from matplotlib.figure import Figure
# uncomment to select /GTK/GTKAgg/GTKCairo
#from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureC... | gpl-2.0 |
treycausey/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 2 | 32006 | from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fe... | bsd-3-clause |
xavierwu/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 |
rodsol/opencog | opencog/python/spatiotemporal/temporal_events/composition/emperical_distribution.py | 34 | 6615 | import csv
import numpy
from spatiotemporal.temporal_events.relation_formulas import TemporalRelation
from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium, generate_random_events
from spatiotemporal.time_intervals import TimeInterval
__author__ = 'keyvan'
def trim_float(float_object, no_digits... | agpl-3.0 |
ppwwyyxx/tensorflow | tensorflow/python/kernel_tests/constant_op_eager_test.py | 33 | 21448 | # 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 |
IssamLaradji/scikit-learn | sklearn/linear_model/tests/test_omp.py | 12 | 7532 | # Author: Vlad Niculae
# Licence: 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 |
vortex-ape/scikit-learn | sklearn/neighbors/tests/test_nearest_centroid.py | 43 | 4640 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.utils.testing import assert_raises
# toy sampl... | bsd-3-clause |
edublancas/sklearn-model-evaluation | examples/learning_curve.py | 2 | 1336 | from sklearn.model_selection import learning_curve
from sklearn import model_selection
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.datasets import load_digits
import matplotlib.pyplot as plt
import numpy as np
from sklearn_evaluation import plot
digits = load_digits()
X, y = di... | mit |
ldirer/scikit-learn | examples/decomposition/plot_pca_vs_fa_model_selection.py | 70 | 4523 | """
===============================================================
Model selection with Probabilistic PCA and Factor Analysis (FA)
===============================================================
Probabilistic PCA and Factor Analysis are probabilistic models.
The consequence is that the likelihood of new data can be u... | bsd-3-clause |
MarkWieczorek/SHTOOLS | examples/python/IOStorageConversions/SHConversions.py | 2 | 2220 | #!/usr/bin/env python3
"""
This script tests the conversions between real and complex spherical harmonics
coefficients
"""
import numpy as np
import matplotlib.pyplot as plt
import pyshtools
from pyshtools import shio
from pyshtools import expand
pyshtools.utils.figstyle()
def main():
test_SHConversions()
e... | bsd-3-clause |
rohanp/scikit-learn | sklearn/manifold/isomap.py | 229 | 7169 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
coldmanck/Neural-Network-in-Python | assignment2/code_base/trainer.py | 1 | 1136 | from __future__ import print_function
import matplotlib.pyplot as plt
from code_base.classifiers.cnn import *
from code_base.data_utils import get_CIFAR2_data
from code_base.solver import Solver
import pickle
model = ThreeLayerConvNet(num_classes=2, weight_scale=0.001, hidden_dim=500, reg=0.001)
data = get_CIFAR2_data... | mit |
huongttlan/statsmodels | statsmodels/examples/ex_misc_tarma.py | 34 | 1875 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 03 23:01:44 2013
Author: Josef Perktold
"""
from __future__ import print_function
import numpy as np
from statsmodels.tsa.arima_process import arma_generate_sample, ArmaProcess
from statsmodels.miscmodels.tmodel import TArma
from statsmodels.tsa.arima_model import ARMA... | bsd-3-clause |
timothydmorton/keplerhack | inferpop.py | 1 | 2769 | from __future__ import print_function, division
import sys
import os, os.path
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
period_rng = (50, 300)
rp_rng = (0.75, 20)
# Read synthetic catalog
koi_file = sys.argv[1]
kois = pd.read_hdf(koi_file, 'kois'... | mit |
DonBeo/scikit-learn | examples/ensemble/plot_adaboost_hastie_10_2.py | 355 | 3576 | """
=============================
Discrete versus Real AdaBoost
=============================
This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates
the difference in performance between the discrete SAMME [2] boosting
algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate... | bsd-3-clause |
dhruv13J/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
vrv/tensorflow | tensorflow/python/estimator/inputs/inputs.py | 94 | 1290 | # Copyright 2017 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 |
gpospelov/BornAgain | Examples/varia/AxesInDifferentUnits.py | 1 | 3447 | """
In this example we demonstrate how to plot simulation results with
axes in different units (nbins, mm, degs and QyQz).
"""
import bornagain as ba
from bornagain import angstrom, deg, nm, nm2, kvector_t
import ba_plot
from matplotlib import pyplot as plt
from matplotlib import rcParams
def get_sample():
"""
... | gpl-3.0 |
Sentient07/scikit-learn | benchmarks/bench_isolation_forest.py | 46 | 3782 | """
==========================================
IsolationForest benchmark
==========================================
A test of IsolationForest on classical anomaly detection datasets.
"""
print(__doc__)
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import IsolationFore... | bsd-3-clause |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/sklearn/ensemble/tests/test_bagging.py | 13 | 25689 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | gpl-2.0 |
oesteban/fmriprep | fmriprep/interfaces/confounds.py | 1 | 14247 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Handling confounds.
.. testsetup::
>>> import os
>>> import pandas as pd
"""
import os
import re
import shutil
import numpy as np
import pandas as pd
from nipype import logging
from nipyp... | bsd-3-clause |
quoclieu/codebrew17-starving | env/lib/python3.5/site-packages/gcloud/monitoring/test__dataframe.py | 7 | 8218 | # Copyright 2016 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 agree... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.