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
ElvisLouis/code
work/ML/tensorflow/separa/pyradbas/train_exact.py
1
1299
# -*- coding: utf-8 -*- # Author: Stefano Brilli # Date: 24/10/2011 # E-mail: stefanobrilli@gmail.com import rbfn import numpy as np import numpy.linalg as la def train_exact(I, O, gw=1.0): """ Build an exact (zero error for inputs) radial basis network I (N by M) N vector of M size O (N by T) N ...
gpl-2.0
wallarelvo/mod
scripts/common.py
1
7239
import re import pandas as pd import time import shapely.geometry as geom NFS_PATH = "/home/wallar/nfs/data/data-sim/" # ]]NFS_PATH = "/data/drl/mod_sim_data/data-sim/" def get_metrics(n_vehicles, cap, waiting_time, predictions): m_file = NFS_PATH + "v{}-c{}-w{}-p{}/metrics_pnas.csv".format( n_vehicles...
gpl-2.0
CalebHarada/DCT-photometry
Junk/master_flat.py
1
1812
import matplotlib.pyplot as plt import ccdproc as cp from ccdproc import ImageFileCollection, Combiner from astropy import units as u directory = '...' save_directory = '...' filter = '...' # set desired filter master_bias = cp.CCDData.read('...') master_dark = cp.CCDData.read('...') # must already have the...
mit
lcpt/xc
verif/tests/materials/fiber_section/test_fiber_section_prop.py
1
11322
# -*- coding: utf-8 -*- __author__= "Ana Ortega (AO_O) " __copyright__= "Copyright 2016, AO_O" __license__= "GPL" __version__= "3.0" __email__= "ana.ortega@ciccp.es " ''' Evaluation of several geometrical and mechanical properties of a RC rectangular section under uniaxial bending moment. The data are taken from Exa...
gpl-3.0
codrut3/tensorflow
tensorflow/contrib/learn/python/learn/estimators/kmeans.py
15
10904
# 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
unsiloai/syntaxnet-ops-hack
tensorflow/examples/get_started/regression/test.py
8
3181
# 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
tttor/csipb-jamu-prj
predictor/connectivity/similarity/compound-kernel/genetic-programming/src/plot.py
1
1062
import numpy as np import matplotlib.pyplot as plt # evenly sampled time at 200ms intervals t = np.arange(0., 0.5, 1.0, 1.5, 2.0) # red dashes, blue squares and green triangles plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') plt.show() # x = np.array([[0.1, 0.04], # [0.2, 0.08], # [0...
mit
xuewei4d/scikit-learn
sklearn/model_selection/tests/test_search.py
4
80478
"""Test the search module""" from collections.abc import Iterable, Sized from io import StringIO from itertools import chain, product from functools import partial import pickle import sys from types import GeneratorType import re import numpy as np import scipy.sparse as sp import pytest from sklearn.utils._testing...
bsd-3-clause
etherkit/OpenBeacon2
client/win/venv/Lib/site-packages/PyInstaller/hooks/hook-matplotlib.backends.py
2
3125
#----------------------------------------------------------------------------- # Copyright (c) 2013-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
gpl-3.0
ocanbascil/hackerrank-machine-learning
predicting-office-space-price/solution.py
1
3026
from StringIO import StringIO import pandas as pd from sklearn import linear_model from sklearn.preprocessing import PolynomialFeatures from sklearn.metrics import mean_squared_error as mse from sklearn.cross_validation import KFold def get_data(): return pd.read_csv('data.txt', header=None, delim_whitespace=Tru...
mit
juliojsb/sarviewer
plotters/matplotlib/cpu.py
1
2136
#!/usr/bin/env python2 """ Author :Julio Sanz Website :www.elarraydejota.com Email :juliojosesb@gmail.com Description :Generate CPU graph from cpu.dat file Dependencies :Python 2.x, matplotlib Usage :python cpu.py License :GPLv3 """ import matplotlib matplotlib.use('Agg') import m...
gpl-3.0
rafaelwerneck/kuaa
evaluation_measures/normalized_accuracy_score/plugin_normalized_accuracy_score.py
1
6176
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # This file is part of Kuaa. # # Kuaa is a framework for the automation of machine learning experiments. # # It provides a workflow-based standardized environment for easy evaluation of # feature d...
gpl-3.0
sanguinariojoe/aquagpusph
examples/2D/built_in_beam/cMake/plot_t.py
14
5704
#****************************************************************************** # * # * ** * * * * * # * * * * * * * * * * ...
gpl-3.0
maxlikely/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
13
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
Clyde-fare/scikit-learn
sklearn/utils/fixes.py
133
12882
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
mmagnus/rna-pdb-tools
rna_tools/tools/clarna_play/ClaRNAlib/cluster-doublets.py
2
10101
#!/usr/bin/python import sys import os import re import math import random from optparse import OptionParser import simplejson as json from numpy import array from Bio import PDB from Bio.SVDSuperimposer import SVDSuperimposer import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from StringIO impor...
gpl-3.0
tanishq-dubey/Atlas
src/dataPlotter.py
1
2165
import sys, serial, argparse import numpy as np from time import sleep from collections import deque import matplotlib.pyplot as plt import matplotlib.animation as animation # plot class class AnalogPlot: # constr def __init__(self, strPort, maxLen): # open serial port self.ser = serial.Serial(s...
mit
ankurankan/scikit-learn
examples/cluster/plot_digits_agglomeration.py
377
1694
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Feature agglomeration ========================================================= These images how similar features are merged together using feature agglomeration. """ print(__doc__) # Code source: Gaël Varoquaux #...
bsd-3-clause
tridesclous/tridesclous
doc/conf.py
1
11849
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # tridesclous documentation build configuration file, created by # sphinx-quickstart on Tue Nov 22 14:33:27 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
mit
moutai/scikit-learn
sklearn/gaussian_process/tests/test_kernels.py
24
11602
"""Testing for kernels for Gaussian processes.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Licence: BSD 3 clause from collections import Hashable from sklearn.externals.funcsigs import signature import numpy as np from sklearn.gaussian_process.kernels import _approx_fprime from sklearn.metrics...
bsd-3-clause
mrshu/iepy
iepy/extraction/active_learning_core.py
1
10059
from copy import copy import inspect import logging import pickle import random import os.path import numpy from sklearn.cross_validation import StratifiedKFold from sklearn.metrics import precision_recall_curve from iepy import defaults from iepy.extraction.relation_extraction_classifier import RelationExtractionCla...
bsd-3-clause
cogstat/cogstat
cogstat/cogstat_stat_num.py
1
26314
# -*- coding: utf-8 -*- """ This module contains functions for statistical analysis that cannot be found in other packages. Arguments are the pandas data frame (pdf) and parameters. Output is the result of the numerical analysis in numerical form. """ from zipfile import ZipFile import json from tempfile import Temp...
gpl-3.0
dsullivan7/scikit-learn
sklearn/covariance/tests/test_robust_covariance.py
213
3359
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
tacaswell/awj
test_awj.py
1
2722
import tempfile import shutil import pandas as pd from pandas.util.testing import assert_frame_equal from contextlib import contextmanager from glob import glob import os.path from awj import AWJ @contextmanager def awj_context(max_size=None): work_dir = tempfile.mkdtemp() awj = AWJ(work_dir, max_size=max_si...
bsd-3-clause
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/tests/io/parser/header.py
6
9126
# -*- coding: utf-8 -*- """ Tests that the file header is properly handled or inferred during parsing for all of the parsers defined in parsers.py """ import pytest import numpy as np import pandas.util.testing as tm from pandas import DataFrame, Index, MultiIndex from pandas.compat import StringIO, lrange, u cla...
mit
verilylifesciences/purplequery
purplequery/client.py
1
21528
# Copyright 2019 Verily Life Sciences LLC # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Fake implementation of Google BigQuery client.""" import collections import uuid from typing import Any, Callable, Dict, List, Optional, Tuple, cast # noqa: F401 from t...
bsd-3-clause
gprMax/gprMax
tests/test_models.py
1
10111
# Copyright (C) 2015-2020: The University of Edinburgh # Authors: Craig Warren and Antonis Giannopoulos # # This file is part of gprMax. # # gprMax 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 Foundatio...
gpl-3.0
xyguo/scikit-learn
sklearn/datasets/twenty_newsgroups.py
25
13704
"""Caching loader for the 20 newsgroups text classification dataset The description of the dataset is available on the official website at: http://people.csail.mit.edu/jrennie/20Newsgroups/ Quoting the introduction: The 20 Newsgroups data set is a collection of approximately 20,000 newsgroup documents,...
bsd-3-clause
meduz/scikit-learn
examples/linear_model/plot_logistic.py
73
1568
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic function ========================================================= Shown in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or tw...
bsd-3-clause
jmschrei/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
ltiao/scikit-learn
sklearn/mixture/gmm.py
7
30564
""" 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
adykstra/mne-python
mne/tests/test_bem.py
1
17079
# Authors: Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD 3 clause from copy import deepcopy from os import remove, makedirs import os.path as op from shutil import copy import numpy as np import pytest from numpy.testing import assert_equal, assert_allclose import matplotlib.pyplot as plt from mne impor...
bsd-3-clause
georgetown-analytics/machine-learning
archive/code/wheat.py
5
2120
# wheat # Classification and Clustering of Wheat Dataset # # Author: Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Thu Feb 26 17:56:52 2015 -0500 # # Copyright (C) 2015 District Data Labs # For license information, see LICENSE.txt # # ID: wheat.py [] benjamin@bengfort.com $ """ Classificat...
mit
PatrickOReilly/scikit-learn
sklearn/feature_extraction/text.py
6
50885
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gmail.com> # # License: B...
bsd-3-clause
Vitens/epynet
epynet/baseobject.py
2
2641
import pandas as pd import warnings import weakref def lazy_property(fn): '''Decorator that makes a property lazy-evaluated. ''' attr_name = fn.__name__ @property def _lazy_property(self): if attr_name not in self._values.keys(): self._values[attr_name] = fn(self) retu...
apache-2.0
edoddridge/aronnax
reproductions/plot_Davis_et_al_2014.py
2
3633
import os import os.path as p import glob from builtins import range import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt self_path = p.dirname(p.abspath(__file__)) root_path = p.dirname(self_path) import sys sys.path.append(p.join(root_path, 'test')) sys.path.append(p.join(roo...
mit
yuxng/Deep_ISM
ISM/lib/ism/test_seg.py
1
5931
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Test a Fast R-CNN network on an imdb (image database).""" from ism....
mit
zhenv5/scikit-learn
sklearn/manifold/tests/test_mds.py
324
1862
import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from sklearn.manifold import mds def test_smacof(): # test metric smacof using the data of "Modern Multidimensional Scaling", # Borg & Groenen, p 154 sim = np.array([[0, 5, 3, 4], ...
bsd-3-clause
siconos/siconos-deb
examples/Mechanics/NewtonEuler/BouncingBallNETS.py
1
5094
#!/usr/bin/env python # Siconos is a program dedicated to modeling, simulation and control # of non smooth dynamical systems. # # Copyright 2016 INRIA. # # 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 L...
apache-2.0
drakipovic/deep-learning
1. labos/tf_logreg.py
1
1773
import tensorflow as tf from sklearn.preprocessing import OneHotEncoder import numpy as np from data import sample_gmm_2d, graph_surface, eval_perf_binary, graph_data class TFLogreg(object): def __init__(self, D, C, param_delta=0.02, l=0.001): self.X = tf.placeholder(tf.float32, [None, D]) ...
mit
AlexRobson/scikit-learn
examples/linear_model/plot_sparse_recovery.py
243
7461
""" ============================================================ Sparse recovery: feature selection for sparse linear models ============================================================ Given a small number of observations, we want to recover which features of X are relevant to explain y. For this :ref:`sparse linear ...
bsd-3-clause
fabianp/scikit-learn
examples/applications/face_recognition.py
191
5513
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW_: http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2...
bsd-3-clause
lamastex/scalable-data-science
dbcArchives/2021/000_0-sds-3-x-projects/student-project-06_group-ParticleClustering/Parquet/02_dl_horovod_parquet.py
1
24689
# Databricks notebook source # MAGIC %md # MAGIC ScaDaMaLe Course [site](https://lamastex.github.io/scalable-data-science/sds/3/x/) and [book](https://lamastex.github.io/ScaDaMaLe/index.html) # COMMAND ---------- # MAGIC %md ## UCluster with distributed learning # COMMAND ---------- # MAGIC %md # MAGIC This notebo...
unlicense
aminert/scikit-learn
benchmarks/bench_plot_lasso_path.py
301
4003
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
bsd-3-clause
open-mpi/netloc
tools/lsnettopo/viz-networkx.py
1
2451
#!/usr/bin/python # Copyright (c) 2013 University of Wisconsin-La Crosse. # All rights reserved. # # See COPYING in top-level directory. # # $HEADER$ # # You will need the following libraries to use this sample script. # NetworkX # http://networkx.github.io/ # Matplotlib # http://matpl...
bsd-3-clause
horance-liu/tensorflow
tensorflow/contrib/timeseries/examples/lstm.py
13
9268
# 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
dermotte/liresolr
src/main/python/weights1299_analyze_data.py
1
3447
import re import numpy as np import matplotlib.pyplot as plt import json from pathlib import Path import pandas as pd home_directory = str(Path.home()) input_file = home_directory + '/projects/wipo2018/weights1299.txt' state = 0 count_images = 0 count_classes = 0 current_image = '' data = {} # weights = [] classes = ...
gpl-2.0
bnaul/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
127
1270
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import matplotlib.pyplot as plt from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_rand...
bsd-3-clause
hugobowne/scikit-learn
sklearn/cross_validation.py
4
67659
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause fro...
bsd-3-clause
indiajoe/SALTHRS
SALT_HRS_SpectrumExtraction.py
1
27961
""" Pipeline for extracting SALT - HRS instrument spectrum See example.py for how to run this pipeline. J.P.Ninan indiajoe@gmail.com """ import numpy as np import numpy.ma from astropy.io import fits from astropy.modeling import models, fitting import matplotlib.pyplot as...
gpl-3.0
cancan101/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator.py
5
53629
# 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
kabrau/PyImageRoi
source/Generate_TFRecord.py
1
6507
""" Usage: # From tensorflow/models/ # Create train data: python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=data/train.record # Create test data: python generate_tfrecord.py --csv_input=data/test_labels.csv --output_path=data/test.record """ from __future__ import division from __...
mit
mcquay239/cg-lectures
mesh.py
1
4847
#!/usr/bin/env python import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from math import sqrt, fabs from pyhull.convex_hull import ConvexHull class Pole: __slots__ = ("r", "c") def __init__(self, r, c): self.r = r self.c = c class Tria...
mit
newemailjdm/pybrain
pybrain/tools/plotting/classification.py
25
5041
""" matplotlib helpers for ClassificationDataSet and classifiers in general. """ __author__ = 'Werner Beroux <werner@beroux.com>' import numpy as np import matplotlib.pyplot as plt class ClassificationDataSetPlot(object): @staticmethod def plot_module_classification_sequence_performance(module, dataset, seque...
bsd-3-clause
lseman/pylspm
pylspm/call_mpi.py
1
1511
from mpi4py import MPI import sys comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() import pandas as pd import numpy as np from .pylspm import PyLSpm import random from scipy.stats.stats import pearsonr from .boot import PyLSboot def PyLSmpi(mode, br, cores, dados, LVcsv, Mcsv, sche...
mit
datasciencebr/serenata-de-amor
research/src/fetch_congressperson_details.py
2
3759
import datetime import os import requests import re import pandas as pd import numpy as np from bs4 import BeautifulSoup class CongresspersonDetails: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DATA_PATH = os.path.join(BASE_DIR, 'data') DATE = datetime.date.today().strftime('%...
mit
Adai0808/scikit-learn
benchmarks/bench_sgd_regression.py
283
5569
""" Benchmark for SGD regression Compares SGD regression against coordinate descent and Ridge on synthetic data. """ print(__doc__) # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import numpy as np import pylab as pl import gc from time import time from sklearn.linear_model i...
bsd-3-clause
maartenbreddels/vaex
packages/vaex-core/vaex/column.py
1
24547
import logging import os import warnings import six import numpy as np import pyarrow as pa import vaex from .array_types import supported_array_types, supported_arrow_array_types, string_types, is_string_type on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: import vaex.strings logger = log...
mit
colin2328/asciiclass
lectures/lec6/match-manual.py
3
2055
import csv from sklearn import tree import editdist import re def string_match_score(p1,p2,field): s1 = p1[field] s2 = p2[field] return editdist.distance(s1.lower(),s2.lower())/float(len(s1)) def jaccard_score(p1,p2,field): name1 = p1[field] name2 = p2[field] set1 = set(name1.lower().split()) ...
mit
jmmease/pandas
pandas/core/dtypes/generic.py
9
3256
""" define generic base classes for pandas objects """ # define abstract base classes to enable isinstance type checking on our # objects def create_pandas_abc_type(name, attr, comp): @classmethod def _check(cls, inst): return getattr(inst, attr, '_typ') in comp dct = dict(__instancecheck__=_chec...
bsd-3-clause
vermouthmjl/scikit-learn
sklearn/feature_selection/__init__.py
140
1302
""" The :mod:`sklearn.feature_selection` module implements feature selection algorithms. It currently includes univariate filter selection methods and the recursive feature elimination algorithm. """ from .univariate_selection import chi2 from .univariate_selection import f_classif from .univariate_selection import f_...
bsd-3-clause
logpai/logparser
logparser/logmatch/regexmatch.py
1
8388
# Copyright 2018 The LogPAI Team (https://github.com/logpai). # # Licensed under the MIT License: # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without ...
mit
mhue/scikit-learn
sklearn/tests/test_base.py
216
7045
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
bsd-3-clause
olemke/pyatmlab
pyatmlab/graphics.py
1
9077
#!/usr/bin/env python # coding: utf-8 """Interact with matplotlib and other plotters """ import os.path import datetime now = datetime.datetime.now import logging import subprocess import sys import pickle import lzma import pathlib import numpy import matplotlib import matplotlib.cbook import matplotlib.pyplot imp...
bsd-3-clause
ryfeus/lambda-packs
Keras_tensorflow/source/numpy/core/tests/test_multiarray.py
8
240387
from __future__ import division, absolute_import, print_function import collections import tempfile import sys import shutil import warnings import operator import io import itertools import ctypes import os if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins from decimal import D...
mit
stonewell/learn-curve
src/stock_data_provider/cn_a/baostock_adjfactor.py
1
1821
# coding=utf-8 import os import csv import baostock as bs import pandas as pd def convert_symbol(symbol): parts = symbol.lower().split('.') return '{}.{}'.format(parts[1], parts[0]) def load_adjfactor(symbol, data_path): adj_file = os.path.join(data_path, symbol, 'adj.csv') if os.path.exists(adj...
mit
lhilt/scipy
scipy/interpolate/interpolate.py
4
97600
from __future__ import division, print_function, absolute_import __all__ = ['interp1d', 'interp2d', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly', 'RegularGridInterpolator', 'interpn'] import itertools import warnings import functools import operator import numpy as np from numpy import (array, transpose, searc...
bsd-3-clause
ankeshanand/neural-cryptography-tensorflow
src/model.py
1
5593
import tensorflow as tf import numpy as np import matplotlib # OSX fix matplotlib.use('TkAgg') import matplotlib.pyplot as plt import seaborn as sns from layers import conv_layer from config import * from utils import init_weights, gen_data class CryptoNet(object): def __init__(self, sess, msg_len=MSG_LEN, bat...
mit
david-ragazzi/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/collections.py
69
39876
""" Classes for the efficient drawing of large collections of objects that share most properties, e.g. a large number of line segments or polygons. The classes are not meant to be as flexible as their single element counterparts (e.g. you may not be able to select all line styles) but they are meant to be fast for com...
gpl-3.0
VaibhavAgarwalVA/sympy
sympy/plotting/tests/test_plot_implicit.py
52
2912
import warnings from sympy import (plot_implicit, cos, Symbol, symbols, Eq, sin, re, And, Or, exp, I, tan, pi) from sympy.plotting.plot import unset_show from tempfile import NamedTemporaryFile from sympy.utilities.pytest import skip from sympy.external import import_module #Set plots not to show un...
bsd-3-clause
rsivapr/scikit-learn
sklearn/metrics/cluster/__init__.py
312
1322
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
eggplantbren/TwinPeaks3
prototype.py
1
1617
import numpy as np import numpy.random as rng import matplotlib.pyplot as plt import copy def randh(shape=None): if shape is not None: return 10.**(1.5 - 6.*rng.rand(shape))*rng.randn(shape) return 10.**(1.5 - 6.*rng.rand())*rng.randn() class Model: N = 100 def __init__(self): self.x = np.empty(Model....
mit
shincling/MemNN_and_Varieties
MemN2N_python/Unknown_networks/unknown_main.py
1
29900
# -*- coding: utf8 -*- from __future__ import division import argparse import glob import lasagne import numpy as np import theano import theano.tensor as T import time from sklearn import metrics from sklearn.preprocessing import LabelBinarizer,label_binarize class SimpleAttentionLayer(lasagne.layers.MergeLayer): ...
bsd-3-clause
dhruv13J/scikit-learn
sklearn/feature_extraction/image.py
263
17600
""" The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to extract features from images. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Olivier Grisel # Vlad Niculae # License: BSD 3 clause fro...
bsd-3-clause
msschwartz21/craniumPy
experiments/templates/TEMP-transform_after_align.py
1
2245
import deltascope as ds import time import glob import re import traceback import os import multiprocessing as mp import pandas as pd from functools import partial outdirs = ['path\to\outdir'] deg = 2 fit_dim = ['x','z'] def transform_file(f,model=None): print(f,'starting') tic = time.time() s =...
gpl-3.0
YihaoLu/statsmodels
statsmodels/iolib/summary2.py
21
19583
from statsmodels.compat.python import (lrange, iterkeys, iteritems, lzip, reduce, itervalues, zip, string_types, range) from statsmodels.compat.collections import OrderedDict import numpy as np import pandas as pd import datetime import textw...
bsd-3-clause
pradyu1993/scikit-learn
examples/linear_model/plot_ols.py
3
1959
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
PatrickOReilly/scikit-learn
sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
geoalchimista/chflux
chflux/common.py
1
25558
""" Common functions used in flux calculation (c) 2016-2017 Wu Sun <wu.sun@ucla.edu> """ from collections import namedtuple import warnings import numpy as np from scipy import optimize import scipy.constants.constants as sci_const import pandas as pd # Physical constants # Do not modify unless you are in a differ...
bsd-3-clause
zfrenchee/pandas
doc/source/conf.py
1
19891
# -*- coding: utf-8 -*- # # pandas documentation build configuration file, created by # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that ...
bsd-3-clause
jmschrei/scikit-learn
sklearn/utils/tests/test_class_weight.py
90
12846
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
nyirock/mg_blast_wrapper
mg_blast_wrapper_v1.13.2.py
1
25155
#!/usr/bin/python import getopt import sys from Bio import SeqIO from Bio.SeqUtils import GC import time# import time, gmtime, strftime import os import shutil import pandas from Bio.SeqRecord import SeqRecord from Bio.Seq import Seq import csv #from datetime import datetime import numpy as np from scipy import stats ...
mit
kaiserroll14/301finalproject
main/pandas/tools/util.py
9
2780
import numpy as np import pandas.lib as lib import pandas as pd from pandas.compat import reduce from pandas.core.index import Index from pandas.core import common as com def match(needles, haystack): haystack = Index(haystack) needles = Index(needles) return haystack.get_indexer(needles) def cartesian...
gpl-3.0
jblupus/PyLoyaltyProject
old/experimentos/experimentos.py
1
7083
from os import mkdir from os.path import exists import numpy as np import pandas as pd from sklearn.utils import shuffle from old.project import CassandraUtils from old.project import get_time RTD_STS_KEY = 'retweetedStatus' MT_STS_KEY = 'userMentionEntities' PATH = '/home/joao/Dev/Data/Twitter/' FRIENDS_PATH = '/ho...
bsd-2-clause
TUM-LMF/fieldRNN
util/eval.py
2
10249
import numpy as np import pandas as pd import cPickle as pickle import sklearn def inverse_confusion_matrix(cm): # inverse functino of sklearn confusion_matrix rows, cols = cm.shape y_pred = [] y_true = [] for r in range(rows): for c in range(cols): for i in range(cm[c,r]): ...
mit
cademarkegard/airflow
airflow/hooks/base_hook.py
18
2571
# -*- coding: utf-8 -*- # # 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, software ...
apache-2.0
MetaMemoryT/OpenTrader
OpenTrader/OTPpnAmgc.py
1
12003
# -*-mode: python; py-indent-offset: 4; indent-tabs-mode: nil; encoding: utf-8-dos; coding: utf-8 -*- # from http://pythonprogramming.net/advanced-matplotlib-graphing-charting-tutorial """ OTPpnAmgc charts a CSV file of Open High Low Close Volume values, along with the SMA, MACD and RSI, using matplotlib. Give the C...
lgpl-3.0
TomAugspurger/pandas
pandas/tests/io/formats/test_info.py
1
11770
from io import StringIO import re from string import ascii_uppercase as uppercase import sys import textwrap import numpy as np import pytest from pandas.compat import PYPY from pandas import ( CategoricalIndex, DataFrame, MultiIndex, Series, date_range, option_context, reset_option, ...
bsd-3-clause
shikhar413/openmc
openmc/volume.py
6
12168
from collections import OrderedDict from collections.abc import Iterable, Mapping from numbers import Real, Integral from xml.etree import ElementTree as ET import warnings import numpy as np import pandas as pd import h5py from uncertainties import ufloat import openmc import openmc.checkvalue as cv _VERSION_VOLUME...
mit
ZENGXH/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
VladimirTyrin/urbansim
urbansim/models/tests/test_dcm.py
6
22108
import numpy as np import numpy.testing as npt import pandas as pd import pytest import os import tempfile import yaml from pandas.util import testing as pdt from ...utils import testing from .. import dcm @pytest.fixture def seed(request): current = np.random.get_state() def fin(): np.random.set_s...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
gpl-2.0
carloderamo/mushroom
mushroom_rl/environments/mujoco_envs/humanoid_gait/reward_goals/reward.py
1
10506
from pathlib import Path import numpy as np from collections import deque from mushroom_rl.environments.mujoco_envs.humanoid_gait.utils import convert_traj_quat_to_euler from .trajectory import HumanoidTrajectory class GoalRewardInterface: """ Interface to specify a reward function for the ``HumanoidGait`` ...
mit
DonghoChoi/ISB_Project
local/WS_eye_duration_time.py
2
7092
#!/usr/bin/python # Author: Dongho Choi ''' This script (1) read 'pages' data of a user (2) calculate dwell time of each page (3) retrieve fixation data corresponding to the dwell time (4) calculate eye dwell time in which fixations are within the effective range of the screen ''' import os.path import datetime impor...
gpl-3.0
miltonsarria/dsp-python
examples_classify/ex1.py
1
2005
import numpy as np import matplotlib.pyplot as plt import h5py from sklearn.linear_model import LogisticRegression file1='artificial_data.h5' file2='artificial_data_test.h5' ########### cargar datos de entrenamiento y datos de prueba########### hf = h5py.File(file1, "r") X1 = np.array(hf.get('X1')); Y1=np.array(hf.get...
mit
huzq/scikit-learn
maint_tools/sort_whats_new.py
28
1251
#!/usr/bin/env python # Sorts what's new entries with per-module headings. # Pass what's new entries on stdin. import sys import re from collections import defaultdict LABEL_ORDER = ['MajorFeature', 'Feature', 'Enhancement', 'Efficiency', 'Fix', 'API'] def entry_sort_key(s): if s.startswith('- |'...
bsd-3-clause
suranap/qiime
scripts/make_distance_boxplots.py
15
13899
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" from os.path import join from ...
gpl-2.0
liberatorqjw/scikit-learn
examples/datasets/plot_iris_dataset.py
283
1928
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
probml/pyprobml
scripts/sgd_demo_torch.py
1
6230
# We apply different SGD optimizers to a CNN on MNIST # Based on various tutorials #https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#sphx-glr-beginner-blitz-cifar10-tutorial-py #https://github.com/CSCfi/machine-learning-scripts/blob/master/notebooks/pytorch-mnist-mlp.ipynb import numpy as np np.se...
mit
henrykironde/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