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 |
|---|---|---|---|---|---|
joshua-cogliati-inl/raven | framework/utils/cached_ndarray.py | 1 | 14661 | # Copyright 2017 Battelle Energy Alliance, 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 t... | apache-2.0 |
jisazaTappsi/shatter | shatter/rules.py | 2 | 16417 | #!/usr/bin/env python
"""Defines a more user friendly way of entering data."""
import warnings
import pandas as pd
from shatter.constants import *
from shatter.output import Output
from shatter.util import helpers
from shatter.util.ordered_set import OrderedSet
from shatter.util.code_dict import CodeDict
from shatte... | mit |
mayblue9/scikit-learn | sklearn/mixture/gmm.py | 68 | 31091 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import warnings
import numpy as... | bsd-3-clause |
dendisuhubdy/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_test.py | 30 | 60826 | # 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 |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/io/data.py | 2 | 45764 | """
Module contains tools for collecting data from various remote sources
"""
# flake8: noqa
import warnings
import tempfile
import datetime as dt
import time
from collections import defaultdict
import numpy as np
from pandas.compat import(
StringIO, bytes_to_str, range, lmap, zip
)
import pandas.compat as co... | mit |
reinoslav/DeepLearningTrackingDemo | main.py | 1 | 4136 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
if __name__ == '__main__':
num_epochs = 1
total_series_length = 50000
truncated_backprop_length = 15
state_size = 4
num_classes = 2
echo_step = 3
batch_size = 5
num_batches = total_series_length // batch_size // ... | mit |
varses/awsch | lantz/drivers/tektronix/tds1012.py | 3 | 6856 | # -*- coding: utf-8 -*-
"""
lantz.drivers.tektronix.tds1012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements the drivers to control an oscilloscope.
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
Source: Tektronix Manual
"""
impor... | bsd-3-clause |
evan-bradley/brandcentralstation | machinelearning/CNN/CNNUpdate.py | 1 | 15944 | import os
import glob
import cv2
import shutil
from sklearn.utils import shuffle
import numpy as np
import tensorflow as tf
from tensorflow import set_random_seed
import time
import MySQLdb
import json
from numpy.random import seed
# db = MySQLdb.connect(host="138.197.85.34", user="root", password="somethingeasy", db=... | gpl-3.0 |
elijah513/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 |
gotomypc/scikit-learn | examples/svm/plot_svm_kernels.py | 329 | 1971 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM-Kernels
=========================================================
Three different types of SVM-Kernels are displayed below.
The polynomial and RBF are especially useful when the
data-points are not linearly sep... | bsd-3-clause |
rajat1994/scikit-learn | examples/calibration/plot_calibration_multiclass.py | 272 | 6972 | """
==================================================
Probability Calibration for 3-class classification
==================================================
This example illustrates how sigmoid calibration changes predicted
probabilities for a 3-class classification problem. Illustrated is the
standard 2-simplex, wher... | bsd-3-clause |
lucidfrontier45/scikit-learn | examples/ensemble/plot_forest_importances_faces.py | 5 | 1555 | """
=================================================
Pixel importances with a parallel forest of trees
=================================================
This example shows the use of forests of trees to evaluate the importance
of the pixels in an image classification task (faces). The hotter the pixel,
the more impor... | bsd-3-clause |
TaichiHo/smarkingPrediction | pythonFiles/ParkFinalLinearRegression_20160228.py | 1 | 9976 |
# coding: utf-8
#Import the libraries
import time, holidays
import pandas as pd
import numpy as np
import statsmodels.api as sm
import matplotlib.pylab as plt
import statsmodels.graphics.tsaplots as tsaplots
from collections import Counter, OrderedDict
from datetime import date, datetime, timedelta
#Define the fu... | mit |
gnychis/grforwarder | gr-digital/examples/snr_estimators.py | 14 | 5302 | #!/usr/bin/env python
import sys
try:
import scipy
from scipy import stats
except ImportError:
print "Error: Program requires scipy (www.scipy.org)."
sys.exit(1)
try:
import pylab
except ImportError:
print "Error: Program requires Matplotlib (matplotlib.sourceforge.net)."
sys.exit(1)
... | gpl-3.0 |
sssundar/Drone | rotation/hpf.py | 1 | 1557 | from scipy import signal
from matplotlib import pyplot as plt
import numpy as np
# A normalized IIR filter with the constructed response:
# H(z) = [(1-B)/2] (1-z^-1) / (1+Bz^-M) to start with 0 <= B < 1 and M > 0
# This works out as y(n) = x(n) - x(n-1) - B*y(n-M)
# out(n) = [(1-B)/2] y(n)
# Remember that a... | gpl-3.0 |
antiface/mne-python | examples/simulation/plot_simulate_evoked_data.py | 10 | 3125 | """
==============================
Generate simulated evoked data
==============================
"""
# Author: Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from... | bsd-3-clause |
fbergama/wass | gridding/wass_utils.py | 1 | 4526 | import numpy as np
import struct
def load_camera_mesh( meshfile ):
with open(meshfile, "rb") as mf:
npts = struct.unpack( "I", mf.read( 4 ) )[0]
limits = np.array( struct.unpack( "dddddd", mf.read( 6*8 ) ) )
Rinv = np.reshape( np.array(struct.unpack("ddddddddd", mf.read(9*8) )), (3,3) )
... | gpl-3.0 |
sanghack81/SDCIT | experiments/run_kernel_choice_sensitivity.py | 1 | 5819 | import multiprocessing
import os
import numpy as np
import numpy.ma as ma
import scipy.io
from joblib import Parallel, delayed
from sklearn.metrics import euclidean_distances
from tqdm import tqdm
from experiments.exp_setup import SDCIT_RESULT_DIR, SDCIT_DATA_DIR, PARALLEL_JOBS
from sdcit.kcit import python_kcit_K, p... | mit |
blink1073/scikit-image | doc/ext/plot_directive.py | 89 | 20530 | """
A special directive for generating a matplotlib plot.
.. warning::
This is a hacked version of plot_directive.py from Matplotlib.
It's very much subject to change!
Usage
-----
Can be used like this::
.. plot:: examples/example.py
.. plot::
import matplotlib.pyplot as plt
plt.plot... | bsd-3-clause |
DmitryOdinoky/sms-tools | lectures/05-Sinusoidal-model/plots-code/sineModel-anal-synth.py | 24 | 1483 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.p... | agpl-3.0 |
M1kol4j/BQ_t4_Look | bq_t4_look.py | 1 | 15967 | #!/usr/bin/env python
"""
bq_t4_look.py
Created by Mikolaj Szydlarski on 2014-04-29.
Copyright (c) 2014, ITA UiO - All rights reserved.
"""
import os
import sys
import datetime
import getopt
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.ticker as ticker
from... | mit |
fw1121/galaxy_tools | toolshed/inchlib_clust/inchlib_clust.py | 8 | 24156 | #coding: utf-8
from __future__ import print_function
import csv, json, copy, re, argparse, os, urllib2
import numpy, scipy, fastcluster, sklearn
import scipy.cluster.hierarchy as hcluster
from sklearn import preprocessing
from scipy import spatial
LINKAGES = ["single", "complete", "average", "centroid", "ward", "med... | mit |
ChristosChristofidis/bokeh | bokeh/models/sources.py | 13 | 10604 | from __future__ import absolute_import
from ..plot_object import PlotObject
from ..properties import HasProps
from ..properties import Any, Int, String, Instance, List, Dict, Either, Bool, Enum
from ..validation.errors import COLUMN_LENGTHS
from .. import validation
from ..util.serialization import transform_column_so... | bsd-3-clause |
renyi533/tensorflow | tensorflow/lite/micro/examples/micro_speech/apollo3/compare_1k.py | 9 | 5012 | # Copyright 2018 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 |
chrisburr/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
iproduct/course-social-robotics | 11-dnn-keras/venv/Lib/site-packages/pandas/tests/scalar/interval/test_interval.py | 3 | 8840 | import numpy as np
import pytest
from pandas import Interval, Period, Timedelta, Timestamp
import pandas._testing as tm
import pandas.core.common as com
@pytest.fixture
def interval():
return Interval(0, 1)
class TestInterval:
def test_properties(self, interval):
assert interval.closed == "right"
... | gpl-2.0 |
MatthieuBizien/scikit-learn | sklearn/utils/multiclass.py | 40 | 12966 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | bsd-3-clause |
ch3ll0v3k/scikit-learn | benchmarks/bench_mnist.py | 154 | 6006 | """
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | bsd-3-clause |
rodorad/spark-tk | regression-tests/sparktkregtests/testcases/models/random_forest_classifier_test.py | 2 | 7690 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
Onderwaater/spacetime | lib/spacetime/util.py | 2 | 9495 | # This file is part of Spacetime.
#
# Copyright 2010-2014 Leiden University.
# Written by Sander Roobol.
#
# Spacetime 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 2 of the License, or
# (at ... | gpl-2.0 |
khkaminska/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
srjoglekar246/sympy | sympy/utilities/runtests.py | 2 | 63752 | """
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly
(or identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* po... | bsd-3-clause |
dsullivan7/scikit-learn | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
AnaniSkywalker/UDACITY_Machine_Learning | SMS_Messages/SmsMessages.py | 1 | 5691 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 16 15:13:28 2017
@author: Anani Assoutovi
"""
# SMSSpamCollection
import pandas as pd, string, pprint
from collections import Counter
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.cross_validation import train_test_split
i... | mit |
WhittKinley/aima-python | submissions/Porter/myKMeans.py | 3 | 7634 | from sklearn.cluster import KMeans
import traceback
from submissions.porter import billionaires
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
# trumpECHP = DataFrame()
#
# '''
# Extract data from the CORGIS elections, and merge it with the
# CORGIS demographics. Both dat... | mit |
cloud-fan/spark | python/pyspark/pandas/missing/common.py | 16 | 2092 | #
# 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 |
walterreade/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 43 | 24671 | """
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 numpy.testing import run_module_suite
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from... | bsd-3-clause |
kambysese/mne-python | mne/decoding/tests/test_transformer.py | 3 | 9474 | # Author: Mainak Jas <mainak@neuro.hut.fi>
# Romain Trachel <trachelr@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import pytest
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_allclose, assert_equal)
from mne impor... | bsd-3-clause |
winklerand/pandas | pandas/tests/io/msgpack/test_sequnpack.py | 14 | 3074 | # coding: utf-8
from pandas import compat
from pandas.io.msgpack import Unpacker, BufferFull
from pandas.io.msgpack import OutOfData
import pytest
import pandas.util.testing as tm
class TestPack(object):
def test_partial_data(self):
unpacker = Unpacker()
msg = "No more data to unpack"
... | bsd-3-clause |
soft-matter/mr | mr/filtering.py | 1 | 2315 | """Simple functions that eliminate spurrious trajectories
by wrapping pandas group-by and filter capabilities."""
def filter_stubs(tracks, threshold=100):
"""Filter out trajectories with few points. They are often specious.
Parameters
----------
tracks : DataFrame
must include columns named '... | gpl-3.0 |
great-expectations/great_expectations | great_expectations/dataset/dataset.py | 1 | 198226 | import inspect
import logging
from datetime import datetime
from functools import lru_cache, wraps
from itertools import zip_longest
from numbers import Number
from typing import Any, List, Optional, Set, Union
import numpy as np
import pandas as pd
from dateutil.parser import parse
from scipy import stats
from great... | apache-2.0 |
thonkify/thonkify | src/lib/future/utils/__init__.py | 1 | 20278 | """
A selection of cross-compatible functions for Python 2 and 3.
This module exports useful functions for 2/3 compatible code:
* bind_method: binds functions to classes
* ``native_str_to_bytes`` and ``bytes_to_native_str``
* ``native_str``: always equal to the native platform string object (because
... | mit |
BNUCNL/FreeROI | froi/widgets/unused/volumedintensitydialog.py | 6 | 2368 | __author__ = 'zhouguangfu'
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplo... | bsd-3-clause |
bjornaa/ladim | examples/logo/animate.py | 1 | 2099 | # import itertools
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from netCDF4 import Dataset
from postladim import ParticleFile
# ---------------
# User settings
# ---------------
# Files
particle_file = "logo.nc"
grid_file = "../data/ocean_avg_0014.nc"
# Subgrid d... | mit |
strint/tensorflow | tensorflow/examples/learn/iris_val_based_early_stopping.py | 62 | 2827 | # 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 |
rosswhitfield/mantid | qt/applications/workbench/workbench/plotting/figuremanager.py | 3 | 22835 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
clinicalml/anchorExplorer | gui.py | 2 | 7273 | #from Tkinter import *
import random
from copy import deepcopy
#import tkFileDialog
import itertools
from multiprocessing import Pool
import string
import ttk
import shelve
import time
import sys
import cPickle as pickle
from collections import defaultdict
import numpy as np
import re
from sklearn import metrics
from D... | bsd-2-clause |
cwu2011/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 |
compas-dev/compas | src/compas_plotters/core/utilities.py | 1 | 1996 | __all__ = [
'get_axes_dimension',
'assert_axes_dimension',
'width_to_dict',
'size_to_sizedict',
]
def get_axes_dimension(axes):
"""Returns the number of dimensions of a matplotlib axes object.
Parameters
----------
axes : object
The matplotlib axes object.
... | mit |
a-holm/MachinelearningAlgorithms | Regression/DecisionTreeRegression/regularDecisionTreeRegression.py | 1 | 2168 | # -*- coding: utf-8 -*-
"""Decision Tree regression for machine learning.
Decision tree builds regression or classification models in the form of a tree
structure. It brakes down a dataset into smaller and smaller subsets while at
the same time an associated decision tree is incrementally developed. The final
result i... | mit |
pypot/scikit-learn | examples/text/document_classification_20newsgroups.py | 222 | 10500 | """
======================================================
Classification of text documents using sparse features
======================================================
This is an example showing how scikit-learn can be used to classify documents
by topics using a bag-of-words approach. This example uses a scipy.spars... | bsd-3-clause |
nbir/gambit-scripts | scripts/racial_segregation/src/artificial.py | 1 | 6846 | # Gambit scripts
#
# Copyright (C) USC Information Sciences Institute
# Author: Nibir Bora <nbora@usc.edu>
# URL: <http://cbg.isi.edu/>
# For license information, see LICENSE
import os
import sys
import csv
import anyjson
import itertools
import numpy as np
import lib.geo as geo
import jsbeautifier as jsb
import matp... | apache-2.0 |
mhue/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 248 | 2903 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
Nyker510/scikit-learn | sklearn/tests/test_metaestimators.py | 226 | 4954 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/bezier.py | 10 | 15819 | """
A module providing some utility functions regarding bezier path manipulation.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib.path import Path
from operator import xor
import warnings
class NonInters... | gpl-3.0 |
akpetty/ArcticSeaIcePrediction2017 | Scripts/forecast_funcs.py | 1 | 11273 | import matplotlib
matplotlib.use("AGG")
from mpl_toolkits.basemap import Basemap, shiftgrid
import numpy as np
from pylab import *
import numpy.ma as ma
from glob import glob
import pandas as pd
from scipy import stats
import statsmodels.api as sm
from statsmodels.sandbox.regression.predstd import wls_prediction_std
#f... | gpl-3.0 |
haraldschilly/smc | src/scripts/test_install.py | 6 | 2775 | #!/usr/bin/env python
###############################################################################
#
# SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal.
#
# Copyright (C) 2014, William Stein
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
lucalianas/openmicroscopy | components/tools/OmeroPy/src/omero/install/logs_library.py | 15 | 6927 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Function for parsing OMERO log files.
The format expected is defined for Python in
omero.util.configure_logging.
Copyright 2010 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
:author: Josh Moore ... | gpl-2.0 |
ruhulsbu/WEAT4TwitterGroups | histwords/statutils/mixedmodels.py | 2 | 6893 | import collections
import copy
import pandas as pd
import statsmodels.api as sm
import scipy as sp
import numpy as np
def make_data_frame(words, years, feature_dict):
"""
Makes a pandas dataframe for word, years, and dictionary of feature funcs.
Each feature func should take (word, year) and return featur... | mit |
lenovor/scikit-learn | sklearn/utils/tests/test_random.py | 230 | 7344 | 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 |
shl198/Pipeline | nothing.py | 2 | 4880 | import pandas as pd
import os
import ipdb
import numpy
from Bio import SeqIO
import subprocess
from Modules.f00_Message import Message
from natsort import natsorted
import matplotlib.pyplot as plt
import matplotlib as mpl
from multiprocessing import Process
mpl.style.use('ggplot')
import pysam
from Bio.Seq import Seq
... | mit |
astroswego/magellanic-structure | setup.py | 1 | 1146 | #!/usr/bin/env python3
"""magellanic-structure: description goes here
long description goes here
"""
DOCLINES = __doc__.split('\n')
CLASSIFIERS = """\
Programming Language :: Python
Programming Language :: Python :: 3
Intended Audience :: Science/Research
"""
MAJOR = 0
MINOR = 1
MICRO = 0
VERSION = '%d.%d.%d' % (MA... | mit |
hopshadoop/hops-util-py | hops/featurestore_impl/featureframes/FeatureFrame.py | 1 | 34557 | from hops import hdfs, constants, util
from hops.featurestore_impl.util import fs_utils
from hops.featurestore_impl.exceptions.exceptions import TrainingDatasetNotFound, CouldNotConvertDataframe, \
NumpyDatasetFormatNotSupportedForExternalTrainingDatasets, HDF5DatasetFormatNotSupportedForExternalTrainingDatasets
fr... | apache-2.0 |
feranick/SpectralMachine | Utilities/Legagy/ConvertTrainFormat_legacy1.py | 1 | 1777 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
*********************************************
* Convert train data to binary or text file
* version: 20180203b
*
* By: Nicola Ferralis <feranick@hotmail.com>
***********************************************
'''
print(__doc__)
import numpy as np
import sys, os.path, rand... | gpl-3.0 |
MazamaScience/ispaq | ispaq/crossCorrelation_metrics.py | 1 | 12485 | """
ISPAQ Business Logic for Cross-Correlation Metrics.
:copyright:
Mazama Science
:license:
GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, print_function)
import math
import numpy as np
import pandas as pd
fr... | gpl-3.0 |
jbalm/ActuarialCashFlowModel | Main.py | 1 | 65512 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 25 22:57:32 2016
@author: Quang Dien DUONG
"""
from Asset_data0 import Asset_data0
from Liabilities_data0 import Liabilities_data_m, Liabilities_data0
from ALM_v1 import ALM
#from ALM_v2_2 import ALM
from ESG_RN import ESG_RN
from Technical_Provision import Technical_Prov... | gpl-3.0 |
tavo91/NER-WNUT17 | common/representation.py | 1 | 2497 | from collections import defaultdict as ddict
from common import utilities as utils
from keras.preprocessing.sequence import pad_sequences
from settings import *
from sklearn.preprocessing import LabelBinarizer
# TODO: get labels from corpus for other tasks
index2category = [
'B-corporation',
'B-creative-work'... | mit |
dsquareindia/scikit-learn | examples/ensemble/plot_adaboost_hastie_10_2.py | 355 | 3576 | """
=============================
Discrete versus Real AdaBoost
=============================
This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates
the difference in performance between the discrete SAMME [2] boosting
algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate... | bsd-3-clause |
vybstat/scikit-learn | examples/calibration/plot_calibration_curve.py | 225 | 5903 | """
==============================
Probability Calibration curves
==============================
When performing classification one often wants to predict not only the class
label, but also the associated probability. This probability gives some
kind of confidence on the prediction. This example demonstrates how to di... | bsd-3-clause |
MonoCloud/zipline | zipline/utils/tradingcalendar.py | 9 | 11195 | #
# 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 |
cclib/cclib | test/io/testccio.py | 3 | 6733 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Unit tests for parser ccio module."""
import os
import sys
import tempfile
from io import StringIO
import unittest
fro... | bsd-3-clause |
wohllab/milkyway_proteomics | galaxy_milkyway_files/tools/wohl-proteomics/psm_extract/psm_extract.py | 1 | 9835 | import os, sys, re
import optparse
import shutil
import pandas
import numpy
import gc
import multiprocessing
from joblib import Parallel, delayed
parser = optparse.OptionParser()
#For psm extractor, we're going to filter by 1. PSM q-value and 2. FIDO q-values...
parser.add_option("--qthresh",action="store", type="flo... | mit |
RayMick/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
seckcoder/lang-learn | python/sklearn/examples/plot_classifier_comparison.py | 1 | 3994 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
======================
Classifiers Comparison
======================
A comparison of a several classifiers in scikit-learn on synthetic datasets.
The point of this example is to illustrate the nature of decision boundaries
of different classifiers.
This should be taken wit... | unlicense |
tawsifkhan/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 130 | 6059 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
btabibian/scikit-learn | sklearn/feature_extraction/hashing.py | 5 | 6830 | # Author: Lars Buitinck
# License: BSD 3 clause
import numbers
import warnings
import numpy as np
import scipy.sparse as sp
from . import _hashing
from ..base import BaseEstimator, TransformerMixin
def _iteritems(d):
"""Like d.iteritems, but accepts any collections.Mapping."""
return d.iteritems() if hasat... | bsd-3-clause |
aabadie/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/cluster/plot_dict_face_patches.py | 1 | 2744 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | mit |
danellecline/stoqs | stoqs/contrib/analysis/classify.py | 1 | 21316 | #!/usr/bin/env python
"""
Script to execute steps in the classification of measurements including:
1. Labeling specific MeasuredParameters
2. Tagging MeasuredParameters based on a model
Mike McCann
MBARI 16 June 2014
"""
import os
import sys
# Insert Django App directory (parent of config) into python path
sys.pat... | gpl-3.0 |
jerkos/cobrapy | cobra/flux_analysis/phenotype_phase_plane.py | 1 | 12054 | from numpy import linspace, zeros, array, meshgrid, abs, empty, arange, \
int32, unravel_index
from multiprocessing import Pool
from ..solvers import solver_dict, get_solver_name
# attempt to import plotting libraries
try:
from matplotlib import pyplot
from mpl_toolkits.mplot3d import axes3d
except Import... | lgpl-2.1 |
mcdeaton13/Tax-Calculator | taxcalc/functions.py | 1 | 50445 |
import pandas as pd
from pandas import DataFrame
import math
import numpy as np
from .decorators import *
@iterate_jit(nopython=True)
def FilingStatus(MARS):
if MARS == 3 or MARS == 6:
_sep = 2
else:
_sep = 1
return _sep
@iterate_jit(nopython=True)
def Adj(e35300_0, e35600_0, e35910_0,... | mit |
anirudhjayaraman/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 299 | 1770 | # 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 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/IPython/core/tests/test_pylabtools.py | 15 | 7752 | """Tests for pylab tools module.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2011, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------... | mit |
JingJunYin/tensorflow | tensorflow/contrib/timeseries/examples/known_anomaly.py | 53 | 6786 | # 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 |
mojoboss/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py | 230 | 2649 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... | bsd-3-clause |
ZenDevelopmentSystems/scikit-learn | examples/svm/plot_oneclass.py | 249 | 2302 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | bsd-3-clause |
wlamond/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 63 | 6459 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
ahoyosid/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
benschmaus/catapult | trace_processor/experimental/visualize_traces/visualize_traces.py | 7 | 3307 | # Copyright 2016 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.
import argparse
import json
import os
import sys
from ggplot import *
import pandas
def _ConvertToSimplifiedFormat(values_list):
data = {}
for trace_na... | bsd-3-clause |
Xeralux/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py | 46 | 13101 | # 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 |
sjsrey/pysal_core | pysal_core/examples/__init__.py | 2 | 2352 | import os
import _version
base = os.path.abspath(os.path.dirname(_version.__file__))
__all__ = ['get_path', 'available', 'explain']
file_2_dir = {}
example_dir = base
dirs = []
for root, subdirs, files in os.walk(example_dir, topdown=False):
for f in files:
file_2_dir[f] = root
head, tail = os.path.sp... | bsd-3-clause |
ben-hopps/nupic | src/nupic/math/roc_utils.py | 49 | 8308 | # ----------------------------------------------------------------------
# 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 |
kastman/lyman | lyman/signals.py | 1 | 11987 | import numpy as np
from scipy import signal, sparse, stats
from scipy.ndimage import gaussian_filter
import nibabel as nib
from .utils import check_mask
def detrend(data, axis=-1, replace_mean=False):
"""Linearly detrend on an axis, optionally replacing the original mean.
Parameters
----------
data ... | bsd-3-clause |
mikekestemont/grimm | src/letter_analysis.py | 1 | 11566 | import os
from glob import glob
from collections import namedtuple, Counter, OrderedDict
import shutil
from operator import itemgetter
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from vectorization import Vectorizer
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from s... | mit |
hughdbrown/QSTK-nohist | tests/unit/qstksim/test_tradesim_SPY_Short.py | 3 | 2617 | '''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on May 19, 2012
@author: Sourabh Bajaj
@contact: sourabhbajaj90@gmail.com
@summary: Test cases for tradeSim -... | bsd-3-clause |
DmitryYurov/BornAgain | Examples/python/fitting/ex02_AdvancedExamples/multiple_datasets.py | 2 | 6304 | """
Fitting example: simultaneous fit of two datasets
"""
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
import bornagain as ba
from bornagain import deg, angstrom, nm
def get_sample(params):
"""
Returns a sample with uncorrelated cylinders and pyramids.
"""
radius_a = para... | gpl-3.0 |
maryklayne/Funcao | sympy/mpmath/visualization.py | 18 | 9232 | """
Plotting (requires matplotlib)
"""
from colorsys import hsv_to_rgb, hls_to_rgb
from .libmp import NoConvergence
from .libmp.backend import xrange
class VisualizationMethods(object):
plot_ignore = (ValueError, ArithmeticError, ZeroDivisionError, NoConvergence)
def plot(ctx, f, xlim=[-5,5], ylim=None, points=2... | bsd-3-clause |
Sentient07/scikit-learn | examples/svm/plot_weighted_samples.py | 95 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
sgenoud/scikit-learn | sklearn/tests/test_naive_bayes.py | 3 | 5808 | import pickle
from io import BytesIO
import numpy as np
import scipy.sparse
from cStringIO import StringIO
from numpy.testing import assert_almost_equal
from numpy.testing import assert_array_equal
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_equal
from nose.tools import assert_... | bsd-3-clause |
Nyker510/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.