repo_name
stringlengths
7
60
path
stringlengths
6
134
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.04k
149k
license
stringclasses
12 values
cemarchi/biosphere
Src/BioAnalyzer/Analysis/GenePrioritization/Steps/DataIntegration/IntermediateRepresentation/Transformers/MicroRnaToGeneTransformer.py
1
4546
import math import statistics from itertools import groupby from random import randint from typing import Dict, Tuple, Counter import pandas as pd from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DataIntegration.IntermediateRepresentation.Generators import \ IntermediateRepresentationGeneratorBase from Src....
bsd-3-clause
winklerand/pandas
pandas/tests/test_errors.py
9
1147
# -*- coding: utf-8 -*- import pytest from warnings import catch_warnings import pandas # noqa import pandas as pd @pytest.mark.parametrize( "exc", ['UnsupportedFunctionCall', 'UnsortedIndexError', 'OutOfBoundsDatetime', 'ParserError', 'PerformanceWarning', 'DtypeWarning', 'E...
bsd-3-clause
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/pandas/tests/frame/test_query_eval.py
11
42389
# -*- coding: utf-8 -*- from __future__ import print_function import operator import pytest from pandas.compat import (zip, range, lrange, StringIO) from pandas import DataFrame, Series, Index, MultiIndex, date_range import pandas as pd import numpy as np from numpy.random import randn from pandas.util.testing imp...
mit
JT5D/scikit-learn
examples/plot_multilabel.py
9
4299
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD 3 clause """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ...
bsd-3-clause
bgris/ODL_bgris
lib/python3.5/site-packages/odl/util/graphics.py
1
15419
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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. #...
gpl-3.0
DistrictDataLabs/django-data-product
irisfinder/views.py
1
1948
from django.shortcuts import render import datetime from models import Iris, SVMModels from forms import UserIrisData import sklearn from sklearn import svm from sklearn.cross_validation import train_test_split import numpy as np from django.conf import settings import cPickle import scipy from pytz import timezone imp...
apache-2.0
nvoron23/statsmodels
statsmodels/sandbox/examples/try_multiols.py
33
1243
# -*- coding: utf-8 -*- """ Created on Sun May 26 13:23:40 2013 Author: Josef Perktold, based on Enrico Giampieri's multiOLS """ #import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.sandbox.multilinear import multiOLS, multigroup data = sm.datasets.longley.load_pandas() df = data.e...
bsd-3-clause
ChanderG/scikit-learn
sklearn/manifold/tests/test_isomap.py
226
3941
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
nmayorov/scikit-learn
sklearn/linear_model/logistic.py
9
67760
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> im...
bsd-3-clause
google-research/google-research
smu/parser/smu_utils_lib_test.py
1
35529
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
fyffyt/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
cyliustack/sofa
bin/sofa_analyze.py
1
50661
import argparse import matplotlib matplotlib.use('agg') import csv import json import multiprocessing as mp import os import random import re import sys from functools import partial from operator import attrgetter, itemgetter import networkx as nx import numpy as np import pandas as pd import time from sofa_aisi impor...
apache-2.0
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/pandas/tseries/tests/test_frequencies.py
9
25284
from datetime import datetime, time, timedelta from pandas.compat import range import sys import os import nose import numpy as np from pandas import Index, DatetimeIndex, Timestamp, Series, date_range, period_range import pandas.tseries.frequencies as frequencies from pandas.tseries.tools import to_datetime impor...
apache-2.0
hanteng/babel
scripts/geoname_cldr.py
1
2479
#!/usr/bin/env python # -*- coding: utf-8 -*- #歧視無邊,回頭是岸。鍵起鍵落,情真情幻。 # url_target="https://raw.githubusercontent.com/datasets/country-codes/master/data/country-codes.csv" import csv import pandas as pd import codecs def export_to_csv(df, ex_filename, sep=','): if sep==',': df.to_csv(ex_filename, sep=sep, q...
bsd-3-clause
tuanvu216/udacity-course
intro_to_machine_learning/lesson/lesson_4_choose_your_own_algorithm/your_algorithm.py
1
2628
#!/usr/bin/python import matplotlib.pyplot as plt from prep_terrain_data import makeTerrainData from class_vis import prettyPicture from time import time features_train, labels_train, features_test, labels_test = makeTerrainData() ### the training data (features_train, labels_train) have both "fast" and "slow" point...
mit
NZRS/content-analysis
netflix.py
2
3126
from bs4 import BeautifulSoup from urllib2 import quote import unicodedata import requests import json import glob import pandas as pd movie_list = [] for page in glob.glob('*.html'): with open(page, 'r+') as f: my_page = f.read() my_soup = BeautifulSoup(my_page) for div in my_soup.find_al...
agpl-3.0
einarhuseby/arctic
tests/integration/test_arctic.py
4
6898
from datetime import datetime as dt, timedelta as dtd from mock import patch from pandas import DataFrame from pandas.util.testing import assert_frame_equal import pytest import time import numpy as np from arctic.arctic import Arctic, VERSION_STORE from arctic.exceptions import LibraryNotFoundException, QuotaExceeded...
lgpl-2.1
BlueBrain/NEST
testsuite/manualtests/cross_check_test_mip_corrdet.py
13
2594
# -*- coding: utf-8 -*- # # cross_check_test_mip_corrdet.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 o...
gpl-2.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_console_config.py
24
21691
# Configuration file for ipython-console. c = get_config() #------------------------------------------------------------------------------ # ZMQTerminalIPythonApp configuration #------------------------------------------------------------------------------ # ZMQTerminalIPythonApp will inherit config from: TerminalIP...
mit
ofgulban/scikit-image
doc/examples/filters/plot_rank_mean.py
7
1525
""" ============ Mean filters ============ This example compares the following mean filters of the rank filter package: * **local mean**: all pixels belonging to the structuring element to compute average gray level. * **percentile mean**: only use values between percentiles p0 and p1 (here 10% and 90%). * **bila...
bsd-3-clause
tienjunhsu/trading-with-python
lib/widgets.py
78
3012
# -*- coding: utf-8 -*- """ A collection of widgets for gui building Copyright: Jev Kuznetsov License: BSD """ from __future__ import division import sys from PyQt4.QtCore import * from PyQt4.QtGui import * import numpy as np from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Figur...
bsd-3-clause
igabriel85/dmon-adp
adpformater/adpformater.py
1
1615
import pandas as pd class DataFormatter(): def __init__(self, dataloc): self.dataloc = dataloc def aggJsonToCsv(self): return "CSV file" def expTimestamp(self): return "Expand metric timestamp" def window(self): return "Window metrics" def pivot(self): r...
apache-2.0
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/io/sql.py
7
58343
# -*- coding: utf-8 -*- """ Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from __future__ import print_function, division from datetime import datetime, date, time import warnings import re import numpy as np import pandas._libs.lib as ...
agpl-3.0
rboyes/KerasScripts
CSVTrainer.py
1
5321
import os import datetime import sys import time import string import random import pandas as pd import numpy as np import gc if(len(sys.argv) < 2): print('Usage: CSVTrainer.py train.csv validation.csv model.h5 log.txt') sys.exit(1) trainingName = sys.argv[1] validationName = sys.argv[2] modelName = sys....
apache-2.0
saimn/astropy
astropy/visualization/wcsaxes/frame.py
8
10649
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc from collections import OrderedDict import numpy as np from matplotlib import rcParams from matplotlib.lines import Line2D, Path from matplotlib.patches import PathPatch __all__ = ['RectangularFrame1D', 'Spine', 'BaseFrame', 'RectangularFr...
bsd-3-clause
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/pandas/io/json/table_schema.py
12
5184
""" Table Schema builders http://specs.frictionlessdata.io/json-table-schema/ """ from pandas.core.dtypes.common import ( is_integer_dtype, is_timedelta64_dtype, is_numeric_dtype, is_bool_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_categorical_dtype, is_period_dtype, is_string_dtype ) def as_js...
mit
ianatpn/nupictest
external/linux32/lib/python2.6/site-packages/matplotlib/pylab.py
70
10245
""" This is a procedural interface to the matplotlib object-oriented plotting library. The following plotting commands are provided; the majority have Matlab(TM) analogs and similar argument. _Plotting commands acorr - plot the autocorrelation function annotate - annotate something in the figure arrow ...
gpl-3.0
googleinterns/cabby
cabby/model/datasets.py
1
4391
# coding=utf-8 # Copyright 2020 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 ...
apache-2.0
georgid/sms-tools
lectures/7-Sinusoidal-plus-residual-model/plots-code/stochasticSynthesisFrame.py
2
2997
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 sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import utilFunction...
agpl-3.0
sriki18/scipy
scipy/signal/_max_len_seq.py
41
4942
# Author: Eric Larson # 2014 """Tools for MLS generation""" import numpy as np from ._max_len_seq_inner import _max_len_seq_inner __all__ = ['max_len_seq'] # These are definitions of linear shift register taps for use in max_len_seq() _mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1], ...
bsd-3-clause
zseder/hunmisc
hunmisc/utils/plotting/matplotlib_simple_xy.py
1
1535
""" Copyright 2011-13 Attila Zseder Email: zseder@gmail.com This file is part of hunmisc project url: https://github.com/zseder/hunmisc hunmisc is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either versi...
gpl-3.0
pap/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/fontconfig_pattern.py
72
6429
""" A module for parsing and generating fontconfig patterns. See the `fontconfig pattern specification <http://www.fontconfig.org/fontconfig-user.html>`_ for more information. """ # Author : Michael Droettboom <mdroe@stsci.edu> # License : matplotlib license (PSF compatible) # This class is defined here because it m...
agpl-3.0
appapantula/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
idlead/scikit-learn
examples/linear_model/plot_sgd_comparison.py
112
1819
""" ================================== 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
abhishekkrthakur/scikit-learn
examples/svm/plot_oneclass.py
249
2302
""" ========================================== One-class SVM with non-linear kernel (RBF) ========================================== An example using a one-class SVM for novelty detection. :ref:`One-class SVM <svm_outlier_detection>` is an unsupervised algorithm that learns a decision function for novelty detection: ...
bsd-3-clause
ati-ozgur/KDD99ReviewArticle
HelperCodes/create_table_JournalAndArticleCounts.py
1
1930
import ReviewHelper import pandas as pd df = ReviewHelper.get_pandas_data_frame_created_from_bibtex_file() #df_journal = df.groupby('journal')["ID"] dfJournalList = df.groupby(['journal'])['ID'].count().order(ascending=False) isOdd = (dfJournalList.size % 2 == 1) if (isOdd): table_row_length = dfJournalList.si...
mit
arthurmensch/modl
benchmarks/log.py
1
2179
import time import numpy as np from lightning.impl.primal_cd import CDClassifier from lightning.impl.sag import SAGAClassifier from sklearn.datasets import fetch_20newsgroups_vectorized from lightning.classification import SAGClassifier from sklearn.linear_model import LogisticRegression bunch = fetch_20newsgroups_v...
bsd-2-clause
hansonrobotics/chatbot
src/chatbot/stats.py
1
3618
import os import logging import pandas as pd import glob import re import datetime as dt from collections import Counter logger = logging.getLogger('hr.chatbot.stats') trace_pattern = re.compile( r'../(?P<fname>.*), (?P<tloc>\(.*\)), (?P<pname>.*), (?P<ploc>\(.*\))') def collect_history_data(history_dir, days): ...
mit
hdmetor/scikit-learn
sklearn/linear_model/ridge.py
89
39360
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
apaloczy/ap_tools
utils.py
1
54151
# Description: General-purpose functions for personal use. # Author: André Palóczy # E-mail: paloczy@gmail.com __all__ = ['seasonal_avg', 'seasonal_std', 'deseason', 'blkavg', 'blkavgdir', 'blkavgt', 'blkapply', 'stripmsk', ...
mit
camallen/aggregation
experimental/condor/animal_EM.py
2
7334
#!/usr/bin/env python __author__ = 'greghines' import numpy as np import os import pymongo import sys import cPickle as pickle import bisect import csv import matplotlib.pyplot as plt import random import math import urllib import matplotlib.cbook as cbook def index(a, x): 'Locate the leftmost value exactly equal...
apache-2.0
ominux/scikit-learn
examples/linear_model/plot_sgd_iris.py
4
2171
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print __doc__ i...
bsd-3-clause
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py
18
26105
""" An experimental support for curvilinear grid. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import zip from itertools import chain from .grid_finder import GridFinder from .axislines import AxisArtistHelper, GridHelperB...
gpl-2.0
vshtanko/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
soleneulmer/atmos
indicators_molec.py
1
4324
# =================================== # CALCULATES Ioff and Ires # Indicators described in Molecfit II # # Solene 20.09.2016 # =================================== # import numpy as np from astropy.io import fits import matplotlib.pyplot as plt # from PyAstronomy import pyasl from scipy.interpolate import interp1d from ...
mit
allenlavoie/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
28
5024
# 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
sysid/kg
quora/Ensemble_CNN_TD_Quora.py
1
12948
# coding: utf-8 # In[1]: import pandas as pd import numpy as np import nltk from nltk.corpus import stopwords from nltk.stem import SnowballStemmer import re from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt # In[2]: train = pd.read_csv("../input/train.csv") test = pd.read_csv("../input/te...
mit
lovexiaov/SandwichApp
venv/lib/python2.7/site-packages/py2app/build_app.py
9
77527
""" Mac OS X .app build command for distutils Originally (loosely) based on code from py2exe's build_exe.py by Thomas Heller. """ from __future__ import print_function import imp import sys import os import zipfile import plistlib import shlex import shutil import textwrap import pkg_resources import collections from...
apache-2.0
ashhher3/scikit-learn
examples/cluster/plot_dict_face_patches.py
337
2747
""" Online learning of a dictionary of parts of faces ================================================== This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use the online API of the sciki...
bsd-3-clause
metaml/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/lines.py
69
48233
""" This module contains all the 2D line class which can draw with a variety of line styles, markers and colors. """ # TODO: expose cap and join style attrs from __future__ import division import numpy as np from numpy import ma from matplotlib import verbose import artist from artist import Artist from cbook import ...
agpl-3.0
imaculate/scikit-learn
sklearn/linear_model/randomized_l1.py
11
24849
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
SophieIPP/ipp-macro-series-parser
ipp_macro_series_parser/demographie/parser.py
1
3235
# -*- coding: utf-8 -*- # TAXIPP -- A French microsimulation model # By: IPP <taxipp@ipp.eu> # # Copyright (C) 2012, 2013, 2014, 2015 IPP # https://github.com/taxipp # # This file is part of TAXIPP. # # TAXIPP is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
gpl-3.0
gef756/scipy
scipy/interpolate/interpolate.py
25
80287
""" Classes for interpolating values. """ from __future__ import division, print_function, absolute_import __all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp', 'ppform', 'lagrange', 'PPoly', 'BPoly', 'RegularGridInterpolator', 'interpn'] import itertools from numpy impo...
bsd-3-clause
tsherwen/AC_tools
Scripts/2D_GEOSChem_slice_subregion_plotter_example.py
1
2934
#!/usr/bin/python # -*- coding: utf-8 -*- """ Plotter for 2D slices of GEOS-Chem output NetCDFs files. NOTES --- - This is setup for Cly, but many other options (plot/species) are availible by just updating passed variables/plotting function called. """ import AC_tools as AC import numpy as np import matplotli...
mit
LaboratoireMecaniqueLille/crappy
crappy/blocks/grapher.py
1
5641
# coding: utf-8 import numpy as np from .block import Block from .._global import OptionalModule try: import matplotlib.pyplot as plt from matplotlib.widgets import Button except (ModuleNotFoundError, ImportError): plt = OptionalModule("matplotlib") Button = OptionalModule("matplotlib") class Grapher(Block...
gpl-2.0
zorojean/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py
221
5517
""" Testing for the gradient boosting loss functions and initial estimators. """ import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.utils import check_random_state from ...
bsd-3-clause
debsankha/bedtime-programming
ls222/visual-lotka.py
1
5120
#!/usr/bin/env python from math import * import thread import random import time import pygtk pygtk.require("2.0") import gtk import gtk.glade import commands import matplotlib.pyplot class rodent: def __init__(self): self.time_from_last_childbirth=0 class felix: def __init__(self): self.size=0 self.is_virgin...
gpl-3.0
karvenka/sp17-i524
project/S17-IR-P014/code/delay.py
15
5276
import sys import csv import sip #import org.apache.log4j.{Level, Logger} import matplotlib #matplotlib.user('agg') import matplotlib.pyplot as plt plt.switch_backend('agg') from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) from pyspark import SparkContext, SparkConf from datetime import date...
apache-2.0
garrettkatz/directional-fibers
dfibers/experiments/levy_opt/levy_opt.py
1
6952
""" Measure global optimization performance of Levy function """ import sys, time import numpy as np import matplotlib.pyplot as pt import multiprocessing as mp import dfibers.traversal as tv import dfibers.numerical_utilities as nu import dfibers.logging_utilities as lu import dfibers.fixed_points as fx import dfiber...
mit
jreback/pandas
pandas/io/formats/latex.py
2
25201
""" Module for formatting output data in Latex. """ from abc import ABC, abstractmethod from typing import Iterator, List, Optional, Sequence, Tuple, Type, Union import numpy as np from pandas.core.dtypes.generic import ABCMultiIndex from pandas.io.formats.format import DataFrameFormatter def _split_into_full_shor...
bsd-3-clause
junbochen/pylearn2
pylearn2/scripts/papers/jia_huang_wkshp_11/evaluate.py
44
3208
from __future__ import print_function from optparse import OptionParser import warnings try: from sklearn.metrics import classification_report except ImportError: classification_report = None warnings.warn("couldn't find sklearn.metrics.classification_report") try: from sklearn.metrics import confusion...
bsd-3-clause
versae/DH2304
data/arts1.py
1
1038
import numpy as np import pandas as pd arts = pd.DataFrame() # Clean the dates so you only see numbers. def clean_years(value): result = value chars_to_replace = ["c.", "©", ", CARCC", "no date", "n.d.", " SODRAC", ", CA", " CARCC", ""] chars_to_split = ["-", "/"] if isinstance(result, str): ...
mit
nakul02/systemml
src/main/python/systemml/classloader.py
4
7952
#------------------------------------------------------------- # # 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...
apache-2.0
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/mpl_toolkits/axisartist/axisline_style.py
8
5277
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib.patches import _Style, FancyArrowPatch from matplotlib.transforms import IdentityTransform from matplotlib.path import Path import numpy as np class _FancyAxislineStyle: class S...
mit
yunfeilu/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
pianomania/scikit-learn
sklearn/utils/tests/test_random.py
85
7349
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
dingocuster/scikit-learn
sklearn/metrics/regression.py
175
16953
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
timqian/sms-tools
lectures/5-Sinusoidal-model/plots-code/sineModelAnal-flute.py
24
1179
import numpy as np import matplotlib.pyplot as plt import sys, os, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as STFT import sineModel as SM import utilFunctions as UF (fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi...
agpl-3.0
jcrist/blaze
blaze/compute/tests/test_bcolz_compute.py
9
5874
from __future__ import absolute_import, division, print_function import pytest bcolz = pytest.importorskip('bcolz') from datashape import discover, dshape import numpy as np import pandas.util.testing as tm from odo import into from blaze import by from blaze.expr import symbol from blaze.compute.core import compu...
bsd-3-clause
themrmax/scikit-learn
sklearn/manifold/tests/test_t_sne.py
11
25443
import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import scipy.sparse as sp from sklearn.neighbors import BallTree from sklearn.utils.testing import assert_less_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from skle...
bsd-3-clause
xhochy/arrow
python/pyarrow/tests/test_hdfs.py
1
13325
# 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
sumitsourabh/opencog
opencog/python/utility/functions.py
34
11056
from math import fabs, isnan from datetime import datetime from spatiotemporal.unix_time import UnixTime from utility.generic import convert_dict_to_sorted_lists from utility.numeric.globals import EPSILON from numpy import NINF as NEGATIVE_INFINITY, PINF as POSITIVE_INFINITY from scipy.integrate import quad __author_...
agpl-3.0
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/scipy/stats/_stats_mstats_common.py
12
8157
from collections import namedtuple import numpy as np from . import distributions __all__ = ['_find_repeats', 'linregress', 'theilslopes'] def linregress(x, y=None): """ Calculate a linear least-squares regression for two sets of measurements. Parameters ---------- x, y : array_like T...
mit
nikitasingh981/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
50
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
kylerbrown/scikit-learn
sklearn/covariance/tests/test_robust_covariance.py
213
3359
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
Mako-kun/mangaki
mangaki/mangaki/utils/svd.py
2
5410
from django.contrib.auth.models import User from mangaki.models import Rating, Work, Recommendation from mangaki.utils.chrono import Chrono from mangaki.utils.values import rating_values from scipy.sparse import lil_matrix from sklearn.utils.extmath import randomized_svd import numpy as np from django.db import connect...
agpl-3.0
IndraVikas/scikit-learn
examples/hetero_feature_union.py
288
6236
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
samuelstjean/dipy
scratch/very_scratch/diffusion_sphere_stats.py
20
18082
import nibabel import os import numpy as np import dipy as dp #import dipy.core.generalized_q_sampling as dgqs import dipy.reconst.gqi as dgqs import dipy.reconst.dti as ddti import dipy.reconst.recspeed as rp import dipy.io.pickles as pkl import scipy as sp from matplotlib.mlab import find #import dipy.core.sphere_pl...
bsd-3-clause
Vimos/scikit-learn
sklearn/kernel_approximation.py
7
18505
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
xebitstudios/Kayak
examples/poisson_glm.py
3
1224
import numpy as np import numpy.random as npr import matplotlib.pyplot as plt import sys sys.path.append('..') import kayak N = 10000 D = 5 P = 1 learn = 0.00001 batch_size = 500 # Random inputs. X = npr.randn(N,D) true_W = npr.randn(D,P) lam = np.exp(np.dot(X, true_W)) Y = npr.poisson(lam) kyk_batcher = k...
mit
jbloom/mutpath
src/plot.py
1
10257
"""Module for performing plotting for ``mutpath`` package. This module uses ``pylab`` and ``matplotlib`` to make plots. These plots will fail if ``pylab`` and ``matplotlib`` are not available for importation. Before running any function in this module, you can run the *PylabAvailable* function to determine if ``pylab`...
gpl-3.0
edxnercel/edx-platform
.pycharm_helpers/pydev/pydev_ipython/inputhook.py
52
18411
# coding: utf-8 """ Inputhook management for GUI event loop integration. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distribu...
agpl-3.0
mmottahedi/neuralnilm_prototype
scripts/e249.py
2
3897
from __future__ import print_function, division import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid, rectify from lasagne.objectives import crossentropy, mse...
mit
carlvlewis/bokeh
bokeh/charts/builder/tests/test_line_builder.py
33
2376
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
kevin-intel/scikit-learn
sklearn/datasets/_openml.py
2
34451
import gzip import json import os import shutil import hashlib from os.path import join from warnings import warn from contextlib import closing from functools import wraps from typing import Callable, Optional, Dict, Tuple, List, Any, Union import itertools from collections.abc import Generator from collections import...
bsd-3-clause
zrhans/pythonanywhere
pyscripts/ply_wrose.py
1
1678
""" DATA,Chuva,Chuva_min,Chuva_max,VVE,VVE_min,VVE_max,DVE,DVE_min,DVE_max,Temp.,Temp._min,Temp._max,Umidade,Umidade_min,Umidade_max,Rad.,Rad._min,Rad._max,Pres.Atm.,Pres.Atm._min,Pres.Atm._max,Temp.Int.,Temp.Int._min,Temp.Int._max,CH4,CH4_min,CH4_max,HCnM,HCnM_min,HCnM_max,HCT,HCT_min,HCT_max,SO2,SO2_min,SO2_max,O3,O3...
apache-2.0
dudulianangang/vps
EneConsTest.py
1
5969
import sdf import matplotlib.pyplot as plt import numpy as np import matplotlib as mpl plt.style.use('seaborn-white') # plt.rcParams['font.family'] = 'sans-serif' # plt.rcParams['font.sans-serif'] = 'Tahoma' # # plt.rcParams['font.monospace'] = 'Ubuntu Mono' plt.rcParams['font.size'] = 16 # plt.rcParams['axes.labelsiz...
apache-2.0
planetarymike/IDL-Colorbars
IDL_py_test/027_Eos_B.py
1
5942
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf cm_data = [[1., 1., 1.], [1., 1., 1.], [0.498039, 0.498039, 0.498039], [0., 0., 0.513725], [0., 0., 0.533333], [0., 0., 0.54902], [0., 0., 0.564706], [0., 0., 0.580392], [0., 0., 0.6], [0., 0., 0.615686], [0., 0., 0.568627], [0., 0., 0.584...
gpl-2.0
ManuSchmi88/landlab
landlab/plot/imshow.py
3
21050
#! /usr/bin/env python """ Methods to plot data defined on Landlab grids. Plotting functions ++++++++++++++++++ .. autosummary:: :toctree: generated/ ~landlab.plot.imshow.imshow_grid ~landlab.plot.imshow.imshow_grid_at_cell ~landlab.plot.imshow.imshow_grid_at_node """ import numpy as np import insp...
mit
hrjn/scikit-learn
examples/feature_selection/plot_f_test_vs_mi.py
75
1647
""" =========================================== Comparison of F-test and mutual information =========================================== This example illustrates the differences between univariate F-test statistics and mutual information. We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the targ...
bsd-3-clause
waddell/urbansim
urbansim/urbanchoice/mnl.py
4
9002
""" Number crunching code for multinomial logit. ``mnl_estimate`` and ``mnl_simulate`` especially are used by ``urbansim.models.lcm``. """ from __future__ import print_function import logging import numpy as np import pandas as pd import scipy.optimize import pmat from pmat import PMAT from ..utils.logutil import ...
bsd-3-clause
sinhrks/scikit-learn
sklearn/tree/tests/test_tree.py
32
52369
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
bsd-3-clause
dmitriz/zipline
zipline/utils/tradingcalendar.py
6
11182
# # Copyright 2013 Quantopian, Inc. # # 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 wr...
apache-2.0
barbagroup/PetIBM
examples/ibpm/cylinder2dRe40/scripts/plotVorticity.py
4
1401
""" Computes, plots, and saves the 2D vorticity field from a PetIBM simulation after 2000 time steps (20 non-dimensional time-units). """ import pathlib import h5py import numpy from matplotlib import pyplot simu_dir = pathlib.Path(__file__).absolute().parents[1] data_dir = simu_dir / 'output' # Read vorticity fiel...
bsd-3-clause
rhoscanner-team/pcd-plotter
delaunay_example.py
1
1435
import numpy as np from scipy.spatial import Delaunay points = np.random.rand(30, 2) # 30 points in 2-d tri = Delaunay(points) # Make a list of line segments: # edge_points = [ ((x1_1, y1_1), (x2_1, y2_1)), # ((x1_2, y1_2), (x2_2, y2_2)), # ... ] edge_points = [] edges = set() def ad...
gpl-2.0
rahul-c1/scikit-learn
sklearn/cluster/tests/test_mean_shift.py
19
2844
""" Testing for mean shift clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_array_equal from sklearn.cluster import MeanShift from sklearn.clu...
bsd-3-clause
hainm/scikit-learn
examples/cluster/plot_kmeans_assumptions.py
270
2040
""" ==================================== Demonstration of k-means assumptions ==================================== This example is meant to illustrate situations where k-means will produce unintuitive and possibly unexpected clusters. In the first three plots, the input data does not conform to some implicit assumptio...
bsd-3-clause
wdurhamh/statsmodels
statsmodels/sandbox/examples/ex_cusum.py
33
3219
# -*- coding: utf-8 -*- """ Created on Fri Apr 02 11:41:25 2010 Author: josef-pktd """ import numpy as np from scipy import stats from numpy.testing import assert_almost_equal import statsmodels.api as sm from statsmodels.sandbox.regression.onewaygls import OneWayLS from statsmodels.stats.diagnostic import recursive...
bsd-3-clause
nmartensen/pandas
pandas/io/sql.py
3
58612
# -*- coding: utf-8 -*- """ Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from __future__ import print_function, division from datetime import datetime, date, time import warnings import re import numpy as np import pandas._libs.lib as ...
bsd-3-clause
jenshnielsen/basemap
examples/maskoceans.py
4
1922
from mpl_toolkits.basemap import Basemap, shiftgrid, maskoceans, interp import numpy as np import matplotlib.pyplot as plt # example showing how to mask out 'wet' areas on a contour or pcolor plot. topodatin = np.loadtxt('etopo20data.gz') lonsin = np.loadtxt('etopo20lons.gz') latsin = np.loadtxt('etopo20lats.gz') #...
gpl-2.0