repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
iLampard/alphaware | alphaware/selector.py | 1 | 6672 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import copy
from sklearn.base import (BaseEstimator,
TransformerMixin)
from sklearn_pandas import DataFrameMapper
from xutils import py_assert
from argcheck import preprocess
from itertools import chain
from alphaware.base import... | apache-2.0 |
ssaeger/scikit-learn | sklearn/model_selection/tests/test_validation.py | 18 | 28537 | """Test the validation module"""
from __future__ import division
import sys
import warnings
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils... | bsd-3-clause |
xgrg/alfa | roistats/plotting.py | 1 | 5563 |
def _prefit_data(y, data, covariates):
adj_model = 'roi ~ %s + 1'%' + '.join(covariates)
ycorr = pd.DataFrame(correct(data, adj_model), columns=[y])
del data[y]
data = data.join(ycorr)
log.info('Fit model used for correction: %s'%adj_model)
return data
def _plot_significance(data_dummies, x1... | mit |
beepee14/scikit-learn | sklearn/datasets/species_distributions.py | 198 | 7923 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
nilbody/h2o-3 | py/h2o_gbm.py | 30 | 16328 |
import re, random, math
import h2o_args
import h2o_nodes
import h2o_cmd
from h2o_test import verboseprint, dump_json, check_sandbox_for_errors
def plotLists(xList, xLabel=None, eListTitle=None, eList=None, eLabel=None, fListTitle=None, fList=None, fLabel=None, server=False):
if h2o_args.python_username!='kevin':
... | apache-2.0 |
Paul-St-Young/QMC | from_density.py | 1 | 3864 | #!/usr/bin/env python
import h5py
from lxml import etree
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
# helper functions
# ====================
def grab_density_parameters(qmc_input_xml):
root = etree.parse(qmc_input_xml)... | mit |
kashif/scikit-learn | examples/linear_model/plot_ridge_path.py | 55 | 2138 | """
===========================================================
Plot Ridge coefficients as a function of the regularization
===========================================================
Shows the effect of collinearity in the coefficients of an estimator.
.. currentmodule:: sklearn.linear_model
:class:`Ridge` Regressi... | bsd-3-clause |
dallascard/guac | core/export/convert_to_ARKcat_format.py | 1 | 1824 | import os
import sys
from optparse import OptionParser
import pandas as pd
from ..util import dirs
from ..util import file_handling as fh
from ..preprocessing import data_splitting as ds
def main():
usage = "%prog project label_file splits_file output_dir"
parser = OptionParser(usage=usage)
parser.add_o... | apache-2.0 |
airanmehr/bio | Scripts/TimeSeriesPaper/Simulation/createPool.py | 1 | 5695 | '''
Copyleft Dec 4, 2015 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com
'''
import numpy as np;
np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd; pd.options.display.max_rows=30;pd.options.display.expand_frame_repr=False
import os; home=os... | mit |
jblackburne/scikit-learn | sklearn/ensemble/__init__.py | 153 | 1382 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification, regression and anomaly detection.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesCla... | bsd-3-clause |
clemkoa/scikit-learn | examples/ensemble/plot_voting_probas.py | 29 | 2932 | """
===========================================================
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 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axis3d.py | 9 | 17055 | #!/usr/bin/python
# axis3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import math
import copy
from matplotlib import... | mit |
MoonRaker/pvlib-python | pvlib/forecast.py | 1 | 26344 | '''
The 'forecast' module contains class definitions for
retreiving forecasted data from UNIDATA Thredd servers.
'''
import datetime
from netCDF4 import num2date
import numpy as np
import pandas as pd
from requests.exceptions import HTTPError
from xml.etree.ElementTree import ParseError
from pvlib.location import Loc... | bsd-3-clause |
wangsharp/trading-with-python | cookbook/workingWithDatesAndTime.py | 77 | 1551 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 16 17:45:02 2011
@author: jev
"""
import time
import datetime as dt
from pandas import *
from pandas.core import datetools
# basic functions
print 'Epoch start: %s' % time.asctime(time.gmtime(0))
print 'Seconds from epoch: %.2f' % time.time()
t... | bsd-3-clause |
FRidh/scipy | scipy/spatial/_plotutils.py | 53 | 4034 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.decorator import decorator as _decorator
__all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d']
@_decorator
def _held_figure(func, obj, ax=None, **kw):
import matplotlib.pyplot as plt
if ax... | bsd-3-clause |
dch312/scipy | scipy/signal/spectral.py | 3 | 13830 | """Tools for spectral analysis.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy import fftpack
from . import signaltools
from .windows import get_window
from ._spectral import lombscargle
import warnings
from scipy._lib.six import string_types
__all__ = ['periodogr... | bsd-3-clause |
ebothmann/seaborn | seaborn/linearmodels.py | 5 | 43689 | """Plotting functions for linear models (broadly construed)."""
from __future__ import division
import copy
import itertools
import numpy as np
import pandas as pd
from scipy.spatial import distance
import matplotlib as mpl
import matplotlib.pyplot as plt
try:
import statsmodels
assert statsmodels
_has_sta... | bsd-3-clause |
yosssi/scipy_2015_sklearn_tutorial | notebooks/solutions/06B_learning_curves.py | 21 | 1448 | from sklearn.metrics import explained_variance_score, mean_squared_error
from sklearn.cross_validation import train_test_split
def plot_learning_curve(model, err_func=explained_variance_score, N=300, n_runs=10, n_sizes=50, ylim=None):
sizes = np.linspace(5, N, n_sizes).astype(int)
train_err = np.zeros((n_runs,... | cc0-1.0 |
sandeepkrjha/pgmpy | pgmpy/estimators/ExhaustiveSearch.py | 5 | 8140 | #!/usr/bin/env python
from warnings import warn
from itertools import combinations
import networkx as nx
from pgmpy.estimators import StructureEstimator
from pgmpy.estimators import K2Score
from pgmpy.utils.mathext import powerset
from pgmpy.models import BayesianModel
class ExhaustiveSearch(StructureEstimator):
... | mit |
ArnaudBelcour/Workflow_GeneList_Analysis | pathway_extraction/database_mapping_from_gos.py | 1 | 2431 | #!/usr/bin/env python3
import csv
import pandas as pa
from tqdm import tqdm
from . import *
def request_gene_ontology(url, file_name):
"""
Requests the Gene Ontology server to obtain mapping file between GO and Interpro, KEGG, Enzyme Code, MetaCyc.
Rewrites each file into a correct tsv file.
... | agpl-3.0 |
pschella/scipy | doc/source/tutorial/stats/plots/kde_plot3.py | 132 | 1229 | import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
np.random.seed(12456)
x1 = np.random.normal(size=200) # random data, normal distribution
xs = np.linspace(x1.min()-1, x1.max()+1, 200)
kde1 = stats.gaussian_kde(x1)
kde2 = stats.gaussian_kde(x1, bw_method='silverman')
fig = plt.figure(figsi... | bsd-3-clause |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/wsj.py | 19 | 4502 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
unified_strdate,
)
class WSJIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
https?://video-api\.wsj\.com/api-vid... | gpl-3.0 |
mromanello/CitationExtractor | citation_extractor/ned/candidates.py | 1 | 9851 | # -*- coding: utf-8 -*-
# author: Matteo Filipponi
"""Candidates Generation code related to the NED step."""
from __future__ import print_function
import logging
from citation_extractor.Utils.strmatching import StringSimilarity, StringUtils
from citation_extractor.ned import AUTHOR_TYPE, WORK_TYPE, REFAUWORK_TYPE
im... | gpl-3.0 |
yonglehou/scikit-learn | sklearn/cluster/bicluster.py | 211 | 19443 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
bombehub/FrequentCheckpointing | zigzag.py | 1 | 1335 | __author__ = 'mk'
import matplotlib.pyplot as plt
unitSize = 8192
unitNum = 25600
uf = 32
threadID = 0
dataDir = "./log/latency/"
resultDir = "./diagrams/experimental_result/"
algLabel = ['naive', 'cou', 'zigzag', 'pingpong', 'MK', 'LL']
fig = plt.figure(figsize=(8, 4))
def init():
plt.xlabel("time(ns)")
plt.... | gpl-3.0 |
tgsmith61591/skutil | skutil/h2o/balance.py | 1 | 11679 | from __future__ import absolute_import, division, print_function
import pandas as pd
from abc import ABCMeta
import warnings
from sklearn.externals import six
from skutil.base import overrides
from .transform import _flatten_one
from .util import reorder_h2o_frame, _gen_optimized_chunks, h2o_col_to_numpy
from .base imp... | bsd-3-clause |
toobaz/pandas | pandas/tests/arrays/categorical/test_dtypes.py | 2 | 7118 | import numpy as np
import pytest
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas import Categorical, CategoricalIndex, Index, Series, Timestamp
import pandas.util.testing as tm
class TestCategoricalDtypes:
def test_is_equal_dtype(self):
# test dtype comparisons between cats
... | bsd-3-clause |
CompPhysics/ThesisProjects | doc/MSc/msc_students/former/AudunHansen/Audun/Pythonscripts/CCAlgebra.py | 1 | 37355 | # <!-- collapse=True -->
from IPython.display import display, Math, Latex
#from sympy.interactive import printing
#printing.init_printing()
from numpy import *
from itertools import *
from matplotlib.pyplot import *
class Operator():
#Normal ordered operator for cluster algebra (diagrammatic)
def __init__(s... | cc0-1.0 |
Koheron/laser-development-kit | examples/spectrum_analyzer.py | 2 | 1482 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import numpy as np
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
from koheron import connect
from drivers import Spectrum
from drivers import Laser
host = os.getenv('HOST','192.168.1.100')
client = connect(host, nam... | mit |
icdishb/scikit-learn | examples/decomposition/plot_incremental_pca.py | 244 | 1878 | """
===============
Incremental PCA
===============
Incremental principal component analysis (IPCA) is typically used as a
replacement for principal component analysis (PCA) when the dataset to be
decomposed is too large to fit in memory. IPCA builds a low-rank approximation
for the input data using an amount of memo... | bsd-3-clause |
iLeoDo/SAExtractor | SAEFun/tester/LearnerTester.py | 1 | 5133 | from util import config
from sklearn import cross_validation
from sklearn import tree
import DTreeLearner
from sklearn.externals.six import StringIO
import pydot
import dot_parser
# DTreeLearner.feature_extraction(
# config.path_data+'/raw_data/data.csv',
# config.path_data+'/raw_data/raw',
# config.path_da... | apache-2.0 |
ebrahimraeyat/civilTools | applications/records/MainWindow.py | 1 | 20043 | import sys
import os
abs_path = os.path.dirname(__file__)
sys.path.insert(0, abs_path)
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5 import uic
# import pandas as pd
import pickle
import numpy as np
#from pandas.tools.plotting import table
##matplotlib.use("Agg")
# from m... | gpl-3.0 |
bhatiaharsh/naturalHHD | pynhhd-v1.1/examples/utils/drawing.py | 1 | 3712 | '''
Copyright (c) 2015, Harsh Bhatia (bhatia4@llnl.gov)
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. Redistributions of source code must retain the above copyright notice, this
list of conditions a... | bsd-2-clause |
JonasWallin/BayesFlow | src/tests/pipeline.py | 1 | 13575 | from __future__ import division
import os
import time
import tempfile
import imp
import shutil
from mpi4py import MPI
import numpy as np
import matplotlib.pyplot as plt
from .. import setup_sim, hierarical_mixture_mpi, HMlogB, HMElog, HMres
from ..exceptions import BadQualityError
from ..utils import load_fcdata
from ... | gpl-2.0 |
shahankhatch/scikit-learn | examples/linear_model/plot_sgd_loss_functions.py | 249 | 1095 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... | bsd-3-clause |
strint/tensorflow | tensorflow/contrib/learn/python/learn/grid_search_test.py | 137 | 2035 | # 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 |
scienceopen/hist-feasibility | Plots/EMCCD_fiducial.py | 2 | 1130 | #!/usr/bin/env python
"""
creates EMCCD fiducials for TGARS 2015 Reconstruction of fine scale auroral Dyanmics paper figure
"""
from numpy import array,rot90
import imageio
from matplotlib.pyplot import show
#
from pathlib import Path
from histfeas.fiducial import fiducial
#%% EMCCD Figure
path = '~/data/2007-03/optica... | gpl-3.0 |
iandriver/RNA-sequence-tools | test_count_matrix.py | 2 | 1472 | import os
import pandas as pd
import cPickle as pickle
import subprocess
import csv
def make_count_matrix(dirs_in):
count_dict = {}
single_file_stop = True
rows =[]
headers = ['Gene_ID']
for p in dirs_in:
head_stop = True
for root, dirnames, filenames in os.walk(p):
cnam... | mit |
KaelChen/numpy | numpy/core/code_generators/ufunc_docstrings.py | 51 | 90047 | """
Docstrings for generated ufuncs
The syntax is designed to look like the function add_newdoc is being
called from numpy.lib, but in this file add_newdoc puts the docstrings
in a dictionary. This dictionary is used in
numpy/core/code_generators/generate_umath.py to generate the docstrings
for the ufuncs in numpy.co... | bsd-3-clause |
danielvdende/incubator-airflow | airflow/www/views.py | 1 | 111409 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
aemerick/galaxy_analysis | grackle/cooling_cell_plot.py | 1 | 3215 | from galaxy_analysis.plot.plot_styles import *
import matplotlib.pyplot as plt
import os, sys
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
def bins_from_centers(x):
xnew = np.zeros(len(x) + 1)
dx = np.zeros(len(x) + 1)
dx[1:-1] = x[1:] - x[:-1]
dx[0] = dx[1]
dx[-1]... | mit |
bruino/pulppy | mplCanvas.py | 1 | 5364 | #!/usr/bin/env python
# Pulppy Software - Linear Programming software for optimizing various practical problems of Operations Research.
# 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 witho... | mit |
waterponey/scikit-learn | examples/cluster/plot_face_ward_segmentation.py | 71 | 2460 | """
=========================================================================
A demo of structured Ward hierarchical clustering on a raccoon face image
=========================================================================
Compute the segmentation of a 2D image with Ward hierarchical
clustering. The clustering is s... | bsd-3-clause |
sijiangdu/Tensorflow | mnist_rnn/mnist_cnn_kaggles_cmpt.py | 1 | 18345 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
# Modifications copyright (C) 2017 Sijiang Du
# 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/license... | apache-2.0 |
MJuddBooth/pandas | pandas/tests/io/sas/test_xport.py | 2 | 4895 | import os
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from pandas.io.sas.sasreader import read_sas
# CSV versions of test xpt files were obtained using the R foreign library
# Numbers in a SAS xport file are always float64, so need to convert
# before making comparisons.
... | bsd-3-clause |
UltronAI/Deep-Learning | Pattern-Recognition/hw2-Feature-Selection/main.py | 1 | 2886 | import numpy as np
from skfeature.function.similarity_based import trace_ratio
from FeatureSelector.FisherSelector import FisherSelector
from sklearn import svm
from FisherClassifier import FisherClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier, Ada... | mit |
krez13/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
jjx02230808/project0223 | examples/decomposition/plot_pca_3d.py | 354 | 2432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | bsd-3-clause |
kyoheiotsuka/LDA | lda.py | 2 | 7617 | # -*- coding: utf-8 -*-
import numpy as np
import scipy.special
import time, cPickle
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
class LDA:
# variational implimentation of smoothed LDA
def __init__(self):
# do nothing particularly
pass
def ... | mit |
bzero/statsmodels | examples/python/quantile_regression.py | 30 | 3970 |
## Quantile regression
#
# This example page shows how to use ``statsmodels``' ``QuantReg`` class to replicate parts of the analysis published in
#
# * Koenker, Roger and Kevin F. Hallock. "Quantile Regressioin". Journal of Economic Perspectives, Volume 15, Number 4, Fall 2001, Pages 143–156
#
# We are interested... | bsd-3-clause |
lucabaldini/pyxpe | pyxpe/recon/event.py | 1 | 8144 | #!/usr/bin/env python
# Copyright (C) 2007--2016 the X-ray Polarimetry Explorer (XPE) team.
#
# For the license terms see the file LICENSE, distributed along with this
# software.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published... | gpl-3.0 |
Clyde-fare/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 |
EarToEarOak/RTLSDR-Scanner | rtlsdr_scanner/dialogs_help.py | 1 | 5039 | #
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2015 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 |
dhruv13J/scikit-learn | sklearn/svm/tests/test_sparse.py | 95 | 12156 | from nose.tools import assert_raises, assert_true, assert_false
import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classif... | bsd-3-clause |
bnaul/scikit-learn | benchmarks/bench_sample_without_replacement.py | 14 | 7745 | """
Benchmarks for sampling without replacement of integer.
"""
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.utils.random import sample_without_replacement
def compute_time(t_start, delta):
mu_se... | bsd-3-clause |
mcanthony/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/_cm.py | 70 | 375423 | """
Color data and pre-defined cmap objects.
This is a helper for cm.py, originally part of that file.
Separating the data (this file) from cm.py makes both easier
to deal with.
Objects visible in cm.py are the individual cmap objects ('autumn',
etc.) and a dictionary, 'datad', including all of these objects.
"""
im... | agpl-3.0 |
ray-project/ray | python/ray/experimental/data/impl/arrow_block.py | 1 | 5133 | import collections
from typing import Iterator, List, Union, Tuple, Any, TypeVar, TYPE_CHECKING
try:
import pyarrow
except ImportError:
pyarrow = None
from ray.experimental.data.impl.block import Block, BlockBuilder, \
SimpleBlockBuilder
if TYPE_CHECKING:
import pandas
T = TypeVar("T")
class Arrow... | apache-2.0 |
cdeboever3/cdpybio | cdpybio/analysis.py | 1 | 43419 | import pandas as pd
chrom_sizes = pd.Series(
{1: 249250621,
10: 135534747,
11: 135006516,
12: 133851895,
13: 115169878,
14: 107349540,
15: 102531392,
16: 90354753,
17: 81195210,
18: 78077248,
19: 59128983,
2: 243199373,
20: 63025520,
21: 48129895,
... | mit |
russel1237/scikit-learn | sklearn/tests/test_multiclass.py | 136 | 23649 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_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_false
from sklearn.utils.testing ... | bsd-3-clause |
anirudhjayaraman/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
gietal/Stocker | sandbox/sentdex/3.py | 1 | 1034 | import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.dates as mdates
import numpy as np
def graphRaw():
date, bid, ask = np.loadtxt(
'Data/GBPUSD1d.txt',
# 'Data/GBPUSD10s.txt',
delimiter=',',
unpack=True,
converters={0:... | mit |
JohnCEarls/DataDirac | test/test_hddata_process.py | 1 | 9435 | import sys
sys.path.append('/home/sgeadmin/DataDirac')
from datadirac import data
from datadirac.utils import hddata_process
import boto
import os
import os.path
import random
def test_metadata( meta_file):
header = []
meta_base = []
with open(meta_file, 'r') as meta:
for line in meta:
... | gpl-3.0 |
kdz/test | Spec.py | 1 | 6467 | __author__ = 'kdsouza'
from functools import reduce
import pandas as pd
from MPL_pyqt_mergewidget import *
from MPL_style_formatting import *
from VEdit import *
from MPL_dicts import *
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.figure import Figure as MPLFigure
from canopy_data_import.c... | mit |
hainm/scikit-learn | examples/cluster/plot_adjusted_for_chance_measures.py | 286 | 4353 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... | bsd-3-clause |
IDEALLab/design_embeddings_jmd_2016 | util.py | 1 | 17261 | ##########################################
# File: util.py #
# Copyright Richard Stebbing 2014. #
# Distributed under the MIT License. #
# (See accompany file LICENSE or copy at #
# http://opensource.org/licenses/MIT) #
##########################################
# Imports
import r... | mit |
jskDr/jamespy_py3 | medic/dl.py | 1 | 12919 | from sklearn import model_selection, metrics
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import matplotlib.pyplot as plt
import os
import keras
from keras import backend as K
from keras.utils import np_utils
from keras.models import Model
from keras.layers import Input, Conv2D, BatchNormalization... | mit |
djgagne/scikit-learn | sklearn/feature_selection/tests/test_from_model.py | 244 | 1593 | import numpy as np
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import SGD... | bsd-3-clause |
ibmsoe/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py | 75 | 29377 | # 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 |
yaukwankiu/armor | tests/modifiedMexicanHatTest15_march2014_sigmaPreprocessing20.py | 1 | 7833 | # modified mexican hat wavelet test.py
# spectral analysis for RADAR and WRF patterns
# NO plotting - just saving the results: LOG-response spectra for each sigma and max-LOG response numerical spectra
# pre-convolved with a gaussian filter of sigma=10
import os, shutil
import time, datetime
import pickle
imp... | cc0-1.0 |
bsipocz/statsmodels | statsmodels/graphics/tsaplots.py | 16 | 10392 | """Correlation plot functions."""
import numpy as np
from statsmodels.graphics import utils
from statsmodels.tsa.stattools import acf, pacf
def plot_acf(x, ax=None, lags=None, alpha=.05, use_vlines=True, unbiased=False,
fft=False, **kwargs):
"""Plot the autocorrelation function
Plots lags on th... | bsd-3-clause |
scholer/na_strand_model | nascent/graph_visualization/live_visualizer_base.py | 2 | 9342 | # -*- coding: utf-8 -*-
## Copyright 2015 Rasmus Scholer Sorensen, rasmusscholer@gmail.com
##
## This file is part of Nascent.
##
## Nascent is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as
## published by the Free Software Foundati... | gpl-3.0 |
ryanfobel/dmf_control_board | dmf_control_board_firmware/calibrate/impedance_benchmarks.py | 3 | 9822 | # coding: utf-8
import pandas as pd
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib.colors import Colormap
from matplotlib.gridspec import GridSpec
import numpy as np
pd.set_option('display.width', 300)
def plot_capacitance_vs_frequency(df, **kwargs):
cleaned_df = df.dropna().copy(... | gpl-3.0 |
sumspr/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
numpy/datetime | numpy/core/function_base.py | 82 | 5474 | __all__ = ['logspace', 'linspace']
import numeric as _nx
from numeric import array
def linspace(start, stop, num=50, endpoint=True, retstep=False):
"""
Return evenly spaced numbers over a specified interval.
Returns `num` evenly spaced samples, calculated over the
interval [`start`, `stop` ].
Th... | bsd-3-clause |
great-expectations/great_expectations | great_expectations/expectations/metrics/column_map_metrics/column_values_in_type_list.py | 1 | 1603 | import numpy as np
import pandas as pd
from great_expectations.execution_engine import PandasExecutionEngine
from great_expectations.expectations.core.expect_column_values_to_be_of_type import (
_native_type_type_map,
)
from great_expectations.expectations.metrics.map_metric import (
ColumnMapMetricProvider,
... | apache-2.0 |
cloud-fan/spark | python/pyspark/pandas/tests/plot/test_series_plot.py | 15 | 4133 | #
# 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 |
NMTHydro/Recharge | utils/zonal_stats_shapefile_class_raster.py | 1 | 13084 | # ===============================================================================
# Copyright 2018 gabe-parrish
#
# 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/licen... | apache-2.0 |
sugartom/tensorflow-alien | tensorflow/examples/learn/iris_with_pipeline.py | 62 | 1824 | # 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 |
victorbergelin/scikit-learn | sklearn/covariance/tests/test_graph_lasso.py | 272 | 5245 | """ Test the graph_lasso module.
"""
import sys
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV,
empirical_... | bsd-3-clause |
sonapraneeth-a/object-classification | library/tf/models/MLPClassifier_old.py | 1 | 30651 | import tensorflow as tf
from sklearn.metrics import confusion_matrix, classification_report, accuracy_score
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import numpy as np
from library.utils import file_utils
from sklearn.preprocessing import StandardScaler, MinMaxScaler
import m... | mit |
chenyyx/scikit-learn-doc-zh | examples/zh/semi_supervised/plot_label_propagation_digits_active_learning.py | 36 | 4076 | """
========================================
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... | gpl-3.0 |
AlexGidiotis/Multimodal-Gesture-Recognition-with-LSTMs-and-CTC | skeletal_network/load_skeleton.py | 1 | 2178 | import pandas as pd
import numpy as np
# The arrays loaded are not in proper format so we modify them to x,y pairs. Also we filter irrelevant values.
def modify_array(arr):
# arrays to be returned
arr_x = []
arr_y = []
for item in arr:
# Get the items in proper format
item = item.strip('[').strip(']... | mit |
vinodkc/spark | python/pyspark/pandas/data_type_ops/boolean_ops.py | 2 | 13344 | #
# 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 |
calben/matlabconverters | matlabconverters/loaders.py | 1 | 1129 | import numpy as np
import pandas as pd
from scipy.io import loadmat
def load_mat(mat: str, show_debug=False) -> {}:
data = loadmat(mat)
if(show_debug):
print("Mat has " + str(len(data.keys())) + " keys.")
if verify_flat_mat(data):
print("Mat is flat.")
else:
pr... | mit |
bjorand/influxdb-python | influxdb/tests/influxdb08/dataframe_client_test.py | 8 | 12409 | # -*- coding: utf-8 -*-
"""
unit tests for misc module
"""
from .client_test import _mocked_session
import unittest
import json
import requests_mock
from nose.tools import raises
from datetime import timedelta
from influxdb.tests import skipIfPYpy, using_pypy
import copy
import warnings
if not using_pypy:
import ... | mit |
hbar/python-ChargedParticleTools | lib/ChargedParticleTools/IonizationCrossSection.py | 1 | 2226 | from numpy import *
import matplotlib.pyplot as pl
class IonizationCrossSection(object):
def __init__ (self,element,Ei=1e4,shell='k',subshell=1):
self.element = element
self.shell = shell
self.ionizationEnergy = Ei
Z = element.z
print self.shell
if self.shell=='k' or... | mit |
maheshakya/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py | 256 | 2406 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
andreiapostoae/dota2-predictor | training/query.py | 2 | 7404 | """ Module responsible for querying the result of a game """
import operator
import os
import logging
import numpy as np
from os import listdir
from sklearn.externals import joblib
from preprocessing.augmenter import augment_with_advantages
from tools.metadata import get_hero_dict, get_last_patch
logging.basicConf... | mit |
hchen13/bigdatarecruit | DataMining/dataMiningFunc.py | 1 | 22603 | from tool import database, helper
import pandas as pd
import numpy as np
import json
# ******************************** hr排行 *************************************
# 获取公司hr数量排行
# @return DataFrame
def lagouCompanyHrRankDf():
# 获取数据库连接和sql
conn = database.getDatabaseConn()
sql_lagou_hr = database.getLagouHrI... | gpl-3.0 |
xumi1993/seispy | seispy/plotR.py | 1 | 3583 | import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib.lines import Line2D
from seispy.rfcorrect import SACStation
from seispy.rf import CfgParser
import argparse
import numpy as np
from os.path import join
import sys
def init_figure():
h = plt.figure(figsize=(8, 10))
gs = Gr... | gpl-3.0 |
andyh616/mne-python | mne/decoding/tests/test_ems.py | 19 | 1969 | # Author: Denis A. Engemann <d.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from nose.tools import assert_equal, assert_raises
from mne import io, Epochs, read_events, pick_types
from mne.utils import requires_sklearn
from mne.decoding import compute_ems
data_dir = op.join(op.dirname(__file_... | bsd-3-clause |
metaml/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/dates.py | 54 | 33991 | #!/usr/bin/env python
"""
Matplotlib provides sophisticated date plotting capabilities, standing
on the shoulders of python :mod:`datetime`, the add-on modules
:mod:`pytz` and :mod:`dateutils`. :class:`datetime` objects are
converted to floating point numbers which represent the number of days
since 0001-01-01 UTC. T... | agpl-3.0 |
spurihwr/ImageProcessingProjects | Image_Recognition/PCABasedImageReco.py | 1 | 2899 | ####################################################################
# This code is PCA base face recognition programme. It reads 5
# faces from ORL database and the rest 5 are used as test.
# PCA_Performance shows the recognition performance.
#
# Download the ORL database from internet.
# This code was modified by... | mit |
olologin/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 |
adjih/openlab | tools/memmap.py | 6 | 9300 | #! /usr/bin/env python
##
## memmap.py
## Copyright HiKoB 2012
## Author: Antoine Fraboulet
##
## Generates charts for .text, .rodata, .bss and .data sections
##
##
import os, sys
from pylab import *
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
import jstreemap
## ###################... | gpl-3.0 |
luo66/scikit-learn | examples/text/document_clustering.py | 230 | 8356 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
psachin/swift | swift/common/middleware/x_profile/html_viewer.py | 6 | 21032 | # Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
ScottFreeLLC/AlphaPy | alphapy/plots.py | 1 | 33611 | ################################################################################
#
# Package : AlphaPy
# Module : plots
# Created : July 11, 2013
#
# Copyright 2019 ScottFree Analytics LLC
# Mark Conway & Robert D. Scott II
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
guyhwilson/guyhwilson.github.io | markdown_generator/talks.py | 199 | 4000 |
# coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i... | mit |
timothydmorton/VESPA | vespa/stars/trilegal.py | 1 | 9246 | from __future__ import print_function,division
import logging
import subprocess as sp
import os, re
import time
try:
import numpy as np
import pandas as pd
from astropy.units import UnitsError
from astropy.coordinates import SkyCoord
except ImportError:
np, pd = (None, None)
UnitsError, SkyCo... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.