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 |
|---|---|---|---|---|---|
jorgemauricio/INIFAP_Course | ejercicios/ej_19_merge.py | 1 | 2213 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 17 16:17:25 2017
@author: jorgemauricio
"""
# librerias
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
# crear un dataframe
dframe1 = DataFrame({'key':['X','Z','Y','Z','X','X'],'data_set_1': np.arange(6)})
# desplegar... | mit |
jenshnielsen/basemap | examples/fillstates.py | 4 | 3041 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap as Basemap
from matplotlib.colors import rgb2hex
from matplotlib.patches import Polygon
# Lambert Conformal map of lower 48 states.
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urc... | gpl-2.0 |
perimosocordiae/scipy | scipy/stats/_multivariate.py | 7 | 153934 | #
# Author: Joris Vankerschaver 2013
#
import math
import numpy as np
from numpy import asarray_chkfinite, asarray
import scipy.linalg
from scipy._lib import doccer
from scipy.special import gammaln, psi, multigammaln, xlogy, entr, betaln
from scipy._lib._util import check_random_state
from scipy.linalg.blas import dro... | bsd-3-clause |
adykstra/mne-python | tutorials/misc/plot_ecog.py | 3 | 2827 | """
======================
Working with ECoG data
======================
MNE supports working with more than just MEG and EEG data. Here we show some
of the functions that can be used to facilitate working with
electrocorticography (ECoG) data.
"""
# Authors: Eric Larson <larson.eric.d@gmail.com>
# Chris Hold... | bsd-3-clause |
evanbiederstedt/RRBSfun | epiphen/cll_tests/total_CLL_chr17.py | 1 | 8306 | import glob
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 50) # print all rows
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
cw154 = glob.glob("binary_position_RRBS_cw154*")
trito = glob.glob("binary_position_RRBS_trito_pool*")
print(le... | mit |
jseabold/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 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/api/tests/test_api.py | 7 | 8812 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from pandas.core import common as com
from pandas import api
from pandas.api import types
from pandas.util import testing as tm
_multiprocess_can_split_ = True
class Base(object):
def check(self, namespace, expected, ignored=None):
# see w... | gpl-3.0 |
zuku1985/scikit-learn | sklearn/decomposition/dict_learning.py | 19 | 46220 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
cckao/fast-rcnn | lib/roi_data_layer/minibatch.py | 44 | 7337 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
impor... | mit |
wkfwkf/statsmodels | statsmodels/datasets/tests/test_utils.py | 26 | 1697 | import os
import sys
from statsmodels.datasets import get_rdataset, webuse, check_internet
from numpy.testing import assert_, assert_array_equal, dec
cur_dir = os.path.dirname(os.path.abspath(__file__))
def test_get_rdataset():
# smoke test
if sys.version_info[0] >= 3:
#NOTE: there's no way to test bo... | bsd-3-clause |
yl565/statsmodels | statsmodels/stats/tests/test_anova.py | 29 | 19073 | # -*- coding: utf-8 -*-
from statsmodels.compat.python import StringIO
import numpy as np
from statsmodels.stats.anova import anova_lm
from statsmodels.formula.api import ols
from pandas import read_table
kidney_table = StringIO("""Days Duration Weight ID
0.0 1 1 1
2.0 1 1 ... | bsd-3-clause |
sindresf/The-Playground | Python/Machine Learning/Kaggle/Zillo-Price/Zillo-Price/liteGBM.py | 1 | 2394 | import numpy as np
import pandas as pd
import lightgbm as lgb
import gc
#LB performance gets a little better if you add a line to filter out crazy logerror truth values prior to training
print('Loading data ...')
train = pd.read_csv('../input/train_2016.csv')
prop = pd.read_csv('../input/properties_2016.csv')
for c... | mit |
kdebrab/pandas | pandas/tests/frame/test_apply.py | 3 | 40655 | # -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
import operator
from datetime import datetime
import warnings
import numpy as np
from pandas import (notna, DataFrame, Series, MultiIndex, date_range,
Timestamp, compat)
import pandas as pd
from pandas.core.dtypes.dtype... | bsd-3-clause |
ZenDevelopmentSystems/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 157 | 13799 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... | bsd-3-clause |
TheWylieStCoyote/gnuradio | gr-filter/examples/fir_filter_ccc.py | 3 | 3376 | #!/usr/bin/env python
#
# Copyright 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, filter
from gnuradio import... | gpl-3.0 |
Winand/pandas | scripts/find_undoc_args.py | 7 | 4728 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from collections import namedtuple
from itertools import islice
import types
import os
import re
import argparse
#http://docs.python.org/2/library/argparse.html
# arg name is positional is not prefixed with - or --
parser = argparse.... | bsd-3-clause |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/convolution/utils.py | 1 | 9881 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from ..modeling.core import FittableModel, custom_model
__all__ = ['discretize_model']
class DiscretizationError(Exception)... | mit |
jmmease/pandas | pandas/tests/dtypes/test_inference.py | 2 | 36747 | # -*- coding: utf-8 -*-
"""
These the test the public routines exposed in types/common.py
related to inference and not otherwise tested in types/test_common.py
"""
from warnings import catch_warnings
import collections
import re
from datetime import datetime, date, timedelta, time
from decimal import Decimal
import n... | bsd-3-clause |
trankmichael/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 143 | 22295 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
michigraber/scikit-learn | setup.py | 143 | 7364 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean ... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/examples/user_interfaces/mpl_with_glade.py | 9 | 3171 | #!/usr/bin/env python
from __future__ import print_function
import matplotlib
matplotlib.use('GTK')
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
from matplotlib.backends.backend_gtkagg import NavigationToolba... | mit |
abimannans/scikit-learn | examples/plot_multilabel.py | 236 | 4157 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
SKravitsky/MachineLearningServer | MachineLearning/CSV_Prediction.py | 1 | 1337 | import numpy as np
import pandas as pd
import os
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.externals.six import StringIO
import pydot
def get_csv():
if os.path.exists("Update2.csv"):
df = pd.read_csv("Update2.csv")
... | apache-2.0 |
benjello/openfisca-france-data | openfisca_france_data/tests/test_fake_survey_simulation.py | 1 | 9234 | # -*- coding: utf-8 -*-
from __future__ import division
import numpy
import os
import pandas
from openfisca_core.tools import assert_near
import openfisca_france.tests.base as france_base
from openfisca_france_data.tests import base
from openfisca_france_data.erfs.scenario import ErfsSurveyScenario
from openfisca_s... | agpl-3.0 |
rsnemmen/nemmen | nmmn/dsp.py | 2 | 13526 | """
Signal processing
===================
Mostly time series.
"""
import numpy
import pylab
import scipy.signal
def peaks(y,x=None,what=0,**args):
"""
Detects the peaks in the time series given by Y (and X if provided).
:param x,y: time series input arrays
:param what: select what you want -- max/0 or min/1 pe... | mit |
rrohan/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
weissercn/learningml | learningml/GoF/data/gaussian_same_projection_on_each_axis/plot_2D_projections.py | 1 | 5066 | from __future__ import print_function
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
label_size = 28
###########################################################################################################################################################... | mit |
DanielWatkins/climstat | reading_sparc_data.py | 1 | 4947 | #### Unzipping the nested 6-second data files ####
# Data downloaded from SPARC ftp and saved to <data_path>/<data_folder>
# This loops through the data folders and unpacks the gzips, and
# then removes them.
import os
import gzip
import shutil
data_path =
data_folder =
pattern = '*.dat.gz'
for root, dirs, files ... | gpl-3.0 |
booya-at/paraBEM | examples/plots/far_field_error.py | 2 | 1430 | # -*- coding: utf-8 -*-
from __future__ import division
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import parabem
from parabem.pan3d import doublet_3_0_n0, doublet_3_0_sphere, doublet_3_0_vsaero
from parabem.utils import check_path
pnt1 = parabem.PanelVector3(... | gpl-3.0 |
lenovor/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 105 | 22788 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
kagayakidan/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
devinplatt/ms-thesis | train/sample-cnn/sample_cnn/data/mtt/build_mtt.py | 2 | 6216 | """Converts MagnaTagATune dataset to TFRecord files. """
import os
import pandas as pd
import tensorflow as tf
from threading import Thread
from queue import Queue
from madmom.audio.signal import LoadAudioFileError
from sample_cnn.data.audio_processing import (audio_to_sequence_example,
... | mit |
tomlof/scikit-learn | sklearn/linear_model/ransac.py | 16 | 19158 | # coding: utf-8
# Author: Johannes Schönberger
#
# License: BSD 3 clause
import numpy as np
import warnings
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
fr... | bsd-3-clause |
sahilshekhawat/pydy | examples/double_pendulum/scipy/double_pendulum_integration.py | 8 | 3476 | #!/usr/bin/env python
# This is an example of integrating the equations of motion for a double
# pendulum which were generated with sympy.physics.mechanics. We make use of
# SciPy/NumPy for the integration routines and Matplotlib for plotting.
#
# Steps taken:
# 1. Turned on mechanics_printing() in sympy.physics.mecha... | bsd-3-clause |
alec-eickbusch/pyHFSS | bbq.py | 1 | 44150 | '''
Copyright Zlatko Minev and Zaki Leghtas
2015, 2016, 2017
'''
import os
import time
import shutil
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from stat import S_ISREG, ST_CTIME, ST_MODE
from pandas import HDFStore, Series, DataFrame
from pint import UnitRegistry
from hfss import *
f... | mit |
mugizico/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
DailyActie/Surrogate-Model | examples/sklearn_ann.py | 1 | 2388 | # MIT License
#
# Copyright (c) 2016 Daily Actie
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | mit |
ngoix/OCRF | sklearn/datasets/base.py | 20 | 23481 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import sys
import shutil
from os import environ... | bsd-3-clause |
elijah513/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 |
JDReutt/BayesDB | bayesdb/functions.py | 2 | 10404 | #
# Copyright (c) 2010-2014, MIT Probabilistic Computing Project
#
# Lead Developers: Jay Baxter and Dan Lovell
# Authors: Jay Baxter, Dan Lovell, Baxter Eaves, Vikash Mansinghka
# Research Leads: Vikash Mansinghka, Patrick Shafto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... | apache-2.0 |
andrewcmyers/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py | 72 | 12865 | # 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 |
ProgramFan/bentoo | bentoo/tools/collector.py | 1 | 45647 | # coding: utf-8
#
'''Collector - Test results collector
Collector scans a test project directory, parses all result files found and
saves all parsed results as a self-described data sheet in a file. One can then
use Analyser or other tools to investigate the resultant data sheet.
To use collector, simply following th... | mit |
thatchristoph/RTLSDR-Scanner | src/spectrum.py | 1 | 8058 | #
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2014 Al Brown
#
# A frequency scanning GUI for the OsmoSDR rtl-sdr library at
# http://sdr.osmocom.org/trac/wiki/rtl-sdr
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
feranick/Pi-bot | piRC/pirc.py | 1 | 27015 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
**********************************************************
* PiRC - Self-driving RC car via Machine Learning
* version: 20200209a
* By: Nicola Ferralis <feranick@hotmail.com>
***********************************************************
'''
print(__doc__)
import numpy a... | gpl-3.0 |
okfn-brasil/gastos_abertos | utils/import_execucao.py | 1 | 6904 | #!/usr/bin/env python
# coding: utf-8
''' Read a CSV with execucao and insert it in the DB.
Usage:
./import_execucao [options] [PATH] [LINES_PER_INSERT]
PATH: Can be a CSV file or a folder. If it is a folder, insert all CSVs there.
Options:
-h --help Show this message.
-D Drop table.
-u ... | agpl-3.0 |
rahul-c1/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 45 | 5463 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
EvenStrangest/tensorflow | tensorflow/examples/skflow/boston.py | 4 | 1596 | # 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 |
alvarofierroclavero/scikit-learn | benchmarks/bench_plot_svd.py | 325 | 2899 | """Benchmarks of Singular Value Decomposition (Exact and Approximate)
The data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import numpy as np
from collections import defaultdict
from scipy.linalg import svd
from sklearn.utils.extmath import randomized_svd
from sklearn.datasets.s... | bsd-3-clause |
pwcazenave/PySeidon | pyseidon/validationClass/tidalStats.py | 2 | 19999 | #!/usr/bin/python2.7
# encoding: utf-8
import numpy as np
from scipy.stats import t
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
from scipy.interpolate import interp1d
from scipy.signal import correlate
import time
import seaborn
import pandas as pd
class TidalStats:
'''
An object r... | agpl-3.0 |
bikash/h2o-dev | h2o-py/tests/testdir_algos/kmeans/pyunit_NOFEATURE_getModelKmeans.py | 1 | 1145 | import sys
sys.path.insert(1, "../../../")
import h2o
import numpy as np
from sklearn.cluster import KMeans
from sklearn.preprocessing import Imputer
def getModelKmeans(ip,port):
# Connect to a pre-existing cluster
h2o.init(ip,port) # connect to localhost:54321
#Log.info("Importing benign.csv data...\n"... | apache-2.0 |
cogmission/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/widgets.py | 69 | 40833 | """
GUI Neutral widgets
All of these widgets require you to predefine an Axes instance and
pass that as the first arg. matplotlib doesn't try to be too smart in
layout -- you have to figure out how wide and tall you want your Axes
to be to accommodate your widget.
"""
import numpy as np
from mlab import dist
from p... | agpl-3.0 |
bukzor/sympy | sympy/external/importtools.py | 85 | 7294 | """Tools to assist importing optional external modules."""
from __future__ import print_function, division
import sys
# Override these in the module to change the default warning behavior.
# For example, you might set both to False before running the tests so that
# warnings are not printed to the console, or set bo... | bsd-3-clause |
ky822/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 162 | 7103 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
JeroenZegers/Nabu-MSSS | nabu/postprocessing/reconstructors/deepattractornet_reconstructor.py | 1 | 4033 | """@file deepattractornet_reconstructor.py
contains the reconstor class using deep attractor network"""
from sklearn.cluster import KMeans
import mask_reconstructor
from nabu.postprocessing import data_reader
import numpy as np
import os
import scipy
class DeepattractorReconstructor(mask_reconstructor.MaskReconstruc... | mit |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/scipy/signal/waveforms.py | 64 | 14818 | # Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... | gpl-3.0 |
EtienneCmb/brainpipe | brainpipe/feature/featools.py | 1 | 6663 | import numpy as np
import pandas as pd
__all__ = ['cfcRndSignals', 'cfcVec', 'bandRef', 'findBandName', 'findBandFcy']
def cfcRndSignals(fPha=2, fAmp=100, sf=1024, ndatasets=10,
tmax=1, chi=0, noise=1, dPha=0, dAmp=0):
"""Generate randomly phase-amplitude coupled signals.
Kargs:
fP... | gpl-3.0 |
PaulZhutovsky/ftd_project | descriptive_T_test_ROIs.py | 1 | 5874 | from glob import glob
from os import path as osp
from data_handling import create_file_name, ensure_folder
from scipy import stats
import pandas as pd
import numpy as np
REG_PATTERN = 'results_*_atlas_*no_covariates'
ATLAS_RESULTS_FOLDERS = sorted(glob(osp.join('/data/shared/bvFTD/Machine_Learning', REG_PATTERN)))
DAT... | apache-2.0 |
gdetor/SI-RF-Structure | Statistics/rfs-matrix.py | 1 | 5384 | # Copyright (c) 2014, Georgios Is. Detorakis (gdetor@gmail.com) and
# Nicolas P. Rougier (nicolas.rougier@inria.fr)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redis... | gpl-3.0 |
mihajenko/anidb_tag_miner | stats.py | 1 | 6281 | #!/usr/bin/env python
import json
import pickle
import sys
from collections import Counter
from operator import itemgetter
from pprint import PrettyPrinter
import random
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.cluster import AgglomerativeClustering
from sklearn.cluster i... | apache-2.0 |
stephane-caron/smartgridcomm-2010 | strats/aloha.py | 2 | 2539 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# aloha.py
# This file is part of DR StratComp.
#
# Copyright (C) 2010 - Stéphane Caron
#
# 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 v... | gpl-2.0 |
TaxIPP-Life/til-france | til_france/tests/rescale_migration.py | 1 | 2539 | # -*- coding:utf-8 -*-
from __future__ import division
import os
import numpy
import pandas
from til_france.tests.base import til_france_path
def rescale_migration():
# Data from INSEE projections
data_path = os.path.join(til_france_path, 'param/demo')
sheetname_by_gender = dict(zip(
['tot... | gpl-3.0 |
hitszxp/scikit-learn | sklearn/decomposition/__init__.py | 99 | 1331 | """
The :mod:`sklearn.decomposition` module includes matrix decomposition
algorithms, including among others PCA, NMF or ICA. Most of the algorithms of
this module can be regarded as dimensionality reduction techniques.
"""
from .nmf import NMF, ProjectedGradientNMF
from .pca import PCA, RandomizedPCA
from .incrementa... | bsd-3-clause |
NunoEdgarGub1/scikit-learn | sklearn/covariance/robust_covariance.py | 198 | 29735 | """
Robust location and covariance estimators.
Here are implemented estimators that are resistant to outliers.
"""
# Author: Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import linalg
from scipy.stats import chi2
from . import empir... | bsd-3-clause |
MTgeophysics/mtpy | mtpy/modeling/winglink.py | 1 | 96332 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 22 15:19:30 2011
deal with output files from winglink.
@author: jp
"""
import numpy as np
import os
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.ticker import MultipleLocator
import matplotlib.colorbar as mcb
from matplotlib.col... | gpl-3.0 |
reuk/waveguide | demo/evaluation/vault/spacing.py | 2 | 2127 | #!/usr/local/bin/python
import numpy as np
import matplotlib
render = True
if render:
matplotlib.use('pgf')
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from string import split
import scipy.signal as signal
import pysndfile
import math
import os
import re
import json
def main():
fig, ax = ... | gpl-2.0 |
DonBeo/statsmodels | statsmodels/graphics/dotplots.py | 31 | 18190 | import numpy as np
from statsmodels.compat import range
from . import utils
def dot_plot(points, intervals=None, lines=None, sections=None,
styles=None, marker_props=None, line_props=None,
split_names=None, section_order=None, line_order=None,
stacked=False, styles_order=None, s... | bsd-3-clause |
hsaputra/tensorflow | tensorflow/python/estimator/inputs/queues/feeding_queue_runner_test.py | 116 | 5164 | # 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 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pandas/tests/indexes/common.py | 3 | 35517 | # -*- coding: utf-8 -*-
import pytest
from pandas import compat
from pandas.compat import PY3
import numpy as np
from pandas import (Series, Index, Float64Index, Int64Index, UInt64Index,
RangeIndex, MultiIndex, CategoricalIndex, DatetimeIndex,
TimedeltaIndex, PeriodIndex, Int... | mit |
liberatorqjw/scikit-learn | examples/decomposition/plot_ica_blind_source_separation.py | 349 | 2228 | """
=====================================
Blind source separation using FastICA
=====================================
An example of estimating sources from noisy data.
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 3 instruments playing simultaneously and 3 microphones
recording the mixed si... | bsd-3-clause |
mbakker7/ttim | examples/linesinkex.py | 1 | 2267 | import numpy as np
import matplotlib.pyplot as plt
from ttim import *
xls = 100 * np.cos(np.linspace(np.pi, 0, 7))
yls = 50 * np.ones(len(xls))
ml1 = ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
Saq=[0.1, 1e-4, 1e-4], Sll=[0, 0], phreatictop=True,
tmin=0.1, tmax=10, M=2... | mit |
weegreenblobbie/nsound | nsound_config.py | 1 | 44199 | """
$Id: nsound_config.py 913 2015-08-08 16:41:22Z weegreenblobbie $
Nsound is a C++ library and Python module for audio synthesis featuring
dynamic digital filters. Nsound lets you easily shape waveforms and write
to disk or plot them. Nsound aims to be as powerful as Csound but easy to
use.
Copyright (c) 2009-Prese... | gpl-2.0 |
mutirri/bokeh | examples/charts/file/boxplot.py | 37 | 1117 | from collections import OrderedDict
import pandas as pd
from bokeh.charts import BoxPlot, output_file, show
from bokeh.sampledata.olympics2014 import data
# create a DataFrame with the sample data
df = pd.io.json.json_normalize(data['data'])
# filter by countries with at least one medal and sort
df = df[df['medals.... | bsd-3-clause |
blaze/distributed | distributed/protocol/tests/test_arrow.py | 1 | 1428 | import pandas as pd
import pytest
pa = pytest.importorskip("pyarrow")
import distributed
from distributed.utils_test import gen_cluster
from distributed.protocol import deserialize, serialize, to_serialize
df = pd.DataFrame({"A": list("abc"), "B": [1, 2, 3]})
tbl = pa.Table.from_pandas(df, preserve_index=False)
batc... | bsd-3-clause |
siutanwong/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 234 | 9928 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
meghana1995/sympy | sympy/plotting/plot.py | 8 | 64545 | """Plotting module for Sympy.
A plot is represented by the ``Plot`` class that contains a reference to the
backend and a list of the data series to be plotted. The data series are
instances of classes meant to simplify getting points and meshes from sympy
expressions. ``plot_backends`` is a dictionary with all the bac... | bsd-3-clause |
mtconley/turntable | test/lib/python2.7/site-packages/numpy/lib/function_base.py | 30 | 124613 | from __future__ import division, absolute_import, print_function
import warnings
import sys
import collections
import operator
import numpy as np
import numpy.core.numeric as _nx
from numpy.core import linspace, atleast_1d, atleast_2d
from numpy.core.numeric import (
ones, zeros, arange, concatenate, array, asarr... | mit |
sondree/Master-thesis | Python PLOTS/plotfitness_receiver.py | 1 | 7560 | #!/usr/bin/python
import argparse
import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
import matplotlib.ticker as plticker
import time
import random
from matplotlib.patches import *
from mpl_toolkits.mplot3d import Axes3D
from random import randint
f... | gpl-3.0 |
HHSIDEAlab/DDOD-HealthData.gov | value_delivered_chart.py | 1 | 7797 | #!/usr/bin/env python
######################
## 2015-11-25 Created by David Portnoy
######################
# For APIs
import json
import requests
# For data manipulation
import pandas as pd
from numpy import random # For random
# For charting
from bokeh.charts import Bar, output_file, reset_output, output_server,... | gpl-2.0 |
harshaneelhg/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
quells/ElectronDensityIntegration | Python/graph-lin.py | 1 | 3908 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import optparse
from matplotlib import pyplot as plt
import numpy as np
import sys
parser = optparse.OptionParser(description='Graph combined electron data')
(options, args) = parser.parse_args()
try:
filename = args[0]
except IndexError:
print 'No file specified.'
sys.ex... | mit |
stepos01/ns3-lr-wpan-mlme | src/core/examples/sample-rng-plot.py | 188 | 1246 | # -*- Mode:Python; -*-
# /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRA... | gpl-2.0 |
Scapogo/zipline | tests/test_exception_handling.py | 8 | 2199 | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
fivejjs/GPy | GPy/models/bayesian_gplvm.py | 4 | 10052 | # Copyright (c) 2012 - 2014 the GPy Austhors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from .. import kern
from ..core.sparse_gp_mpi import SparseGP_MPI
from ..likelihoods import Gaussian
from ..core.parameterization.variational import NormalPosterior, NormalPrior... | bsd-3-clause |
sgenoud/scikit-learn | examples/applications/plot_stock_market.py | 3 | 8450 | """
.. _stock_market:
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily... | bsd-3-clause |
xuewei4d/scikit-learn | examples/gaussian_process/plot_gpc_isoprobability.py | 31 | 3043 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=================================================================
Iso-probability lines for Gaussian Processes classification (GPC)
=================================================================
A two-dimensional classification example showing iso-probability lines for... | bsd-3-clause |
harshaneelhg/scikit-learn | examples/applications/plot_model_complexity_influence.py | 323 | 6372 | """
==========================
Model Complexity Influence
==========================
Demonstrate how model complexity influences both prediction accuracy and
computational performance.
The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for
regression (resp. classification).
For each class of models we m... | bsd-3-clause |
CalSol/Impulse | Telemetry/historical_viewer2.py | 1 | 13038 | import colorsys
import config
from matplotlib.pyplot import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.dates as mdates
import matplotlib.ticker as ticker
from matplotlib.transforms import BboxTransformTo
from Tkinter import *
import Tkinter as Tk
from GraphData import SQ... | apache-2.0 |
LucFrachon/autonomous_car_behavioral_cloning | import_data.py | 1 | 11756 | import os
import csv
import cv2
import random
import numpy as np
import matplotlib.image as img
import sklearn
from sklearn.utils import shuffle
def import_data(ex_from = None, ex_to = None, log_dir = '/home/lucfrachon/udacity_sim/data/',
log_filename = 'driving_log.csv', images_dir = '/home/lucfrachon/udacity... | mit |
h2oai/h2o-3 | h2o-py/tests/testdir_munging/pyunit_isna.py | 5 | 1816 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
from collections import OrderedDict
import h2o
from tests import pyunit_utils
def test_isna():
nan = float("nan")
frame = h2o.H2OFrame.from_python(OrderedDict([
("A", [1, 0, 3, 4, 8, 4, 7]),
("B", [2, nan, -... | apache-2.0 |
asteca/ASteCA | packages/out/make_D1_plot.py | 1 | 7630 |
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from os.path import join
from . import add_version_plot
from . import mp_mcmc_cnvrg
from . import tracePlot
from . import prep_plots
from . prep_plots import figsize_x, figsize_y, grid_x, grid_y
def main(npd, pd, clp):
"""
Make D1 block p... | gpl-3.0 |
johncadigan/scrapy-sci | wallpaper_demo/wallpaper/classifier_pipelines.py | 2 | 1983 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
from scrapy.contrib.exporter import JsonItemExporter
from scrapy.exceptions import DropItem
from sklearn.linear_mode... | bsd-3-clause |
koder-ua/network_ping_test | plot_tests_results.py | 1 | 13740 | from __future__ import print_function
import sys
import math
import yaml
import argparse
import collections
def ns_to_readable(val):
for limit, ext in ((1E9, ''), (1E6, 'm'), (1E3, 'u'), (1, 'n')):
if val >= limit:
return "{} {}s".format(int(val / limit), ext)
TestRun = collections.namedtup... | apache-2.0 |
puchchi/stock_scraper_latest | MainDriver/AddingNewStock.py | 1 | 5113 | # This file will do following steps.
# 1: Initialize db by creating table for given stock if it not present there.
# 2: Scrape data of that stock and fill in db.
# 3: Create CSV file from db.
# 4: Create all Indicators and save them in another CSV file.
# 5: Test Indicator
import sys
from os import path
sys.path.appe... | mit |
cxhernandez/mdentropy | mdentropy/utils.py | 1 | 2859 | from __future__ import print_function
import time
from numpy import dtype, finfo, float32, nan_to_num, random, unique, void
from scipy.spatial import cKDTree
from scipy.special import digamma
__all__ = ['floor_threshold', 'shuffle', 'Timing', 'unique_row_count',
'avgdigamma']
EPS = finfo(float32).eps
... | gpl-3.0 |
RPGOne/Skynet | scikit-learn-0.18.1/examples/cluster/plot_affinity_propagation.py | 349 | 2304 | """
=================================================
Demo of affinity propagation clustering algorithm
=================================================
Reference:
Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages
Between Data Points", Science Feb. 2007
"""
print(__doc__)
from sklearn.cluster impor... | bsd-3-clause |
Agent007/deepchem | devtools/jenkins/generate_graph.py | 2 | 5215 | import csv
import os
import numpy as np
import matplotlib.pyplot as plt
import time
plt.switch_backend('agg')
TODO = {
('tox21', 'random'): [
'weave', 'graphconv', 'tf', 'tf_robust', 'irv', 'xgb', 'logreg',
'textcnn'
],
('clintox', 'random'): [
'weave', 'graphconv', 'tf', 'tf_robust... | mit |
louispotok/pandas | pandas/core/computation/expressions.py | 4 | 7061 | """
Expressions
-----------
Offer fast expression evaluation through numexpr
"""
import warnings
import numpy as np
import pandas.core.common as com
from pandas.core.computation.check import _NUMEXPR_INSTALLED
from pandas.core.config import get_option
if _NUMEXPR_INSTALLED:
import numexpr as ne
_TEST_MODE = N... | bsd-3-clause |
OshynSong/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
aerdem4/kaggle-quora-dup | model.py | 1 | 9236 | import re
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import StratifiedKFold
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.layers import Dense, Input, LSTM, Embedding, D... | mit |
sainathadapa/fastai-courses | deeplearning2/kmeans.py | 10 | 2802 | import tensorflow as tf
import math, numpy as np
import matplotlib.pyplot as plt
def plot_data(centroids, data, n_samples):
colour = plt.cm.rainbow(np.linspace(0,1,len(centroids)))
for i, centroid in enumerate(centroids):
samples = data[i*n_samples:(i+1)*n_samples]
plt.scatter(samples[:,0], sa... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.