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 |
|---|---|---|---|---|---|
tmerrick1/spack | var/spack/repos/builtin/packages/py-mdanalysis/package.py | 5 | 2741 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
jdemel/gnuradio | gr-filter/examples/resampler.py | 3 | 3842 | #!/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 |
e-koch/VLA_Lband | AT0206/Figures/m33_archival_comparison.py | 2 | 2606 |
'''
Create comparison figure of archival VLA M33 data
'''
from spectral_cube import SpectralCube
from signal_id import Noise, RadioMask
from radio_beam import Beam
import aplpy
from matplotlib import pyplot as p
from astropy import units as u
from astropy.io import fits
# Load in the cubes
cube = SpectralCube.read("... | mit |
TomAugspurger/pandas | pandas/plotting/_matplotlib/__init__.py | 2 | 2002 | from typing import TYPE_CHECKING, Dict, Type
from pandas.plotting._matplotlib.boxplot import (
BoxPlot,
boxplot,
boxplot_frame,
boxplot_frame_groupby,
)
from pandas.plotting._matplotlib.converter import deregister, register
from pandas.plotting._matplotlib.core import (
AreaPlot,
BarhPlot,
... | bsd-3-clause |
Og192/Python | pandasLearning/linearModel_forCom.py | 2 | 4386 | import sklearn
from sklearn import linear_model
from sklearn import tree
from sklearn.datasets import load_iris
import pandas as pd
import numpy as np
from sklearn.metrics import r2_score
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import ... | gpl-2.0 |
jeonghoonkang/BerePi | apps/excel/extract_ids/save_xlsx_list_df.py | 1 | 1609 | # -*- coding:utf-8 -*-
# Author : http://github.com/jeonghoonkang
from __future__ import print_function
import argparse
import pandas as pd
import os
import sys
import math
import xlsxwriter
def brush_argparse():
parser = argparse.ArgumentParser()
#parser.add_argument("-xlsx", help="xlsx 파일 이... | bsd-2-clause |
jrderuiter/pyim | setup.py | 1 | 1962 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
with open('HISTORY.rst') as history_file:
HISTORY = history_file.read()
REQUIREMENTS = [
'pyfaidx>=0.4.8.1', 'intervaltree>=2.1', 'tqdm>=4.7', 'to... | mit |
JaveyWang/5-char-real-number-recognition | src/segm_crop.py | 1 | 1566 | import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
import logging
from PIL import Image
import src.util.segment as segment
logging.basicConfig(level=logging.INFO)
DIR_DATASET = "../dataset"
DIR_IMAGE = os.path.join(DIR_DATASET, "image")
DIR_SAVE = "../dataset/segm_crop"
FILENAME_IMG_LIST = os.li... | mit |
pandas-ml/pandas-ml | pandas_ml/skaccessors/cross_decomposition.py | 3 | 1938 | #!/usr/bin/env python
from pandas_ml.core.accessor import _AccessorMethods
class CrossDecompositionMethods(_AccessorMethods):
"""
Accessor to ``sklearn.cross_decomposition``.
"""
_module_name = 'sklearn.cross_decomposition'
_method_mapper = dict(fit={'PLSCanonical': '_fit', 'CCA': '_f... | bsd-3-clause |
jlund3/ankura | ankura/run_free_classifier.py | 1 | 3142 | import sys
import ankura
import sklearn
import random
import bs4
import scipy
import os.path
import pickle
import time
from sklearn.linear_model import LinearRegression
import numpy as np
import socket
# LABEL_NAME = 'coarse_newsgroup'
# LABEL_NAME = 'label'
LABEL_NAME = 'binary_rating'
def run_experiment(num_topics=... | gpl-3.0 |
tomasreimers/tensorflow-emscripten | tensorflow/contrib/learn/python/learn/estimators/multioutput_test.py | 18 | 1920 | # 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 |
datapythonista/datapythonista.github.io | docs/cart_talk.py | 1 | 5718 | """Source code used for the talk:
http://www.slideshare.net/MarcGarcia11/cart-not-only-classification-and-regression-trees
"""
# data
import pandas as pd
data = {'age': [38, 49, 27, 19, 54, 29, 19, 42, 34, 64,
19, 62, 27, 77, 55, 41, 56, 32, 59, 35],
'distance': [6169.98, 7598.87, 3276.07, 15... | apache-2.0 |
MartinThoma/algorithms | ML/50-mlps/13-keras-cnn-dropout/hasy_tools.py | 1 | 44573 | #!/usr/bin/env python
"""
Tools for the HASY dataset.
Type `./hasy_tools.py --help` for the command line tools and `help(hasy_tools)`
in the interactive Python shell for the module options of hasy_tools.
See https://arxiv.org/abs/1701.08380 for details about the dataset.
"""
import csv
import json
import logging
im... | mit |
wkfwkf/statsmodels | statsmodels/sandbox/nonparametric/kdecovclass.py | 33 | 5703 | '''subclassing kde
Author: josef pktd
'''
import numpy as np
import scipy
from scipy import stats
import matplotlib.pylab as plt
class gaussian_kde_set_covariance(stats.gaussian_kde):
'''
from Anne Archibald in mailinglist:
http://www.nabble.com/Width-of-the-gaussian-in-stats.kde.gaussian_kde---td1955892... | bsd-3-clause |
marionleborgne/nupic.research | projects/sp_paper/analyze_trauma_experiment.py | 6 | 6604 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015-2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
DerThorsten/seglib | seglibpython/seglib/region_descriptors/pixel/codebook.py | 1 | 1746 | import numpy
# own code
from seglib.preprocessing import reshapeFromImage,reshapeToImage
from seglib.clustering import MiniBatchKMeans as MiniBatchKMeansCustom
from sklearn.cluster import MiniBatchKMeans as MiniBatchKMeansSklearn
#external
from sklearn.decomposition import PCA,ProbabilisticPCA, RandomizedPCA, ... | mit |
russel1237/scikit-learn | sklearn/setup.py | 225 | 2856 | 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 |
anirudhjayaraman/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 68 | 23597 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
ZenDevelopmentSystems/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
arahuja/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pandas/tests/io/test_clipboard.py | 13 | 4988 | # -*- coding: utf-8 -*-
import numpy as np
from numpy.random import randint
from textwrap import dedent
import pytest
import pandas as pd
from pandas import DataFrame
from pandas import read_clipboard
from pandas import get_option
from pandas.util import testing as tm
from pandas.util.testing import makeCustomDatafra... | mit |
466152112/scikit-learn | examples/linear_model/plot_ols.py | 220 | 1940 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | bsd-3-clause |
Aasmi/scikit-learn | doc/sphinxext/gen_rst.py | 142 | 40026 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
simonward86/MySJcLqwwx | ML_test.py | 1 | 10331 | from datetime import datetime
import Methods as models
import Predictors as predictors
import stock_tools as st
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib import gridspec
# Create a template with the available variables
interest = 'SPY'
start_date = datetime.strptime('2000-0... | apache-2.0 |
jlegendary/nupic | examples/opf/clients/hotgym/anomaly/one_gym/run.py | 15 | 4940 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/scipy/stats/_discrete_distns.py | 15 | 20781 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy import special
from scipy.special import entr, gammaln as gamln
from numpy import floor, ceil, log, exp, sqrt, log1p, expm1, tanh, cosh, s... | bsd-3-clause |
cdegroc/scikit-learn | sklearn/externals/joblib/__init__.py | 1 | 4402 | """ Joblib is a set of tools to provide **lightweight pipelining in
Python**. In particular, joblib offers:
1. transparent disk-caching of the output values and lazy re-evaluation
(memoize pattern)
2. easy simple parallel computing
3. logging and tracing of the execution
Joblib is optimized to be **fast*... | bsd-3-clause |
Arkahnn/VanillaRNN | main.py | 1 | 2588 | import matplotlib.pyplot as plt
import numpy as np
import random
import VanillaRNN
import tools
if __name__ == "__main__":
# Set a seed to test the network. After having tested it, you can take it out
np.random.seed(256)
random.seed(256)
K, eta, alpha, H_size, mini_batch_size, t_prev = 300, 0.1, 0.9,... | apache-2.0 |
frederick623/HTI | ae_rebate/ae_rebate.py | 1 | 3784 | import os
import re
import csv
import xlrd
import fnmatch
import pandas as pd
import numpy as np
import win32com.client
def xlsx_to_arr(xlsx_file, worksheet=0, row_start=0, col_start=0, row_end=-1, col_end=-1):
arr = []
wb = xlrd.open_workbook(xlsx_file)
ws = wb.sheet_by_index(worksheet)
row_end = ws.nrows if ro... | apache-2.0 |
akloster/bokeh | bokeh/cli/core.py | 42 | 16025 | from __future__ import absolute_import, print_function
import sys, os
from six.moves.urllib import request as urllib2
from six.moves import cStringIO as StringIO
import pandas as pd
try:
import click
is_click = True
except ImportError:
is_click = False
from . import help_messages as hm
from .utils import... | bsd-3-clause |
JohnReid/pybool | setup.py | 1 | 4578 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright John Reid 2010, 2011, 2012, 2013
#
"""
aksetup setup script for pybool. Adapted from http://git.tiker.net/pyublas.git/tree.
"""
import os
def read(*fnames):
"""
Utility function to read the README file.
Used for the long_description. It's nic... | mit |
eggplantbren/ExperimentalNS | TwoScalars/DNest/postprocess.py | 1 | 7100 | # Copyright (c) 2009, 2010, 2011, 2012 Brendon J. Brewer.
#
# This file is part of DNest3.
#
# DNest3 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 ... | gpl-3.0 |
kmike/scikit-learn | sklearn/linear_model/coordinate_descent.py | 2 | 47509 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD Style.
import sys
import warnings
import itertools
import operator
from abc import AB... | bsd-3-clause |
UNR-AERIAL/scikit-learn | sklearn/tests/test_calibration.py | 213 | 12219 | # 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 |
georgid/sms-tools | software/models_interface/spsModel_function.py | 2 | 3560 | # function to call the extractHarmSpec analysis/synthesis functions in software/models/spsModel.py
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import get_window
import spsModel as SPS
import... | agpl-3.0 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/backends/backend_gdk.py | 2 | 16162 | from __future__ import division, print_function
import math
import os
import sys
import warnings
def fn_name(): return sys._getframe(1).f_code.co_name
import gobject
import gtk; gdk = gtk.gdk
import pango
pygtk_version_required = (2,2,0)
if gtk.pygtk_version < pygtk_version_required:
raise ImportError ("PyGTK %d.... | mit |
cxhernandez/pcled | scripts/python/ledcntrl.py | 1 | 1364 | #! /usr/bin/env python
import pcled
from pcled.utils import assertion, execute, get_args
try:
from pynvml import nvmlInit, nvmlDeviceGetHandleByIndex
except ImportError:
nvmlInit = nvmlDeviceGetHandleByIndex = None
try:
import psutil
except ImportError:
psutil = None
try:
import ... | mit |
huletlab/PyAbel | examples/example_dasch_methods.py | 1 | 1522 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
"""example_dasch_methods.py.
"""
import numpy as np
import abel
import matplotlib.pyplot as plt
# Dribinski sample image size 501x501
n = 501
IM = abel.tools.analytical.sample_image(n... | mit |
xcompass/pandas-gbq | setup.py | 1 | 1378 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import versioneer
NAME = 'pandas-gbq'
# versioning
cmdclass = versioneer.get_cmdclass()
def readme():
with open('README.rst') as f:
return f.read()
INSTALL_REQUIRES = (
['pandas', 'httplib2', 'google-api-p... | bsd-3-clause |
ngoix/OCRF | sklearn/cluster/tests/test_k_means.py | 41 | 27789 | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | bsd-3-clause |
dikaiosune/nau-bb-learn-reporting | nau_bb_reporting/reports/hardlinks.py | 1 | 7173 | """
This report looks at all of the course content HTML and tries to find
links that point back to Bb Learn but are not managed by the LMS or CMS
(i.e. they are copypasta from a user who was smart but not smart enough).
In a given term, we get all of the course content HTML, and then begin
ingesting it into BeautifulS... | mit |
jseabold/statsmodels | statsmodels/discrete/tests/test_count_model.py | 4 | 27801 | from statsmodels.compat.platform import PLATFORM_LINUX32
import numpy as np
from numpy.testing import (assert_,
assert_equal, assert_array_equal, assert_allclose)
import pytest
import pandas as pd
import statsmodels.api as sm
from .results.results_discrete import RandHIE
from .test_discrete... | bsd-3-clause |
zorojean/scikit-learn | examples/neighbors/plot_species_kde.py | 282 | 4059 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
MicrosoftGenomics/FaST-LMM | fastlmm/feature_selection/PerformSelectionDistributable.py | 1 | 17266 | # std modules
from collections import defaultdict
import gzip
import bz2
import cPickle
import time
import os
import gc
import logging
# common modules
import matplotlib
matplotlib.use('Agg',warn=False) #This lets it work even on machines without graphics displays
import scipy as sp
import numpy as np
import pandas a... | apache-2.0 |
esa/pagmo | PyGMO/topology/__init__.py | 7 | 10175 | # -*- coding: utf-8 -*-
from PyGMO.topology._topology import *
# Some methods added to interface to networkx
def _to_networkx(self):
"""
Export topology as a networkx DiGraph.
"""
try:
import networkx as nx
except ImportError:
raise ImportError('Could not import the networkx module... | gpl-3.0 |
nikitasingh981/scikit-learn | examples/linear_model/plot_iris_logistic.py | 119 | 1679 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <https://en.wikipedia.org/wiki/Iris_... | bsd-3-clause |
moonbury/pythonanywhere | github/MasteringMLWithScikit-learn/8365OS_04_Codes/s.py | 3 | 1368 | import pandas as pd
from sklearn.cross_validation import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.grid_search import GridSearchCV
from sklearn.pipeline import Pipeline
pipeline = Pipeline([
('vect', TfidfV... | gpl-3.0 |
meduz/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 |
TomAugspurger/pandas | pandas/tests/indexing/multiindex/test_iloc.py | 5 | 4991 | 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 data by default.
... | bsd-3-clause |
ishanic/scikit-learn | examples/ensemble/plot_forest_iris.py | 335 | 6271 | """
====================================================================
Plot the decision surfaces of ensembles of trees on the iris dataset
====================================================================
Plot the decision surfaces of forests of randomized trees trained on pairs of
features of the iris dataset.
... | bsd-3-clause |
anderspitman/scikit-bio | skbio/metadata/_testing.py | 1 | 37014 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
Yurlungur/cactus_scripts | plot_robust_stability_evolution.py | 1 | 3112 | #!/usr/bin/env python2
"""
plot_robust_stability_evolution.py
Author: Jonah Miller (jonah.maxwell.miller@gmail.com)
Time-stamp: <2014-03-13 11:39:30 (jonah)>
This little program plots the L2 norm of the (x,y)-component of the
3-metric of the Minkowski spacetime as a function of time. This is
very useful for the robus... | gpl-2.0 |
nilmtk/nilmtk | nilmtk/dataset_converters/refit/convert_refit.py | 1 | 4996 | '''
REFIT dataset converter for the clean version avaiable at the URLs below:
"REFIT: Electrical Load Measurements (Cleaned)"
https://pureportal.strath.ac.uk/en/datasets/refit-electrical-load-measurements-cleaned
https://pureportal.strath.ac.uk/files/52873459/Processed_Data_CSV.7z
https://pureportal.strath.ac.uk/files... | apache-2.0 |
ltiao/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py | 230 | 2649 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... | bsd-3-clause |
robin-lai/scikit-learn | sklearn/neighbors/tests/test_dist_metrics.py | 230 | 5234 | import itertools
import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from nose import SkipTest
def dist_func(x1, x2, p):
return np.sum((x1 - x2) ** p) ** (1. / p)
de... | bsd-3-clause |
rushter/MLAlgorithms | examples/nnet_mlp.py | 1 | 2579 | import logging
try:
from sklearn.model_selection import train_test_split
except ImportError:
from sklearn.cross_validation import train_test_split
from sklearn.datasets import make_classification
from sklearn.datasets import make_regression
from sklearn.metrics import roc_auc_score
from mla.metrics.metrics im... | mit |
richlewis42/pandas-learn | pdlearn/adaptor/transformer.py | 1 | 1140 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of pandas-learn
# https://github.com/RichLewis42/pandas-learn
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
# Copyright (c) 2015, Rich Lewis <rl403@cam.ac.uk>
"""
pdlearn.adaptor.transformer
~~~~~~~~~~~~~~~~~~~~~~~~~~~
... | mit |
syershov/omim | search/search_quality/scoring_model.py | 4 | 9026 | #!/usr/bin/env python3
from math import exp, log
from scipy.stats import pearsonr
from sklearn import cross_validation, grid_search, svm
import argparse
import collections
import itertools
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import random
import sys
MAX_DISTANCE_METERS = 2e6
MAX_RA... | apache-2.0 |
snap-stanford/ogb | ogb/nodeproppred/make_master_file.py | 1 | 4402 | ### script for writing meta information of datasets into master.csv
### for node property prediction datasets.
import pandas as pd
dataset_dict = {}
dataset_list = []
### add meta-information about protein function prediction task
name = 'ogbn-proteins'
dataset_dict[name] = {'num tasks': 112, 'num classes': 2, 'eval ... | mit |
cytomine/Cytomine-python-datamining | cytomine-datamining/algorithms/sldc/examples/with_pyxit/pyxit_classifier.py | 1 | 5219 | # -*- coding: utf-8 -*-
import os
import pickle
import numpy as np
import tempfile
from cytomine_sldc import TileCache
from sklearn.utils import check_random_state
from sldc import PolygonClassifier, TileExtractionException, Loggable, SilentLogger, Logger
__author__ = "Mormont Romain <romain.mormont@gmail.com>"
__ve... | apache-2.0 |
freedomflyer/test | lab1/plotting.py | 1 | 2686 | import optparse
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import *
import matplotlib.patches as mpatches
# Class that parses a file and plots several graphs
class Plotter:
def __init__(self):
# create some fake data
self.x = []
self.y = []
self.all = []
... | gpl-2.0 |
htm-community/nupic.critic | nupic_output.py | 3 | 6198 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
AnasGhrab/scikit-learn | examples/semi_supervised/plot_label_propagation_versus_svm_iris.py | 286 | 2378 | """
=====================================================================
Decision boundary of label propagation versus SVM on the Iris dataset
=====================================================================
Comparison for decision boundary generated on iris dataset
between Label Propagation and SVM.
This demon... | bsd-3-clause |
ga7g08/sympy | sympy/interactive/session.py | 43 | 15119 | """Tools for setting up interactive sessions. """
from __future__ import print_function, division
from distutils.version import LooseVersion as V
from sympy.core.compatibility import range
from sympy.external import import_module
from sympy.interactive.printing import init_printing
preexec_source = """\
from __futu... | bsd-3-clause |
fabianp/scikit-learn | examples/model_selection/grid_search_digits.py | 227 | 2665 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.grid_search.GridSearc... | bsd-3-clause |
adamhajari/spyre | spyre/tezt_app2.py | 1 | 2175 | # from spyre import spyre
# import spyre
import numpy as np
import pandas as pd
from numpy import pi
try:
from . import server
except Exception:
import server
server.include_df_index = True
class TestApp2(server.App):
title = "Test App 2"
inputs = [
{
"type": 'slider',
... | mit |
katyhuff/cyder | output/line_plot.py | 1 | 8607 |
"""
Comparison of griddata and tricontour for an unstructured triangular grid.
"""
from __future__ import print_function
import matplotlib.pyplot as plt
from pylab import *
import matplotlib.tri as tri
import numpy as np
from numpy.random import uniform, seed
from matplotlib.mlab import griddata
from collections imp... | bsd-3-clause |
joergdietrich/astropy | astropy/time/tests/test_basic.py | 2 | 44916 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TEST_UNICODE_LITERALS
import copy
import functools
import sys
import datetime
from copy import deepcopy
import numpy as np
from ...tests.helper import pytest, catch_warnings
from ...tests.disable_internet import INTERNET_OFF
from ...extern import six... | bsd-3-clause |
SwissTPH/app-rural-geolocator | createTasks.py | 1 | 10671 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Citizen Cyberscience Centre, Swiss TPH
#
# This program 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
#... | gpl-3.0 |
jm-begon/scikit-learn | examples/cross_decomposition/plot_compare_cross_decomposition.py | 142 | 4761 | """
===================================
Compare cross decomposition methods
===================================
Simple usage of various cross decomposition algorithms:
- PLSCanonical
- PLSRegression, with multivariate response, a.k.a. PLS2
- PLSRegression, with univariate response, a.k.a. PLS1
- CCA
Given 2 multivari... | bsd-3-clause |
mac389/at-risk-agents | visualization.py | 1 | 10167 | import json,random,os, logging, itertools, brewer2mpl
import matplotlib.pyplot as plt
import numpy as np
import Graphics as artist
from scipy.stats import kruskal
from matplotlib import rcParams
from awesome_print import ap
rcParams['text.usetex'] = True
'''
File Structure Summary
Variable : Filename
ini... | mit |
txominpelu/airflow | airflow/hooks/hive_hooks.py | 17 | 14064 | from __future__ import print_function
from builtins import zip
from past.builtins import basestring
import csv
import logging
import subprocess
from tempfile import NamedTemporaryFile
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from hive_ser... | apache-2.0 |
degoldschmidt/pytrack-analysis | examples/get_animate.py | 1 | 14646 | """
===============
Demo Animation
===============
"""
from pytrack_analysis.profile import get_profile
import numpy as np
import imageio
import pandas as pd
import os, sys
import os.path as op
from pytrack_analysis.plot import set_font, swarmbox
from pytrack_analysis.database import Experiment
import pytrack_analysis... | gpl-3.0 |
platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-signal-periodogram-1.py | 1 | 1149 | from scipy import signal
import matplotlib.pyplot as plt
# Generate a test signal, a 2 Vrms sine wave at 1234 Hz, corrupted by
# 0.001 V**2/Hz of white noise sampled at 10 kHz.
fs = 10e3
N = 1e5
amp = 2*np.sqrt(2)
freq = 1234.0
noise_power = 0.001 * fs / 2
time = np.arange(N) / fs
x = amp*np.sin(2*np.pi*freq*time)
x ... | gpl-2.0 |
luo66/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 |
raghavrv/scikit-learn | examples/linear_model/plot_robust_fit.py | 147 | 3050 | """
Robust linear estimator fitting
===============================
Here a sine function is fit with a polynomial of order 3, for values
close to zero.
Robust fitting is demoed in different situations:
- No measurement errors, only modelling errors (fitting a sine with a
polynomial)
- Measurement errors in X
- M... | bsd-3-clause |
homeslike/OpticalTweezer | scripts/p0.1_at0.05/vCOMhist.py | 28 | 1192 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import sys
# import vCOMdata.dat as array
# folder="../output/runs/170123_2033/"
folder="../output/runs/"+str(sys.argv[1])
# when = str(sys.argv[1])
for i in range(0,len(sys.argv)):
print(str(i) + ": "+ str(sys.argv[i]))
# data = np.... | mit |
CforED/Machine-Learning | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
jaidevd/scikit-learn | examples/mixture/plot_gmm_covariances.py | 89 | 4724 | """
===============
GMM covariances
===============
Demonstration of several covariances types for Gaussian mixture models.
See :ref:`gmm` for more information on the estimator.
Although GMM are often used for clustering, we can compare the obtained
clusters with the actual classes from the dataset. We initialize th... | bsd-3-clause |
zorojean/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 |
demh/cuRRBS | paper/Figure_1/Figure_1A/obtain_distributions_and_fragments_old.py | 3 | 17745 | # -*- coding: utf-8 -*-
###########################################################################################
######### cuRRBS: customised Reduced Representation Bisulfite Sequencing #########
###########################################################################################
#
# Created by Danie... | gpl-3.0 |
TobiasLundby/UAST | Module7/route_plan_class.py | 1 | 4997 | #!/usr/bin/python
#/****************************************************************************
# route_plan_class
# Copyright (c) 2016, Tobias Lundby <tobiaslundby@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | bsd-3-clause |
humdings/zipline | zipline/examples/dual_moving_average.py | 8 | 3514 | #!/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 |
dendisuhubdy/tensorflow | tensorflow/contrib/timeseries/examples/known_anomaly.py | 14 | 7880 | # 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 |
studywolf/blog | SymPy/test_timing.py | 1 | 3065 | '''
Copyright (C) 2016 Travis DeWolf
This program 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 program is distributed in the hope t... | gpl-3.0 |
drammock/mne-python | examples/decoding/ssd_spatial_filters.py | 10 | 5433 | """
===========================================================
Compute Spectro-Spatial Decomposition (SSD) spatial filters
===========================================================
In this example, we will compute spatial filters for retaining
oscillatory brain activity and down-weighting 1/f background signals
as ... | bsd-3-clause |
felipemontefuscolo/bitme | plotly_test.py | 1 | 1306 | import pandas as pd
import datetime
def read_data(file: str, begin: pd.Timestamp=None, end: pd.Timestamp=None) -> pd.DataFrame:
timeparser = lambda s: pd.datetime.strptime(str(s), '%Y-%m-%dT%H:%M:%S')
data = pd.DataFrame(pd.read_csv(file, parse_dates=True, index_col='time', date_parser=timeparser))
if beg... | mpl-2.0 |
jrabenoit/fizzy | prep.py | 1 | 4937 | #!/usr/bin/env python3
import pandas as pd
import os, scipy.stats
import numpy as np
def Misc():
#Encode categorical variables as integers rather than using onehot or dummy variables- do on a column-by-column basis
demow['ETHNIC']=pd.Categorical(demow['ETHNIC']).codes
#pivots table
d60p= d60.pivo... | gpl-3.0 |
fredhusser/scikit-learn | sklearn/datasets/mldata.py | 309 | 7838 | """Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: BSD 3 clause
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# Pyt... | bsd-3-clause |
pelson/cartopy | lib/cartopy/examples/tube_stations.py | 3 | 2383 | """
Tube Stations
-------------
Produces a map showing London Underground station locations with high
resolution background imagery provided by OpenStreetMap.
"""
from matplotlib.path import Path
import matplotlib.pyplot as plt
import numpy as np
import cartopy.crs as ccrs
from cartopy.io.img_tiles import OSM
def ... | lgpl-3.0 |
OshynSong/scikit-learn | sklearn/neighbors/classification.py | 132 | 14388 | """Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by ... | bsd-3-clause |
pv/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 |
vortex-ape/scikit-learn | sklearn/linear_model/bayes.py | 9 | 21171 | """
Various bayesian regression
"""
from __future__ import print_function
# Authors: V. Michel, F. Pedregosa, A. Gramfort
# License: BSD 3 clause
from math import log
import numpy as np
from scipy import linalg
from scipy.linalg import pinvh
from .base import LinearModel, _rescale_data
from ..base import RegressorMi... | bsd-3-clause |
hyflashstar/gupiao | src/交易策略模拟_不能做空.py | 1 | 4894 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 29 11:27:56 2017
@author: 53771
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 25 15:05:53 2017
@author: 53771
"""
import loadStock as ls
import PairTrading as pairTrading
import tushare as ts
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
... | apache-2.0 |
cisl/gmor | gmor/model.py | 1 | 73742 | """
model.py
__author__ = "David Bristow, Alison Goshulak"
__copyright__ = "Copyright 2016"
__credits__ = []
__maintainer__ = "David Bristow"
__status__ = "Development"
"""
#pylint: disable=too-many-arguments
#pylint: disable=too-many-instance-attributes
#pylint: disable=trailing-whitespace
#import csv
#import random
... | gpl-3.0 |
samuel1208/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 |
RealImpactAnalytics/airflow | tests/hooks/test_hive_hook.py | 1 | 10247 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
annoviko/pyclustering | pyclustering/cluster/tests/integration/it_dbscan.py | 1 | 6718 | """!
@brief Integration-tests for DBSCAN algorithm.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest
import matplotlib
matplotlib.use('Agg')
from pyclustering.cluster.tests.dbscan_templates import DbscanTestTemplates
from pyclustering.clu... | gpl-3.0 |
marioem/data-science-from-scratch | code/visualizing_data.py | 58 | 5116 | import matplotlib.pyplot as plt
from collections import Counter
def make_chart_simple_line_chart(plt):
years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]
gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]
# create a line chart, years on x-axis, gdp on y-axis
plt.plot(years, gdp, color='gr... | unlicense |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/compat/__init__.py | 7 | 11629 | """
compat
======
Cross-compatible functions for Python 2 and 3.
Key items to import for 2/3 compatible code:
* iterators: range(), map(), zip(), filter(), reduce()
* lists: lrange(), lmap(), lzip(), lfilter()
* unicode: u() [u"" is a syntax error in Python 3.0-3.2]
* longs: long (int in Python 3)
* callable
* iterab... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.