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 |
|---|---|---|---|---|---|
uwdb/Cosette | analyze_result.py | 1 | 1136 | import pandas as pd
import matplotlib.pyplot as plt
RESULT_FILE = "./examples/calcite/calcite_result_with_label.csv"
def analyze_result():
"""
analyze calcite result
"""
result = pd.read_csv(RESULT_FILE)
# get frequency of results
result_count = result['Result'].value_counts()
print "Resul... | bsd-2-clause |
dstndstn/astrometry.net | solver/spoof.py | 2 | 1573 | # This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
try:
import pyfits
except ImportError:
try:
from astropy.io import fits as pyfits
except ImportError:
raise ImportError("Cannot import either pyfits or astropy.io.fits")
import math
f... | bsd-3-clause |
raphaelvalentin/qtlayout | syntax/interpolate/plotting/xyplot4.py | 1 | 6650 | from libarray import shape
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
from matplotlib.figure import SubplotParams
from matplotlib.ticker import MaxNLocator
from os.path import isfile
class plot(object):
__properties__ = {'figsize':(8, 6),
'xlabel':'',
... | gpl-2.0 |
sinhrks/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 65 | 2838 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from nose.tools import assert_equa... | bsd-3-clause |
vivekec/datascience | projects/misc/email_analysis/script/email_analysis.py | 1 | 1049 | import subprocess as sp
tmp = sp.call('cls',shell=True)
import numpy as np
from scipy.stats import itemfreq
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel('resources/dataset.xlsx')
features = pd.DataFrame({'Subject':df.iloc[:,0],
'Body':df.iloc[:,1],
... | gpl-3.0 |
luo66/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
jdanbrown/pydatalab | google/datalab/ml/_summary.py | 2 | 6158 | # Copyright 2017 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 a... | apache-2.0 |
hunse/deepnet | examples/vh_deepautoencoder.py | 1 | 6961 |
"""
Learn a single-layer sparse autoencoder on Van Hateren data
(as in CogSci 2013 paper)
"""
import sys, os, time, datetime
os.environ['THEANO_FLAGS'] = 'device=gpu, floatX=float32'
import theano
import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
plt.ion()
import deepnet
import deepnet... | mit |
tmaiwald/OSIM | OSIM/Plots/E-C-Hyperplane.py | 1 | 2141 | from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import cm
import Transportstrom_Kennlinie as tp
import numpy as np
fig = plt.figure()
Ix = fig.gca(projection='3d')
dUC = fig.gca(projection='3d')
dUE = fig.gca(projection='3d')
dUB = fig.gca(projection='3d')
#Anzeigeparamter
rast... | bsd-2-clause |
shikhardb/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 75 | 34122 | from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fe... | bsd-3-clause |
cauchycui/scikit-learn | sklearn/utils/tests/test_testing.py | 144 | 4121 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... | bsd-3-clause |
ual/urbansim | scripts/cache_to_hdf5.py | 6 | 5004 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import glob
import os
import sys
import numpy as np
import pandas as pd
def cache_to_df(dir_path):
"""
Convert a directory of binary array data files to a Pandas DataFrame.
Parameters
----------
dir_path : str
""... | bsd-3-clause |
louispotok/pandas | pandas/core/generic.py | 1 | 333229 | # pylint: disable=W0231,E1101
import collections
import functools
import warnings
import operator
import weakref
import gc
import json
import numpy as np
import pandas as pd
from pandas._libs import tslib, properties
from pandas.core.dtypes.common import (
_ensure_int64,
_ensure_object,
is_scalar,
is_... | bsd-3-clause |
jjardel/probablyPOTUS | etl/load/src/_loaders.py | 2 | 1042 | from lib.utils.db_conn import DBConn
from lib.utils.lw import get_logger
from pandas import read_csv
class FileLoader(object):
def __init__(self, creds_file, data_file, table, schema, delim=','):
self.logger = get_logger(__name__)
self.file = data_file
self.table = table
self.s... | gpl-3.0 |
wanggang3333/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 278 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
hdmetor/scikit-learn | examples/ensemble/plot_adaboost_multiclass.py | 354 | 4124 | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | bsd-3-clause |
msmbuilder/msmbuilder | msmbuilder/project_templates/cluster/cluster-plot.py | 9 | 1089 | """Plot cluster centers on tICA coordinates
{{header}}
"""
# ? include "plot_header.template"
# ? from "plot_macros.template" import xdg_open with context
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from msmbuilder.io import load_trajs, load_generic
sns.set_style('ticks')
colors =... | lgpl-2.1 |
loli/sklearn-ensembletrees | sklearn/linear_model/tests/test_bayes.py | 30 | 1812 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
aktech/sympy | sympy/plotting/plot_implicit.py | 83 | 14400 | """Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... | bsd-3-clause |
talonchandler/dipsim | notes/2017-09-28-anisotropy/figures/anisotropy-kappa.py | 1 | 2488 | from dipsim import multiframe, util, detector, illuminator, microscope, util
import dipsim.fluorophore as flu
import numpy as np
import matplotlib.pyplot as plt
import os; import time; start = time.time(); print('Running...')
# Main input parameters
n_pts = 1000
kappas = [-3, 0, 3, None]
n_cols = len(kappas)
n_rows =... | mit |
ConeyLiu/spark | python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py | 6 | 20725 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
1haodian/spark | python/setup.py | 11 | 9765 | #!/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 |
saifrahmed/bokeh | bokeh/charts/builder/tests/test_area_builder.py | 33 | 3666 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
roofit-dev/parallel-roofit-scripts | profiling/numIntSet_timing/unbinned_scaling2_k_scaling_overhead_optConst0_NOaffinity.py | 1 | 9094 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: Patrick Bos
# @Date: 2016-11-16 16:23:55
# @Last Modified by: E. G. Patrick Bos
# @Last Modified time: 2017-06-15 08:30:35
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from pathlib import Path
import itertool... | apache-2.0 |
JingJunYin/tensorflow | tensorflow/contrib/timeseries/examples/predict_test.py | 80 | 2487 | # 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 |
kgullikson88/TS23-Scripts | Search.py | 1 | 13594 | from scipy.interpolate import InterpolatedUnivariateSpline as interp
import os
import sys
import numpy as np
import DataStructures
import matplotlib.pyplot as plt
import Correlate
import FitsUtils
import FindContinuum
import Units
homedir = os.environ["HOME"]
modeldir = homedir + "/School/Research/Models/Sorted/Ste... | gpl-3.0 |
YinongLong/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
f0k/ismir2015 | experiments/predict.py | 1 | 7996 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Computes predictions with a neural network trained for singing voice detection.
For usage information, call with --help.
Author: Jan Schlüter
"""
from __future__ import print_function
import sys
import os
import io
from argparse import ArgumentParser
import numpy ... | mit |
napjon/moocs_solution | Data_Science/project_3/plot_residuals/prediction.py | 1 | 2976 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def plot_residuals(dataframe, predictions):
'''
Using the same methods that we used to plot a histogram of entries
per hour for our data, why don't you make a histogram of the residuals
(that is, the difference between the original... | mit |
kjung/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 |
AshivDhondea/SORADSIM | scenarios/main_057_iss_01.py | 1 | 8538 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 07 14:14:57 2017
@author: Ashiv Dhondea
"""
import AstroFunctions as AstFn
import GeometryFunctions as GF
import TimeHandlingFunctions as THF
import UnbiasedConvertedMeasurements as UCM
import math
import numpy as np
# Libraries needed for time keeping and... | mit |
bzero/statsmodels | statsmodels/sandbox/stats/multicomp.py | 26 | 70641 | '''
from pystatsmodels mailinglist 20100524
Notes:
- unfinished, unverified, but most parts seem to work in MonteCarlo
- one example taken from lecture notes looks ok
- needs cases with non-monotonic inequality for test to see difference between
one-step, step-up and step-down procedures
- FDR doesn't look rea... | bsd-3-clause |
Supermem/ibis | ibis/sql/alchemy.py | 6 | 22574 | # Copyright 2015 Cloudera 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 writing, so... | apache-2.0 |
hslh/diachronic-meaning-clin | analyze_and_plot_words.py | 1 | 9654 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import argparse
import json
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from math import log, log10
from scipy.stats.stats import pearsonr, spearmanr
''' Script that takes the raw data (output of query_words_in_embeddings.py), does frequency cut-off,... | gpl-3.0 |
RaoUmer/opendatasci | notebooks/linreg.py | 4 | 6100 | # Supporting library for Lin Reg Notebooks
# Author: Nitin Borwankar
# Open Data Science Training
import warnings
# squelch an anaconda "bug" and some python verbosity
# this can move to system wide python if needed
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", catego... | bsd-2-clause |
perryjohnson/biplaneblade | sandia_blade_lib/prep_stn21_mesh.py | 1 | 24681 | """Write initial TrueGrid files for one Sandia blade station.
Usage
-----
start an IPython (qt)console with the pylab flag:
$ ipython qtconsole --pylab
or
$ ipython --pylab
Then, from the prompt, run this script:
|> %run sandia_blade_lib/prep_stnXX_mesh.py
or
|> import sandia_blade_lib/prep_stnXX_mesh
Au... | gpl-3.0 |
plissonf/scikit-learn | benchmarks/bench_isotonic.py | 268 | 3046 | """
Benchmarks of isotonic regression performance.
We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.
The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.
This alows the scaling of the algorith... | bsd-3-clause |
jmontoyam/mne-python | mne/decoding/time_gen.py | 3 | 64985 | # Authors: Jean-Remi King <jeanremi.king@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Clement Moutard <clement.moutard@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import copy
from .base import _set_cv
f... | bsd-3-clause |
lenovor/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 176 | 2169 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... | bsd-3-clause |
apdjustino/DRCOG_Urbansim | src/drcog/models/hlcm_estimation.py | 1 | 2881 | import synthicity.urbansim.interaction as interaction
import pandas as pd
from synthicity.utils import misc
def estimate (dset,indvars,depvar = 'building_id',alternatives=None,SAMPLE_SIZE=100,max_segment_size = 1200,estimation_table = 'households_for_estimation',
output_names=None,agents_groupby = ['inco... | agpl-3.0 |
jakejhansen/minesweeper_solver | policy_gradients/test_condensed_v4.py | 1 | 8720 | # review solution
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.python.ops.nn import relu, softmax
import gym
import sys
import os
sys.path.append('../')
from minesweeper_tk import Minesweeper
model = "condensed_6x6_v4"
# training settings
epochs = 100000 # number of tr... | mit |
dimkal/mne-python | mne/preprocessing/tests/test_ica.py | 4 | 23111 | from __future__ import print_function
# Author: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import os
import os.path as op
import warnings
from nose.tools import assert_true, assert_raises, assert_equal
from copy import ... | bsd-3-clause |
soylentdeen/BlurryApple | Tools/Kansas/kansas.py | 1 | 2188 | import scipy
import numpy
import VLTTools
from pyevolve import Util
from pyevolve import Mutators
from pyevolve import Initializators
from pyevolve import G1DList, GSimpleGA, Selectors
from pyevolve import Consts
import math
import matplotlib.pyplot as pyplot
fig = pyplot.figure(0)
fig.clear()
ax = fig.add_axes([0.1, ... | gpl-2.0 |
oemof/examples | oemof_examples/oemof.solph/v0.4.x/generic_chp/ccet.py | 1 | 2938 | # -*- coding: utf-8 -*-
"""
General description
-------------------
Example that illustrates how to use custom component `GenericCHP` can be used.
In this case it is used to model a combined cycle extraction turbine.
Installation requirements
-------------------------
This example requires the version v0.3.x of oemof... | gpl-3.0 |
AlgorithmLover/OJCodes | qlcoder/data_mining/topic_model/reference/refered_code.py | 1 | 3286 | #!/usr/bin/python
# -*- coding:utf8 -*-
import time
import jieba.analyse
def post_cut(url):
fr = open(url + "/post_data.txt")
fo = open(url + "/post_key.txt", "a+")
for line in fr.readlines():
term = line.strip().split("\t")
if len(term) == 3 and term[2] != "":
key_list = jieb... | mit |
origingod/salary-prediction-with-machine-learning | Analyser.py | 1 | 8381 | #encoding: utf8
"""
Do some data-work
烦的时候写写注释 By H.YC
"""
from __future__ import print_function
try:
import cPickle as pickle
except:
import pickle
import sys
import os
import numpy as np
import sklearn
from sklearn import linear_model, datasets, metrics
from sklearn.cross_validation import train_test_split
... | gpl-2.0 |
okyere/excel-data-collection | app/views.py | 1 | 13703 | # -*- coding: utf-8 -*-
from functools import wraps
from flask import render_template, flash, abort, redirect, session, url_for, request, g, jsonify, make_response, Response
from app import theapp, db, dao
#from flask.ext.mail import Message
from .models import Department, TableInfo, Field, FieldType, UploadsLog
from ... | mit |
MatthieuBizien/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 37 | 12559 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
rgommers/statsmodels | statsmodels/graphics/tests/test_regressionplots.py | 5 | 4406 | '''Tests for regressionplots, entire module is skipped
'''
import numpy as np
import nose
import statsmodels.api as sm
from statsmodels.graphics.regressionplots import (plot_fit, plot_ccpr,
plot_partregress, plot_regress_exog, abline_plot,
plot_partregress_grid, plot_ccpr_grid, ad... | bsd-3-clause |
jorge2703/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 234 | 12267 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
chen0510566/MissionPlanner | Lib/site-packages/numpy/fft/fftpack.py | 59 | 39653 | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
rfft(a, n=None, axis=-1)
irfft(a, n=None, axis=-1)
hfft(a, n=None, axis=-1)
ihfft(a, n=None, axis=-1)
fftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
rfftn(a, s=None, axes=None)
irfftn(a, s=None, axes=None... | gpl-3.0 |
alexandreleroux/mayavi | mayavi/tools/figure.py | 2 | 11186 | """
Functions related to creating the engine or the figures.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from types import IntType
import gc
import warnings
import copy
import numpy as np
# Enthought imports
fr... | bsd-3-clause |
hrjn/scikit-learn | sklearn/datasets/__init__.py | 61 | 3734 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_breast_cancer
from .base import load_boston
from .base import load_diabetes
from .base import load_digi... | bsd-3-clause |
danilnagy/taxiMap | app.py | 1 | 7480 | from flask import Flask
from flask import render_template
from flask import request
from flask import Response
import pickle
import numpy as np
import json
import time
import sys
import random
import math
import pyorient
from sklearn import preprocessing
from sklearn import svm
from multiprocessing import Pool
fro... | gpl-2.0 |
kcompher/FreeDiscovUI | freediscovery/dupdet/imatch.py | 1 | 3622 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from sklearn.base import BaseEstimator
from freediscovery.cluster.utils import _merge_clusters
from sklearn.utils.validation ... | bsd-3-clause |
alfanugraha/LUMENS-repo | processing/algs/PolarPlot.py | 6 | 3110 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BarPlot.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | gpl-2.0 |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 8 | 8995 | # 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... | mit |
johnboyington/homework | ne737/prev/hw4ne737.py | 1 | 1475 | #ne737 hw4
import numpy as np
import matplotlib.pyplot as plt
###############################################################################
# PROBLEM 1
###############################################################################
i = np.array(range(38)) + 815
ci = np.array([189, 171,... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/projections/__init__.py | 21 | 3371 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from .geo import AitoffAxes, HammerAxes, LambertAxes, MollweideAxes
from .polar import PolarAxes
from matplotlib import axes
class ProjectionRegistry(object):
"""
Manages the set of project... | gpl-3.0 |
UDST/activitysim | activitysim/abm/models/joint_tour_composition.py | 2 | 3417 | # ActivitySim
# See full license in LICENSE.txt.
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402
import logging
import pandas as pd
from activitysim.core import simulate
from activitysim.core import tracing
from... | bsd-3-clause |
gromitsun/sim-xrf-py | others/snr_90_180/snr_180_as.py | 1 | 1768 | import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
# # #fonts# # #
import matplotlib
from matplotlib import rc
matplotlib.rcParams['pdf.fonttype'] = 'truetype'
fontProperties = {'family':'serif','serif':['Arial'],
'weight' : 'normal', 'size' : '12'}
rc('font',**fontPropertie... | mit |
devanshdalal/scikit-learn | examples/gaussian_process/plot_gpc.py | 103 | 3927 | """
====================================================================
Probabilistic predictions with Gaussian process classification (GPC)
====================================================================
This example illustrates the predicted probability of GPC for an RBF kernel
with different choices of the hy... | bsd-3-clause |
genialis/resolwe-bio | resolwe_bio/processes/import_data/proteomics_data.py | 1 | 7773 | """Upload proteomics data."""
import re
from pathlib import Path
import pandas as pd
from resolwe.process import FileField, Process, SchedulingClass, StringField
def change_suffix(path):
"""Change suffix of a file to lowercase."""
new_path = path.with_suffix(path.suffix.lower())
path.replace(new_path)
... | apache-2.0 |
waterponey/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
juhi24/baecc | baecc/snowfall.py | 1 | 3445 | """Tools for estimating density and other properties of falling snow"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import copy
import warnings
from itertools import cycle
from datetime import timedelta
def remove_subplot_gaps(f, axis='row', axarr=None):
if axarr is None:
ax... | gpl-3.0 |
ishanic/scikit-learn | sklearn/ensemble/gradient_boosting.py | 126 | 65552 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
HeraclesHX/scikit-learn | sklearn/linear_model/setup.py | 169 | 1567 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | bsd-3-clause |
NunoEdgarGub1/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 |
korepwx/tfsnippet | tfsnippet/examples/utils/evaluation.py | 1 | 9573 | import imageio
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from tfsnippet.distributions import Bernoulli
from tfsnippet.stochastic import StochasticTensor
from tfsnippet.trainer import merge_feed_dict, resolve_feed_dict
from tfsnippet.utils import get_default_session_or_error
from .... | mit |
schets/scikit-learn | examples/cluster/plot_cluster_iris.py | 350 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
mhdella/scikit-learn | sklearn/ensemble/__init__.py | 217 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
ndingwall/scikit-learn | sklearn/model_selection/_split.py | 7 | 82092 | """
The :mod:`sklearn.model_selection._split` module includes classes and
functions to split the data based on a preset strategy.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# Ragha... | bsd-3-clause |
tunnell/wax | docs/conf.py | 1 | 8105 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import sphinx_rtd_theme
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like s... | bsd-3-clause |
jjsalomon/python-analytics | pandas2 - Reading & Writing Data/pandas5 - JSON Data.py | 1 | 1221 | # -*- coding: utf-8 -*-
"""
Created on Sun May 28 17:37:50 2017
@author: azkei
"""
# Creating a DataFrame and writing it to JSON
# Generate DataFrame
frame = pd.DataFrame(np.arange(16).reshape(4,4),
index=['white','black','red','blue'],
columns=['up','down','right','left'])
# ... | mit |
saimn/glue | glue/external/wcsaxes/axislabels.py | 2 | 4454 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from matplotlib.text import Text
import matplotlib.transforms as mtransforms
from .frame import RectangularFrame
class AxisLabels(Text):
def __init__(self, frame, minpad=1, *args, **kwargs):
self._frame = frame
s... | bsd-3-clause |
CitoyensCapteurs/CitizenWatt | samples/graph.py | 1 | 1843 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
from scipy.integrate import trapz
# Load data
with open('sample', 'r') as fh:
lines = fh.readlines()
for i in range(len(lines)):
if i % 120 != 0:
lines[i] = lines[i-1]
... | gpl-3.0 |
tawsifkhan/scikit-learn | sklearn/tests/test_lda.py | 77 | 6258 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert... | bsd-3-clause |
jimmbraddock/ns-3.20-ATN | 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 |
sanketloke/scikit-learn | sklearn/cluster/spectral.py | 25 | 18522 | # -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... | bsd-3-clause |
tarthy6/dozer-thesis | examples/old/concrete/uniax.py | 3 | 7655 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
from woo import utils,plot,pack,timing,eudoxos
import time, sys, os, copy
#import matplotlib
#matplotlib.rc('text',usetex=True)
#matplotlib.rc('text.latex',preamble=r'\usepackage{concrete}\usepackage{euler}')
"""
A fairly complex script perf... | gpl-2.0 |
tynn/numpy | numpy/lib/function_base.py | 2 | 142404 | from __future__ import division, absolute_import, print_function
try:
# Accessing collections abstact classes from collections
# has been deprecated since Python 3.3
import collections.abc as collections_abc
except ImportError:
import collections as collections_abc
import re
import sys
import warnings
... | bsd-3-clause |
Vimos/scikit-learn | examples/mixture/plot_gmm.py | 122 | 3265 | """
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians
obtained with Expectation Maximisation (``GaussianMixture`` class) and
Variational Inference (``BayesianGaussianMixture`` class models with
a Dirichlet ... | bsd-3-clause |
jmetzen/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 81 | 5461 | """
======================================================================
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 |
patyoon/predict_applied | regression/correlation_results.py | 1 | 9116 | from MySQLdb import connect
from numpy import zeros
from operator import itemgetter
import pylab as pl
from optparse import OptionParser
from collections import defaultdict
import pickle, random, os
import numpy as np
from sklearn.linear_model import LinearRegression, LogisticRegression
from regression_models import r... | gpl-2.0 |
danoan/image-processing | denoise.py | 1 | 3062 | import os,sys
PROJECT_FOLDER=os.path.dirname(os.path.realpath(__file__))
sys.path.append( "{}/packages".format(PROJECT_FOLDER) )
import argparse
import numpy as np
from scipy import misc
import matplotlib.pyplot as plt
from improc.denoise import chambolle,rof,tikhonov,fista,rof_modified_curvature
def read_input():
... | mit |
vascotenner/holoviews | holoviews/plotting/mpl/hooks.py | 1 | 9173 | import copy
import numpy as np
from matplotlib import pyplot as plt
try:
from mpld3 import plugins
except:
plugins = None
import param
from ...core import NdOverlay, Overlay
from ...element import HeatMap, Raster, Scatter, Curve, Points, Bars, Histogram
from . import CurvePlot, PointPlot, OverlayPlot, Raster... | bsd-3-clause |
booya-at/paraBEM | examples/plots/panel_src.py | 2 | 1530 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import parabem
from parabem.pan3d import src_3_0_vsaero
from parabem.utils import check_path
pnt1 = parabem.PanelVector3(-1, -1, 0)
pnt2 = parabem.PanelVector3(1, -1, 0)
pnt3 = parabem.PanelVector3(1, 1, 0)
pnt4 = parabem.Panel... | gpl-3.0 |
iLeoDo/SAExtractor | SAEFun/DTreeLearner.py | 1 | 4741 | import csv
import cPickle as pickle
from sklearn import tree
from sklearn.externals.six import StringIO
import pydot
import dot_parser
import requests
from judge.FeatueExtract import FeatureExtract
from SAECrawlers.items import UrlItem
from util import db, config
def csv_for_db(sql, sqlparam, resultfile, datapath):... | apache-2.0 |
nvoron23/statsmodels | statsmodels/tsa/vector_ar/tests/test_var.py | 23 | 18346 | """
Test VAR Model
"""
from __future__ import print_function
# pylint: disable=W0612,W0231
from statsmodels.compat.python import (iteritems, StringIO, lrange, BytesIO,
range)
from nose.tools import assert_raises
import nose
import os
import sys
import numpy as np
import statsmod... | bsd-3-clause |
mcanthony/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_svg.py | 69 | 23593 | from __future__ import division
import os, codecs, base64, tempfile, urllib, gzip, cStringIO
try:
from hashlib import md5
except ImportError:
from md5 import md5 #Deprecated in 2.5
from matplotlib import verbose, __version__, rcParams
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
... | agpl-3.0 |
appapantula/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 |
elkingtonmcb/sympy | sympy/interactive/tests/test_ipythonprinting.py | 21 | 6055 | """Tests that the IPython printing module is properly loaded. """
from sympy.core.compatibility import u
from sympy.interactive.session import init_ipython_session
from sympy.external import import_module
from sympy.utilities.pytest import raises
# run_cell was added in IPython 0.11
ipython = import_module("IPython",... | bsd-3-clause |
rs2/pandas | pandas/tests/io/formats/test_style.py | 1 | 66244 | import copy
import re
import textwrap
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
jinja2 = pytest.importorskip("jinja2")
from pandas.io.formats.style import Styler, _get_level_lengths # noqa # isort:skip
... | bsd-3-clause |
victorbergelin/scikit-learn | sklearn/cluster/tests/test_spectral.py | 262 | 7954 | """Testing for Spectral Clustering methods"""
from sklearn.externals.six.moves import cPickle
dumps, loads = cPickle.dumps, cPickle.loads
import numpy as np
from scipy import sparse
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
bmcfee/librosa | librosa/segment.py | 2 | 36388 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Temporal segmentation
=====================
Recurrence and self-similarity
------------------------------
.. autosummary::
:toctree: generated/
cross_similarity
recurrence_matrix
recurrence_to_lag
lag_to_recurrence
timelag_filter
path_enhan... | isc |
q1ang/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 |
Charleo85/ml_project | resource/dcgan_tensorflow/face/train.py | 1 | 3620 | import ipdb
import os
import pandas as pd
import numpy as np
from model import *
from util import *
n_epochs = 100
learning_rate = 0.0002
batch_size = 128
image_shape = [64,64,3]
dim_z = 100
dim_W1 = 1024
dim_W2 = 512
dim_W3 = 256
dim_W4 = 128
dim_W5 = 3
visualize_dim=196
face_image_path = '/media/storage3/Study/dat... | mit |
wkfwkf/statsmodels | statsmodels/genmod/tests/test_glm.py | 6 | 37718 | """
Test functions for models.GLM
"""
from statsmodels.compat import range
import os
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_raises,
assert_allclose, assert_, assert_array_less, dec)
from scipy import stats
import statsmodels.api as sm
from st... | bsd-3-clause |
NicovincX2/Python-3.5 | Physique/Électromagnétisme/Magnétisme/champ_tournant_triphase.py | 1 | 4292 | # -*- coding: utf-8 -*-
import os
"""
Ce programme est proposé par Vincent Grenard (PCSI, Lycée Poincaré, Nancy).
Il permet de visualiser la rotation du champ magnétique total lors de la
superposition de trois champs en mode triphasé.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import an... | gpl-3.0 |
andrebrener/crypto_predictor | main.py | 1 | 6044 | # =============================================================================
# File: main.py
# Author: Andre Brener
# Created: 06 Jun 2017
# Last Modified: 18 Jun 2017
# Description: description
# =============================================================================
import os
import l... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.