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
deepinsight/Deformable-ConvNets
deeplab/runs_CAIScene/infer3.py
1
9886
import os os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' import sys import argparse import numpy as np import cv2 import math import datetime import random import json import pandas as pd #import multiprocessing from Queue import Queue from threading import Thread import mxnet as mx import mxnet.ndarray as nd from ea...
apache-2.0
wanggang3333/scikit-learn
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
hainm/scikit-learn
sklearn/metrics/tests/test_score_objects.py
138
14048
import pickle import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.testing import assert_true from sklearn.utils.testing im...
bsd-3-clause
conversationai/conversationai-moderator-reddit
perspective_reddit_bot/compute_bot_metrics_test.py
1
2559
# Copyright 2018 Google 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 in writing, s...
apache-2.0
xiaoxiamii/scikit-learn
sklearn/decomposition/tests/test_factor_analysis.py
222
3055
# Author: Christian Osendorfer <osendorf@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Licence: BSD3 import numpy as np from sklearn.utils.testing import assert_warns from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing im...
bsd-3-clause
kdebrab/pandas
pandas/tests/series/test_datetime_values.py
3
19069
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import locale import calendar import pytest from datetime import datetime, date import numpy as np import pandas as pd from pandas.core.dtypes.common import is_integer_dtype, is_list_like from pandas import (Index, Series, DataFrame, bdate_range, ...
bsd-3-clause
shujingke/opencog
opencog/python/spatiotemporal/temporal_events/membership_function.py
34
4673
from math import fabs from random import random from scipy.stats.distributions import rv_frozen from spatiotemporal.time_intervals import TimeInterval from spatiotemporal.unix_time import random_time, UnixTime from utility.generic import convert_dict_to_sorted_lists from utility.functions import Function, FunctionPiece...
agpl-3.0
glneo/gnuradio-davisaf
gr-digital/examples/example_timing.py
17
7791
#!/usr/bin/env python from gnuradio import gr, digital from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser try: import scipy except ImportError: print "Error: could not import scipy (http://www.scipy.org/)" sys.exit(1) try: import pylab excep...
gpl-3.0
MartinThoma/algorithms
ML/nlp/document_classification_reuters.py
1
4397
#!/usr/bin/env python """Train a document classifier.""" import time import reuters from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.ensemble import AdaBoostClassifier, RandomForestClassifier from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_sco...
mit
tgsmith61591/skutil
skutil/preprocessing/tests/test_balance.py
1
4844
from __future__ import print_function import pandas as pd import numpy as np from sklearn.datasets import load_iris from skutil.preprocessing import * from skutil.preprocessing.balance import _BaseBalancer from numpy.testing import assert_array_equal from skutil.testing import assert_fails import warnings # Def data f...
bsd-3-clause
alexgerst/yawgmoth
src/personalvars.py
1
4209
#This is a file for holding information specific to your server #Only change lines that have comments to the right of them # --------------------------- # Startup Variables # --------------------------- #Where you saved your token file def token_location(): return "/home/ec2-user/token.txt" #Where you saved the ...
mit
wazeerzulfikar/scikit-learn
sklearn/cluster/mean_shift_.py
9
15822
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
bsd-3-clause
valexandersaulys/airbnb_kaggle_contest
prototype_alpha/randomForest_take1.py
1
1339
""" Take 1 on the RandomForest, predicting for country_destinations. """ import pandas as pd from sklearn.cross_validation import train_test_split training = pd.read_csv("protoAlpha_training.csv") testing = pd.read_csv("protoAlpha_testing.csv") X = training.iloc[:,1:-1] y = training['country_destination'] x_train,x_...
gpl-2.0
louispotok/pandas
pandas/tests/io/parser/quoting.py
18
5813
# -*- coding: utf-8 -*- """ Tests that quoting specifications are properly handled during parsing for all of the parsers defined in parsers.py """ import csv import pandas.util.testing as tm from pandas import DataFrame from pandas.compat import PY3, StringIO, u class QuotingTests(object): def test_bad_quote_...
bsd-3-clause
gmum/r2-learner
scripts/fit_triple.py
2
1745
#!/usr/bin/env python import sys, os, time, traceback from sklearn.grid_search import ParameterGrid from multiprocessing import Pool sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from misc.experiment_utils import save_exp, get_exp_logger, shorten_params, exp_done from r2 import * from misc.data_api i...
mit
followyourheart/SFrame
oss_src/unity/python/sframe/data_structures/sgraph.py
9
58636
""" .. warning:: This product is currently in a beta release. The API reference is subject to change. This package defines the GraphLab Create SGraph, Vertex, and Edge objects. The SGraph is a directed graph, consisting of a set of Vertex objects and Edges that connect pairs of Vertices. The methods in this module are...
bsd-3-clause
jrbourbeau/cr-composition
notebooks/legacy/lightheavy/spectrum-analysis-xgboost.py
1
27958
#!/usr/bin/env python from __future__ import division, print_function from collections import defaultdict import itertools import numpy as np from scipy import interp import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import seaborn.apionly as sns from sklearn.metrics imp...
mit
viekie/tensorflow-tutorial
chap03/word2vector.py
1
3414
#!/usr/bin/env python # -*- coding: utf8 -*- # Power by viekie2017-08-26 09:24:00 ## # @file word2vector.py # @brief # @author viekiedu@gmail.com # @version 1.0 # @date 2017-08-26 import collections import matplotlib import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from six.moves import xrang...
apache-2.0
phobson/wqio
wqio/hydro.py
2
37198
import warnings import numpy from matplotlib import pyplot from matplotlib import dates from matplotlib import gridspec import seaborn import pandas from wqio import utils from wqio import viz from wqio import validate from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() SEC_...
bsd-3-clause
381426068/MissionPlanner
Lib/site-packages/numpy/core/code_generators/ufunc_docstrings.py
57
85797
# Docstrings for generated ufuncs docdict = {} def get(name): return docdict.get(name) def add_newdoc(place, name, doc): docdict['.'.join((place, name))] = doc add_newdoc('numpy.core.umath', 'absolute', """ Calculate the absolute value element-wise. Parameters ---------- x : array_like...
gpl-3.0
tensorflow/models
research/cognitive_planning/viz_active_vision_dataset_main.py
5
13173
# Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
yanlend/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
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/groupby/test_index_as_string.py
1
3760
import pytest import pandas as pd import numpy as np from pandas.util.testing import assert_frame_equal, assert_series_equal import pandas.util.testing as tm @pytest.fixture(params=[['inner'], ['inner', 'outer']]) def frame(request): levels = request.param df = pd.DataFrame({'outer': ['a', 'a', 'a', 'b', 'b'...
apache-2.0
araichev/gtfstk
gtfstk/shapes.py
1
8064
""" Functions about shapes. """ from typing import Optional, List, Dict, TYPE_CHECKING import pandas as pd from pandas import DataFrame import numpy as np import utm import shapely.geometry as sg from . import constants as cs from . import helpers as hp # Help mypy but avoid circular imports if TYPE_CHECKING: fr...
mit
Ziqi-Li/bknqgis
bokeh/bokeh/sampledata/airports.py
15
1027
""" The data in airports.json is a subset of US airports with field elevations > 1500 meters. The query result was taken from .. code-block:: none http://services.nationalmap.gov/arcgis/rest/services/GlobalMap/GlobalMapWFS/MapServer/10/query on October 15, 2015. """ from __future__ import absolute_import from b...
gpl-2.0
radk0s/pathfinding
algorithm/graph.py
1
2681
from datetime import datetime from cost import cost as costNorm import dijkstra as d import numpy as np import matplotlib.pyplot as plt import scipy.interpolate import os def cost(frm, to): return costNorm(frm.lon, frm.lat, frm.ele, to.lon, to.lat, to.ele) def graph_path(frm, to, res): start_time = datetime....
mit
SummaLabs/DLS
app/backend-test/core_models/run03_test_train_model_on_dataset.py
1
1751
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ar' import app.backend.core.utils as dlsutils import json import skimage.io as io import matplotlib.pyplot as plt from keras.utils.visualize_util import plot as kplot from app.backend.core.datasets.dbwatcher import DatasetsWatcher from app.backend.core.models.f...
mit
vortex-ape/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
65
1479
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
Openergy/oplus
oplus/err.py
1
7074
import os import pandas as pd from . import CONF class Err: WARNING = "Warning" FATAL = "Fatal" SEVERE = "Severe" CATEGORIES = (WARNING, FATAL, SEVERE) def __init__(self, path): if not os.path.isfile(path): raise FileNotFoundError("No file at given path: '%s'." % path) ...
mpl-2.0
parloma/Prensilia
prensilia/Exp_OUTPUT_WINDOWS.py
1
5782
#Parameters: RF First Classification Layer - RF Second Classification Layer - Name of the volunteer #Import required import sys from os import mkdir,sep,path #import numpy as np #from cv2 import * #from hand_grabber import PyOpenNIHandGrabber #from pose_recognizer import PyPoseRecognizer import thread import xml.etree...
apache-2.0
jlegendary/scikit-learn
examples/model_selection/grid_search_digits.py
227
2665
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.grid_search.GridSearc...
bsd-3-clause
trela/qikify
qikify/controllers/SVM.py
1
1804
"""Support Vector Machine implementation. """ from sklearn.grid_search import GridSearchCV from sklearn.svm import SVC from qikify.helpers import standardize class SVM(object): """Support Vector Machine implementation. """ def __init__(self, grid_search = False): """Support Vector Machine implemen...
mit
flightgong/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
44
7031
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
MadsJensen/agency_connectivity
phase_analysis_no_steps_x-freq.py
1
3644
# -*- coding: utf-8 -*- """ @author: mje @emai: mads@cnru.dk """ import numpy as np # import mne import matplotlib.pyplot as plt import pandas as pd from itertools import combinations from my_settings import * plt.style.use("ggplot") b_df = pd.read_csv( "/Users/au194693/projects/agency_connectivity/data/behavio...
bsd-3-clause
thjashin/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py
82
6157
# 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
kmike/scikit-learn
sklearn/metrics/tests/test_score_objects.py
4
3898
import pickle from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.metrics import f1_score, r2_score, auc_score, fbeta_score from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics import SCORERS, Scorer from sklearn.svm import LinearS...
bsd-3-clause
mitocw/content-mit-latex2edx-demo
static/js/jsxgraph/server/fft.py
2
4429
from JXGServerModule import JXGServerModule import numpy import numpy.fft import wave, struct, uuid import os, subprocess import StringIO, gzip, base64 import datetime, math, random # Should be changed to something more persistent but must be writable by # the webserver (usually user www-data) #if not 'MPLCONFIGDIR' i...
mit
maschwanden/boxsimu
tests/test_boxmodelsystem1.py
1
13815
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 10:45:10 2016 @author: Mathias Aschwanden (mathias.aschwanden@gmail.com) """ import os import unittest from unittest import TestCase import sys import copy import numpy as np import datetime from matplotlib import pyplot as plt if not os.path.abspath(__file__ + "/...
mit
akrherz/iem
scripts/climodat/assign_default_hour.py
1
1500
"""Sample obs to see what our default times are.""" # Third party import pandas as pd from pandas.io.sql import read_sql from pyiem.util import get_dbconn, logger LOG = logger() def main(): """Go Main Go.""" df = read_sql( "SELECT iemid, id, temp24_hour, precip24_hour from stations WHERE " "...
mit
james-nichols/dtrw
compartment_models/PBPK_test.py
1
5547
#!/usr/local/bin/python3 # Libraries are in parent directory import sys sys.path.append('../') import math import numpy as np import scipy as sp import matplotlib.pyplot as plt import pdb from dtrw import * class DTRW_PBPK(DTRW_compartment): def __init__(self, X_inits, T, dT, V, Q, R, mu, Vmax, Km, g, g_T): ...
gpl-2.0
DSLituiev/scikit-learn
sklearn/metrics/tests/test_classification.py
15
54365
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
fyffyt/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
ucsd-progsys/ml2
learning/randomforest2.py
2
3950
import math import os.path import random random.seed() from sklearn import tree from sklearn.ensemble import RandomForestClassifier import numpy as np import pandas as pd import input_old csvs2 = [f for f in os.listdir('ml2/data/fa15/op+context-count+type+size') if f.endswith('.csv')] csvs = [f for f in os.listdir('...
bsd-3-clause
HeraclesHX/scikit-learn
sklearn/lda.py
72
17751
""" Linear Discriminant Analysis (LDA) """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .externals.six import string_types f...
bsd-3-clause
sebastien-forestier/NIPS2016
ros/nips2016/src/nips2016/learning/learning.py
1
4188
import os import pickle import matplotlib.pyplot as plt import numpy as np import time import datetime from core.supervisor import Supervisor class Learning(object): def __init__(self, config, n_motor_babbling=0, explo_noise=0.1, choice_eps=0.2, enable_hand=True, normalize_interests=True): self.config...
gpl-3.0
jaak-s/macau
python/macau/test_macau.py
1
10384
import unittest import numpy as np import pandas as pd import scipy.sparse import macau import itertools class TestMacau(unittest.TestCase): def test_bpmf(self): Y = scipy.sparse.rand(10, 20, 0.2) Y, Ytest = macau.make_train_test(Y, 0.5) results = macau.bpmf(Y, Ytest = Ytest, num_latent = 4...
mit
jesserobertson/pynoddy
pynoddy/experiment/SensitivityAnalysis.py
2
12280
from pynoddy.experiment import Experiment import numpy as np class SensitivityAnalysis(Experiment): '''Sensitivity analysis experiments for kinematic models Sensitivity analysis with methods from the SALib package: https://github.com/jdherman/SALib ''' #from SALib.sample import saltelli ...
gpl-2.0
blackecho/Deep-Learning-TensorFlow
yadlt/models/linear/logistic_regression.py
2
3960
"""Softmax classifier implementation using Tensorflow.""" from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tqdm import tqdm from yadlt.core import Evaluation, Loss from yadlt.core import SupervisedModel from yadlt.utils import tf_utils, utilities ...
mit
moutai/scikit-learn
sklearn/tree/export.py
14
16020
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
benjaminpope/whisky
kergain_sim.py
2
11632
import numpy as np import matplotlib.pyplot as plt import pysco from pysco.core import * import fitsio from k2_epd_george import print_time from time import time as clock from old_diffract_tools import * import pymultinest from pysco.diffract_tools import shift_image_ft from pysco.common_tasks import shift_image from...
gpl-3.0
EclipseXuLu/DataHouse
DataHouse/tokendata/tokendata_fetcher.py
1
4621
import json import time from pprint import pprint import pandas as pd import requests def precess_token_sales(json_str_path): result = [] with open(json_str_path, mode='rt') as f: json_obj = json.load(f) index = 0 for _ in json_obj['data']: print('*' * 100) pr...
mit
hdmetor/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
peastman/msmbuilder
msmbuilder/project_templates/tica/tica-sample-coordinate-plot.py
9
1174
"""Plot the result of sampling a tICA coordinate {{header}} """ # ? include "plot_header.template" # ? from "plot_macros.template" import xdg_open with context import numpy as np import seaborn as sns from matplotlib import pyplot as plt from msmbuilder.io import load_trajs, load_generic sns.set_style('ticks') col...
lgpl-2.1
KarrLab/obj_model
obj_model/io.py
1
96862
""" Reading/writing schema objects to/from files * Comma separated values (.csv) * Excel (.xlsx) * JavaScript Object Notation (.json) * Tab separated values (.tsv) * Yet Another Markup Language (.yaml, .yml) :Author: Jonathan Karr <karr@mssm.edu> :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu> :Date: 2016-11-23 :...
mit
ilo10/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
minesense/VisTrails
contrib/NumSciPy/ArrayPlot.py
6
24193
import core.modules import core.modules.module_registry from core.modules.vistrails_module import Module, ModuleError from core.modules.basic_modules import PythonSource from Array import * from Matrix import * import pylab import matplotlib import urllib import random class ArrayPlot(object): namespace = 'numpy|...
bsd-3-clause
SHDShim/pytheos
examples/6_p_scale_test_Dorogokupets2015_Pt.py
1
1417
# coding: utf-8 # In[1]: get_ipython().run_line_magic('cat', '0Source_Citation.txt') # In[2]: get_ipython().run_line_magic('matplotlib', 'inline') # %matplotlib notebook # for interactive # For high dpi displays. # In[3]: get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'retina'") # ...
apache-2.0
bibsian/database-development
poplerGUI/ui_logic_mainwindow.py
1
11994
#!/usr/bin/env python from PyQt4 import QtGui, QtCore from pandas import read_csv import subprocess import psutil import time import sys, os from Views import ui_mainrefactor as mw from poplerGUI import ui_logic_session as sesslogic from poplerGUI import ui_logic_site as sitelogic from poplerGUI import ui_logic_main as...
mit
aurelieladier/openturns
python/doc/pyplots/UserDefinedCovarianceModel.py
2
1077
import openturns as ot from math import exp from matplotlib import pyplot as plt from openturns.viewer import View def C(s, t): return exp(-4.0 * abs(s - t) / (1 + (s * s + t * t))) N = 64 a = 4.0 #myMesh = ot.IntervalMesher([N]).build(ot.Interval(-a, a)) myMesh = ot.RegularGrid(-a, 2 * a / N, N + 1) myCovarian...
lgpl-3.0
MTgeophysics/mtpy
mtpy/imaging/plotstations.py
1
22452
# -*- coding: utf-8 -*- """ =============== PlotStations =============== Plots station locations in map view. Created on Fri Jun 07 18:20:00 2013 @author: jpeacock-pr """ #============================================================================== import matplotlib.pyplot as plt import numpy as np import os im...
gpl-3.0
finfou/tushare
tushare/stock/reference.py
2
25190
# -*- coding:utf-8 -*- """ 投资参考数据接口 Created on 2015/03/21 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ from __future__ import division from tushare.stock import cons as ct from tushare.stock import ref_vars as rv from tushare.util import dateu as dt import pandas as pd import time i...
bsd-3-clause
robbwagoner/airflow
airflow/hooks/base_hook.py
5
1379
import logging import random from airflow import settings from airflow.models import Connection from airflow.utils import AirflowException class BaseHook(object): """ Abstract base class for hooks, hooks are meant as an interface to interact with external systems. MySqlHook, HiveHook, PigHook return ...
apache-2.0
JT5D/scikit-learn
sklearn/tree/tree.py
2
31720
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
biocore/qiime
qiime/compare_categories.py
15
7131
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2012, The QIIME project" __credits__ = ["Jai Ram Rideout", "Michael Dwan", "Logan Knecht", "Damien Coy", "Levi McCracken"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jai R...
gpl-2.0
szrg/data-science-from-scratch
code/visualizing_data.py
58
5116
import matplotlib.pyplot as plt from collections import Counter def make_chart_simple_line_chart(plt): years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3] # create a line chart, years on x-axis, gdp on y-axis plt.plot(years, gdp, color='gr...
unlicense
B3AU/waveTree
examples/cluster/plot_affinity_propagation.py
12
2282
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ print(__doc__) from sklearn.cluster impor...
bsd-3-clause
ubccr/tacc_stats
analyze/process_pickles/aggregate_jobs.py
1
2428
#!/usr/bin/env python import analyze_conf import sys import datetime, glob, job_stats, os, subprocess, time import itertools, argparse import matplotlib if not 'matplotlib.pyplot' in sys.modules: matplotlib.use('pdf') import matplotlib.pyplot as plt import numpy import tspl, tspl_utils import multiprocessing, functoo...
lgpl-2.1
benhamner/ASAP-AES
Benchmarks/length_benchmark.py
2
3284
#!/usr/bin/env python2.7 import re from sklearn.ensemble import RandomForestRegressor def add_essay_training(data, essay_set, essay, score): if essay_set not in data: data[essay_set] = {"essay":[],"score":[]} data[essay_set]["essay"].append(essay) data[essay_set]["score"].append(score) def add_es...
bsd-2-clause
joshua-cogliati-inl/raven
framework/SupervisedLearning/NDsplineRom.py
1
4919
# Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
verilylifesciences/site-selection-tool
bsst/plot.py
1
13466
# Copyright 2020 Verily Life Sciences LLC # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd """Functions for plotting incidence, recruitment, and events in the Baseline Site Selection Tool.""" from bsst...
bsd-3-clause
vikhyat/dask
dask/dataframe/tests/test_dataframe.py
1
90686
from itertools import product from datetime import datetime from operator import getitem from distutils.version import LooseVersion import pandas as pd import pandas.util.testing as tm import numpy as np import pytest from numpy.testing import assert_array_almost_equal import dask from dask.async import get_sync from...
bsd-3-clause
Barmaley-exe/scikit-learn
sklearn/qda.py
21
7639
""" Quadratic Discriminant Analysis """ # Author: Matthieu Perrot <matthieu.perrot@gmail.com> # # License: BSD 3 clause import warnings import numpy as np from .base import BaseEstimator, ClassifierMixin from .externals.six.moves import xrange from .utils import check_array, check_X_y from .utils.validation import ...
bsd-3-clause
mattgiguere/scikit-learn
sklearn/ensemble/tests/test_bagging.py
2
21999
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
mojoboss/scikit-learn
examples/plot_multioutput_face_completion.py
330
3019
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
bsd-3-clause
djgagne/scikit-learn
sklearn/linear_model/tests/test_base.py
101
12205
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model....
bsd-3-clause
liyu1990/sklearn
sklearn/model_selection/_validation.py
4
35605
""" The :mod:`sklearn.model_selection._validation` module includes classes and functions to validate the model. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from __...
bsd-3-clause
birm/Elemental
python/lapack_like/spectral.py
1
53459
# # Copyright (c) 2009-2015, Jack Poulson # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # from ..core import * from ..blas_like import Copy, Entry...
bsd-3-clause
ak681443/mana-deep
evaluation/allmods/mainfolder/eval.py
1
4180
# coding: utf-8 # In[1]: import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, UpSampling2D from keras.models import Model from keras.callbacks import TensorBoard from keras.models import model_from_json from keras.models import load_model from keras im...
apache-2.0
soft-matter/mr
doc/sphinxext/docscrape_sphinx.py
4
7745
import re import inspect import textwrap import pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plots = config.get('use_plots', False) NumpyDocString.__init__(self, docstring,...
gpl-3.0
michrawson/nyu_ml_lectures
notebooks/figures/plot_kneighbors_regularization.py
25
1363
import numpy as np import matplotlib.pyplot as plt from sklearn.neighbors import KNeighborsRegressor def make_dataset(n_samples=100): rnd = np.random.RandomState(42) x = np.linspace(-3, 3, n_samples) y_no_noise = np.sin(4 * x) + x y = y_no_noise + rnd.normal(size=len(x)) return x, y def plot_re...
cc0-1.0
arthurmensch/cogspaces
exps/reduce.py
1
3396
import os from os.path import join from typing import List, Union import numpy as np import pandas as pd from joblib import Parallel, delayed, dump, load from nilearn.input_data import NiftiMasker from sklearn.utils import gen_batches from cogspaces.datasets import fetch_mask, fetch_atlas_modl, \ fetch_contrasts,...
bsd-2-clause
harshaneelhg/scikit-learn
sklearn/metrics/scorer.py
211
13141
""" The :mod:`sklearn.metrics.scorer` submodule implements a flexible interface for model selection and evaluation using arbitrary score functions. A scorer object is a callable that can be passed to :class:`sklearn.grid_search.GridSearchCV` or :func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame...
bsd-3-clause
DES-SL/EasyLens
easylens/Data/image_analysis.py
1
7851
__author__ = 'sibirrer' import numpy as np import scipy.ndimage.interpolation as interp import astropy.io.fits as pyfits import pyextract.pysex as pysex import easylens.util as util class ImageAnalysis(object): """ class for analysis routines acting on a single image """ def __init__(self): ...
mit
zimuxin/AliMusicPrediction
阿里音乐流行趋势预测项目_Group13/AliMusicPrediction/music_prediction-master/features/song.py
1
3785
from matplotlib.legend_handler import HandlerLine2D import numpy as np import csv import matplotlib.pyplot as plt #--------stable------------------- import os,sys path = os.getcwd() parent_path = os.path.dirname(path) sys.path.append(parent_path) import static_data as sd CURRENT_PATH=sd.CURRENT_PATH ARTIST_FOLDER=sd.AR...
mit
lbishal/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
pixki/redesestocasticas
ctmc.py
1
4299
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Jairo Sánchez # @Date: 2015-12-02 12:03:55 # @Last Modified by: Jairo Sánchez # @Last Modified time: 2016-01-19 15:46:28 import numpy as np from scipy import misc as sc from scipy.stats import expon import argparse from mpl_toolkits.mplot3d import Axes3D from...
gpl-2.0
alexisrosuel/PyEWA
pyewa/distributions.py
1
1217
""" EWA.prior A collection of common distributions """ import numpy as np import matplotlib.pyplot as plt class Distribution: def __init__(self, support=np.linspace(0, 1, 10), pdf=np.ones(shape=10)): self.pdf = pdf self.support = support def update_pdf(self, pdf): self.pdf = pdf ...
mit
vshtanko/scikit-learn
examples/gaussian_process/gp_diabetes_dataset.py
223
1976
#!/usr/bin/python # -*- coding: utf-8 -*- """ ======================================================================== Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset ======================================================================== In this example, we fit a Gaussian Process model onto...
bsd-3-clause
murali-munna/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
marcusrehm/serenata-de-amor
rosie/rosie/chamber_of_deputies/tests/test_traveled_speeds_classifier.py
2
3774
from unittest import TestCase import numpy as np import pandas as pd import sklearn from numpy.testing import assert_array_equal from rosie.chamber_of_deputies.classifiers.traveled_speeds_classifier import TraveledSpeedsClassifier class TestTraveledSpeedsClassifier(TestCase): def setUp(self): self.data...
mit
liberatorqjw/scikit-learn
sklearn/utils/arpack.py
31
64776
""" 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
ky822/nyu_ml_lectures
notebooks/figures/plot_interactive_tree.py
20
2317
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs from sklearn.tree import DecisionTreeClassifier from sklearn.externals.six import StringIO # doctest: +SKIP from sklearn.tree import export_graphviz from scipy.misc import imread from scipy import ndimage import re X, y = ma...
cc0-1.0
anshulgupta0803/music-genre-classification
code/CNN.py
1
7256
# coding: utf-8 # In[ ]: from __future__ import print_function import tensorflow as tf import numpy as np from matplotlib import pyplot as plt import os from tflearn.data_utils import shuffle class CNN(object): def __init__(self, patch_size, num_filters_fist_layer, num_filters_second_layer, siz...
apache-2.0
davidwaroquiers/pymatgen
pymatgen/analysis/diffraction/tests/test_tem.py
5
11403
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Unit tests for TEM calculator. """ import unittest import numpy as np import pandas as pd import plotly.graph_objs as go from pymatgen.analysis.diffraction.tem import TEMCalculator from pymatgen.core.lat...
mit
HarllanAndrye/nilmtk
nilmtk/feature_detectors/cluster.py
6
5343
from __future__ import print_function, division import numpy as np import pandas as pd # Fix the seed for repeatability of experiments SEED = 42 np.random.seed(SEED) def cluster(X, max_num_clusters=3, exact_num_clusters=None): '''Applies clustering on reduced data, i.e. data where power is greater than th...
apache-2.0
QuLogic/iris
docs/iris/example_code/Meteorology/wind_speed.py
11
2361
""" Plotting wind direction using quiver =========================================================== This example demonstrates using quiver to plot wind speed contours and wind direction arrows from wind vector component input data. The vector components are co-located in space in this case. For the second plot, the ...
gpl-3.0
MartinSavc/scikit-learn
sklearn/utils/tests/test_class_weight.py
140
11909
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
jesseengel/magenta
magenta/models/rl_tuner/rl_tuner.py
2
81040
# Copyright 2019 The Magenta Authors. # # 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 ...
apache-2.0
runt18/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/projections/__init__.py
1
2188
from geo import AitoffAxes, HammerAxes, LambertAxes from polar import PolarAxes from matplotlib import axes class ProjectionRegistry(object): """ Manages the set of projections available to the system. """ def __init__(self): self._all_projection_types = {} def register(self, *projections)...
agpl-3.0
anve8004/trading-with-python
historicDataDownloader/historicDataDownloader.py
77
4526
''' Created on 4 aug. 2012 Copyright: Jev Kuznetsov License: BSD a module for downloading historic data from IB ''' import ib import pandas from ib.ext.Contract import Contract from ib.opt import ibConnection, message from time import sleep import tradingWithPython.lib.logger as logger from pandas impor...
bsd-3-clause