repo_name
stringlengths
9
55
path
stringlengths
7
120
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
169k
license
stringclasses
12 values
mikeireland/chronostar
projects/scocen/cmd_age_sequence_AG_with_lithium.py
1
8855
""" Plot CMDs for CUT components and show that components with higher kinematic age show less overluminosity in comparison to others. """ import numpy as np from astropy.table import Table import matplotlib.pyplot as plt import matplotlib.ticker as ticker from matplotlib.gridspec import GridSpec from mpl_toolkits.axes...
mit
meteorcloudy/tensorflow
tensorflow/examples/learn/text_classification_character_cnn.py
33
5463
# 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
saleiro/SemEval2017-Task5
Code/sentiment_analysis.py
1
7352
from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction import DictVectorizer import numpy as np from sklearn.metrics import mean_absolute_error from sklearn.metrics.pairwise import cosine_similarity import gensim import argparse from scipy.sparse import hstack from sklearn.ensemble ...
mit
ywcui1990/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt4agg.py
70
4985
""" Render to qt from agg """ from __future__ import division import os, sys import matplotlib from matplotlib.figure import Figure from backend_agg import FigureCanvasAgg from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\ show, draw_if_interactive, backend_version, \ NavigationToolba...
agpl-3.0
dr-leo/pandaSDMX
pandasdmx/source/__init__.py
1
6250
from pydantic import HttpUrl from enum import Enum from importlib import import_module, resources import json from typing import Any, Dict, Union, Optional from pandasdmx.model import DataStructureDefinition from pandasdmx.util import BaseModel, Resource, validator sources: Dict[str, "Source"] = {} DataContentType ...
apache-2.0
Kate-Willett/HadISDH_Build
MakeAreaAvgTS.py
1
40798
# PYTHON 3 # # Author: Kate Willett # Created: 4 March 2019 # Last update: 15 April 2019 # Location: /data/local/hadkw/HADCRUH2/UPDATE2014/PROGS/PYTHON/ # GitHub: https://github.com/Kate-Willett/PYTHON # ----------------------- # CODE PURPOSE AND OUTPUT # ----------------------- # This code reads in monthly mean...
cc0-1.0
evgchz/scikit-learn
sklearn/datasets/species_distributions.py
19
7870
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
pavlovml/tensorflow
tensorflow/python/client/notebook.py
5
3918
"""Notebook front-end to TensorFlow. When you run this binary, you'll see something like below, which indicates the serving URL of the notebook: The IPython Notebook is running at: http://127.0.0.1:8888/ Press "Shift+Enter" to execute a cell Press "Enter" on a cell to go into edit mode. Press "Escape" to go back ...
apache-2.0
nal-epfl/line-sigcomm14
plotting-scripts-new/plot-edge-seq-cong-prob.py
1
9288
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Install dependencies: # sudo pip install matplotlib import colorsys import copy import getopt import json from nicePlot import nicePlot from line import * import math import numpy import os import pprint import re import subprocess import sys ## Params inputFile = 'e...
gpl-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/scipy/stats/tests/test_morestats.py
4
34938
# Author: Travis Oliphant, 2002 # # Further enhancements and tests added by numerous SciPy developers. # from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.random import RandomState from numpy.testing import (TestCase, run_module_suite, assert_array_equal, ...
agpl-3.0
wjlei1990/spaceweight
setup.py
1
1886
import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args ...
gpl-3.0
shakeh/bridge
res-plotting/Residual_Plotting.py
2
2481
# Residual_Plotting.py # A script that takes in an Output_for_plotting_[PULSAR].tim file created by Average_Epochs.py, and an output directory # as a result, it creates a plot of pulsar residuals, stored in the output directory # sample input: # python Residual_Plotting.py /Users/fkeri/Desktop/Output_for_plotting_B1855...
apache-2.0
srjoglekar246/sympy
examples/intermediate/sample.py
3
3446
""" Utility functions for plotting sympy functions. See examples\mplot2d.py and examples\mplot3d.py for usable 2d and 3d graphing functions using matplotlib. """ from numpy import repeat, arange, empty, ndarray, array from sympy import Symbol, Basic, Rational, I, sympify def sample2d(f, x_args): """ Samples ...
bsd-3-clause
tomasreimers/tensorflow-emscripten
tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py
18
13185
# 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
markovg/nest-simulator
pynest/nest/voltage_trace.py
18
7823
# -*- coding: utf-8 -*- # # voltage_trace.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 of the License, ...
gpl-2.0
dalejung/trtools
trtools/core/select.py
1
2914
""" Collections of tools to quickly select rows/items """ import collections import warnings import numpy as np from pandas import Panel, DataFrame, MultiIndex, Series, Timestamp from pandas.core.indexing import _IXIndexer from trtools.monkey import patch, patch_prop @patch(DataFrame, 'cols') def _cols(self, *a...
mit
magne-max/zipline-ja
zipline/data/bundles/yahoo.py
1
6260
import os import numpy as np import pandas as pd from pandas_datareader.data import DataReader import requests from zipline.utils.cli import maybe_show_progress from .core import register def _cachpath(symbol, type_): return '-'.join((symbol.replace(os.path.sep, '_'), type_)) def yahoo_equities(symbols, start...
apache-2.0
bhargav/scikit-learn
benchmarks/bench_isolation_forest.py
40
3136
""" ========================================== IsolationForest benchmark ========================================== A test of IsolationForest on classical anomaly detection datasets. """ print(__doc__) from time import time import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import IsolationFore...
bsd-3-clause
ngoix/OCRF
examples/linear_model/plot_bayesian_ridge.py
50
2733
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
nlpub/russe-evaluation
russe/evaluation/evaluate.py
1
4899
#!/usr/bin/env python import argparse from pandas import read_csv from scipy.stats import pearsonr, spearmanr from os.path import splitext import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import average_precision_score, precision_recall_curve, \ accura...
mit
mlassnig/pilot
Experiment.py
3
37135
# Class definition: # Experiment # This class is the main experiment class; ATLAS etc will inherit from this class # Instances are generated with ExperimentFactory # Subclasses should implement all needed methods prototyped in this class # Note: not compatible with Singleton Design Pattern due to the subclass...
apache-2.0
MRod5/pyturb
src/pyturb/gas_models/gas_mixture.py
1
9198
""" gas_mixture: ------------ Gas mixture of ideal gases. The approach for the ideal gases may be Perfect or Semiperfect. MRodriguez 2020 """ import pyturb.utils.constants as cts from pyturb.gas_models.gas import Gas from pyturb.gas_models.perfect_ideal_gas import PerfectIdealGas from pyturb.gas_models.semiperfect_i...
mit
marianotepper/dask
dask/array/core.py
2
59930
from __future__ import absolute_import, division, print_function import operator from operator import add, getitem import inspect from numbers import Number from collections import Iterable from bisect import bisect from itertools import product, count from collections import Iterator from functools import partial, wr...
bsd-3-clause
pprett/scikit-learn
sklearn/datasets/tests/test_samples_generator.py
25
16022
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
mxjl620/scikit-learn
sklearn/discriminant_analysis.py
32
27308
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .extern...
bsd-3-clause
ilyes14/scikit-learn
examples/svm/plot_separating_hyperplane_unbalanced.py
329
1850
""" ================================================= SVM: Separating hyperplane for unbalanced classes ================================================= Find the optimal separating hyperplane using an SVC for classes that are unbalanced. We first find the separating plane with a plain SVC and then plot (dashed) the ...
bsd-3-clause
mhue/scikit-learn
sklearn/ensemble/__init__.py
217
1307
""" The :mod:`sklearn.ensemble` module includes ensemble-based methods for classification and regression. """ from .base import BaseEnsemble from .forest import RandomForestClassifier from .forest import RandomForestRegressor from .forest import RandomTreesEmbedding from .forest import ExtraTreesClassifier from .fores...
bsd-3-clause
cyber-meow/Robotic_state_representation_learning
inter/interaction.py
1
2565
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from inter.interfaces import Environment, Bot class Interaction(object): """ This is rather for test purposes once the robot has learned something from its experience. For the main interaction class please lo...
mit
f3r/scikit-learn
sklearn/metrics/cluster/tests/test_supervised.py
41
8901
import numpy as np from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import homogeneity_score from sklearn.metrics.cluster import completeness_score from sklearn.metrics.cluster import v_measure_score from sklearn.metrics.cluster import homogeneity_completeness_v_measure from sklearn...
bsd-3-clause
TiedNets/TiedNets
plot_result_bars.py
1
4139
__author__ = 'Agostino Sturaro' import os import csv import numpy as np import matplotlib.pyplot as plt # BEGIN user defined variables input_fpath = os.path.normpath('../Simulations/MN_nets/MN_rnd_atk_reasons.tsv') output_fpath = os.path.normpath('../Simulations/MN_nets/MN_rnd_atk_reasons.pdf') # we need a single ta...
gpl-3.0
UNR-AERIAL/scikit-learn
sklearn/datasets/svmlight_format.py
114
15826
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause
wanglei828/apollo
modules/tools/plot_planning/imu_speed_jerk.py
1
3753
#!/usr/bin/env python ############################################################################### # Copyright 2019 The Apollo 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 ...
apache-2.0
harisbal/pandas
pandas/tests/io/sas/test_sas7bdat.py
4
8326
import pandas as pd from pandas.compat import PY2 import pandas.util.testing as tm import pandas.util._test_decorators as td from pandas.errors import EmptyDataError import os import io import numpy as np import pytest # https://github.com/cython/cython/issues/1720 @pytest.mark.filterwarnings("ignore:can't resolve pa...
bsd-3-clause
q1ang/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
249
1095
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
endolith/scikit-image
doc/examples/edges/plot_canny.py
4
1602
""" =================== Canny edge detector =================== The Canny filter is a multi-stage edge detector. It uses a filter based on the derivative of a Gaussian in order to compute the intensity of the gradients.The Gaussian reduces the effect of noise present in the image. Then, potential edges are thinned dow...
bsd-3-clause
dyoung418/tensorflow
tensorflow/examples/learn/text_classification_character_rnn.py
8
4104
# 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
belltailjp/scikit-learn
examples/mixture/plot_gmm.py
248
2817
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet process. Both models have access to five components with which to fit the data. Note that the EM model will necessari...
bsd-3-clause
yuanagain/seniorthesis
venv/lib/python2.7/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
yunfeilu/scikit-learn
examples/ensemble/plot_gradient_boosting_regression.py
227
2520
""" ============================ Gradient Boosting regression ============================ Demonstrate Gradient Boosting on the Boston housing dataset. This example fits a Gradient Boosting model with least squares loss and 500 regression trees of depth 4. """ print(__doc__) # Author: Peter Prettenhofer <peter.prett...
bsd-3-clause
qjcg/dotfiles
.ipython/profile_default/ipython_config.py
1
18940
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
gpl-3.0
schreiberx/sweet
mule_local/python/mule_local/rexi/brexi/BREXI.py
1
4254
#! /usr/bin/env python3 import sys import numpy import mule_local.rexi.brexi.rk_co as rk_co import mule_local.rexi.EFloat as ef from mule_local.rexi.REXICoefficients import * from mule_local.rexi.Functions import * class BREXI: def __init__( self, efloat_mode = None, ): self.eflo...
mit
226262/Neural-Network-Digit-Recognition
plotter.py
1
3993
import os import numpy import matplotlib.pyplot as plt import pygame, random class Plotter: width=300 height=width array=numpy.full((width,height),0) xMin=width xMax=0 yMin=height yMax=0 edge=0 isAnythingDrew = False def write_rad(self,x,y,promien): ...
gpl-3.0
Tong-Chen/scikit-learn
examples/cluster/plot_dict_face_patches.py
12
2723
""" 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
joshloyal/scikit-learn
sklearn/utils/validation.py
8
25965
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp from ..externals...
bsd-3-clause
gfrubi/GR
figuras-editables/fig-Killing-S2.py
2
2263
from mpl_toolkits.mplot3d import axes3d from matplotlib.pyplot import * # requiere version 1.4 !! from matplotlib.patches import FancyArrowPatch from mpl_toolkits.mplot3d import proj3d from numpy import * class Arrow3D(FancyArrowPatch): def __init__(self, xs, ys, zs, *args, **kwargs): FancyArrowPatch.__ini...
gpl-3.0
and2egg/philharmonic
philharmonic/explorer.py
2
4700
import itertools import numpy as np import pandas as pd from philharmonic import conf from philharmonic.simulator.simulator import run from philharmonic.logger import info from philharmonic.utils import loc def _generate_range(min_value, max_value, resolution): return np.arange(min_value, max_value + resolution,...
gpl-3.0
hsiaoyi0504/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
jjx02230808/project0223
examples/applications/wikipedia_principal_eigenvector.py
233
7819
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/sklearn/utils/arpack.py
265
64837
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
gpl-2.0
Erotemic/ibeis
ibeis/algo/graph/tests/mst_debug.py
1
5614
import networkx as nx import utool as ut import pandas as pd edges = { 2234: {5383: {'decision': 'match', 'reviewed_tags': ['needswork']}}, 2265: {}, 2280: {}, 2654: {5334: {'decision': 'match', 'reviewed_tags': ['needswork', 'viewpoint', 'correctable', 'orientation']}}, 5334: {26...
apache-2.0
zhuango/python
pandasLearning/featureProcessing.py
2
4334
import numpy as np import pandas as pd from math import * from sklearn import preprocessing # def cut(tasks): # count = 4 # tasks['任务gps经度'] = pd.factorize(pd.qcut(tasks['任务gps经度'], count))[0] # tasks['任务gps纬度'] = pd.factorize(pd.qcut(tasks['任务gps纬度'], count))[0] # attribute = 'vip_count_around_33...
gpl-2.0
ericdill/bokeh
bokeh/cli/core.py
42
16025
from __future__ import absolute_import, print_function import sys, os from six.moves.urllib import request as urllib2 from six.moves import cStringIO as StringIO import pandas as pd try: import click is_click = True except ImportError: is_click = False from . import help_messages as hm from .utils import...
bsd-3-clause
nhoffman/bioy
bioy_pkg/subcommands/classifier.py
2
37986
# This file is part of Bioy # # Bioy 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. # # Bioy is distributed in the hope...
gpl-3.0
danmergens/mi-instrument
mi/common/zpls_plot.py
3
7240
""" @package mi.common @file mi/common/zpls_plot.py @author Rene Gelinas @brief ZPLSC Echogram generation for the ooicore Release notes: This class supports the generation of ZPLS echograms. It needs matplotlib version 1.3.1 (or higher) for the code to display the colorbar on the right side of the figure. If matplotl...
bsd-2-clause
AlertaDengue/InfoDenguePredict
infodenguepredict/models/cross_prediction_RQF.py
1
3663
""" This scripts implements cross disease predicitons using RQF model trained on dengue """ from infodenguepredict.models.quantile_forest import build_model, build_lagged_features, calculate_metrics from infodenguepredict.data.infodengue import get_cluster_data, get_city_names from infodenguepredict.predict_settings i...
gpl-3.0
apache/spark
python/pyspark/sql/tests/test_arrow.py
15
27974
# # 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
ryanjmccall/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_macosx.py
69
15397
from __future__ import division import os import numpy from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ FigureManagerBase, FigureCanvasBase, NavigationToolbar2 from matplotlib.cbook import maxdict from matplotlib.figure import Figure from matplotl...
gpl-3.0
Srisai85/scikit-learn
sklearn/ensemble/weight_boosting.py
97
40773
"""Weight Boosting This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The ``BaseWeightBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each ot...
bsd-3-clause
sangwook236/SWDT
sw_dev/python/rnd/test/machine_learning/keras/keras_class_activation_map.py
2
2826
#!/usr/bin/env python # coding: UTF-8 import numpy as np from tensorflow.keras.models import Model from tensorflow.keras.layers import UpSampling2D, Conv2D import tensorflow.keras.applications.resnet50 as resnet import cv2 import matplotlib.pyplot as plt def load_img(fname, input_size, preprocess_fn): original_img =...
gpl-3.0
upibhalla/moose-core
tests/python/test_rdesigneur_random_syn_input.py
2
1402
# -*- coding: utf-8 -*- from __future__ import print_function, division # This example demonstrates random (Poisson) synaptic input to a cell. # Copyright (C) Upinder S. Bhalla NCBS 2018 # Released under the terms of the GNU Public License V3. No warranty. # Changelog: # Thursday 20 September 2018 09:53:27 AM IST # - ...
gpl-3.0
camallen/aggregation
experimental/serengeti/IAAI/bySpecies.py
2
1975
#!/usr/bin/env python __author__ = 'greg' from nodes import setup import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr numUser = [5,10,15,20,25] algPercent = [] currPercent = [] speciesList = ['elephant','zebra','warthog','impala','buffalo','wildebeest','gazelleThomsons','dikDik','...
apache-2.0
joeyginorio/Action-Understanding-with-Rational-Rules
model_src/grid_world.py
1
9591
# Joey Velez-Ginorio # Gridworld Implementation # --------------------------------- from mdp import MDP from grid import Grid from scipy.stats import uniform from scipy.stats import beta from scipy.stats import expon import numpy as np import random import pyprind import matplotlib.pyplot as plt class GridWorld(MDP):...
mit
kdaily/cloudbiolinux
installed_files/ipython_config.py
15
14156
# Configuration file for ipython. c = get_config() c.InteractiveShell.autoindent = True c.InteractiveShell.colors = 'Linux' c.InteractiveShell.confirm_exit = False c.AliasManager.user_aliases = [ ('ll', 'ls -l'), ('lt', 'ls -ltr'), ] #------------------------------------------------------------------------------ #...
mit
IndraVikas/scikit-learn
examples/datasets/plot_random_multilabel_dataset.py
93
3460
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distri...
bsd-3-clause
thomasahle/numberlink
gen/mitm.py
1
6461
import random from collections import Counter, defaultdict import itertools # starter altid (0,0) -> (0,1) # Sti har formen [2, l, r]*, da man kan forlænge med 2, gå til venstre eller gå til højre. T, L, R = range(3) class Path: def __init__(self, steps): self.steps = steps def xys(self, dx=0, dy=1)...
agpl-3.0
MikaelFuresjo/ImundboQuant
src/PreProcess.py
1
169439
""" MIT License Copyright (c) [2016] [Mikael Furesjö] Software = Python Scripts in the [Imundbo Quant v1.6] series 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 w...
mit
flameOnYou/mt4plus
main.py
1
6204
#coding:utf-8 ''' 读取hst文件 ''' import struct import time import datetime import hstutils import json import threading import logging import initEnvironment import tushare as ts import pandas as pd import traceback import requests as rq logging.basicConfig(level=logging.DEBUG, format='%(as...
gpl-2.0
kubeflow/pipelines
components/dataset_manipulation/split_data_into_folds/in_CSV/component.py
1
2735
from kfp.components import InputPath, OutputPath, create_component_from_func def split_table_into_folds( table_path: InputPath('CSV'), train_1_path: OutputPath('CSV'), train_2_path: OutputPath('CSV'), train_3_path: OutputPath('CSV'), train_4_path: OutputPath('CSV'), train_5_path: OutputPath('C...
apache-2.0
kuke/HAMDLE
PyCUDA/plot_first_five_Legendre.py
1
1152
#! /bin/python import sys import matplotlib.pyplot as plt import numpy as np X = np.arange(-1, 1.05, 0.05) order = 5 def generate_Legendre_matrix(order, X): m = X.size Legendre_mat = [[0 for col in range(m)] for row in range(order+1)] Legendre_mat[0] = [1 for i in range(0, m)] Legendre_mat[1] = X for i in rang...
gpl-3.0
arahuja/scikit-learn
sklearn/decomposition/tests/test_truncated_svd.py
240
6055
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
bsd-3-clause
a-doumoulakis/tensorflow
tensorflow/examples/learn/text_classification_cnn.py
29
5677
# 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
dennissergeev/sattools
sattools/utils.py
2
6718
# -*- coding: utf-8 -*- """ Auxiliary functions for sattools module """ from __future__ import division, print_function import datetime import h5py import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import os import pytz default_cmap_dir = os.path.join(os.path.dirname(os.path.realpath(__file_...
mit
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/sklearn/feature_extraction/hashing.py
24
5668
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
mit
markinho-web/markinho-web.github.io
MEFaplicado-html/estado_plano/codigos/Derivando-FuncoesFormaEstadoPlano3nos.py
2
22792
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 10 14:46:37 2019 Funções de forma ok! @author: markinho """ import sympy as sp import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import axes3d, Axes3D from mpl_toolkits.mplot3d.art3d import Po...
mit
mattjj/pyhawkes
experiments/discrete_continuous_comparison.py
2
5308
import time import numpy as np np.random.seed(1111) np.seterr(over="raise") import cPickle, os from hips.plotting.layout import create_figure import matplotlib.pyplot as plt import brewer2mpl colors = brewer2mpl.get_map("Set1", "Qualitative", 9).mpl_colors # goodcolors = np.array([0,1,2,4,6,7,8]) # colors = np.array(...
mit
r-mart/scikit-learn
sklearn/metrics/tests/test_classification.py
83
49782
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import la...
bsd-3-clause
costypetrisor/scikit-learn
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
jreback/pandas
pandas/core/indexes/timedeltas.py
1
9039
""" implement the TimedeltaIndex """ from pandas._libs import index as libindex, lib from pandas._libs.tslibs import Timedelta, to_offset from pandas._typing import DtypeObj from pandas.errors import InvalidIndexError from pandas.core.dtypes.common import TD64NS_DTYPE, is_scalar, is_timedelta64_dtype from pandas.cor...
bsd-3-clause
roytu/impede
impede-app/server/py/filter_library.py
2
4231
""" Module that contains some example filters """ import numpy as np import matplotlib.pyplot as plt from graph import Node, Edge, Graph from resistor import Resistor from capacitor import Capacitor from diode import Diode from opamp import Opamp from wire import Wire from units import Units from filter import Filte...
mit
dungvtdev/upsbayescpm
bayespy/inference/vmp/nodes/GaussianProcesses.py
5
25953
################################################################################ # Copyright (C) 2011-2012 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ import itertools import numpy as np #import scipy as sp #import s...
mit
spektom/incubator-airflow
airflow/providers/apache/hive/hooks/hive.py
4
39159
# # 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...
apache-2.0
bartvm/GroundHog
experiments/nmt/tree.py
17
6574
#!/usr/bin/env python import argparse import cPickle import traceback import logging import time import copy import networkx as nx import numpy import experiments.nmt from experiments.nmt import RNNEncoderDecoder, parse_input import theano import theano.tensor as TT import matplotlib.pyplot as plt import matplotl...
bsd-3-clause
googleinterns/amt-xpub
buffling/signal_to_noise_ratio.py
1
4384
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
thientu/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
eg-zhang/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
ulisespereira/PereiraBrunel2016
S2/fig5.py
1
10899
import numpy as np import matplotlib.gridspec as gridspec from scipy import sparse from scipy.integrate import odeint import matplotlib.pyplot as plt import math as mt from stimulus import * from myintegrator import * import cProfile import json from matplotlib.colors import LogNorm from matplotlib.ticker import Multip...
gpl-2.0
toobaz/pandas
pandas/tests/util/test_assert_numpy_array_equal.py
2
5404
import numpy as np import pytest from pandas import Timestamp from pandas.util.testing import assert_numpy_array_equal def test_assert_numpy_array_equal_shape_mismatch(): msg = """numpy array are different numpy array shapes are different \\[left\\]: \\(2L*,\\) \\[right\\]: \\(3L*,\\)""" with pytest.raise...
bsd-3-clause
colinbrislawn/scikit-bio
skbio/draw/tests/test_distributions.py
7
27970
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
karvenka/sp17-i524
project/S17-IO-3012/code/bin/benchmark_version_mapreduce.py
19
4617
import matplotlib.pyplot as plt import sys import pandas as pd def get_parm(): """retrieves mandatory parameter to program @param: none @type: n/a """ try: return sys.argv[1] except: print ('Must enter file name as parameter') exit() def read_file(filename): """...
apache-2.0
JackKelly/neuralnilm_prototype
neuralnilm/net.py
2
25235
from __future__ import division, print_function from functools import partial import matplotlib.pyplot as plt import numpy as np import pandas as pd import csv import h5py from datetime import datetime, timedelta import logging from numpy.random import rand from time import time from os.path import exists, join import...
mit
thesuperzapper/tensorflow
tensorflow/examples/learn/iris_custom_model.py
50
2613
# 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
DonBeo/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
jmschrei/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
amolkahat/pandas
pandas/tests/test_base.py
2
46356
# -*- coding: utf-8 -*- from __future__ import print_function import re import sys from datetime import datetime, timedelta import pytest import numpy as np import pandas as pd import pandas.compat as compat from pandas.core.dtypes.common import ( is_object_dtype, is_datetimetz, is_datetime64_dtype, needs_i8_...
bsd-3-clause
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/pandas/sparse/tests/test_pivot.py
7
2417
import numpy as np import pandas as pd import pandas.util.testing as tm class TestPivotTable(tm.TestCase): _multiprocess_can_split_ = True def setUp(self): self.dense = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'foo'], ...
mit
shyamalschandra/scikit-learn
sklearn/svm/setup.py
321
3157
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('svm', parent_package, top_path) config.add_subpackage('tests') # Section L...
bsd-3-clause
andaag/scikit-learn
sklearn/metrics/pairwise.py
104
42995
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
lshain-android-source/external-blktrace
btt/btt_plot.py
43
11282
#! /usr/bin/env python # # btt_plot.py: Generate matplotlib plots for BTT generate data files # # (C) Copyright 2009 Hewlett-Packard Development Company, L.P. # # This program 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 So...
gpl-2.0
Vishruit/DDP_models
code/create_label_tags.py
1
2811
import random import numpy as np import os import shutil import time import sys np.random.seed(1) from PIL import Image import matplotlib.pyplot as plt import matplotlib.image as mpimg import scipy.misc def getJPGFilePaths(directory,excludeFiles): file_paths = [] file_name = [] file_loc = [] global ext...
gpl-3.0
JesseLivezey/pylearn2
pylearn2/packaged_dependencies/theano_linear/unshared_conv/localdot.py
39
5044
""" WRITEME """ import logging from ..linear import LinearTransform from .unshared_conv import FilterActs, ImgActs from theano.compat.six.moves import xrange from theano.sandbox import cuda if cuda.cuda_available: import gpu_unshared_conv # register optimizations import numpy as np import warnings try: impor...
bsd-3-clause