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
toastedcornflakes/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
hsuantien/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
127
37672
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from sklearn import datasets from sklearn.base import clone from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble.grad...
bsd-3-clause
teonlamont/mne-python
mne/viz/tests/test_3d.py
2
18155
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Mainak Jas <mainak@neuro.hut.fi> # Mark Wronkiewicz <wronk.mark@gmail.c...
bsd-3-clause
yuyu2172/chainercv
tests/visualizations_tests/test_vis_bbox.py
3
4256
import unittest import numpy as np from chainer import testing from chainercv.utils import generate_random_bbox from chainercv.visualizations import vis_bbox try: import matplotlib # NOQA _available = True except ImportError: _available = False @testing.parameterize( *testing.product_dict([ ...
mit
eg-zhang/scikit-learn
examples/cluster/plot_color_quantization.py
297
3443
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
bsd-3-clause
fzalkow/scikit-learn
sklearn/neighbors/tests/test_kd_tree.py
129
7848
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics import Dista...
bsd-3-clause
vivekmishra1991/scikit-learn
examples/linear_model/plot_robust_fit.py
238
2414
""" Robust linear estimator fitting =============================== Here a sine function is fit with a polynomial of order 3, for values close to zero. Robust fitting is demoed in different situations: - No measurement errors, only modelling errors (fitting a sine with a polynomial) - Measurement errors in X - M...
bsd-3-clause
radiasoft/radtrack
experimental/hermite/testHermite02.py
1
6919
# # Test executable #2 to exercise the Gauss-Hermite class # Here, we fit a Gauss-Hermite expansion to an arbitrary profile. # The SciPy least squares method is used. # # Copyright (c) 2013 RadiaBeam Technologies. All rights reserved # # python imports import math # SciPy imports import numpy as np import matplotlib.p...
apache-2.0
pauliacomi/pyGAPS
src/pygaps/parsing/json.py
1
8713
""" Parse to and from a JSON string/file format for isotherms. The _parser_version variable documents any changes to the format, and is used to check for any deprecations. """ import json import warnings import pandas from pygaps.core.baseisotherm import BaseIsotherm from pygaps.core.modelisotherm import ModelIsot...
mit
airanmehr/bio
Scripts/TimeSeriesPaper/RealData/Friday.py
1
16916
''' Copyleft Jan 27, 2017 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com ''' import numpy as np; np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; pd.options.display.max_rows = 40; pd.options.display.expand_frame_repr = False import pylab as plt; imp...
mit
brianquinlan/learn-tensorflow
learning1/learn.py
1
1334
import pandas import numpy from IPython import display import tensorflow from tensorflow.contrib import learn import numpy def get_features(dataframe): return dataframe[['a', 'b', 'c']] def get_targets(dataframe): return dataframe[['d']] data = pandas.read_csv(open('linear.csv'), sep=',').astype(numpy.float3...
mit
classicboyir/BuildingMachineLearningSystemsWithPython
ch07/figure1_2.py
22
1848
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import numpy as np from sklearn.datasets import load_boston from sklearn.linear_model import LinearRegr...
mit
saiwing-yeung/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
55
4761
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivari...
bsd-3-clause
mkness/TheCannon
code/makeplot_coeff_general.py
1
2724
#!/usr/bin/python import numpy from numpy import savetxt import matplotlib from matplotlib import pyplot import scipy from scipy import interpolate from matplotlib.ticker import MultipleLocator, FormatStrFormatter s = matplotlib.font_manager.FontProperties() s.set_family('serif') s.set_size(14) from matplotlib import r...
mit
andrescodas/casadi
docs/examples/python/direct_single_shooting.py
2
3248
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
lgpl-3.0
shakamunyi/tensorflow
tensorflow/contrib/learn/python/learn/tests/test_custom_decay.py
7
2270
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
jat255/hyperspy
hyperspy/drawing/_markers/rectangle.py
4
3742
# -*- coding: utf-8 -*- # Copyright 2007-2020 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
oxpeter/small_fry
concordance.py
1
13262
#!/usr/bin/env python """ This program is a simulation of gene expression studies performed in four different ant species, in order to determine the likelihood of achieving given congruence between studies by chance. The starting point is the Cerapachys biroi, Acromyrmex echinatior, Solenopsis invicta and Dinoponera qu...
gpl-2.0
khancyr/ardupilot
Tools/mavproxy_modules/lib/magcal_graph_ui.py
108
8248
# Copyright (C) 2016 Intel Corporation. All rights reserved. # # This file 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 later version. # # This fi...
gpl-3.0
assad2012/ggplot
ggplot/tests/test_stat_summary.py
12
1028
from __future__ import (absolute_import, division, print_function, unicode_literals) from ggplot.tests import image_comparison from ggplot import * import numpy as np import pandas as pd @image_comparison(baseline_images=['default']) def test_stat_summary_default(): print(ggplot(aes(x='...
bsd-2-clause
PatrickOReilly/scikit-learn
examples/svm/plot_svm_regression.py
120
1520
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
lvniqi/tianchi_power
code/preprocess.py
1
32964
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat May 13 17:36:18 2017 @author: boweiy """ from sklearn.model_selection import train_test_split import pandas as pd import numpy as np import os import xgboost as xgb from multiprocessing import Pool as m_Pool from sklearn import preprocessing from sklea...
mit
XueqingLin/tensorflow
tensorflow/contrib/learn/python/learn/estimators/rnn.py
4
10267
# 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
anurag313/scikit-learn
sklearn/datasets/tests/test_samples_generator.py
181
15664
from __future__ import division from collections import defaultdict from functools import partial import numpy as np import scipy.sparse as sp from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing imp...
bsd-3-clause
syl20bnr/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/projections/polar.py
69
20981
import math import numpy as npy import matplotlib rcParams = matplotlib.rcParams from matplotlib.artist import kwdocd from matplotlib.axes import Axes from matplotlib import cbook from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker import Formatter, Locator from matplotlib.tr...
gpl-3.0
ProkopHapala/SimpleSimulationEngine
python/pyMolecular/test_CLCFGO.py
1
26748
import os import sys import numpy as np #sys.path.append("../") sys.path.append('../') from pyMeta import cpp_utils cpp_utils.clean_build = False # Recompile only if changed #import eFF import CLCFGO as effmc import eFF_terms as effpy # ========== Globals iNorm = -1 bDebug = 0 natom=0; norb=2; perOrb=1; nqOr...
mit
MDAnalysis/mdanalysis
package/MDAnalysis/analysis/encore/clustering/__init__.py
1
1447
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
gpl-2.0
barney-NG/pyCAMTracker
src/filterpy/kalman/tests/test_kf.py
1
13439
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mor...
mit
rsignell-usgs/notebook
WCS/WCS_sciencebase_test.py
1
2121
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Extract data from USGS ScienceBase # <codecell> %matplotlib inline # <codecell> from owslib.wcs import WebCoverageService import numpy as np import numpy.ma as ma endpoint='https://www.sciencebase.gov/catalogMaps/mapping/ows/5638cf1fe4b0...
mit
NunoEdgarGub1/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
matteobachetti/srt-single-dish-tools
srttools/scan.py
1
35441
"""Scan class.""" from __future__ import (absolute_import, division, print_function) from .io import read_data, root_name, get_chan_columns, get_channel_feed from .io import mkdir_p import glob from .read_config import read_config, get_config_file from .fit import ref_mad, contiguous_regions im...
bsd-3-clause
DistrictDataLabs/yellowbrick
yellowbrick/style/utils.py
1
2199
# yellowbrick.style.utils # Utility functions for styles # # Author: Neal Humphrey # Created: Wed Mar 22 12:39:35 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LICENSE.txt # # ID: utils.py [45268fc] humphrey.neal@gmail.com $ """ Utility functions for styles """ #########...
apache-2.0
henry-ngo/VIP
vip_hci/stats/utils_stats.py
1
1208
#! /usr/bin/env python """ Various stat functions. """ from __future__ import division, print_function __author__ = 'C. Gomez @ ULg' __all__ = ['descriptive_stats'] import numpy as np from matplotlib.pyplot import boxplot def descriptive_stats(array, verbose=True, label='', mean=False, plot=False): """ Simple...
mit
behrtam/wine-quality-prediction
naive-red.py
1
1207
from sklearn.naive_bayes import GaussianNB from sklearn.naive_bayes import MultinomialNB from sklearn.naive_bayes import BernoulliNB from sklearn.cross_validation import train_test_split from sklearn.metrics import mean_squared_error from sklearn.metrics import classification_report from sklearn.metrics import confusio...
mit
nicholasmalaya/arcanus
exp/press_trans/code/read_incline_error.py
2
2212
#!/bin/py # # open file # read contents # (re)start when third column found # import sys # # open and read file # path="../data/statistics_incl.lvm" file = open(path, "r+") # # data objects # set_names = [] voltage = [] std = [] height = [] voltage2 = [] std2 = [] height2 = [] for line in file: ...
mit
ThomasHSmith/PhosphoProTools
src/phosphoprotools/piscoreanalysis.py
1
10612
# Filename: piscoreanalysis.py # Author: Thomas H. Smith 2017 """ Small collection of functions used for statistical analysis of phosphoproteomics datasets with row-wise intensity values with at least two replicates from each experimental condition """ from scipy import stats from numpy import var, mean, log2, log10, ...
mit
sellberg/SACLA2016A8015
scripts/04_ADUs_mean_hist.py
2
1706
#!/home/doniach/dermen/epd731/bin/python import numpy as np import h5py import matplotlib import matplotlib.pyplot as plt import argparse import time import pandas as pd # -- default parameters run = 448539 file_folder = '/UserData/fperakis/2016_6/01_test/' # -- files and folders file_name = '%d.h5'%(run) file_path...
bsd-2-clause
tbarchyn/flow_ninja
flow_ninja_utilities.py
1
2227
# FLOW NINJA # Copyright 2016-2017 Thomas E. Barchyn # 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 limitation the rights to use, copy, modify, merge,...
mit
vinodkc/spark
python/pyspark/pandas/tests/indexes/test_base.py
14
97964
# # 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
pratapvardhan/scikit-learn
examples/model_selection/plot_underfitting_overfitting.py
53
2668
""" ============================ Underfitting vs. Overfitting ============================ This example demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions. The plot shows the function that we want to approximate, wh...
bsd-3-clause
willettk/rgz-analysis
python/rgz_sdss_gz.py
2
4629
import numpy as np from matplotlib import pyplot as plt from astropy.io import ascii from astropy.io import fits from scipy import stats from astropy.io.votable import parse_single_table from astropy.cosmology import WMAP9 rgzdir = '/Users/willettk/Astronomy/Research/GalaxyZoo/rgz-analysis' def votable_read(fname): ...
mit
ZENGXH/scikit-learn
examples/cluster/plot_agglomerative_clustering_metrics.py
402
4492
""" Agglomerative clustering with different metrics =============================================== Demonstrates the effect of different metrics on the hierarchical clustering. The example is engineered to show the effect of the choice of different metrics. It is applied to waveforms, which can be seen as high-dimens...
bsd-3-clause
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sklearn/linear_model/setup.py
83
1719
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 config = Configuration('linear_model', parent_package, top_path) cblas_libs, blas_info = get_blas_info...
mit
mehdidc/scikit-learn
sklearn/tests/test_cross_validation.py
3
45125
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn...
bsd-3-clause
LilyFG/LilyFG.github.io
markdown_generator/publications.py
197
3887
# coding: utf-8 # # Publications markdown generator for academicpages # # Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_g...
mit
gfyoung/pandas
pandas/tests/frame/methods/test_to_records.py
6
14349
from collections import abc import numpy as np import pytest from pandas import ( CategoricalDtype, DataFrame, MultiIndex, Series, Timestamp, date_range, ) import pandas._testing as tm class TestDataFrameToRecords: def test_to_records_timeseries(self): index = date_range("1/1/200...
bsd-3-clause
kashif/scikit-learn
sklearn/metrics/cluster/tests/test_unsupervised.py
26
3305
import numpy as np from scipy.sparse import csr_matrix from sklearn import datasets from sklearn.metrics.cluster.unsupervised import silhouette_score from sklearn.metrics import pairwise_distances from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_almost_equal from sklearn.utils.te...
bsd-3-clause
vibhorag/scikit-learn
sklearn/ensemble/tests/test_base.py
284
1328
""" Testing for the base module (sklearn.ensemble.base). """ # Authors: Gilles Louppe # License: BSD 3 clause from numpy.testing import assert_equal from nose.tools import assert_true from sklearn.utils.testing import assert_raise_message from sklearn.datasets import load_iris from sklearn.ensemble import BaggingCla...
bsd-3-clause
cactusbin/nyt
matplotlib/lib/matplotlib/rcsetup.py
4
31862
""" 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, ...
unlicense
wavelets/deepnet
deepnet/visualize.py
10
5738
import numpy as np import cPickle as pickle import matplotlib.pyplot as plt plt.ion() fig_id = 0 def GetFigId(): globals()['fig_id'] += 1 return globals()['fig_id'] - 1 def show_model_state(model, step): for i, node in enumerate(model.node_list): dims = int(np.floor(np.sqrt(node.state.shape[0]))) displa...
bsd-3-clause
jswoboda/GeoDataPython
GeoData/utilityfuncs.py
1
25206
#!/usr/bin/env python """ Note: "cartesian" column order is x,y,z in the Nx3 matrix This module holds a number of functions that can be used to read data into GeoData objects. All of the function s have the following outputs (data,coordnames,dataloc,sensorloc,times) Outputs data - A dictionary with keys that are t...
mit
hlin117/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
lin-credible/scikit-learn
sklearn/linear_model/tests/test_coordinate_descent.py
40
23697
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
bsd-3-clause
zfrenchee/pandas
pandas/tests/series/test_timeseries.py
1
32356
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytest import numpy as np from datetime import datetime, timedelta, time import pandas as pd import pandas.util.testing as tm import pandas.util._test_decorators as td from pandas._libs.tslib import iNaT from pandas.compat import lrange, StringIO, product from ...
bsd-3-clause
jmschrei/scikit-learn
examples/linear_model/plot_robust_fit.py
26
2701
""" Robust linear estimator fitting =============================== Here a sine function is fit with a polynomial of order 3, for values close to zero. Robust fitting is demoed in different situations: - No measurement errors, only modelling errors (fitting a sine with a polynomial) - Measurement errors in X - M...
bsd-3-clause
mxjl620/scikit-learn
examples/cluster/plot_kmeans_digits.py
230
4524
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example we compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the gr...
bsd-3-clause
JasonKessler/scattertext
scattertext/test/test_word2VecFromParsedCorpus.py
1
1889
from unittest import TestCase import pandas as pd from scattertext.CorpusFromParsedDocuments import CorpusFromParsedDocuments from scattertext.WhitespaceNLP import whitespace_nlp from scattertext.representations.Word2VecFromParsedCorpus import Word2VecFromParsedCorpus, \ Word2VecFromParsedCorpusBigrams from scattert...
apache-2.0
Jay-Oh-eN/topmodel
web/views/pages.py
1
2302
from flask import render_template, g, request, redirect from topmodel import plots from topmodel.hmetrics import auc from web import app import matplotlib.pyplot as plt @app.route("/") def home(): model_paths = sorted(g.model_data_manager.models.keys()) return render_template("index.html", model_paths=model...
mit
fredhusser/scikit-learn
examples/calibration/plot_calibration.py
225
4795
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
bsd-3-clause
jeremymchacon/colony_counter
cc_n.py
1
9065
#! /usr/bin/Rscript # -*- coding: utf-8 -*- """ Created on Wed Aug 3 21:09:17 2016 @author: Jeremy """ import sys import numpy as np import matplotlib.pyplot as plt import skimage from skimage import io from skimage import filters from skimage import feature from skimage import segmentation import sklearn from skl...
mit
rytaft/h-store
scripts/anticache/plotter.py
9
2968
#!/usr/bin/env python import os import sys import csv import logging import matplotlib.pyplot as plot import pylab OPT_GRAPH_WIDTH = 1200 OPT_GRAPH_HEIGHT = 600 OPT_GRAPH_DPI = 100 ## ============================================== ## main ## ============================================== if __name__ == '__main__': ...
gpl-3.0
jorik041/scikit-learn
sklearn/linear_model/least_angle.py
42
49357
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
bsd-3-clause
milapour/palm
palm/state_collection.py
2
4073
import pandas class StateCollectionFactory(object): """ Factory class that builds a StateCollection. Attributes ---------- state_list : list The states in the model. state_id_list : list The identifier strings for each state. """ def __init__(self): super(StateC...
bsd-2-clause
rolando/ClickSecurity-data_hacking
data_hacking/simple_stats/simple_stats.py
6
7475
# Contingency Table, Two-way table, Joint Distribution, G-Scores # Going off the reservation here, just couldn't find the right functionality elsewhere # References: http://en.wikipedia.org/wiki/Contingency_table # http://en.wikipedia.org/wiki/G_test (Wikipedia) # http://udel.edu/~mcdonald/stath...
mit
yandex/rep
rep/estimators/interface.py
1
8670
""" **REP** wrappers are derived from :class:`Classifier` and :class:`Regressor` depending on the problem of interest. Below you can see the standard methods available in the wrappers. """ from __future__ import division, print_function, absolute_import from abc import ABCMeta, abstractmethod import numpy import pan...
apache-2.0
USCDataScience/NN-fileTypeDetection
classifiers/supportVectorMachine.py
1
2438
# # 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
softsr/paparazzi
sw/airborne/test/ahrs/ahrs_utils.py
15
5172
#! /usr/bin/env python # $Id$ # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # an...
gpl-2.0
olologin/scikit-learn
examples/preprocessing/plot_function_transformer.py
158
1993
""" ========================================================= 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
loli/semisupervisedforests
examples/text/hashing_vs_dict_vectorizer.py
284
3265
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
TimoRoth/oggm
benchmarks/track_model_results.py
2
10718
import os import numpy as np import oggm import geopandas as gpd import xarray as xr from oggm import tasks from oggm import cfg, utils, workflow from oggm.utils import get_demo_file from oggm.tests.funcs import get_test_dir from oggm.core import climate, massbalance from oggm.workflow import execute_entity_task from ...
bsd-3-clause
pianomania/scikit-learn
examples/applications/plot_tomography_l1_reconstruction.py
23
5460
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
bsd-3-clause
aewhatley/scikit-learn
examples/tree/plot_tree_regression_multioutput.py
206
1800
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
bsd-3-clause
kgullikson88/LasCampanas-MIKE
ConvertToExtensions.py
1
2043
import FittingUtilities from astropy.io import fits as pyfits import sys import os import numpy import matplotlib.pyplot as plt import HelperFunctions left_trim = 8 right_trim = 0 bad_regions = {} if __name__ == "__main__": fileList = [] for arg in sys.argv[1:]: fileList.append(arg) for fname in fileL...
gpl-3.0
nguyentu1602/statsmodels
statsmodels/genmod/tests/test_gee.py
19
55589
""" Test functions for GEE External comparisons are to R and Stata. The statmodels GEE implementation should generally agree with the R GEE implementation for the independence and exchangeable correlation structures. For other correlation structures, the details of the correlation estimation differ among implementat...
bsd-3-clause
akrherz/iem
htdocs/json/sbw_by_point.py
1
5353
""" Get storm based warnings by lat lon point, optionally a time """ import sys from io import BytesIO, StringIO import json import datetime import numpy as np from paste.request import parse_formvars from pyiem.util import get_dbconn, utc from pyiem.nws.vtec import VTEC_PHENOMENA, VTEC_SIGNIFICANCE, get_ps_string fro...
mit
FRESNA/PyPSA
test/test_opf_storage.py
1
1107
import pypsa import pandas as pd import sys import os from numpy.testing import assert_array_almost_equal as equal solvers = ['glpk'] if sys.platform == 'win32' else ['cbc', 'glpk'] def test_opf(): csv_folder_name = os.path.join(os.path.dirname(__file__), "..", "examples", "o...
gpl-3.0
TakayukiSakai/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py
1
3793
# Copyright 2015 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
BhallaLab/moose-examples
tutorials/ChemicalOscillators/relaxationOsc.py
4
3265
######################################################################### ## This program is part of 'MOOSE', the ## Messaging Object Oriented Simulation Environment. ## Copyright (C) 2014 Upinder S. Bhalla. and NCBS ## It is made available under the terms of the ## GNU Lesser General Public License version 2...
gpl-2.0
solin319/incubator-mxnet
example/speech_recognition/stt_utils.py
44
5892
# 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 u...
apache-2.0
lsolanka/simtools
simtools/plotting/figsavers.py
3
2426
'''Automatic figure savers.''' from __future__ import absolute_import, print_function, division from matplotlib.backends.backend_pdf import PdfPages class MultiFigureSaver(object): '''Matplotlib figure saver that processes several images. This is an abstract class that defines basic functionality. Use some ...
gpl-2.0
WGierke/git_better
app/main.py
1
6434
from __future__ import division def warn(*args, **kwargs): pass import warnings warnings.warn = warn import argparse import os import pandas as pd import sys from tqdm import tqdm from classifier import get_text_pipeline, get_voting_classifier, DescriptionClassifier, ReadmeClassifier, NumericEnsembleClassifier, nor...
apache-2.0
bzero/arctic
arctic/scripts/arctic_copy_data.py
4
4999
import argparse import os import logging from multiprocessing import Pool import pwd from arctic.decorators import _get_host from arctic.store.audit import ArcticTransaction from ..hosts import get_arctic_lib from ..date import DateRange, to_pandas_closed_closed, CLOSED_OPEN, OPEN_CLOSED, mktz from .utils import setu...
lgpl-2.1
openthings/zeppelin
interpreter/lib/python/backend_zinline.py
61
11831
# 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 use ...
apache-2.0
shakamunyi/tensorflow
tensorflow/contrib/learn/__init__.py
42
2596
# 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
vespero89/Snoring_Challenge
Supervectors/gridsearch_ivec.py
1
6323
import sys sys.path.append('..') import numpy as np from sklearn.svm import SVC import sklearn.preprocessing as preprocessing from sklearn.metrics import recall_score, accuracy_score, confusion_matrix, classification_report import os import sys import utils.dataset_manupulation as dm import utils.utils as utl import w...
gpl-3.0
mattgiguere/scikit-learn
sklearn/mixture/gmm.py
7
31031
""" 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
jseabold/scikit-learn
sklearn/grid_search.py
6
38441
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
PhE/dask
dask/dataframe/tests/test_optimize_dataframe.py
3
2007
import pytest from operator import getitem from toolz import valmap, merge from dask.dataframe.optimize import dataframe_from_ctable import dask.dataframe as dd import pandas as pd dsk = {('x', 0): pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=[0, 1, 3]), ('x', 1): pd.DataFr...
bsd-3-clause
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/pydocstyle/src/tests/test_cases/canonical_numpy_examples.py
3
5315
"""This is the docstring for the example.py module. Modules names should have short, all-lowercase names. The module name may have underscores if this improves readability. Every module should have a docstring at the very top of the file. The module's docstring may extend over multiple lines. If your docstring doe...
mit
rohanp/scikit-learn
examples/decomposition/plot_ica_vs_pca.py
306
3329
""" ========================== FastICA on 2D point clouds ========================== This example illustrates visually in the feature space a comparison by results using two different component analysis techniques. :ref:`ICA` vs :ref:`PCA`. Representing ICA in the feature space gives the view of 'geometric ICA': ICA...
bsd-3-clause
pcm17/tensorflow
tensorflow/examples/learn/boston.py
11
1978
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
kejbaly2/metrique
metrique/reporting.py
1
3359
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Author: "Juraj Niznan" <jniznan@redhat.com> # Author: "Chris Ward <cward@redhat.com> ''' metrique.reporting ~~~~~~~~~~~~~~~~~~ This module contains a basic reporting class for quickly generating textual reports. ''' ...
gpl-3.0
RPGOne/scikit-learn
sklearn/neural_network/rbm.py
46
12291
"""Restricted Boltzmann Machine """ # Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca> # Vlad Niculae # Gabriel Synnaeve # Lars Buitinck # License: BSD 3 clause import time import numpy as np import scipy.sparse as sp from ..base import BaseEstimator from ..base import TransformerMixi...
bsd-3-clause
untom/scikit-learn
examples/applications/plot_species_distribution_modeling.py
254
7434
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
widdowquinn/pyani
tests/test_anim.py
1
7630
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) The James Hutton Institute 2017-2019 # (c) University of Strathclyde 2019-2021 # Author: Leighton Pritchard # # Contact: # leighton.pritchard@strath.ac.uk # # Leighton Pritchard, # Strathclyde Institute for Pharmacy and Biomedical Sciences, # 161 Cathedral Street, # G...
mit
ndingwall/scikit-learn
examples/datasets/plot_random_multilabel_dataset.py
23
3379
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the :func:`~sklearn.datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are dif...
bsd-3-clause
AZMAG/urbansim
urbansim/utils/yamlio.py
3
6649
""" Utilities for doing IO to YAML files. """ try: from itertools import izip as zip except ImportError: pass import os import sys import numpy as np import yaml from collections import OrderedDict if sys.version_info[0] < 3: def __represent_long(dumper, data): """ Strips away extraneou...
bsd-3-clause
jrderuiter/ngs-tk
ngs_tk/cnv/resample.py
1
1837
from __future__ import (absolute_import, division, print_function, unicode_literals) # noinspection PyUnresolvedReferences from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip...
gpl-2.0
fredhusser/scikit-learn
sklearn/linear_model/tests/test_passive_aggressive.py
169
8809
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_rais...
bsd-3-clause
rmhyman/DataScience
Lesson4/lineplot_compare_with_ggplot.py
1
1282
import pandas from ggplot import * def lineplot_compare(hr_by_team_year_sf_la_csv): # Write a function, lineplot_compare, that will read a csv file # called hr_by_team_year_sf_la.csv and plot it using pandas and ggplot. # # This csv file has three columns: yearID, HR, and teamID. The data ...
mit