repo_name
stringlengths
7
84
path
stringlengths
5
184
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
978
477k
license
stringclasses
15 values
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/python/estimator/inputs/queues/feeding_functions.py
46
15782
# 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
ddf-project/DDF
python/ddf/util.py
3
5533
from __future__ import unicode_literals import numpy as np import json import pandas as pd from py4j import java_collections """ Mapping from DDF types to python types """ TYPE_MAPPING = {'integer': int, 'int': int, 'tinyint': int, 'smallint': int, 'big...
apache-2.0
Ledoux/ShareYourSystem
Pythonlogy/ShareYourSystem/Specials/Predicters/Predicter/draft/__init__ copy 2.py
4
6766
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> """ #<DefineAugmentation> import ShareYourSystem as SYS import types BaseModuleStr="ShareYourSystem.Standards.Controllers.Systemer" DecorationModuleStr="ShareYourSystem.Standards.Classors.Clas...
mit
luxinator/Pore-Network-Generator
tools/pb_size_gen.py
1
1053
#!/usr/bin/python ''' * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. ''' __author__ = 'Lucas van Oosterhout' import matplotlib.pyplot as plt import numpy as np mu, sigma = np.log...
gpl-2.0
LiaoPan/scikit-learn
sklearn/svm/tests/test_bounds.py
280
2541
import nose from nose.tools import assert_equal, assert_true from sklearn.utils.testing import clean_warning_registry import warnings import numpy as np from scipy import sparse as sp from sklearn.svm.bounds import l1_min_c from sklearn.svm import LinearSVC from sklearn.linear_model.logistic import LogisticRegression...
bsd-3-clause
wrobstory/seaborn
seaborn/categorical.py
19
102299
from __future__ import division from textwrap import dedent import colorsys import numpy as np from scipy import stats import pandas as pd from pandas.core.series import remove_na import matplotlib as mpl import matplotlib.pyplot as plt import warnings from .external.six import string_types from .external.six.moves im...
bsd-3-clause
jmetzen/scikit-learn
examples/preprocessing/plot_robust_scaling.py
85
2698
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Robust Scaling on Toy Data ========================================================= Making sure that each Feature has approximately the same scale can be a crucial preprocessing step. However, when data contains o...
bsd-3-clause
themrmax/scikit-learn
sklearn/linear_model/tests/test_least_angle.py
27
25397
import numpy as np from scipy import linalg from sklearn.model_selection import train_test_split from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.test...
bsd-3-clause
CVML/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/pandas/tests/dtypes/test_common.py
3
19448
# -*- coding: utf-8 -*- import pytest import numpy as np import pandas as pd from pandas.core.dtypes.dtypes import (DatetimeTZDtype, PeriodDtype, CategoricalDtype, IntervalDtype) import pandas.core.dtypes.common as com import pandas.util.testing as tm class TestPandasDtype(ob...
mit
gajduk/network-inference-from-short-time-series-gajduk
src/methods/symbolic.py
1
1549
from itertools import permutations from numpy import argsort, matrix, zeros from sklearn.metrics import normalized_mutual_info_score def one_pair_at_a_time_symbol(method): def inner(instance): x = matrix(instance.x) n_nodes, n_time_points = x.shape if n_time_points > 12: delta = 6 else: delta = int(n_...
mit
bykoianko/omim
tools/python/booking_hotels_quality.py
20
2632
#!/usr/bin/env python # coding: utf8 from __future__ import print_function from collections import namedtuple, defaultdict from datetime import datetime from sklearn import metrics import argparse import base64 import json import logging import matplotlib.pyplot as plt import os import pickle import time import urllib...
apache-2.0
pratapvardhan/pandas
pandas/tests/tseries/offsets/test_offsets.py
1
130943
from distutils.version import LooseVersion from datetime import date, datetime, timedelta import pytest from pandas.compat import range from pandas import compat import numpy as np from pandas.compat.numpy import np_datetime64_compat from pandas.core.series import Series from pandas._libs.tslibs import conversion f...
bsd-3-clause
ebernhardson/l2r
code/data_augment_es_docs.py
1
1880
import pandas as pd import requests import grequests import json import progressbar import config from utils import np_utils, table_utils def exception_handler(req, e): raise e def main(): # returns an ndarray page_ids = table_utils._read(config.CLICK_DATA)['hit_page_id'].unique() url = config.ES_U...
mit
gdementen/larray
larray/inout/hdf.py
2
6860
from __future__ import absolute_import, print_function import warnings import numpy as np from pandas import HDFStore from larray.core.array import Array from larray.core.axis import Axis from larray.core.constants import nan from larray.core.group import Group, LGroup, _translate_group_key_hdf from larray.core.meta...
gpl-3.0
EPFL-LCSB/pytfa
pytfa/analysis/manipulation.py
1
2376
from ..core.model import Solution import pandas as pd def apply_reaction_variability(tmodel, va, inplace = True): """ Applies the VA results as bounds for the reactions of a cobra_model :param inplace: :param tmodel: :param va: :return: """ if inplace: _tmodel = tmodel else:...
apache-2.0
jtwhite79/pyemu
pyemu/pst/pst_controldata.py
1
18195
"""This module contains several class definitions for obseure parts of the PEST control file: `ControlData` ('* control data'), `RegData` ('* regularization') and `SvdData` ('* singular value decomposition'). These classes are automatically created and appended to `Pst` instances; users shouldn't need to deal with the...
bsd-3-clause
zuku1985/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
73
1232
""" ========================== 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
tulip-control/tulip-control
examples/developer/fuel_tank/continuous_switched_test.py
1
2637
"""test hybrid construction""" from __future__ import print_function import logging logging.basicConfig(level=logging.INFO) import time import numpy as np import matplotlib as mpl mpl.use('Agg') from tulip import abstract, hybrid from polytope import box2poly input_bound = 0.4 uncertainty = 0.05 cont_state_space ...
bsd-3-clause
qifeigit/scikit-learn
doc/sphinxext/gen_rst.py
142
40026
""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from __future__ import division, print_function from time import time import ast import os import re import shutil import traceback i...
bsd-3-clause
cfei18/incubator-airflow
setup.py
1
11546
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
wazeerzulfikar/scikit-learn
examples/linear_model/plot_logistic_path.py
37
1195
#!/usr/bin/env python """ ================================= Path with L1- Logistic Regression ================================= Computes path on IRIS dataset. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from datetime import datetime import numpy as np import...
bsd-3-clause
mayblue9/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
140
6926
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestCl...
bsd-3-clause
DonBeo/statsmodels
statsmodels/nonparametric/_kernel_base.py
29
18238
""" Module containing the base object for multivariate kernel density and regression, plus some utilities. """ from statsmodels.compat.python import range, string_types import copy import numpy as np from scipy import optimize from scipy.stats.mstats import mquantiles try: import joblib has_joblib = True exce...
bsd-3-clause
ominux/scikit-learn
sklearn/neighbors/graph.py
14
2839
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD, (C) INRIA, University of Amsterdam from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def kneighbors_graph(X, n_neighbors, mode='connectivity'): "...
bsd-3-clause
trungnt13/scikit-learn
sklearn/linear_model/__init__.py
270
3096
""" The :mod:`sklearn.linear_model` module implements generalized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. It also implements Stochastic Gradient Descent related algorithms. """ # See http://scikit-le...
bsd-3-clause
architecture-building-systems/CEAforArcGIS
cea/technologies/heat_exchangers.py
2
6169
""" heat exchangers """ from math import log, ceil import pandas as pd import numpy as np from cea.constants import HEAT_CAPACITY_OF_WATER_JPERKGK from cea.technologies.constants import MAX_NODE_FLOW from cea.analysis.costs.equations import calc_capex_annualized, calc_opex_annualized __author__ = "Thuy-An Nguyen" ...
mit
vantares/trading-with-python
lib/bats.py
78
3458
#------------------------------------------------------------------------------- # Name: BATS # Purpose: get data from BATS exchange # # Author: jev # # Created: 17/08/2013 # Copyright: (c) Jev Kuznetsov 2013 # Licence: BSD #------------------------------------------------------------...
bsd-3-clause
idaks/PW-explorer
PW_explorer/Input_Parsers/Clingo_Parser/clingo_parser.py
1
6566
from antlr4 import * from .Antlr_Files.ClingoLexer import ClingoLexer from .Antlr_Files.ClingoParser import ClingoParser from .Antlr_Files.ClingoListener import ClingoListener from ...helper import isfloat, PossibleWorld, Relation import pandas as pd import numpy as np from antlr4.tree.Trees import Trees def rearrang...
apache-2.0
prheenan/Research
Personal/EventDetection/Docs/ToyGraphs/dna_tables/main_dna_sequences.py
1
2026
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt import sys def read_seq(input_file): with open(input_file) as f: # first line is comments ...
gpl-3.0
lweasel/piquant
test/test_classifiers.py
2
4224
import pandas as pd import piquant.classifiers as classifiers def _get_test_classifier( column_name="dummy", value_extractor=lambda x: x, grouped_stats=True, distribution_plot_range=None): return classifiers._Classifier( column_name, value_extractor, grouped_stats, distribution_plot_range)...
mit
xavierwu/scikit-learn
examples/exercises/plot_cv_diabetes.py
231
2527
""" =============================================== Cross-validation on diabetes Dataset Exercise =============================================== A tutorial exercise which uses cross-validation with linear models. This exercise is used in the :ref:`cv_estimators_tut` part of the :ref:`model_selection_tut` section of ...
bsd-3-clause
xapple/plumbing
testing/database/access_db/test_access_db.py
1
1153
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Typically you would run this file from a command line like this: ipython.exe -i -- /deploy/plumbing/tests/database/access_db/test_access_db.py """ # Built-in module # import inspect, os # Internal modules # from plumbing.databases.access_database import Access...
mit
felipemontefuscolo/bitme
common/quote.py
1
1314
from common import Symbol import pandas as pd class Quote: def __init__(self, symbol: Symbol, timestamp: pd.Timestamp = None, bid_size=None, bid_price=None, ask_size=None, ask_price=None): self.timestamp ...
mpl-2.0
ioam/param
tests/API1/testpandas.py
2
7360
""" Test Parameters based on pandas """ import unittest import os import param from . import API1TestCase try: import pandas except ImportError: if os.getenv('PARAM_TEST_PANDAS','0') == '1': raise ImportError("PARAM_TEST_PANDAS=1 but pandas not available.") else: raise unittest.SkipTest("p...
bsd-3-clause
Frankkkkk/arctic
arctic/serialization/numpy_arrays.py
1
6258
import logging import numpy as np import numpy.ma as ma import pandas as pd from bson import Binary, SON from .._compression import compress, decompress, compress_array from ._serializer import Serializer DATA = 'd' MASK = 'm' TYPE = 't' DTYPE = 'dt' COLUMNS = 'c' INDEX = 'i' METADATA = 'md' LENGTHS = 'ln' class ...
lgpl-2.1
CallaJun/hackprince
indico/skimage/io/manage_plugins.py
7
10329
"""Handle image reading, writing and plotting plugins. To improve performance, plugins are only loaded as needed. As a result, there can be multiple states for a given plugin: available: Defined in an *ini file located in `skimage.io._plugins`. See also `skimage.io.available_plugins`. partial definiti...
lgpl-3.0
bravelittlescientist/kdd-particle-physics-ml-fall13
src/nearest_neighbors.py
1
1162
#!/usr/bin/python2 # This is a NN classifier based on the scikit-learn documentation. # # http://scikit-learn.org/stable/modules/neighbors.html import sys from imputation import load_data from util import shuffle_split from metrics import suite from sklearn.neighbors import KNeighborsClassifier def train(Xtrain, Y...
gpl-2.0
PalmDr/XRD-Data-Analysis-Toolkit
Beta1.4/DataAnalysisClass.py
1
4047
__author__ = 'j' import os from tkinter import * from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from Builder import * from TreeView import * from ConvertCSV import * from SQ_Pilatus import * class DataAnalysis(): def __init__(self)...
apache-2.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/scipy/integrate/quadrature.py
20
28269
from __future__ import division, print_function, absolute_import import numpy as np import math import warnings # trapz is a public function for scipy.integrate, # even though it's actually a numpy function. from numpy import trapz from scipy.special import roots_legendre from scipy.special import gammaln from scipy....
mit
mne-tools/mne-tools.github.io
0.14/_downloads/plot_find_eog_artifacts.py
24
1228
""" ================== Find EOG artifacts ================== Locate peaks of EOG to spot blinks and general EOG artifacts. """ # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io from mn...
bsd-3-clause
kapteyn-astro/kapteyn
doc/source/EXAMPLES/kmpfit_voigt.py
1
4841
#!/usr/bin/env python #------------------------------------------------------------ # Script which demonstrates how to find the best-fit # parameters of a Voigt line-shape model # # Vog, 26 Mar 2012 #------------------------------------------------------------ import numpy from matplotlib.pyplot import figure, show, r...
bsd-3-clause
hfutsuchao/Python2.6
stocks/strategy_stock_tech_corr_bak_nonapart.py
1
14626
#coding:utf-8 from sqlalchemy import create_engine import pandas as pd import numpy as np from sqlalchemy.orm import sessionmaker import talib import matplotlib.pyplot as plt from sklearn import preprocessing from multiprocessing import Pool from multiprocessing.dummy import Pool as ThreadPool import time f...
gpl-2.0
kmike/scikit-learn
examples/covariance/plot_covariance_estimation.py
4
4992
""" ======================================================================= Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood ======================================================================= The usual estimator for covariance is the maximum likelihood estimator, :class:`sklearn.covariance.Em...
bsd-3-clause
evanbiederstedt/RRBSfun
trees/chrom_scripts/normal_chr20.py
1
25844
import glob import pandas as pd import numpy as np pd.set_option('display.max_columns', 50) # print all rows import os os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files") normalB = glob.glob("binary_position_RRBS_normal_B_cell*") mcell = glob.glob("binary_position_RRBS_NormalBCD19pCD27...
mit
UNR-AERIAL/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
85
8565
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises...
bsd-3-clause
btabibian/scikit-learn
sklearn/linear_model/tests/test_huber.py
54
7619
# Authors: Manoj Kumar mks542@nyu.edu # License: BSD 3 clause import numpy as np from scipy import optimize, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_a...
bsd-3-clause
kylerbrown/scikit-learn
examples/cluster/plot_cluster_iris.py
350
2593
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initializa...
bsd-3-clause
Erotemic/ibeis
ibeis/annots.py
1
17911
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import utool as ut import six import itertools as it from ibeis import _ibeis_object from ibeis.control.controller_inject import make_ibs_register_decorator (print, rrr, profile) = ut.inject2(__name__, '[annot]') ...
apache-2.0
janusnic/21v-python
unit_20/matplotlib/custom_cmap.py
2
5759
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap """ Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use: cdict = {'red': ...
mit
EmmaIshta/QUANTAXIS
QUANTAXIS/QASU/update_tdx.py
1
2553
import datetime from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_stock_day, QA_fetch_get_stock_min, QA_fetch_get_stock_transaction, QA_fetch_get_stock_xdxr) from QUANTAXIS.QAFetch.QATushare import QA_fetch_g...
mit
herilalaina/scikit-learn
sklearn/cluster/birch.py
18
23684
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
bsd-3-clause
xya/sms-tools
software/models_interface/dftModel_function.py
21
2413
# function to call the main analysis/synthesis functions in software/models/dftModel.py import numpy as np import matplotlib.pyplot as plt from scipy.signal import get_window import os, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) import utilFunctions as UF import dftMod...
agpl-3.0
MadsJensen/CAA
time_decoding_sensor-grad_ent.py
1
1847
import sys import mne from mne.decoding import GeneralizationAcrossTime from sklearn.externals import joblib from sklearn.linear_model import LogisticRegression from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from my_settings import (data_path, epochs_folder) import matplot...
bsd-3-clause
bert9bert/statsmodels
statsmodels/sandbox/distributions/examples/ex_mvelliptical.py
34
5169
# -*- coding: utf-8 -*- """examples for multivariate normal and t distributions Created on Fri Jun 03 16:00:26 2011 @author: josef for comparison I used R mvtnorm version 0.9-96 """ from __future__ import print_function import numpy as np import statsmodels.sandbox.distributions.mv_normal as mvd from numpy.testi...
bsd-3-clause
ndingwall/scikit-learn
sklearn/gaussian_process/tests/test_kernels.py
9
14133
"""Testing for kernels for Gaussian processes.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import pytest import numpy as np from inspect import signature from sklearn.gaussian_process.kernels import _approx_fprime from sklearn.metrics.pairwise \ import PAIRWISE_KERNEL_...
bsd-3-clause
jrdurrant/insect_analysis
vision/measurements/subspace_shape.py
1
4784
import numpy as np from skimage.transform import SimilarityTransform, estimate_transform, matrix_transform import matplotlib.pyplot as plt import scipy from skimage.filters import gaussian def plot_closest_points(image_points, edge_points, closest_edge_points): plt.plot(edge_points[:, 0], edge_points[:, 1], 'r+')...
gpl-2.0
h2educ/scikit-learn
examples/linear_model/plot_sgd_comparison.py
77
1820
""" ================================== Comparing various online solvers ================================== An example showing how different online solvers perform on the hand-written digits dataset. """ # Author: Rob Zinkov <rob at zinkov dot com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot a...
bsd-3-clause
PalNilsson/pilot2
pilot/user/atlas/setup.py
1
17850
#!/usr/bin/env python # 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 # # Authors: # - Paul Nilsson, paul.nilsson@cern.ch, 2017-2020 import os impo...
apache-2.0
frank-tancf/scikit-learn
examples/plot_digits_pipe.py
70
1813
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
hrjn/scikit-learn
sklearn/utils/graph.py
24
6326
""" Graph utilities and algorithms Graphs are represented with their adjacency matrices, preferably using sparse matrices. """ # Authors: Aric Hagberg <hagberg@lanl.gov> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Jake Vanderplas <vanderplas@astro.washington.edu> # License: BSD 3 clause impo...
bsd-3-clause
jasdumas/jasdumas.github.io
post_data/kmeans-cluster-poker-hands.py
1
7337
# load libraries from pandas import Series, DataFrame import pandas as pd import numpy as np import matplotlib.pylab as plt from sklearn.cross_validation import train_test_split from sklearn import preprocessing from sklearn.cluster import KMeans import urllib.request from pylab import rcParams rcParams['figure.figsize...
mit
winklerand/pandas
pandas/tests/io/msgpack/test_newspec.py
22
2650
# coding: utf-8 from pandas.io.msgpack import packb, unpackb, ExtType def test_str8(): header = b'\xd9' data = b'x' * 32 b = packb(data.decode(), use_bin_type=True) assert len(b) == len(data) + 2 assert b[0:2] == header + b'\x20' assert b[2:] == data assert unpackb(b) == data data = ...
bsd-3-clause
dingocuster/scikit-learn
examples/ensemble/plot_adaboost_multiclass.py
354
4124
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
bsd-3-clause
bzero/statsmodels
examples/python/regression_plots.py
33
9585
## Regression Plots from __future__ import print_function from statsmodels.compat import lzip import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import ols ### Duncan's Prestige Dataset #### Load the Data # We can use a utility function...
bsd-3-clause
cogmission/nupic.research
projects/vehicle-control/agent/run_q.py
12
5498
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
IndraVikas/scikit-learn
sklearn/linear_model/tests/test_base.py
120
10082
# 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
neale/CS-program
434-MachineLearning/final_project/linearClassifier/sklearn/linear_model/tests/test_logistic.py
24
39507
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.util...
unlicense
nsat/gnuradio
gr-digital/examples/berawgn.py
32
4886
#!/usr/bin/env python # # Copyright 2012,2013 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 optio...
gpl-3.0
hrjn/scikit-learn
sklearn/metrics/tests/test_common.py
19
43631
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer from sklearn.utils.multiclass import type_of_target fro...
bsd-3-clause
wdm0006/sklearn-extensions
examples/kernel_regression/example.py
1
1546
""" Example from: https://raw.githubusercontent.com/jmetzen/kernel_regression/master/plot_kernel_regression.py ======================================================================== Comparison of kernel regression (KR) and support vector regression (SVR) ==============================================================...
bsd-3-clause
srowen/spark
python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py
7
6774
# # 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
telefar/stockEye
coursera-compinvest1-master/coursera-compinvest1-master/homework/homework/homework5/HW5/hw5_bollinger.py
3
1321
## Computational Investing I ## HW 5 ## ## Author: alexcpsec import pandas as pd import pandas.stats.moments as pdsm import numpy as np import math import copy import QSTK.qstkutil.qsdateutil as du import datetime as dt import QSTK.qstkutil.DataAccess as da import QSTK.qstkutil.tsutil as tsu import QSTK.qstkstudy.Even...
bsd-3-clause
costypetrisor/scikit-learn
sklearn/utils/tests/test_utils.py
215
8100
import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from itertools import chain from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_equal, SkipTest, ...
bsd-3-clause
mfjb/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
CTJChen/ctc_astropylib
mlematch.py
1
23653
import pandas as pd from ctc_observ import * from ctc_arrays import * from scipy.interpolate import pchip from statsmodels.nonparametric.smoothers_lowess import lowess # load HSC catalog first # hsc = pd.read_csv('/cuc36/xxl/multiwavelength/HSC/wide.csv') def pdf_sep_gen(sep_arcsec, xposerr, opterr, pdf='Rayleigh'): ...
apache-2.0
swapnilgt/tablaPercPatternsISMIR
rlcs/run.py
2
14062
import os import sys from src import impl as rlcs import utils as ut import analysis as anls import matplotlib.pyplot as plt import logging import pickle as pkl import time config = ut.loadConfig('config') sylbSimFolder=config['sylbSimFolder'] transFolder=config['transFolder'] lblDir=config['lblDir'] onsDir=config['o...
agpl-3.0
PythonProgramming/Support-Vector-Machines---Basics-and-Fundamental-Investing-Project
p26.py
2
3329
# back testing import numpy as np import matplotlib.pyplot as plt from sklearn import svm, preprocessing import pandas as pd from matplotlib import style import statistics from collections import Counter style.use("ggplot") how_much_better = 5 FEATURES = [ 'DE Ratio', 'Trailing P/E', 'Price/Sales', 'Price/B...
mit
adykstra/mne-python
mne/viz/tests/test_epochs.py
1
8962
# 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> # Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: Simplified BSD import...
bsd-3-clause
devincornell/semanticanlysis
dictionary.py
1
5447
import spacy from .parallel import * import re import functools #from .topicmodel import TopicModel ''' This class parses data according to the MFD format. Available are the empath, mft and mft2.0 dictionaries. For further information about the format of the dictionary files, see Haidt et al.'s example: http://www.m...
mit
adykstra/mne-python
mne/channels/channels.py
1
52814
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Denis Engemann <denis.engemann@gmail.com> # Andrew Dykstra <andrew.r.dykstra@gmail.com> # Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) import os ...
bsd-3-clause
mfjb/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
bikong2/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
260
1219
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
wdurhamh/statsmodels
examples/python/tsa_dates.py
29
1169
## Dates in timeseries models from __future__ import print_function import statsmodels.api as sm import pandas as pd # ## Getting started data = sm.datasets.sunspots.load() # Right now an annual date series must be datetimes at the end of the year. dates = sm.tsa.datetools.dates_from_range('1700', length=len(da...
bsd-3-clause
plissonf/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
anntzer/scikit-learn
examples/gaussian_process/plot_gpc_xor.py
43
2170
""" ======================================================================== Illustration of Gaussian process classification (GPC) on the XOR dataset ======================================================================== This example illustrates GPC on XOR data. Compared are a stationary, isotropic kernel (RBF) and ...
bsd-3-clause
billy-inn/scikit-learn
sklearn/linear_model/tests/test_sparse_coordinate_descent.py
244
9986
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
ronfung/incubator-airflow
airflow/contrib/hooks/bigquery_hook.py
6
39980
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
rouseguy/scipy2015_tutorial
check_env.py
6
2002
problems = 0 try: import IPython print('IPython', IPython.__version__) assert(IPython.__version__ >= '3.0') except ImportError: print("IPython version 3 is not installed. Please install via pip or conda.") problems += 1 try: import numpy print('NumPy', numpy.__version__) assert(nu...
cc0-1.0
jkibele/OpticalRS
OpticalRS/Lyzenga2006.py
1
23015
# -*- coding: utf-8 -*- """ Lyzenga2006 =========== This module implements methods described in Lyzenga et al. 2006. The methods implemented so far are mostly the image preprocessing steps. This implementation is the work of the author of this code (Jared Kibele), not the authors of the original paper. I tried to get...
bsd-3-clause
saimn/astropy
docs/conf.py
2
12625
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # 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 file. # # All configurati...
bsd-3-clause
oesteban/dipy
dipy/tests/test_scripts.py
9
4292
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Test scripts Run scripts and check outputs """ from __future__ import division, print_function, absolute_import import os import shutil from os.path import (dirname, join as pjoin, abspath) from nos...
bsd-3-clause
steinnp/Big-Data-Final
Classification/bayes_most_informative.py
1
3013
import nltk import csv import matplotlib.pyplot as plt word_features = [] def get_words_in_tweets(tweets): all_words = [] for (words, sentiment) in tweets: all_words.extend(words) return all_words def get_word_features(wordlist): wordlist = nltk.FreqDist(wordlist) word_features = wordlist....
mit
justincassidy/scikit-learn
sklearn/metrics/cluster/__init__.py
312
1322
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
glenflet/ZtoRGBpy
ZtoRGBpy/_core.py
1
22787
# -*- coding: utf-8 -*- # ================================================================================= # Copyright 2019 Glen Fletcher <mail@glenfletcher.com> # # 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...
mit
silky/sms-tools
lectures/07-Sinusoidal-plus-residual-model/plots-code/LPC.py
24
1191
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, triang, blackmanharris, resample import math import sys, os, time from scipy.fftpack import fft, ifft import essentia.standard as ess sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../softwar...
agpl-3.0
witgo/spark
python/pyspark/sql/pandas/conversion.py
4
21163
# # 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
demis001/biopandas
tests/testbiopandas.py
2
4473
import mock from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord import unittest #from bioframes import bioframes as bf from bioframes import sequenceframes import sys import pandas as pd from pandas.util.testing import assert_series_equal, assert_frame_equal, assert_index_equal from numpy.testing import assert_...
gpl-2.0
raghavrv/scikit-learn
sklearn/tests/test_cross_validation.py
79
47914
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.exceptions import ConvergenceWarning from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
lsiemens/lsiemens.github.io
theory/fractional_calculus/code/generateanim2dfc.py
1
2823
import numpy import fc2dpy from scipy import special from matplotlib import pyplot from matplotlib.animation import FuncAnimation resolution = 64 # 256 order = 64 # 128 PD = fc2dpy.polydisk(0, 0, 1, 1, resolution=resolution) PD.set_parameterization(1.0 + 0.0j, 1.0 + 0.0j) def encoding(a): # return 1.0/fc2dpy.Gamm...
mit