repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
kingb12/languagemodelRNN
old_comparisons/noing15_LSTM_v_BOW.ipynb
mit
report_files = ["/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing15_200_512_04drb/encdec_noing15_200_512_04drb.json", "/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing15_bow_200_512_04drb/encdec_noing15_bow_200_512_04drb.json"] log_files = ["/Users/bking/IdeaProjects/...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/building_production_ml_systems/solutions/1_training_at_scale.ipynb
apache-2.0
# change these to try this notebook out PROJECT = <YOUR PROJECT> BUCKET = <YOUR PROJECT> REGION = <YOUR REGION> import os os.environ['PROJECT'] = PROJECT os.environ['BUCKET'] = BUCKET os.environ['REGION'] = REGION os.environ['TFVERSION'] = "2.1" %%bash gcloud config set project $PROJECT gcloud config set compute/regi...
dnc1994/MachineLearning-UW
ml-classification/module-3-linear-classifier-learning-solution.ipynb
mit
import graphlab """ Explanation: Implementing logistic regression from scratch The goal of this notebook is to implement your own logistic regression classifier. You will: Extract features from Amazon product reviews. Convert an SFrame into a NumPy array. Implement the link function for logistic regression. Write a f...
mkuron/espresso
doc/tutorials/02-charged_system/02-charged_system-2.ipynb
gpl-3.0
from espressomd import System, electrostatics, electrostatic_extensions from espressomd.shapes import Wall import espressomd import numpy """ Explanation: Tutorial 2: A Simple Charged System, Part 2 7 2D Electrostatics and Constraints In this section, we use the parametrized NaCl system from the last task to simulate ...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/numpy/numpy.ipynb
mit
import numpy as np """ Explanation: NumPy Credits: Forked from Parallel Machine Learning with scikit-learn and IPython by Olivier Grisel NumPy Arrays, dtype, and shape Common Array Operations Reshape and Update In-Place Combine Arrays Create Sample Data End of explanation """ a = np.array([1, 2, 3]) print(a) print(...
kit-cel/wt
wt/uebung/u2_schimpanse.ipynb
gpl-2.0
%matplotlib inline import matplotlib.pyplot as plt from random import random, choice # Kugeln (Werte erstmal unwichtig) black, red, green, white = 0, 1, 2, 7 # Urnen kugeln_urne1 = [white, white, white, black, black] kugeln_urne2 = [white, green, green, red, red] # Wkeiten p_urne1 = 0.7 p_urne2 = 0.3 # 1 - p_ur...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: NASA-GISS Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topics: Transport, ...
abulbasar/machine-learning
Scikit - 02 Visualization.ipynb
apache-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.mlab import normpdf %matplotlib inline plt.rcParams['figure.figsize'] = 10, 6 df = pd.read_csv("http://www-bcf.usc.edu/~gareth/ISL/Auto.data", sep=r"\s+") df.head(10) df.info() df["year"].unique() df.sampl...
georgetown-analytics/machine-learning
examples/jstyczynski/Phishing Website Classification Analysis.ipynb
mit
%matplotlib inline import os import requests import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.decomposition import PCA from sklearn.feature_selection import SelectFromModel from sklearn.linear_model import Ridge, Lasso, ElasticNet from sklearn.discriminant_ana...
magnusax/ml-meta-wrapper
examples/gazer-intro-demo.ipynb
mit
import keras from importlib import reload import os import sys sys.path.insert(0, "C:/Users/magaxels/AutoML") import gazer; reload(gazer) from gazer import GazerMetaLearner """ Explanation: This notebook demonstrates some very basic functionality currently present in the library End of explanation """ from sklearn.d...
edinburghlivinglab/dds-notebooks
notebooks/data_formats.ipynb
cc0-1.0
%%bash cat ../data/formats/messages.csv """ Explanation: Data Formats Overview This notebook examines some of the different ways that data is organised within files. We'll call these data formats. First, we're going to rule out a couple of very widely-used data formats, namely HTML and PDF. The reason is that we are i...
dssg/diogenes
doc/notebooks/display.ipynb
mit
%matplotlib inline import diogenes import numpy as np wine_data = diogenes.read.open_csv_url('http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv', delimiter=';') """ Explanation: The Display Module The :mod:diogenes.display module provides tools for summarizing/exploring d...
mansweet/GaussianLDA
NIPS Topic Modeling.ipynb
apache-2.0
import numpy as np import os from operator import itemgetter from collections import Counter import scipy.stats as stat from gensim.models import Word2Vec from nltk import corpus import FastGaussianLDA2 """ Explanation: Topic Modeling on NIPS Dataset Using Gaussian LDA w/ Word-Embeddings End of explanation """ wvmod...
nishantsbi/pattern_classification
machine_learning/scikit-learn/outofcore_modelpersistence.ipynb
gpl-3.0
import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/rasbt/pattern_classification/master/data/50k_imdb_movie_reviews.csv') df.tail() """ Explanation: Out-of-core Learning and Model Persistence using scikit-learn When we are applying machine learning algorithms to real-world applications, our compute...
SHDShim/pytheos
examples/6_p_scale_test_Jamieson_Au.ipynb
apache-2.0
%config InlineBackend.figure_format = 'retina' """ Explanation: For high dpi displays. End of explanation """ import matplotlib.pyplot as plt import numpy as np from uncertainties import unumpy as unp import pytheos as eos """ Explanation: 0. General note This example compares pressure calculated from pytheos and o...
GoogleCloudPlatform/analytics-componentized-patterns
retail/recommendation-system/bqml-scann/00_prep_bq_and_datastore.ipynb
apache-2.0
!pip install -q -U apache-beam[gcp] # Automatically restart kernel after installs import IPython app = IPython.Application.instance() app.kernel.do_shutdown(True) """ Explanation: Import the sample data into BigQuery and Datastore This notebook is the first of two notebooks that guide you through completing the pre...
TwistedHardware/mltutorial
notebooks/quick_tips/5. The largest Prime.ipynb
gpl-2.0
import numpy as np import math from datetime import datetime %load_ext Cython """ Explanation: The largest prime (so far) A new record for the largest prime has been found lately. Let explore this number and know more about it and how to deal with it using some Python, Numpy and finally using we will take a loog at C...
tensorflow/probability
tensorflow_probability/examples/jupyter_notebooks/Bayesian_Switchpoint_Analysis.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
bspalding/research_public
lectures/drafts/Risk analysis.ipynb
apache-2.0
# Import the libraries we'll be using import numpy as np import statsmodels.api as sm from statsmodels import regression import matplotlib.pyplot as plt # Get market cap and book-to-price for all assets in universe fundamentals = init_fundamentals() data = get_fundamentals(query(fundamentals.valuation.market_cap, ...
aeantipov/fk_mc
examples/Hamiltonian.ipynb
gpl-2.0
import importlib import os import sys def is_interactive(): import __main__ as main return not hasattr(main, '__file__') # defaults shell_mode = not is_interactive() plot_graphs = importlib.util.find_spec("matplotlib") is not None and not shell_mode # Matplotlib if (plot_graphs): import matplotlib imp...
JackDi/phys202-2015-work
assignments/assignment05/InteractEx04.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 4 Imports End of explanation """ def random_line(m, b, sigma, size=10): """Create a line y = m*x + b + N(0,si...
pkreissl/espresso
doc/tutorials/raspberry_electrophoresis/raspberry_electrophoresis.ipynb
gpl-3.0
import espressomd import espressomd.interactions import espressomd.electrostatics import espressomd.lb import espressomd.virtual_sites import sys import tqdm import logging logging.basicConfig(level=logging.INFO, stream=sys.stdout) espressomd.assert_features(["ELECTROSTATICS", "ROTATION", "ROTATIONAL_INERTIA", "EXTER...
dnc1994/MachineLearning-UW
ml-classification/blank/module-10-online-learning-assignment-blank.ipynb
mit
from __future__ import division import graphlab """ Explanation: Training Logistic Regression via Stochastic Gradient Ascent The goal of this notebook is to implement a logistic regression classifier using stochastic gradient ascent. You will: Extract features from Amazon product reviews. Convert an SFrame into a Num...
quaquel/EMAworkbench
ema_workbench/examples/scenario_discovery_resampling.ipynb
bsd-3-clause
import pandas as pd data = pd.read_csv("./data/bryant et al 2010 data.csv", index_col=False) x = data.iloc[:, 2:11] y = data.iloc[:, 15].values """ Explanation: Performing Scenario Discovery in Python The purpose of example is to demonstrate how one can do scenario discovery in python. I will demonstrate how we can p...
KECB/learn
BAMM.101x/text_mining.ipynb
mit
def get_words(url): import requests words = requests.get(url).content.decode('latin-1') word_list = words.split('\n') index = 0 while index < len(word_list): word = word_list[index] if ';' in word or not word: word_list.pop(index) else: index+=1 re...
computational-class/cjc2016
code/08.03-probability.ipynb
mit
from collections import Counter import math, random import matplotlib.pyplot as plt # pyplot def random_kid(): return random.choice(["boy", "girl"]) random_kid() both_girls = 0 older_girl = 0 either_girl = 0 random.seed(100) for _ in range(10000): younger = random_kid() older = random_kid() if older...
utensil/julia-playground
py/galgebra_gr_metrics.ipynb
mit
minkowski = build_ga_from_solution(Solution().minkowski()) show(minkowski.mv()) minkowski.g minkowski.e_sq dot_basis_r_basis(minkowski) gg(minkowski) """ Explanation: Minkowski Spacetime Metric End of explanation """ g4coords = (u, x, y, z) = symbols("u x y z") g = [ [0, 0, -exp(-z), 0], [0, HALF * u **...
mohanprasath/Course-Work
numpy/numpy_exercises_from_kyubyong/Logic_functions_Solutions.ipynb
gpl-3.0
import numpy as np np.__version__ """ Explanation: Logic functions End of explanation """ x = np.array([1,2,3]) print np.all(x) x = np.array([1,0,3]) print np.all(x) """ Explanation: Truth value testing Q1. Let x be an arbitrary array. Return True if none of the elements of x is zero. Remind that 0 evaluates to F...
whiterd/Tutorial-Notebooks
2019-06-09-Presentation-Jupyter-Notebook.ipynb
mit
some_global_variable = 6 def my_function(arg): """This is a docstring.""" some_global_variable = 1 return some_global_variable print(my_function(5)) some_global_variable int? *int*? """ Explanation: <img src="resources/jupyter-main-logo.svg" alt="Jupyter" height="200" width="200"> <h1 align="...
griffinfoster/fundamentals_of_interferometry
7_Observing_Systems/7_8_rfi.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary 7. Observing Systems Previous: 7.7 Propagation Effects Next: 7.x Further Reading and References Import standard modules: End of ...
esimonov/chess_prob
01-Square Boards(RUS).ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from string import ascii_uppercase as alphabet """ Explanation: О вероятности попасть под удар фигуры, поставленной случайным образом на шахматную доску На шахматную доску случайным образом поставлены две фигуры. С какой вероятностью первая фигура б...
StefanoAllesina/ISC
regex/solutions/BeeChecklist_solution.ipynb
gpl-2.0
import csv import re """ Explanation: Solution of Bee Checklist First of all, we import the two modules we'll need to read the csv file, and to use regular expressions: End of explanation """ with open('../data/bee_list.txt') as f: csvr = csv.DictReader(f, delimiter = '\t') species = [] authors = [] ...
njtwomey/ADS
03_data_transformation_and_integration/02_worldbank.ipynb
mit
PYTHON_VERSION = 3 ## change to 2 if using Python 2.x DOWNLOAD_DATA = False ## change to True if you do not have the csv files on your machine import pandas as pd from zipfile import ZipFile import matplotlib.pyplot as plt import seaborn as sns import numpy as np from IPython import display from time import sleep %m...
tensorflow/docs-l10n
site/en-snapshot/lattice/tutorials/premade_models.ipynb
apache-2.0
#@title 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, software # distributed under...
enbanuel/phys202-2015-work
assignments/assignment04/TheoryAndPracticeEx01.ipynb
mit
from IPython.display import Image """ Explanation: Theory and Practice of Visualization Exercise 1 Imports End of explanation """ # Add your filename and uncomment the following line: Image(filename='Quartz_death_penalty_chart.0.png') """ Explanation: Graphical excellence and integrity Find a data-focused visualiza...
DTUWindEnergy/TOPFARM
examples/notebook/tutorial1.ipynb
agpl-3.0
# FUSEDWind imports from fusedwind.plant_flow.vt import GenericWindFarmTurbineLayout, WTPC, WeibullWindRoseVT, GenericWindRoseVT # Topfarm lib imports from topfarm.aep import AEP from topfarm.layout_distribution import spiral, DistributeSpiral, DistributeXY, DistributeFilledPolygon from topfarm.plot import OffshorePl...
google-research/google-research
sufficient_input_subsets/tutorials/sis_mnist_tutorial.ipynb
apache-2.0
# 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, software # distributed under the L...
SimplifyData/Codality
Demo-Test.ipynb
mit
Ax = [-1, 3, -4, 5, 1, -6, 2, 1] """ Explanation: Write a function: def solution(A) that, given a zero-indexed array A consisting of N integers, returns any of its equilibrium indices. The function should return −1 if no equilibrium index exists. For example, given array A shown above, the function may return 1, 3 or...
AllenDowney/ModSimPy
soln/jump_soln.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * """ Explanation: Modeling and Simulati...
albahnsen/ML_SecurityInformatics
notebooks/11-SVM.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import stats plt.style.use('fivethirtyeight') """ Explanation: 11 - Support Vector Machines by Alejandro Correa Bahnsen version 0.2, May 2016 Part of the class Machine Learning for Security Informatics This notebook is licensed under a Cr...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-veg-lr/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-veg-lr', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-VEG-LR Topic: Atmos S...
whitead/numerical_stats
project/type1_examples/bikes.ipynb
gpl-3.0
%matplotlib inline import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import scipy.stats as ss import seaborn as sns import scipy.optimize sns.set_style('whitegrid') sns.set_context('notebook') #the data is read in from the csv all_data = pd.read_csv('Dengler_L_Project/tra...
hwagit/jupyter-notebooks
mod-phase-trans-metals-alloys/tmt4260_exercise1.ipynb
mit
%matplotlib inline import numpy as np import scipy.integrate as sci import scipy.special as scs import matplotlib.pyplot as plt import math import warnings warnings.filterwarnings('ignore') fsize = 15 newparams = {'axes.titlesize': fsize, 'axes.labelsize': fsize, 'axes.linewidth': 2, 'savefig.dpi': 200, ...
tensorflow/neural-structured-learning
research/carls/examples/notebooks/carls_mlp_cora.ipynb
apache-2.0
#@title 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, software # distributed u...
tensorflow/docs-l10n
site/zh-cn/tutorials/structured_data/preprocessing_layers.ipynb
apache-2.0
#@title 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, software # distributed under...
marwin-ko/projects
gyant-technical_challenge/word2vec_model.ipynb
mit
from gensim.models import Word2Vec from sklearn.manifold import TSNE from nltk.corpus import genesis import matplotlib.pyplot as plt from textblob import TextBlob from pprint import pprint import pandas as pd import numpy as np import logging import csv import re % matplotlib inline logging.basicConfig(format='%(asctim...
nadvamir/deep-learning
batch-norm/Batch_Normalization_Exercises.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con...
CAChemE/curso-python-datos
notebooks/015-NumPy-EntradaSalida.ipynb
bsd-3-clause
!head ../data/temperaturas.csv # Esta línea no funciona en Windows import numpy as np %matplotlib inline import matplotlib.pyplot as plt datos = np.loadtxt("../data/temperaturas.csv", skiprows=1, # Saltamos una línea usecols=(1, 2, 3), # Solo columnas 2, 3 y 4 ...
robertoalotufo/ia898
src/idft.ipynb
mit
import numpy as np def idft(F): import ia898.src as ia s = F.shape if F.ndim == 1: F = F[np.newaxis,np.newaxis,:] if F.ndim == 2: F = F[np.newaxis,:,:] (p,m,n) = F.shape A = ia.dftmatrix(m) B = ia.dftmatrix(n) C = ia.dftmatrix(p) Faux = np.conjugate(A).dot(F) Faux = Faux.dot(...
scanner-research/scanner
examples/Walkthrough.ipynb
apache-2.0
%%html <video width="560" height="315" src="https://storage.googleapis.com/scanner-data/public/sample-clip.mp4?ignore_cache=1" controls /> """ Explanation: Scanner walkthrough To explore how Scanner fits in to a bigger pipeline, we're going to walk through a simple video analysis application. If you want to analyze a ...
desihub/desitarget
doc/nb/mock-qa.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(style='white', font_scale=1.1, palette='Set2') """ Explanation: Mock QA This notebook visualizes the default set of mocks currently (as of 2018 August) being used in the DESI Data Challenges. End of explanation """ from desit...
raschuetz/foundations-homework
Data_and_Databases_homework/07/Fake Drake/Fake Drake Lyrics Generator.ipynb
mit
from bs4 import BeautifulSoup from urllib.request import urlopen html_str = urlopen ('http://www.azlyrics.com/d/drake.html').read() document = BeautifulSoup(html_str, 'html.parser') """ Explanation: Plan of Action * load the lyrics into a Data Frame. Every couplet will be in a line. [ { 'couplet': """You ...
dlsun/symbulate
docs/rv.ipynb
mit
from symbulate import * %matplotlib inline """ Explanation: Symbulate Documentation Random Variables A random variable is a function that takes as an input an outcome of a probability space and returns a real number. Commonly encountered random variables are either discrete or continuous. * A discrete random variab...
quantopian/research_public
notebooks/lectures/Spearman_Rank_Correlation/questions/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt import math """ Explanation: Exercises: Spearman Rank Correlation Lecture Link This exercise notebook refers to this lecture. Please use the lecture for explanations and sample code. https://www.quantopian.com/lectures#S...
tensorflow/docs-l10n
site/ko/lite/examples/jax_conversion/overview.ipynb
apache-2.0
#@title 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, software # distributed under...
agushman/coursera
src/cours_2/week_1/PA_linreg_stochastic_grad_descent.ipynb
mit
def write_answer_to_file(answer, filename): with open(filename, 'w') as f_out: f_out.write(str(round(answer, 3))) """ Explanation: Линейная регрессия и стохастический градиентный спуск Задание основано на материалах лекций по линейной регрессии и градиентному спуску. Вы будете прогнозировать выручку компан...
woutdenolf/spectrocrunch
doc/source/tutorials/polarization.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from spectrocrunch.sources import polarization """ Explanation: Polarization Following Detlefs[2012] the electric field of a monochromatic plane wave can be described as $$ \begin{equation} \begin{split} \vec{E}(t,\vec{x}) =& \Re[(V_0\hat{e}_0 + V_...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a/td2a_visualisation.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 2A.data - Matplotlib Tutoriel sur matplotlib. End of explanation """ #Pour intégrer les graphes à votre notebook, il suffit de faire %matplotlib inline #ou alors %pylab inline #pylab charge également numpy. C'est la commande du calcul ...
DANA-Laboratory/CoolProp
doc/notebooks/Saturation and Acentric Factor.ipynb
mit
import CoolProp, numpy as np, matplotlib.pyplot as plt %matplotlib inline PropsSI = CoolProp.CoolProp.PropsSI for fluid in ['Ethane','Water','R125']: Tc = PropsSI('Tcrit',fluid) pc = PropsSI('pcrit',fluid) Ts = np.linspace(PropsSI('Ttriple',fluid),Tc) ps = PropsSI('P','T',Ts,'Q',0,fluid) plt.plot(Tc...
nonmean/nonmean.github.io
_notebooks/2020-02-21-introducing-fastpages.ipynb
mit
#hide !pip install pandas altair #collapse-hide import pandas as pd import altair as alt """ Explanation: Introducing fastpages An easy to use blogging platform with extra features for <a href="https://jupyter.org/">Jupyter Notebooks</a>. toc: true badges: true comments: true sticky_rank: 1 author: Jeremy Howard ...
liuhanfei0615/liupengyuan.github.io
chapter2/homework/computer/middle/201611680672.ipynb
mit
ch=input('请输入一个字符: ') n=int(input('请输入打印行数:')) for i in range(1,n+1): print(' '*(n-i)+(ch+' ')*i) """ Explanation: 1、写函数,给定符号和行数,如’*’,5,可打印相应行数的如下图形: End of explanation """ for i in range(1,10): for j in range(1,i+1): print('{}*{}={:<2}'.format(i,j,i*j),end=' ') print() """ Explanation: 2、打印如下9...
griffinfoster/fundamentals_of_interferometry
2_Mathematical_Groundwork/fft_implementation_assignment.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS import cmath """ Explanation: Implementation of a Radix-2 Fast Fourier Transform Import standard modules: End of explanation """ def loop_DFT(x): """ Impleme...
elmaso/tno-ai
aind2-dl-master/IMDB_In_Keras_Solutions.ipynb
gpl-3.0
# Imports import numpy as np import keras from keras.datasets import imdb from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.preprocessing.text import Tokenizer import matplotlib.pyplot as plt %matplotlib inline np.random.seed(42) """ Explanation: Analyzing IMDB Data in...
jovanbrakus/data-analysis-tools
week-4-assignment.ipynb
gpl-3.0
import pandas import numpy import scipy.stats import seaborn import matplotlib.pyplot as plt data = pandas.read_csv('nesarc_pds.csv', low_memory=False) # MAJORDEPLIFE - Diagnosed major depressions in lifetime # S2AQ5A - Drink beer in last 12 months # S2AQ5B - How often drank a beer in last year data['MAJORDEPLIFE'] ...
DeepLearningUB/DeepLearningMaster
13. Reinforcement learning.ipynb
mit
import numpy as np import seaborn class Bandit: def __init__(self): self.arm_values = np.random.normal(0,1,10) self.K = np.zeros(10) self.est_values = np.zeros(10) def get_reward(self,action): noise = np.random.normal(0,1) reward = self.arm_values[action] + noi...
Naereen/notebooks
euler/Project Euler (Python 3) - to problem 50.ipynb
mit
%load_ext Cython from typing import List def divisors(n: int) -> List[int]: return [k for k in range(1, n+1) if n%k == 0] divisors(28) def number_of_divisors(n: int) -> int: return len(divisors(n)) number_of_divisors(28) def int_sqrt(n: int) -> int: if n <= 0: return 0 if n == 1: return 1 i = ...
cathywu/flow
tutorials/tutorial05_visualize.ipynb
mit
! python ../../../rllab/viskit/frontend.py /path/to/result/directory """ Explanation: Tutorial 05: Visualizing Experiment Results This tutorial describes the process of visualizing and replaying the results of Flow experiments run using RL. The process of visualizing results breaks down into two main components: rew...
tensorflow/docs-l10n
site/en-snapshot/lite/performance/post_training_float16_quant.ipynb
apache-2.0
#@title 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, software # distributed under...
tuanavu/coursera-university-of-washington
machine_learning/4_clustering_and_retrieval/assigment/week6/.ipynb_checkpoints/module-9-precision-recall-assignment-graphlab-checkpoint.ipynb
mit
import graphlab from __future__ import division import numpy as np graphlab.canvas.set_target('ipynb') """ Explanation: Exploring precision and recall The goal of this second notebook is to understand precision-recall in the context of classifiers. Use Amazon review data in its entirety. Train a logistic regression m...
nick-youngblut/SIPSim
ipynb/bac_genome/fullCyc/.ipynb_checkpoints/Day1_rep10_justOverlap-checkpoint.ipynb
mit
import os import glob import re import nestly %load_ext rpy2.ipython %load_ext pushnote %%R library(ggplot2) library(dplyr) library(tidyr) library(gridExtra) library(phyloseq) ## BD for G+C of 0 or 100 BD.GCp0 = 0 * 0.098 + 1.66 BD.GCp100 = 1 * 0.098 + 1.66 """ Explanation: Goal Simulating fullCyc Day1 control gra...
kunaltyagi/SDES
notes/python/p_norvig/algo/Probability.ipynb
gpl-3.0
from fractions import Fraction def P(event, space): "The probability of an event, given a sample space of equiprobable outcomes." return Fraction(len(event & space), len(space)) """ Explanation: <div style="text-align: right">Peter Norvig, 12 Feb 2016</div> A Concrete Introduction to Pr...
bmeaut/python_nlp_2017_fall
course_material/06_Decorators_Packaging/06_Numpy.ipynb
mit
import numpy """ Explanation: Please fill out the feedback form: https://docs.google.com/forms/d/e/1FAIpQLScORHXiMgjvLJDl35SFPA1uXF8J8kSMxV6SkcZSQBRvyhj0CA/viewform?usp=sf_link And now for something completely different... Python for mathematics, science and engineering https://scipy.org/ Numpy numpy is a python packa...
andrew-lundgren/detchar
Notebooks/dft_conventions_and_normalization.ipynb
gpl-3.0
invasd = sqrt(2./srate)/sqrt(shaped_psd1) invasd[0] = 0. whitener = sig.hann(seglen*srate)*roll(irfft(invasd), seglen*srate/2) wtest = TimeSeries(sig.convolve(shaped_noise2, whitener, mode='same')[8*srate:-8*srate], sample_rate=srate) p1 = wtest.psd(seglen).plot() mean(wtest.psd(seglen)) / (2....
scottkleinman/WE1S
we1s-test/ipython-notebook-test.ipynb
mit
##### Configuration ##### # Configure the filename filename = "file.txt" # Configure the path to input directory input_path = "C:\Users\USERNAME\Desktop\we1s-test\input" # input_path = "/Users/USERNAME/Desktop/we1s-test/input" # Configure the path to output directory output_path = "C:\Users\USERNAME\Desktop\we1s-tes...
bp-kelley/rdkit
Contrib/CalcLigRMSD/Examples_CalcLigRMSD.ipynb
bsd-3-clause
help(CalcLigRMSD) """ Explanation: CalcLigRMSD CalcLigRMSD calculates the Root-mean-square deviation (RMSD) between two prealigned molecules. This jupyter notebook shows examples of how to use the CalcLigRMSD function. This function is particularly useful in 2 cases: when the atom names in the compared structures d...
florianwittkamp/FD_ACOUSTIC
JupyterNotebook/1D/FD_1D_DX8_DT2_fast.ipynb
gpl-3.0
%matplotlib inline import numpy as np import time as tm import matplotlib.pyplot as plt """ Explanation: FD_1D_DX8_DT2_fast 1-D acoustic Finite-Difference modelling GNU General Public License v3.0 Author: Florian Wittkamp Finite-Difference acoustic seismic wave simulation Discretization of the first-order acoustic wav...
yl565/statsmodels
examples/notebooks/robust_models_0.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std """ Explanation: Robust Linear Models End of explanation """ data = sm.datasets.stackloss.load() data.exog = ...
jdhp-docs/python_notebooks
nb_dev_python/python_pyomo_stock_problem_1.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from pyomo.environ import * """ Explanation: Pyomo - Stock problem v1 Pyomo installation: see http://www.pyomo.org/installation pip install pyomo End of explanation """ # Cost of energy on the market #cost = [10, 30, 20] # -> -100, 100, 0 #cost = [10, 30...
aje/POT
notebooks/plot_gromov.ipynb
mit
# Author: Erwan Vautier <erwan.vautier@gmail.com> # Nicolas Courty <ncourty@irisa.fr> # # License: MIT License import scipy as sp import numpy as np import matplotlib.pylab as pl from mpl_toolkits.mplot3d import Axes3D # noqa import ot """ Explanation: Gromov-Wasserstein example This example is designed to s...
RNAer/Calour
doc/source/notebooks/microbiome_machine_learning.ipynb
bsd-3-clause
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from sklearn.model_selection import RepeatedStratifiedKFold from calour.training import plot_scatter, plot_roc, plot_cm import calour as ca %matplotlib notebook """ Explanation: Microbiome machine learning analysis Setup Import the calour mod...
phanrahan/magmathon
examples/uart/uart.ipynb
mit
import magma as m m.set_mantle_target("ice40") from mantle import Register @m.circuit.combinational def txmod_logic( data : m.Bits(8), writing : m.Bit, valid : m.Bit, dataStore : m.Bits(11), writeClock : m.Bits(14), writeBit : m.Bits(4),) -> (m.Bit, ...
evidation-health/pymc3
pymc3/examples/GLM-hierarchical.ipynb
apache-2.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pymc3 as pm import pandas as pd data = pd.read_csv('data/radon.csv') county_names = data.county.unique() county_idx = data['county_code'].values n_counties = len(data.county.unique()) """ Explanation: The best of both worlds: Hierarchical ...
pombredanne/gensim
docs/notebooks/deepir.ipynb
lgpl-2.1
# ### uncomment below if you want... # ## ... copious amounts of logging info # import logging # logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) # rootLogger = logging.getLogger() # rootLogger.setLevel(logging.INFO) # ## ... or auto-reload of gensim during development # %load...
khalido/algorithims
k nearest neighbours.ipynb
gpl-3.0
iris = sns.load_dataset("iris") print(f"Iris dataset shape: {iris.shape}") iris.head() """ Explanation: K Nearest Neighbours is a algorithim for finding out the similarity or distance b/w two things, to find out how alike/different they are. Say we have a bunch of fruit, KNN will classify them into clusters by using ...
gxxjjj/QuantEcon.py
solutions/uncertainty_traps_solutions.ipynb
bsd-3-clause
%matplotlib inline from __future__ import division import matplotlib.pyplot as plt import numpy as np import quantecon as qe import seaborn as sns import itertools """ Explanation: quant-econ Solutions: Uncertainty Traps Solutions for http://quant-econ.net/py/uncertainty_traps.html End of explanation """ palette = ...
Aggieyixin/cjc2016
code/04.PythonCrawlerGovernmentReport.ipynb
mit
import urllib2 from bs4 import BeautifulSoup from IPython.display import display_html, HTML HTML('<iframe src=http://www.hprc.org.cn/wxzl/wxysl/lczf/ width=1000 height=500></iframe>') # the webpage we would like to crawl """ Explanation: 数据抓取: 抓取47年政府工作报告 王成军 wangchengjun@nju.edu.cn 计算传播网 http://computational-co...
empet/Math
Julia-set.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np def Julia(z,c, Miter=80):#Miter, maximum number of allowed iterations for n in range(Miter): if abs(z)>2: return n z = z*z + c return Miter """ Explanation: Escape Time Algorithm for Plotting Julia Set L...
tensorflow/docs-l10n
site/zh-cn/tutorials/images/transfer_learning.ipynb
apache-2.0
#@title 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, software # distributed under...
AC209ConsumerConfidence/AC209ConsumerConfidence.github.io
DataCleaning_Final.ipynb
gpl-3.0
all_data_list = [] for year in range(1990,2017): data = pd.read_csv('{}_Output.csv'.format(year), header=None) all_data_list.append(data) # list of dataframes data = pd.concat(all_data_list, axis=0) data.columns = ['id','date','headline', 'lead'] data.head() """ Explanation: <hr width=80%> <center> Data Cleani...
grmToolbox/grmpy
promotion/grmpy_tutorial_notebook/tutorial_semipar_notebook.ipynb
mit
import numpy as np from tutorial_semipar_auxiliary import plot_semipar_mte from grmpy.estimate.estimate import fit import warnings warnings.filterwarnings('ignore') %load_ext autoreload %autoreload 2 """ Explanation: Replication of Carneiro, Heckman, & Vytlacil's (2011) Local Instrumental Variables approach In thi...
california-civic-data-coalition/python-calaccess-notebooks
calaccess-exploration/first-python-notebook-data-preparation.ipynb
mit
import os import requests from datetime import datetime from clint.textui import progress import pandas pandas.set_option('display.float_format', lambda x: '%.2f' % x) pandas.set_option('display.max_columns', None) """ Explanation: "First Python Notebook" data preparation By Ben Welsh This notebook prepares a dataset...
jdvelasq/ingenieria-economica
09-conversion-monedas.ipynb
mit
# Importa la librería financiera. # Solo es necesario ejecutar la importación una sola vez. import cashflows as cf """ Explanation: Conversión de Monedas Juan David Velásquez Henao jdvelasq@unal.edu.co Universidad Nacional de Colombia, Sede Medellín Facultad de Minas Medellín, Colombia Haga click aquí para acceder a...
OceanPARCELS/parcels
parcels/examples/tutorial_periodic_boundaries.ipynb
mit
%matplotlib inline from parcels import FieldSet, ParticleSet, JITParticle, plotTrajectoriesFile from parcels import AdvectionRK4 from datetime import timedelta as delta import math """ Explanation: Tutorial on how to implement periodic boundaries This tutorial will show how to implement Periodic boundary conditions (w...
probml/pyprobml
notebooks/book2/09/vb_gmm_tfp.ipynb
mit
import functools import numpy as np try: import tensorflow.compat.v2 as tf except ModuleNotFoundError: %pip install -qq tensorflow import tensorflow.compat.v2 as tf try: import tensorflow_probability as tfp except ModuleNotFoundError: %pip install -qq tensorflow-probability import tensorflow_pr...
phoebe-project/phoebe2-docs
2.0/examples/mesh_wd.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" %matplotlib inline """ Explanation: Wilson-Devinney Style Meshing Setup Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanat...
TareasJF/INF393
T2/Pregunta1.ipynb
mit
# Generacion de los datos para analisis from sklearn.utils import check_random_state import matplotlib.patches as mpatches import numpy as np def build_data(seed, noise_seed=64, n_samples=500, noise=20): n_samples=500 mean = (0,-4) C = np.array([[0.3, 0.1], [0.1, 1.5]]) np.random.seed(seed) datos1...
bkuczenski/lca-tools-datafiles
doc/Jaccard Index matching example.ipynb
gpl-3.0
stopWordsFile = "en.txt" with open(stopWordsFile) as f: stoplist = [x.strip('\n') for x in f.readlines()] """ Explanation: Load in the stopwords file. These are common words which we wish to exclude when performing comparisons (a, an, the, etc). Every word is separated by a new line. End of explanation """ # htt...
axbaretto/beam
examples/notebooks/documentation/transforms/python/elementwise/partition-py.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License") # 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 u...
Kaggle/learntools
notebooks/deep_learning/raw/ex5_data_augmentation.ipynb
apache-2.0
from tensorflow.keras.applications import ResNet50 from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten, GlobalAveragePooling2D num_classes = 2 resnet_weights_path = '../input/resnet50/resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5' my_new_model = Sequential() my_new...
aakashm301/Workshop
Refactored_Py_DS_ML_Bootcamp-master/09-Geographical-Plotting/03-Choropleth Maps Exercise - Solutions.ipynb
gpl-3.0
import plotly.graph_objs as go from plotly.offline import init_notebook_mode,iplot,plot init_notebook_mode(connected=True) """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Choropleth Maps Exercise - Solutions Welcome to the Choropleth Maps Exercise! In this exercise ...