repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
PTDreamer/dRonin
python/ins/cins.py
11
3838
from sympy import symbols, lambdify, sqrt from sympy import MatrixSymbol, Matrix from numpy import cos, sin, power from sympy.matrices import * from quaternions import * import numpy import ins # this is the set of (currently) recommend INS settings. modified from # https://raw.githubusercontent.com/wiki/TauLabs/TauL...
gpl-3.0
q1ang/scikit-learn
examples/decomposition/plot_pca_vs_fa_model_selection.py
142
4467
""" =============================================================== 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
Zhang-O/small
tensor__cpu/http/spyser_liyou.py
1
5473
import urllib.request from bs4 import BeautifulSoup import re import urllib.parse import xlsxwriter import pandas as pd import numpy as np from urllib import request, parse from urllib.error import URLError import json import multiprocessing import time # 详情页面的 地址 存放在这里面 urls_of_detail = [] total_pages = 0 # 要爬取的内容 ...
mit
harisbal/pandas
pandas/tests/test_panel.py
1
95658
# -*- coding: utf-8 -*- # pylint: disable=W0612,E1101 from warnings import catch_warnings, simplefilter from datetime import datetime import operator import pytest import numpy as np from pandas.core.dtypes.common import is_float_dtype from pandas import (Series, DataFrame, Index, date_range, isna, notna, ...
bsd-3-clause
RomainBrault/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
pratapvardhan/pandas
pandas/tests/io/json/test_normalize.py
6
16358
import pytest import numpy as np import json import pandas.util.testing as tm from pandas import compat, Index, DataFrame from pandas.io.json import json_normalize from pandas.io.json.normalize import nested_to_record @pytest.fixture def deep_nested(): # deeply nested data return [{'country': 'USA', ...
bsd-3-clause
chanceraine/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/legend.py
69
30705
""" Place a legend on the axes at location loc. Labels are a sequence of strings and loc can be a string or an integer specifying the legend location The location codes are 'best' : 0, (only implemented for axis legends) 'upper right' : 1, 'upper left' : 2, 'lower left' : 3, 'lower right' : 4...
agpl-3.0
UKPLab/semeval2017-scienceie
code/convNet.py
1
7292
#!/usr/bin/python # -*- coding: UTF-8 -*- from extras import VSM, read_and_map from representation import VeryStupidCBOWMapper, CharMapper import sys, numpy as np,os from sklearn.linear_model import LogisticRegression from sklearn.metrics import confusion_matrix from sklearn.metrics import precision_recall_fscore_sup...
apache-2.0
ran5515/DeepDecision
tensorflow/examples/tutorials/input_fn/boston.py
76
2920
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/pandas/util/testing.py
3
92623
from __future__ import division # pylint: disable-msg=W0402 import re import string import sys import tempfile import warnings import inspect import os import subprocess import locale import traceback from datetime import datetime from functools import wraps, partial from contextlib import contextmanager from distuti...
mit
jaidevd/scikit-learn
sklearn/cluster/bicluster.py
26
19870
"""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
ephes/scikit-learn
sklearn/__init__.py
154
3014
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
bsd-3-clause
zhoulingjun/zipline
zipline/assets/assets.py
8
34670
# Copyright 2015 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 writ...
apache-2.0
vivekmishra1991/scikit-learn
sklearn/linear_model/randomized_l1.py
68
23405
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
faroit/loudness
python/tests/test_OME.py
1
2084
import numpy as np import matplotlib.pyplot as plt import loudness as ln def plotResponse(freqPoints, dataPoints, freqsInterp, responseInterp, ylim=(-40, 10), title = ""): if np.any(dataPoints): plt.semilogx(freqPoints, dataPoints, 'o') plt.semilogx(freqsInterp, resp...
gpl-3.0
jrshust/spark
python/setup.py
25
9659
#!/usr/bin/env python # # 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 "Li...
apache-2.0
xyguo/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
55
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
FernanOrtega/DAT210x
Module2/assignment3.py
1
1065
import pandas as pd # TODO: Load up the dataset # Ensuring you set the appropriate header column names # df = pd.read_csv('Datasets/servo.data', names=['motor', 'screw', 'pgain', 'vgain', 'class']) print df.head() # TODO: Create a slice that contains all entries # having a vgain equal to 5. Then print the # length ...
mit
DeepVisionTeam/TensorFlowBook
Titanic/data_processing.py
2
4807
import os import re import pandas as pd import tensorflow as tf pjoin = os.path.join DATA_DIR = pjoin(os.path.dirname(__file__), 'data') train_data = pd.read_csv(pjoin(DATA_DIR, 'train.csv')) test_data = pd.read_csv(pjoin(DATA_DIR, 'test.csv')) # Translation: # Don: an honorific title used in Spain, Portugal, Ital...
apache-2.0
tomzw11/Pydrone
route.py
1
2000
import matplotlib.pyplot as plt import matplotlib.patches as patches def route(root): root_height = root[2] coordinates = [\ [0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\ [-0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\ [-0.42*root_height+root[0],-0.15*root_height+root[1]...
mit
moutai/scikit-learn
sklearn/cluster/tests/test_dbscan.py
176
12155
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
MysterionRise/fantazy-predictor
enriching_data.py
1
10896
#!/usr/local/bin/python # -*- coding: utf-8 -*- import calendar import os import pandas as pd # Правила подсчета очков: # # за участие в матче – 2 очка, если сыграно 10 минут и больше; 1 очко, если сыграно меньше 10 минут # # за победу – 3 очка (в гостях); 2 очка (дома) # # за поражение – минус 3 очка (дома); минуc...
mit
bmazin/SDR
Projects/ChannelizerSim/legacy/bin_width_1st_stage.py
1
1524
import matplotlib.pyplot as plt import scipy.signal import numpy as np import math import random from matplotlib.backends.backend_pdf import PdfPages samples = 51200 L = samples/512 fs = 512e6 dt = 1/fs time = [i*dt for i in range(samples)] def pfb_fir(x): N = len(x) T = 4 L = 512 bin_width_scale = 2.5 dx = T*...
gpl-2.0
nistats/nistats
examples/03_second_level_models/plot_oasis.py
1
6030
"""Voxel-Based Morphometry on Oasis dataset ======================================== This example uses Voxel-Based Morphometry (VBM) to study the relationship between aging, sex and gray matter density. The data come from the `OASIS <http://www.oasis-brains.org/>`_ project. If you use it, you need to agree with the d...
bsd-3-clause
MPIBGC-TEE/CompartmentalSystems
notebooks/ELM_dask.py
1
1730
#from dask.distributed import Client import xarray as xr import numpy as np import pandas as pd import importlib import ELMlib importlib.reload(ELMlib) #client = Client(n_workers=2, threads_per_worker=2, memory_limit='1GB') #client #ds = xr.open_dataset('../Data/14C_spinup_holger_fire.2x2_small.nc') from netCDF4 imp...
mit
ky822/scikit-learn
sklearn/utils/metaestimators.py
283
2353
"""Utilities for meta-estimators""" # Author: Joel Nothman # Andreas Mueller # Licence: BSD from operator import attrgetter from functools import update_wrapper __all__ = ['if_delegate_has_method'] class _IffHasAttrDescriptor(object): """Implements a conditional property using the descriptor protocol. ...
bsd-3-clause
cpcloud/ibis
ibis/pandas/execution/tests/test_structs.py
1
2175
from collections import OrderedDict import pandas as pd import pandas.util.testing as tm import pytest import ibis import ibis.expr.datatypes as dt @pytest.fixture(scope="module") def value(): return OrderedDict([("fruit", "pear"), ("weight", 0)]) @pytest.fixture(scope="module") def struct_client(value): ...
apache-2.0
mobarski/sandbox
rsm/v4.py
2
5658
from common2 import * # NAME IDEA -> pooling/random/sparse/distributed hebbian/horde/crowd/fragment/sample memory # FEATURES: # + boost -- neurons with empty mem slots learn faster # + noise -- # + dropout -- temporal disabling of neurons # + decay -- remove from mem # + negatives -- learning to avoid detecting some...
mit
c11/yatsm
yatsm/classification/__init__.py
3
2042
""" Module storing classifiers for YATSM Contains utilities and helper classes for classifying timeseries generated using YATSM change detection. """ import logging from sklearn.ensemble import RandomForestClassifier import yaml from ..errors import AlgorithmNotFoundException logger = logging.getLogger('yatsm') _a...
mit
SKIRT/PTS
magic/plot/imagegrid.py
1
106384
# -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ## \package pts.magic.pl...
agpl-3.0
glamp/coffe2py
main.py
1
1282
import sys from IPython.core.interactiveshell import InteractiveShell import pandasjson as json import StringIO if __name__=="__main__": mode = "ipython" line = sys.stdin.readline() shell = InteractiveShell() while line: # explicitly write to stdout sys.stdout.write(line) sys.st...
bsd-2-clause
capntransit/carfree-council
cfcensus2010.py
1
1828
import sys, os, json, time import pandas as pd BOROCODE = {'61' : '1', '05' : '2', '47': '3', '81' : '4', '85': '5'} if (len(sys.argv) < 2): print ("Usage: cfcensus.py census.csv districts.json") exit() censusfile = sys.argv[1] councilfile = sys.argv[2] TRACTCOL = 'BoroCT' # rename this for 2000 census ...
gpl-3.0
Omegaphora/external_chromium_org
chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py
35
11261
#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Do all the steps required to build and test against nacl.""" import optparse import os.path import re import shutil import subproc...
bsd-3-clause
CartoDB/cartoframes
cartoframes/io/managers/context_manager.py
1
22518
import time import pandas as pd from warnings import warn from carto.auth import APIKeyAuthClient from carto.datasets import DatasetManager from carto.exceptions import CartoException, CartoRateLimitException from carto.sql import SQLClient, BatchSQLClient, CopySQLClient from pyrestcli.exceptions import NotFoundExce...
bsd-3-clause
hsuantien/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_collections.py
2
21231
""" Tests specific to the collections module. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import io import numpy as np from numpy.testing import ( assert_array_equal, assert_array_almost_equal, assert_equal) import pytest import matplotlib.pypl...
mit
sthyme/ZFSchizophrenia
BehaviorAnalysis/Alternative_Analyses/Correlation_between_genes/correlations_DISTANCE_betweengenes.py
1
5605
import matplotlib matplotlib.use('Agg') import matplotlib.pylab as plt import matplotlib.colors as mat_col from matplotlib.colors import LinearSegmentedColormap import scipy import scipy.cluster.hierarchy as sch from scipy.cluster.hierarchy import set_link_color_palette import numpy as np import pandas as pd import glo...
mit
sillvan/hyperspy
hyperspy/drawing/_markers/horizontal_line_segment.py
1
3320
# -*- coding: utf-8 -*- # Copyright 2007-2011 The Hyperspy developers # # This file is part of Hyperspy. # # Hyperspy 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...
gpl-3.0
giacomov/lclike
lclike/duration_computation.py
1
12141
__author__ = 'giacomov' # !/usr/bin/env python # add |^| to the top line to run the script without needing 'python' to run it at cmd # importing modules1 import numpy as np # cant use 'show' inside the farm import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib import gridspec imp...
bsd-3-clause
numenta/nupic.vision
src/nupic/vision/data/OCR/characters/parseJPG.py
3
7772
#!/usr/bin/python2 ''' This script parses JPEG images of text documents to isolate and save images of individual characters. The size of these output images in pixels is specified by the parameters desired_height and desired_width. The JPEG images are converted to grey scale using a parameter called luminance_thre...
agpl-3.0
google-research/social_cascades
news/graph_processing.py
1
1943
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
equialgo/scikit-learn
sklearn/utils/tests/test_random.py
85
7349
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
gfyoung/pandas
pandas/io/formats/printing.py
3
17290
""" Printing tools. """ import sys from typing import ( Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Sized, Tuple, TypeVar, Union, ) from pandas._config import get_option from pandas.core.dtypes.inference import is_sequence EscapeChars = Union[Map...
bsd-3-clause
jaeilepp/eggie
mne/viz/_3d.py
1
24122
"""Functions to make 3D plots with M/EEG data """ from __future__ import print_function # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # ...
bsd-2-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/nltk/probability.py
12
81647
# -*- coding: utf-8 -*- # Natural Language Toolkit: Probability and Statistics # # Copyright (C) 2001-2012 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> (additions) # Trevor Cohn <tacohn@cs.mu.oz.au> (additions) # Peter Ljunglöf <pete...
agpl-3.0
phobson/pygridtools
pygridtools/tests/test_core.py
2
24947
import os import warnings from pkg_resources import resource_filename import tempfile import numpy from numpy import nan import pandas from shapely.geometry import Polygon import geopandas import pytest import numpy.testing as nptest import pandas.util.testing as pdtest from pygridtools import core from pygridgen.te...
bsd-3-clause
nvoron23/statsmodels
statsmodels/graphics/mosaicplot.py
6
26886
"""Create a mosaic plot from a contingency table. It allows to visualize multivariate categorical data in a rigorous and informative way. see the docstring of the mosaic function for more informations. """ # Author: Enrico Giampieri - 21 Jan 2013 from __future__ import division from statsmodels.compat.python import ...
bsd-3-clause
thomas-bottesch/fcl
python/utils/create_pca_vectors_from_dataset.py
1
2284
from __future__ import print_function import fcl import os import time from os.path import abspath, join, dirname, isfile from fcl import kmeans from fcl.datasets import load_sector_dataset, load_usps_dataset from fcl.matrix.csr_matrix import get_csr_matrix_from_object, csr_matrix_to_libsvm_string from sklearn.decompos...
mit
kjung/scikit-learn
sklearn/pipeline.py
12
21283
""" The :mod:`sklearn.pipeline` module implements utilities to build a composite estimator, as a chain of transforms and estimators. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Alexandre Gramfort # Lars Buitinck # Licence: BSD from collections import defaultdict...
bsd-3-clause
LAIRLAB/qr_trees
src/python/run_ilqr_diffdrive.py
1
2328
#!/usr/bin/env python # # Arun Venkatraman (arunvenk@cs.cmu.edu) # December 2016 # # If we are not running from the build directory, then add lib to path from # build assuming we are running from the python folder import os full_path = os.path.realpath(__file__) if full_path.count("src/python") > 0: import sys ...
bsd-3-clause
mcvidomi/poim2motif
run_svm_real.py
1
1483
''' Created on 08.06.2015 @author: marinavidovic ''' import os import pdb import utils_svm import pickle import numpy as np import copy import genQ import makePOIM import view import matplotlib matplotlib.use('Agg') if __name__ == '__main__': read_data = 1 datapath = "/home/mvidovic/POIM...
mit
phev8/dataset_tools
experiment_handler/time_synchronisation.py
1
1444
import os import pandas as pd def read_synchronisation_file(experiment_root): filepath = os.path.join(experiment_root, "labels", "synchronisation.csv") return pd.read_csv(filepath) def convert_timestamps(experiment_root, timestamps, from_reference, to_reference): """ Convert numeric timestamps (seco...
mit
xfaxca/pygaero
example/tmax_peakfind_example.py
1
4986
# tmax_peakfind_example.py """ Demonstration of some of the primary functions in pygaero, including Tmax finding and elemental analysis. """ # Module import from pygaero import pio from pygaero import therm from pygaero import gen_chem import os import matplotlib.pyplot as plt def example1(): # -----------------...
gpl-3.0
FrankWang33/cuda-convnet2
shownet.py
180
18206
# Copyright 2014 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...
apache-2.0
aabadie/scikit-learn
examples/mixture/plot_gmm_selection.py
95
3310
""" ================================ Gaussian Mixture Model Selection ================================ This example shows that model selection can be performed with Gaussian Mixture Models using information-theoretic criteria (BIC). Model selection concerns both the covariance type and the number of components in the ...
bsd-3-clause
equialgo/scikit-learn
examples/cluster/plot_color_quantization.py
61
3444
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
bsd-3-clause
gsmaxwell/phase_offset_rx
gnuradio-core/src/examples/pfb/fmtest.py
17
7785
#!/usr/bin/env python # # Copyright 2009 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 option) # ...
gpl-3.0
smblance/ggplot
ggplot/tests/__init__.py
8
10135
from __future__ import (absolute_import, division, print_function, unicode_literals) import matplotlib as mpl import matplotlib.pyplot as plt from nose.tools import with_setup, make_decorator, assert_true import warnings figsize_orig = mpl.rcParams["figure.figsize"] def setup_package(): m...
bsd-2-clause
seanli9jan/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io_test.py
25
7883
# 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
will-iam/Variant
script/process/ergodicity_scaling.py
1
4083
#!/usr/bin/python3 # -*- coding:utf-8 -*- import __future__ import parser import sys import matplotlib.pyplot as plt #plt.style.use('ggplot') import numpy as np import operator from collections import * caseSize = (8192, 8192) if parser.args.res: maxAvailableNode = parser.args.res else: maxAvailableNode = 8 ...
mit
sgenoud/scikit-learn
sklearn/datasets/lfw.py
6
16362
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
pv/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
xavierwu/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
giorgiop/scikit-learn
examples/ensemble/plot_adaboost_twoclass.py
347
3268
""" ================== Two-class AdaBoost ================== This example fits an AdaBoosted decision stump on a non-linearly separable classification dataset composed of two "Gaussian quantiles" clusters (see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision boundary and decision scores. The di...
bsd-3-clause
anhaidgroup/py_entitymatching
py_entitymatching/dask/dask_extract_features.py
1
9597
import logging import os import pandas as pd import multiprocessing import numpy as np import dask from dask.diagnostics import ProgressBar from dask import delayed from cloudpickle import cloudpickle import tempfile import py_entitymatching.catalog.catalog_manager as cm import py_entitymatching.utils.catalog_helpe...
bsd-3-clause
sinkpoint/dipy
scratch/very_scratch/simulation_comparisons_modified.py
20
13117
import nibabel import os import numpy as np import dipy as dp import dipy.core.generalized_q_sampling as dgqs import dipy.io.pickles as pkl import scipy as sp from matplotlib.mlab import find import dipy.core.sphere_plots as splots import dipy.core.sphere_stats as sphats import dipy.core.geometry as geometry import get...
bsd-3-clause
NunoEdgarGub1/scikit-learn
examples/classification/plot_digits_classification.py
289
2397
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
abalckin/cwavenet
examples/WNvsPWN/show_snr.py
2
2454
#! /usr/bin/python3 import pylab as plb import numpy as np from matplotlib import rc rc('text', usetex=True) rc('text.latex', unicode=True) rc('text.latex', preamble=r'\usepackage[russian]{babel}') #rc('font',**{'family':'serif'}) rc('font',**{'size':'19'}) res = np.loadtxt('result.txt', delimiter=', ')[0:7] #import p...
gpl-2.0
linsalrob/EdwardsLab
phage_protein_blast_genera/tax_violin_plots.py
1
2239
""" """ import os import sys import argparse import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt if __name__ == '__main__': parser = argparse.ArgumentParser(description="") parser.add_argument('-f', help='Genome average output file (from genera_per_phage_protein.py', default='/home/redw...
mit
bmazin/ARCONS-pipeline
fluxcal/fluxCal.py
1
29931
#!/bin/python ''' fluxCal.py Created by Seth Meeker on 11-21-2012 Modified on 02-16-2015 to perform absolute fluxCal with point sources Opens ARCONS observation of a spectrophotometric standard star and associated wavelength cal file, reads in all photons and converts to energies. Bins photons to generate a spectru...
gpl-2.0
nomadcube/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
shikhar413/openmc
tests/regression_tests/diff_tally/test.py
10
4122
import glob import os import pandas as pd import openmc import pytest from tests.testing_harness import PyAPITestHarness class DiffTallyTestHarness(PyAPITestHarness): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Set settings explicitly self._model.settings.ba...
mit
cgheller/splotch
labeltool/splotchColormap.py
4
5402
#!/usr/bin/env python # Generate overlay images in PNG format with transparancy which can be # used to label Splotch frames. This script can be called as a # standalone program, see below for details. To label an entire # directory of Splotch frames, use the driver script <splotchLabelFrames.sh>. # # ...
gpl-2.0
APMonitor/arduino
2_Regression/2nd_order_MIMO/GEKKO/tclab_2nd_order_linear.py
1
3283
import numpy as np import time import matplotlib.pyplot as plt import random # get gekko package with: # pip install gekko from gekko import GEKKO import pandas as pd # import data data = pd.read_csv('data.txt') tm = data['Time (sec)'].values Q1s = data[' Heater 1'].values Q2s = data[' Heater 2'].values...
apache-2.0
DistrictDataLabs/yellowbrick
yellowbrick/contrib/scatter.py
1
11862
# yellowbrick.contrib.scatter # Implements a 2d scatter plot for feature analysis. # # Author: Nathan Danielsen # Created: Fri Feb 26 19:40:00 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LICENSE.txt # # ID: scatter.py [a89633e] benjamin@bengfort.com $ """ Implements a 2D...
apache-2.0
santiago-salas-v/walas
node_images.py
1
1746
import matplotlib import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) patch1 = matplotlib.patches.Circle( [0.5,0.5],0.05 ) patch2 = matplotlib.patches.Rectangle( [0.3,0.3],0.4, 0.4, alpha=0.5, fill=False, edgecolor='black', linestyle = '--' ) arrow1 = matplotlib.patches.Arrow( ...
mit
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/dask/dataframe/io/tests/test_parquet.py
2
45993
from __future__ import (absolute_import, division, print_function, unicode_literals) import os from distutils.version import LooseVersion import numpy as np import pandas as pd import pandas.util.testing as tm import pytest import dask import dask.multiprocessing import dask.dataframe as dd f...
gpl-3.0
hbldh/skboost
skboost/stumps/decision_stump.py
1
17561
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`decision_stump` ================== .. module:: decision_stump :platform: Unix, Windows :synopsis: .. moduleauthor:: hbldh <henrik.blidh@nedomkull.com> Created on 2014-08-31, 01:52 """ from __future__ import division from __future__ import print_function...
mit
eric-haibin-lin/mxnet
python/mxnet/ndarray/numpy/_op.py
2
252233
# pylint: disable=C0302 # 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
arahuja/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/linear_model/ransac.py
191
14261
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
bsd-3-clause
ptitjano/bokeh
examples/compat/mpl_contour.py
7
1028
# demo inspired by: http://matplotlib.org/examples/pylab_examples/contour_demo.html from bokeh import mpl from bokeh.plotting import output_file, show import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt import numpy as np matplotlib.rcParams['xtick.direction'] = 'out' matplotlib.rcParams...
bsd-3-clause
bd-j/magellanic
magellanic/sfhs/prediction_scripts/predicted_total.py
1
5894
import sys, pickle, copy import numpy as np import matplotlib.pyplot as pl import astropy.io.fits as pyfits import magellanic.regionsed as rsed import magellanic.mcutils as utils from magellanic.lfutils import * try: import fsps from sedpy import observate except ImportError: #you wont be able to predict...
gpl-2.0
sunshinelover/chanlun
vn.trader/ctaAlgo/uiChanlunWidget.py
1
68647
# encoding: UTF-8 """ 缠论模块相关的GUI控制组件 """ from vtGateway import VtSubscribeReq from uiBasicWidget import QtGui, QtCore, BasicCell,BasicMonitor,TradingWidget from eventEngine import * from ctaBase import * import pyqtgraph as pg import numpy as np import pymongo from pymongo.errors import * from datetime import datetime...
mit
bgris/ODL_bgris
lib/python3.5/site-packages/odl/util/graphics.py
1
15419
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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. #...
gpl-3.0
emoronayuso/beeton
asterisk-bee/asteriskbee/api_status/scripts_graficas/recoge_marcas_graficas.py
1
2307
#!/usr/bin/python import matplotlib.pyplot as plt import numpy as np #import calendar from datetime import datetime from django.conf import settings settings.configure() import os #para conexion con la bases de datos de beeton (asteriskbee) import sqlite3 as dbapi ##Directorio de la aplicaion ### STATIC_ROOT = '/va...
gpl-3.0
crichardson17/starburst_atlas
Low_resolution_sims/Dusty_LowRes/Padova_inst/padova_inst_0/fullgrid/UV1.py
31
9315
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
CTSRD-SOAAP/chromium-42.0.2311.135
native_client/buildbot/buildbot_selector.py
1
18629
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import subprocess import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import pynacl.p...
bsd-3-clause
googleinterns/cabby
cabby/model/datasets.py
1
4391
# coding=utf-8 # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
ywcui1990/nupic
examples/opf/clients/hotgym/prediction/one_gym/nupic_output.py
17
6193
# ---------------------------------------------------------------------- # 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
deeplook/bokeh
bokeh/charts/builder/timeseries_builder.py
26
6252
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the TimeSeries class which lets you build your TimeSeries charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------...
bsd-3-clause
jonyroda97/redbot-amigosprovaveis
lib/matplotlib/backends/backend_nbagg.py
2
9384
"""Interactive figures in the IPython notebook""" # Note: There is a notebook in # lib/matplotlib/backends/web_backend/nbagg_uat.ipynb to help verify # that changes made maintain expected behaviour. import datetime from base64 import b64encode import json import io import os import six from uuid import uuid4 as uuid ...
gpl-3.0
tuanvu216/udacity-course
intro_to_machine_learning/lesson/lesson_14_evaluation_metrics/evaluate_poi_identifier.py
1
2588
#!/usr/bin/python """ starter code for the evaluation mini-project start by copying your trained/tested POI identifier from that you built in the validation mini-project the second step toward building your POI identifier! start by loading/formatting the data """ import pickle import sys sys.p...
mit
Garrett-R/scikit-learn
sklearn/linear_model/randomized_l1.py
11
23088
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
matplotlib/cmocean
cmocean/rgb/dense.py
2
13693
from matplotlib.colors import ListedColormap from numpy import nan, inf # Used to reconstruct the colormap in pycam02ucs.cm.viscm parameters = {'xp': [16.121891585344997, 33.901145962549492, 5.5873058066040926, -14.703203914141397, -17.875928056390336, -5.3288735306278738], 'yp': [-2.5423728813559308, -...
mit
ctozlm/Dato-Core
src/unity/python/graphlab/data_structures/sframe.py
13
196438
""" This module defines the SFrame class which provides the ability to create, access and manipulate a remote scalable dataframe object. SFrame acts similarly to pandas.DataFrame, but the data is completely immutable and is stored column wise on the GraphLab Server side. """ ''' Copyright (C) 2015 Dato, Inc. All righ...
agpl-3.0
kmkolasinski/Quantulaba
plots/plot_lattice.py
2
1492
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt import csv from matplotlib.collections import LineCollection file = "lattice.dat" #ax = plt.gca(projection='3d') pscale=1.0 lscale=10.0 fig, ax = plt. subplots() ax.set_aspect('equal') desired=[1,2] with open(file, 'r') as fin: reader=csv.reade...
mit
thorwhalen/ut
ml/stream/sequences.py
1
6137
from sklearn.base import BaseEstimator from collections import Counter import pandas as pd from numpy import sum, nan, isnan from ut.util.uiter import window class NextElementPredictor(BaseEstimator): def predict(self, seqs): preds = self.predict_proba(seqs) return [max(pred, key=lambda key: pr...
mit
jmschrei/scikit-learn
sklearn/linear_model/tests/test_passive_aggressive.py
169
8809
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_rais...
bsd-3-clause
lovexiaov/SandwichApp
venv/lib/python2.7/site-packages/py2app/build_app.py
9
77527
""" Mac OS X .app build command for distutils Originally (loosely) based on code from py2exe's build_exe.py by Thomas Heller. """ from __future__ import print_function import imp import sys import os import zipfile import plistlib import shlex import shutil import textwrap import pkg_resources import collections from...
apache-2.0