repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
soulmachine/scikit-learn
examples/cluster/plot_dbscan.py
346
2479
# -*- coding: utf-8 -*- """ =================================== Demo of DBSCAN clustering algorithm =================================== Finds core samples of high density and expands clusters from them. """ print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn...
bsd-3-clause
BillFoland/daisyluAMR
system/daisylu_system.py
1
13721
import os import sys import pickle import pandas as pd import numpy as np import hashlib import os.path from daisylu_config import * from daisylu_vectors import * from sentences import * from daisylu_output import * "" def addWikificationToDFrames(sents, sTypes, sentenceAttr): # nee...
mit
mmottahedi/neuralnilm_prototype
scripts/e351.py
2
6885
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
macks22/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
molpopgen/fwdpy11
examples/discrete_demography/localadaptation.py
1
7832
# # Copyright (C) 2019 Kevin Thornton <krthornt@uci.edu> # # This file is part of fwdpy11. # # fwdpy11 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 3 of the License, or # (at your option) any...
gpl-3.0
OPU-Surveillance-System/monitoring
master/scripts/planner/solvers/test_penalization_plot.py
1
1040
import matplotlib.pyplot as plt with open("test_pen", "r") as f: data = f.read() data = data.split("\n")[:-1] data = [data[i].split(" ") for i in range(0, len(data))] pen = [float(data[i][0]) for i in range(len(data))] u = [float(data[i][1]) for i in range(len(data))] d = [float(data[i][2]) for i in range(len(data...
mit
NDManh/numbbo
code-postprocessing/bbob_pproc/pptex.py
4
14442
#! /usr/bin/env python # -*- coding: utf-8 -*- """Routines for writing TeX for tables.""" from __future__ import absolute_import import os import sys import string import numpy from . import toolsstats from pdb import set_trace #GLOBAL VARIABLES DEFINITION alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...
bsd-3-clause
huobaowangxi/scikit-learn
sklearn/calibration.py
137
18876
"""Calibration of predicted probabilities.""" # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Balazs Kegl <balazs.kegl@gmail.com> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Mathieu Blondel <mathieu@mblondel.org> # # License: BSD 3 clause from __future__ impo...
bsd-3-clause
pbrod/scipy
scipy/special/basic.py
3
70421
# # Author: Travis Oliphant, 2002 # from __future__ import division, print_function, absolute_import import warnings import numpy as np import math from scipy._lib.six import xrange from numpy import (pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype,...
bsd-3-clause
joernhees/scikit-learn
sklearn/feature_selection/tests/test_from_model.py
26
6935
import numpy as np from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal...
bsd-3-clause
boada/astLib
astLib/astSED.py
2
55763
"""module for performing calculations on Spectral Energy Distributions (SEDs) (c) 2007-2013 Matt Hilton U{http://astlib.sourceforge.net} This module provides classes for manipulating SEDs, in particular the Bruzual & Charlot 2003, Maraston 2005, and Percival et al 2009 stellar population synthesis models are current...
lgpl-2.1
wkew/FTMSVisualization
3-HeteroClassPlotter.py
1
10441
# -*- coding: utf-8 -*- """ Created on Fri Apr 22 11:42:36 2016 @author: Will Kew will.kew@gmail.com Copyright Will Kew, 2016 This file is part of FTMS Visualisation (also known as i-van Krevelen). FTMS Visualisation is free software: you can redistribute it and/or modify it under the terms of the G...
gpl-3.0
Fireblend/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
henkhaus/wow
testing/plotter.py
1
1278
from pymongo import MongoClient from matplotlib import pyplot as plt import os from datetime import datetime, date, time, timedelta client = MongoClient() # using wowtest.auctiondata db = client.wowtest posts = db.auctiondata auctions = posts.find().limit(10) #time.time() into datetime ---> #datetime.datetime.fromti...
apache-2.0
mikebenfield/scikit-learn
sklearn/neighbors/regression.py
26
10999
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck # Multi-output support by Arnaud Joly <a.joly@ulg.ac...
bsd-3-clause
MLWave/auto-sklearn
autosklearn/wrapper_for_SMAC.py
5
3119
try: import cPickle as pickle except: import pickle import os import time import signal import sys import lockfile from HPOlibConfigSpace import configuration_space from autosklearn.data.data_manager import DataManager import autosklearn.models.holdout_evaluator from autosklearn.models.paramsklearn import g...
bsd-3-clause
badlogicmanpreet/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/rcsetup.py
69
23344
""" The rcsetup module contains the default values and the validation code for customization using matplotlib's rc settings. Each rc setting is assigned a default value and a function used to validate any attempted changes to that setting. The default values and validation functions are defined in the rcsetup module, ...
agpl-3.0
williamdlees/TRIgS
PlotIdentity.py
2
6306
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the # Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND...
mit
banesullivan/ParaViewGeophysics
PVGeo/ubc/tensor.py
1
21910
__all__ = [ 'TensorMeshReader', 'TensorMeshAppender', 'TopoMeshAppender', ] __displayname__ = 'Tensor Mesh' import os import sys import numpy as np import pandas as pd import vtk from .. import _helpers, interface from ..base import AlgorithmBase from .two_file_base import ModelAppenderBase, ubcMeshRead...
bsd-3-clause
jseabold/scikit-learn
sklearn/feature_selection/rfe.py
4
15662
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import numpy as np from ..utils import check_X_y, safe_sqr from ..utils.metaes...
bsd-3-clause
cuemacro/chartpy
chartpy_examples/subplot_example.py
1
2359
__author__ = 'saeedamen' # Saeed Amen # # Copyright 2016 Cuemacro # # 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 ...
apache-2.0
nvoron23/statsmodels
statsmodels/sandbox/examples/try_multiols.py
33
1243
# -*- coding: utf-8 -*- """ Created on Sun May 26 13:23:40 2013 Author: Josef Perktold, based on Enrico Giampieri's multiOLS """ #import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.sandbox.multilinear import multiOLS, multigroup data = sm.datasets.longley.load_pandas() df = data.e...
bsd-3-clause
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/skimage/viewer/utils/core.py
19
6555
import numpy as np from ..qt import QtWidgets, has_qt, FigureManagerQT, FigureCanvasQTAgg from ..._shared.utils import warn import matplotlib as mpl from matplotlib.figure import Figure from matplotlib import _pylab_helpers from matplotlib.colors import LinearSegmentedColormap if has_qt and 'agg' not in mpl.get_backen...
mit
ilyes14/scikit-learn
examples/preprocessing/plot_function_transformer.py
161
1949
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
bsd-3-clause
gclenaghan/scikit-learn
examples/applications/topics_extraction_with_nmf_lda.py
18
3768
""" ======================================================================================= Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation ======================================================================================= This is an example of applying Non-negative Matrix ...
bsd-3-clause
anhaidgroup/py_stringsimjoin
py_stringsimjoin/tests/test_size_filter.py
1
25474
import unittest from nose.tools import assert_equal, assert_list_equal, nottest, raises from py_stringmatching.tokenizer.delimiter_tokenizer import DelimiterTokenizer from py_stringmatching.tokenizer.qgram_tokenizer import QgramTokenizer import numpy as np import pandas as pd from py_stringsimjoin.filter.size_filter ...
bsd-3-clause
ZENGXH/scikit-learn
sklearn/metrics/tests/test_classification.py
42
52642
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import La...
bsd-3-clause
magne-max/zipline-ja
zipline/pipeline/loaders/utils.py
1
9840
import datetime import numpy as np import pandas as pd from zipline.utils.pandas_utils import mask_between_time def is_sorted_ascending(a): """Check if a numpy array is sorted.""" return (np.fmax.accumulate(a) <= a).all() def validate_event_metadata(event_dates, event_timestamps...
apache-2.0
swatlab/uplift-analysis
src_code_metrics.py
1
4848
import re, csv, pytz, json, subprocess from dateutil import parser import pandas as pd import get_bugs from libmozdata import patchanalysis # Execute a shell command def shellCommand(command_str): cmd =subprocess.Popen(command_str.split(' '), stdout=subprocess.PIPE) cmd_out, cmd_err = cmd.communicate() ret...
mpl-2.0
rdipietro/tensorflow
tensorflow/contrib/learn/python/learn/estimators/classifier_test.py
16
5175
# 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
rs2/pandas
pandas/tests/indexing/multiindex/test_xs.py
1
9100
import numpy as np import pytest from pandas import DataFrame, Index, IndexSlice, MultiIndex, Series, concat, date_range import pandas._testing as tm import pandas.core.common as com @pytest.fixture def four_level_index_dataframe(): arr = np.array( [ [-0.5109, -2.3358, -0.4645, 0.05076, 0.364...
bsd-3-clause
Lab603/PicEncyclopedias
jni-build/jni-build/jni/include/tensorflow/contrib/learn/python/learn/tests/multioutput_test.py
5
1679
# 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...
mit
timmie/cartopy
lib/cartopy/mpl/ticker.py
3
10493
# (C) British Crown Copyright 2014 - 2016, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
ifcharming/voltdb2.1
tools/vis.py
1
5697
#!/usr/bin/env python # This is a visualizer which pulls TPC-C benchmark results from the MySQL # databases and visualizes them. Four graphs will be generated, latency graph on # sinigle node and multiple nodes, and throughput graph on single node and # multiple nodes. # # Run it without any arguments to see what argu...
gpl-3.0
gdetor/SI-RF-Structure
Statistics/clear_data.py
1
5369
# Copyright (c) 2014, Georgios Is. Detorakis (gdetor@gmail.com) and # Nicolas P. Rougier (nicolas.rougier@inria.fr) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redis...
gpl-3.0
cheral/orange3
doc/development/source/orange-demo/orangedemo/OWLearningCurveB.py
2
13882
import sys from collections import OrderedDict from functools import reduce import numpy import sklearn.cross_validation from PyQt4.QtGui import QTableWidget, QTableWidgetItem import Orange.data import Orange.classification from Orange.widgets import widget, gui, settings from Orange.evaluation.testing import Resul...
bsd-2-clause
rizac/gfz-reportgen
gfzreport/sphinxbuild/map/__init__.py
2
43603
''' This module implements the function `plotmap` which plots scattered points on a map retrieved using ArgGIS Server REST API. The function is highly customizable and is basically a wrapper around the `Basemap` library (for the map background) plus matplotlib utilities (for plotting points, shapes, labels and legend) ...
gpl-3.0
yanlend/scikit-learn
doc/datasets/mldata_fixture.py
367
1183
"""Fixture module to skip the datasets loading when offline Mock urllib2 access to mldata.org and create a temporary data folder. """ from os import makedirs from os.path import join import numpy as np import tempfile import shutil from sklearn import datasets from sklearn.utils.testing import install_mldata_mock fr...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/dates.py
6
52305
""" Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and :mod:`dateutil`. :class:`datetime` objects are converted to floating point numbers which represent time in days since 0001-01-01 UTC, plus 1. For example, 0001-01-0...
gpl-3.0
RachitKansal/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
bhargav/scikit-learn
doc/conf.py
26
8446
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # 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. ...
bsd-3-clause
JamesSample/ecosystem_services_impacts
Code/01_es_lu_cc.py
1
21539
#------------------------------------------------------------------------------ # Name: 01_es_lu_cc.py # Purpose: Processing for the CREW project on ES, LUC and CC. # # Author: James Sample # # Created: 14/01/2015 # Copyright: (c) James Sample and JHI, 2015 # License: https://github.com/JamesS...
mit
silky/ProbablyOverthinkingIt
thinkstats2.py
1
69096
"""This file contains code for use with "Think Stats" and "Think Bayes", both by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division """This file contains class definitions for: H...
mit
sniemi/SamPy
sandbox/src1/examples/multi_image.py
1
1769
#!/usr/bin/env python ''' Make a set of images with a single colormap, norm, and colorbar. It also illustrates colorbar tick labelling with a multiplier. ''' from matplotlib.pyplot import figure, show, sci from matplotlib import cm, colors from matplotlib.font_manager import FontProperties from numpy import amin, ama...
bsd-2-clause
suranap/qiime
qiime/quality_scores_plot.py
9
6918
#!/usr/bin/env python # File created Sept 29, 2010 from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __email__ = "William....
gpl-2.0
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/numpy/core/function_base.py
23
6891
from __future__ import division, absolute_import, print_function __all__ = ['logspace', 'linspace'] from . import numeric as _nx from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None): """ Return evenly...
mit
RomainBrault/scikit-learn
sklearn/decomposition/tests/test_incremental_pca.py
43
10272
"""Tests for Incremental PCA.""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises from sklearn import datasets from sklearn.decomposition import PCA, IncrementalPCA iris = datasets.load...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/tests/tseries/test_frequencies.py
1
29684
from datetime import datetime, timedelta import numpy as np import pytest from pandas._libs.tslibs import frequencies as libfrequencies, resolution from pandas._libs.tslibs.ccalendar import MONTHS from pandas._libs.tslibs.frequencies import ( INVALID_FREQ_ERR_MSG, FreqGroup, _period_code_map, get_freq, get_freq_c...
bsd-3-clause
jcrudy/sklearntools
sklearntools/test/test_transformers.py
1
3613
from sklearntools.transformers import Constant, VariableTransformer, Identity,\ Censor, NanMap, Log import numpy as np import pandas from numpy.testing.utils import assert_array_almost_equal from sklearn.datasets.base import load_boston from pyearth.earth import Earth from sklearntools.calibration import ResponseTr...
bsd-3-clause
skdaccess/skdaccess
skdaccess/geo/srtm/cache/data_fetcher.py
2
10677
# The MIT License (MIT) # Copyright (c) 2016 Massachusetts Institute of Technology # # Authors: Cody Rude, Guillaume Rongier # This software has been created in projects supported by the US National # Science Foundation and NASA (PI: Pankratius) # # Permission is hereby granted, free of charge, to any person obtaining ...
mit
yilei0620/3D_Conditional_Gan
GenSample_obj.py
1
4544
import sys sys.path.append('..') import os import json from time import time import numpy as np from sklearn.externals import joblib import scipy from scipy import io # from matplotlib import pyplot as plt # from sklearn.externals import joblib import theano import theano.tensor as T from lib import activations fro...
mit
felipemontefuscolo/bitme
tactic/bitmex_dummy_tactic.py
1
1028
from common.quote import Quote from tactic import TacticInterface, ExchangeInterface, Symbol, OrderCommon, Fill import pandas as pd class BitmexDummyTactic(TacticInterface): """ This class is associated to orders issued by Bitmex """ def finalize(self) -> None: pass def handle_quote(self...
mpl-2.0
peastman/msmbuilder
msmbuilder/tests/test_kernel_approximation.py
9
1158
from __future__ import absolute_import import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.kernel_approximation import Nystroem as NystroemR from msmbuilder.decomposition.kernel_approximation import Nystroem, LandmarkNystroem def test_nystroem_vs_sklearn(): np.random.seed(42) ...
lgpl-2.1
nmayorov/scikit-learn
examples/applications/plot_outlier_detection_housing.py
243
5577
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
bsd-3-clause
moutai/scikit-learn
examples/neural_networks/plot_mlp_training_curves.py
56
3596
""" ======================================================== Compare Stochastic learning strategies for MLPClassifier ======================================================== This example visualizes some training loss curves for different stochastic learning strategies, including SGD and Adam. Because of time-constrai...
bsd-3-clause
garywu/pypedream
pypedream/plot/_filt.py
1
2685
import numpy has_matplotlib = True try: from matplotlib import pyplot, figure except ImportError: has_matplotlib = False from dagpype._core import filters def _make_relay_call(fn, name): def new_fn(*args, **kwargs): @filters def _dagpype_internal_fn_act(target): try: ...
bsd-3-clause
nliolios24/textrank
share/doc/networkx-1.9.1/examples/graph/unix_email.py
62
2683
#!/usr/bin/env python """ Create a directed graph, allowing multiple edges and self loops, from a unix mailbox. The nodes are email addresses with links that point from the sender to the recievers. The edge data is a Python email.Message object which contains all of the email message data. This example shows the po...
mit
imaculate/scikit-learn
sklearn/linear_model/randomized_l1.py
11
24849
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
prabhjyotsingh/incubator-zeppelin
flink/interpreter/src/main/resources/python/zeppelin_pyflink.py
10
2806
# # 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
prasunroypr/digit-recognizer
source/defs.py
1
6607
################################################################################ """ Functions for Digit Recognition Created on Wed Jun 01 00:00:00 2016 @author: Prasun Roy @e-mail: prasunroy.pr@gmail.com """ ################################################################################ # import modules import ma...
gpl-3.0
endolith/scikit-image
skimage/feature/tests/test_util.py
35
2818
import numpy as np try: import matplotlib.pyplot as plt except ImportError: plt = None from numpy.testing import assert_equal, assert_raises from skimage.feature.util import (FeatureDetector, DescriptorExtractor, _prepare_grayscale_input_2D, _mask...
bsd-3-clause
alexsavio/scikit-learn
examples/model_selection/plot_roc_crossval.py
21
3477
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
chaowu2009/stereo-vo
tools/capture_TwoCameras_saveImagesOnly.py
1
2289
import numpy as np import cv2 import time import matplotlib.pylab as plt """ Make sure that you hold the checkerboard horizontally (more checkers horizontally than vertically). In order to get a good calibration you will need to move the checkerboard around in the camera frame such that: the checkerboard is det...
mit
kevin-intel/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
10
16467
""" Testing Recursive feature elimination """ from operator import attrgetter import pytest import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy import sparse from sklearn.feature_selection import RFE, RFECV from sklearn.datasets import load_iris, make_friedman1 from s...
bsd-3-clause
Mako-kun/mangaki
mangaki/mangaki/utils/svd.py
2
5410
from django.contrib.auth.models import User from mangaki.models import Rating, Work, Recommendation from mangaki.utils.chrono import Chrono from mangaki.utils.values import rating_values from scipy.sparse import lil_matrix from sklearn.utils.extmath import randomized_svd import numpy as np from django.db import connect...
agpl-3.0
MartialD/hyperspy
hyperspy/drawing/tiles.py
4
2899
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 3 of the License, or # (at...
gpl-3.0
Rocamadour7/ml_tutorial
05. Clustering/titanic-data-example.py
1
1721
import numpy as np from sklearn.cluster import KMeans from sklearn import preprocessing import pandas as pd ''' Pclass Passenger Class (1 = 1st; 2 = 2nd; 3 = 3rd) survival Survival (0 = No; 1 = Yes) name Name sex Sex age Age sibsp Number of Siblings/Spouses Aboard parch Number of Parents/Children Aboard ticket Ticket ...
mit
huytd/dejavu
dejavu/fingerprint.py
1
6020
import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt from scipy.ndimage.filters import maximum_filter from scipy.ndimage.morphology import (generate_binary_structure, iterate_structure, binary_erosion) import hashlib from operator import itemgetter IDX...
mit
xuleiboy1234/autoTitle
tensorflow/tensorflow/examples/learn/wide_n_deep_tutorial.py
18
8111
# 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...
mit
joshloyal/scikit-learn
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...
bsd-3-clause
eriksonJAguiar/TCC-UENP-Codigos
My_codes/tools-sentiment/word_freq.py
1
4759
import nltk import pandas as pd import re from googletrans import Translator from unicodedata import normalize def read_csv(file): df1 = pd.DataFrame.from_csv('files_extern/%s.csv'%(file),sep=';',index_col=0,encoding ='ISO-8859-1') df1 = df1.reset_index() return df1 def write_csv(data,file): d...
gpl-3.0
pypot/scikit-learn
examples/decomposition/plot_faces_decomposition.py
204
4452
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
hahnicity/ace
chapter1/problem3.py
1
1222
""" Problem 3. calculate the time series yt = 5 + .05 * t + Et (Where E is epsilon) for years 1960, 1961, ..., 2001 assuming Et independently and identically distributed with mean 0 and sigma 0.2. """ from random import uniform from matplotlib.pyplot import plot, show from numpy import array, polyfit, poly1d def ...
unlicense
gnu-sandhi/sandhi
modules/gr36/gnuradio-core/src/examples/pfb/interpolate.py
17
8253
#!/usr/bin/env python # # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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 3, or (at your option) # ...
gpl-3.0
gclenaghan/scikit-learn
sklearn/decomposition/tests/test_truncated_svd.py
73
6086
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
bsd-3-clause
tbtraltaa/medianshape
medianshape/simplicial/surfgen.py
1
10038
# encoding: utf-8 ''' 2D surface embedded in 3D ------------------------- ''' from __future__ import absolute_import import importlib import os import numpy as np from medianshape.simplicial import pointgen3d, mesh, utils from medianshape.simplicial.meshgen import meshgen2d import matplotlib.pyplot as plt from mpl_t...
gpl-3.0
rbharath/pande-gas
vs_utils/utils/dragon_utils.py
3
5800
""" Dragon utilities. """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "BSD 3-clause" from cStringIO import StringIO import numpy as np import os import pandas as pd import subprocess import tempfile from vs_utils.utils import SmilesGenerator class Dragon(object...
bsd-3-clause
suraj-jayakumar/lstm-rnn-ad
src/testdata/random_data_time_series/generate_data.py
1
1042
# -*- coding: utf-8 -*- """ Created on Tue Feb 23 11:15:12 2016 @author: suraj """ import random import numpy as np import pickle import matplotlib.pyplot as plt attachRateList = [] for i in range(3360): attachRateList.append(random.uniform(4,6)) attachRateList = np.array(attachRateList) encoded_attach_rate...
apache-2.0
hackthemarket/pystrat
sim.py
1
10697
# simple trading strategy simulator import pandas as pd from pandas.tools.plotting import autocorrelation_plot from pandas.tools.plotting import scatter_matrix import numpy as np from scipy import stats import sklearn from sklearn import preprocessing as pp import matplotlib as mpl import matplotlib.pyplot as plt f...
gpl-3.0
alexeyum/scikit-learn
sklearn/datasets/mlcomp.py
289
3855
# Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os import numbers from sklearn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): if ...
bsd-3-clause
Gabriel-p/mcs_rot_angles
aux_modules/validation_set.py
1
10176
import os from astropy.io import ascii from astropy.table import Table from astropy.coordinates import Distance, Angle, SkyCoord from astropy import units as u import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sys # Change path so that we can import functions from the '...
gpl-3.0
annahs/atmos_research
LEO_calc_coating_from_meas_scat_amp_and_write_to_db.py
1
3857
import sys import os import datetime import pickle import numpy as np import matplotlib.pyplot as plt from pprint import pprint import sqlite3 import calendar from datetime import datetime #id INTEGER PRIMARY KEY AUTOINCREMENT, #sp2b_file TEXT, #file_index INT, #instr TEXT, #instr_locn TEXT, #particle_type TEXT, #...
mit
great-expectations/great_expectations
great_expectations/expectations/core/expect_column_values_to_be_in_type_list.py
1
17690
import logging from typing import Dict, Optional import numpy as np import pandas as pd from great_expectations.core import ExpectationConfiguration from great_expectations.exceptions import InvalidExpectationConfigurationError from great_expectations.execution_engine import ( ExecutionEngine, PandasExecution...
apache-2.0
bongtrop/peach
tutorial/neural-networks/linear-prediction.py
6
3386
################################################################################ # Peach - Computational Intelligence for Python # Jose Alexandre Nalon # # This file: tutorial/linear-prediction.py # Using neural networks to predict number sequences #######################################################################...
lgpl-2.1
cs207-project/TimeSeries
procs/_corr.py
1
4794
import numpy.fft as nfft import numpy as np import timeseries as ts from scipy.stats import norm # import pyfftw import sys #sys.path.append("/Users/yuhantang/CS207/TimeSeries/procs") from .interface import * def createfromlist(l): d = new_darray(len(l)) for i in range(0,len(l)): darray_set(d,i,l[i]) ...
mit
benjaminoh1/tensorflowcookbook
Chapter 07/bag_of_words.py
1
6082
# Working with Bag of Words #--------------------------------------- # # In this example, we will download and preprocess the ham/spam # text data. We will then use a one-hot-encoding to make a # bag of words set of features to use in logistic regression. # # We will use these one-hot-vectors for logistic regression...
mit
dvro/scikit-protopy
protopy/base.py
1
4528
"""Base and mixin classes for instance reduction techniques""" # Author: Dayvid Victor <dvro@cin.ufpe.br> # License: BSD Style import warnings from abc import ABCMeta, abstractmethod from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.neighbors.classification import KNeighborsClassifier from sklearn...
bsd-2-clause
ZenDevelopmentSystems/scikit-learn
sklearn/linear_model/tests/test_sgd.py
68
43439
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
SP2RC-Coding-Club/Codes
13_07_2017/3D_slab_modes.py
1
35096
#import pdb # pause code for debugging at pdb.set_trace() import numpy as np import toolbox as tool import slab_functions as sf from pysac.plot.mayavi_seed_streamlines import SeedStreamline import matplotlib.pyplot as plt from mayavi import mlab import gc #import move_seed_points as msp import mayavi_plotting_function...
mit
iShoto/testpy
codes/20200104_metric_learning_mnist/src/train_mnist_original_center.py
1
5545
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.utils.data import DataLoader import torch.optim.lr_scheduler as lr_scheduler from torch.autograd.function import Function import torchvision import os import matplotlib...
mit
reinaH/osf.io
scripts/analytics/email_invites.py
55
1332
# -*- coding: utf-8 -*- import os import matplotlib.pyplot as plt from framework.mongo import database from website import settings from utils import plot_dates, mkdirp user_collection = database['user'] FIG_PATH = os.path.join(settings.ANALYTICS_PATH, 'figs', 'features') mkdirp(FIG_PATH) def analyze_email_invi...
apache-2.0
roshchupkin/hase
tools/VCF2hdf5.py
1
4024
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from config import PYTHON_PATH if PYTHON_PATH is not None: for i in PYTHON_PATH: sys.path.insert(0,i) import argparse import h5py import pandas as pd import numpy as np from hdgwas.tools import Timer import tables import...
gpl-3.0
moutai/scikit-learn
sklearn/manifold/locally_linear.py
37
25852
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
moutai/scikit-learn
sklearn/datasets/tests/test_mldata.py
384
5221
"""Test functionality of mldata fetching utilities.""" import os import shutil import tempfile import scipy as sp from sklearn import datasets from sklearn.datasets import mldata_filename, fetch_mldata from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_not_in from sklearn.utils.test...
bsd-3-clause
google-research/disentanglement_lib
disentanglement_lib/data/ground_truth/cars3d.py
1
4067
# coding=utf-8 # Copyright 2018 The DisentanglementLib 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 # # Un...
apache-2.0
Lawrence-Liu/scikit-learn
sklearn/cluster/setup.py
263
1449
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration cblas_libs, blas_info = ...
bsd-3-clause
mohitreddy1996/Gender-Detection-from-Signature
src/train_test/random_forests.py
1
1140
from sklearn.metrics import precision_recall_fscore_support import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import MinMaxScaler, normalize df = pd.read_csv('../../Dataset/dataset.csv', delimiter='\t') dataset = df.values mask = np.random.rand(len...
mit
AlexanderFabisch/scikit-learn
sklearn/decomposition/tests/test_pca.py
21
11810
import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_rai...
bsd-3-clause
eramirem/astroML
book_figures/chapter9/fig_photoz_tree.py
3
3637
""" Photometric Redshifts by Decision Trees --------------------------------------- Figure 9.14 Photometric redshift estimation using decision-tree regression. The data is described in Section 1.5.5. The training set consists of u, g , r, i, z magnitudes of 60,000 galaxies from the SDSS spectroscopic sample. Cross-val...
bsd-2-clause
vitale232/ves
ves/VESinverse_vectorized.py
1
12839
# -*- coding: utf-8 -*- """ Created on Thu Jan 28 16:32:48 2016 @author: jclark this code uses the Ghosh method to determine the apparent resistivities for a layered earth model. Either schlumberger or Wenner configurations can be used """ import numpy as np import random import matplotlib matplotlib...
lgpl-3.0