repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
reata/ProbabilityAndStatistics | Random Variable and its Distribution.ipynb | mit | import math
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
# 引入绘图包
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
%matplotlib inline
"""
Explanation: 随机变量及其分布 Random Variable and its Distribution
包括以下内容:
1. 随机变量 Random Variable
2. 伯努利分布 Bernoulli D... |
Applied-Groundwater-Modeling-2nd-Ed/Chapter_4_problems-1 | P4.6_Flopy_Hubbertville_no_flow_BC_test.ipynb | gpl-2.0 | %matplotlib inline
import sys
import os
import shutil
import numpy as np
from subprocess import check_output
# Import flopy
import flopy
"""
Explanation: <img src="AW&H2015.tiff" style="float: left">
<img src="flopylogo.png" style="float: center">
Problem P4.6 Hubbertville Areal Model testing No-Flow BCs
In Problem P... |
adrianstaniec/deep-learning | 15_gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
tensorflow/tensor2tensor | tensor2tensor/notebooks/hello_t2t-rl.ipynb | apache-2.0 | #@title
# Copyright 2018 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... |
andrewzwicky/puzzles | dailyprogrammer/submissions/2017-09-04.ipynb | mit | from matplotlib import pyplot as plt
from matplotlib import patches as patches
from matplotlib import ticker as ticker
from math import atan, degrees, cos, sin
%matplotlib inline
"""
Explanation: Description
In this challenge, you will be given a set of circles, defined by their centers and radii. Your goal is to fin... |
goodwordalchemy/thinkstats_notes_and_exercises | code/chap10_linear_least_squares.ipynb | gpl-3.0 | ##birthweight vs mother's age:
live, firsts, others = first.MakeFrames()
live = live.dropna(subset=['agepreg', 'totalwgt_lb'])
ages = live.agepreg
weights = live.totalwgt_lb
inter, slope = thinkstats2.LeastSquares(ages, weights)
fit_xs, fit_ys = thinkstats2.FitLine(ages, inter, slope)
thinkplot.Plot(fit_xs, fit_ys)... |
kmalhan/ml_trade | notes/read_stock_data.ipynb | mit | # Import modules
import pandas as pd
import pandas_datareader.data as web
import datetime as dt
import matplotlib.pyplot as plt
import os
import numpy as np
%matplotlib inline
"""
Explanation: Reading and Plotting Stock Information
End of explanation
"""
# Import AAPL stock data
start = dt.datetime(2010, 1, 1)
end =... |
zauonlok/cs231n | assignment2/ConvolutionalNetworks.ipynb | mit | # As usual, a bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.cnn import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient
from cs231n.layers import *
from cs231n.fast_layers import *
from cs... |
Neurosim-lab/netpyne | netpyne/tutorials/saving_loading_tut/saving_tut.ipynb | mit | !mpiexec -n 4 nrniv -python -mpi saving_normal_init.py
"""
Explanation: Saving and Loading Tutorial
Preparing a virtual environment
First, you need to have Python3 and openmpi installed and running on your machine.
In a new directory, here are the steps I took to create a virtual environment for this Jupyter notebook:... |
erickpeirson/statistical-computing | .ipynb_checkpoints/Linear and Quadratic Discriminant Analysis-checkpoint.ipynb | cc0-1.0 | X = np.linspace(0, 20, 100)
def f(x):
if x < 7:
return 'a', 2. + np.random.random()
elif x < 14:
return 'b', 4 + np.random.random()
else:
return 'c', 6 + np.random.random()
K, Y = zip(*[f(x) for x in X])
colors = plt.get_cmap('Set1')
categories = ['a', 'b', 'c']
plt.scatter(X, Y, c=[... |
AllenDowney/CompStats | hypothesis.ipynb | mit | from __future__ import print_function, division
import numpy
import scipy.stats
import matplotlib.pyplot as pyplot
import first
# some nicer colors from http://colorbrewer2.org/
COLOR1 = '#7fc97f'
COLOR2 = '#beaed4'
COLOR3 = '#fdc086'
COLOR4 = '#ffff99'
COLOR5 = '#386cb0'
%matplotlib inline
"""
Explanation: Hypot... |
sellaroliandrea/matrix | matrici.ipynb | mit | lista01 = ['pippo', 4, 5.7, ['lista', 'di', 'parole']]
"""
Explanation: Algebra lineare: matrici
In matematica, una matrice è uno schieramento rettangolare di oggetti.
Sulle matrici sono definite alcune operazioni e le matrici vengono usate in diversi campi della matematica.
In questo lavoro vedremo come realizzare de... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session10/Day4/missing_information/missingdata_tutorial.ipynb | mit | class SolutionMissingError(Exception):
def __init__(self):
Exception.__init__(self,"You need to complete the solution for this code to work!")
def REPLACE_WITH_YOUR_SOLUTION():
raise SolutionMissingError
REMOVE_THIS_LINE = REPLACE_WITH_YOUR_SOLUTION
"""
Explanation: WARNING!!!
After pulling down the tu... |
harpolea/r3d2 | docs/waves.ipynb | mit | from r3d2 import eos_defns, State, wave
eos = eos_defns.eos_gamma_law(5.0/3.0)
U = State(1.0, 0.1, 0.05, 0.2, eos, label="known")
U
"""
Explanation: Waves
The solution to the Riemann problem is built out of waves. These are regions where the variables change, separating constant states. There are two basic types of w... |
saudijack/unfpyboot | Day_00/01_Basics/01_basicsTraining.ipynb | mit | print "Hello World!"
print 'Hello World!'
# This is a comment.
print 'This is not a comment.'
'Something smells funny.'
"""
Explanation: Python Basics
This material was heavily influenced by (stolen from) the UC Berkeley and NASA GSFC Python Bootcamps.
Getting Python to talk back
End of explanation
"""
print 2 + ... |
ginolhac/tutorials | python/advanced/jupyter/code/Monte-Carlo calculation of pi.ipynb | gpl-3.0 | from math import hypot
# Test if point p(x, y) is inside the unit disk
# Returns: True if inside, False if outside
def test(p):
return hypot(p[0], p[1]) < 1
# Returns estimated pi value of an experiment
def compute_pi(i, t):
return 4.0*i/t
"""
Explanation: Use Monte-Carlo method to compute pi value
This examp... |
muneebalam/scrapenhl2 | examples/Boxplot Comparison of Per-Game CF and CA.ipynb | mit | import pandas as pd
from pylab import *
%matplotlib inline
import seaborn as sns
import os.path
sns.set()
sns.reset_orig() # want to use matplotlib style, not seaborn style
import scrapenhl2.scrape.team_info as team_info
import scrapenhl2.scrape.schedules as schedules
import scrapenhl2.scrape.teams as teams
import sc... |
swirlingsand/deep-learning-foundations | gans/dcgan-svhn/DCGAN.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
CalPolyPat/phys202-2015-work | assignments/assignment12/FittingModelsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
"""
Explanation: Fitting Models Exercise 2
Imports
End of explanation
"""
data=np.load("decay_osc.npz")
T=data["tdata"]
Y=data["ydata"]
dy=data["dy"]
f=plt.figure(figsize=(15,10))
plt.errorbar(T,Y,yerr=dy,fmt='o');
as... |
nicholsonjohnc/jupyter | recurrent_neural_networks_for_time_series_prediction.ipynb | mit | # Import libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
# Import data, format dates, sort data ascending by date
data = pd.read_csv(
'data/AirPassengers.csv',
sep=',',
header=0,
names=['date','no_passengers'],
usecols=['date','no_passengers'... |
napsternxg/Udacity-Deep-Learning | udacity/2_fullyconnected.ipynb | gpl-3.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
import cPickle as pickle
import numpy as np
import tensorflow as tf
"""
Explanation: Deep Learning
Assignment 2
Previously in 1_notmnist.ipynb, we created a pickle with formatted datasets for training, developm... |
nikitaswinnen/model-for-predicting-rapid-response-team-events | Data Science Notebooks/Notebooks/EDA/encounter_durations[EDA].ipynb | apache-2.0 | import pandas as pd
import numpy as np
from impala.util import as_pandas
# connect to impala
from impala.dbapi import connect
conn = connect(host="mycluster.domain.com", port=my_impala_port_number)
# Make sure we're pulling from the right location
cur = conn.cursor()
cur.execute('use my_db')
import matplotlib.pypl... |
statsmodels/statsmodels.github.io | v0.12.2/examples/notebooks/generated/statespace_sarimax_stata.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
from datetime import datetime
import requests
from io import BytesIO
# Register converters to avoid warnings
pd.plotting.register_matplotlib_converters()
plt.rc("figure", ... |
dataewan/deep-learning | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
parrt/msan501 | notes/coding.ipynb | mit | print 'hi'
"""
Explanation: Introduction to Python coding
TODO:Perhaps recognize to the students that I know they know the simple conditional and looping statements. The goal here is to get them retrained from birth so to speak to properly understand these operations in context. I'd like to show them how to think abou... |
BeatHubmann/17F-U-DLND | sentiment-rnn/Sentiment_RNN_Solution.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment-network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment-network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
QuantScientist/Deep-Learning-Boot-Camp | day02-PyTORCH-and-PyCUDA/PyTorch/03 PyTorch CPU to GPU copy.ipynb | mit | % reset -f
from __future__ import print_function
from __future__ import division
import math
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import torch
import sys
print('__Python VERSION:', sys.version)
print('__pyTorch VERSION:', torch.__version__)
print('__CUDA VERSION')
from subprocess impor... |
ThunderShiviah/code_guild | interactive-coding-challenges/graphs_trees/tree_bfs/bfs_challenge.ipynb | mit | %run ../bst/bst.py
%load ../bst/bst.py
def bfs(self, visit_func):
# TODO: Implement me
pass
"""
Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small>
Challenge Notebook
Problem: Implement breadth-first search on a binary tree.
Constraints
Test Ca... |
mne-tools/mne-tools.github.io | 0.24/_downloads/48e14d460d6470997b890b156746a671/30_strf.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.decoding import ReceptiveField, TimeDelayingRidge
from scipy.stats import multivariate_normal
from scipy.io import loadmat
... |
tensorflow/quantum | docs/tutorials/quantum_data.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... |
mairob/Trafficsign-classification-in-TensorFlow | CNNs in TensorFlow.ipynb | mit | ## Augumenting functions based on Naoki Shibuya's work! Thank you!
## https://github.com/naokishibuya/car-traffic-sign-classification
import cv2
import numpy as np
def resizeImage(image):
return cv2.resize(img, (48,48))
def random_brightness(image, ratio):
hsv = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
br... |
planetlabs/notebooks | jupyter-notebooks/udm2/udm2.ipynb | apache-2.0 | from collections import namedtuple, OrderedDict
import os
import matplotlib
import matplotlib.colors as colors
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import rasterio
%matplotlib inline
"""
Explanation: Usable Data Mask (UDM2) Visualization and Masking
The Usable Data... |
quantumlib/Cirq | docs/named_topologies.ipynb | apache-2.0 | try:
import cirq
except ImportError:
print("installing cirq...")
!pip install --quiet cirq --pre
print("installed cirq.")
import cirq
from typing import Iterable, List, Optional, Sequence
import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
"""
Explanation: Named Topologies
<... |
SciTools-incubator/python-stratify | index.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
nx, ny = 6, 3
np.random.seed(0)
orography = np.random.normal(1000, 600, size=(ny, nx)) - 400
sea_level_temp = np.random.normal(290, 5, size=(ny, nx))
# Now visualise:
import matplotlib.pyplot as plt
plt.set_cmap('viridis')
fig = plt.figure(figsize=(8, 6))
plt.subplot(1, 2, 1... |
kit-cel/lecture-examples | mloc/ch4_Deep_Learning/MLP_introduction_ReLU.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
function_select = 4
def myfun(x):
functions = {
1: np.power(x,2), # quadratic function
2: np.sin(x), # sinus
3: np.sign(x), # signum
4: np.exp(x), # exponential function
5: np.abs(x)
}
return func... |
zomansud/coursera | ml-classification/week-4/module-6-decision-tree-practical-assignment-blank.ipynb | mit | import graphlab
"""
Explanation: Decision Trees in Practice
In this assignment we will explore various techniques for preventing overfitting in decision trees. We will extend the implementation of the binary decision trees that we implemented in the previous assignment. You will have to use your solutions from this pr... |
hetland/python4geosciences | materials/2_numpy.ipynb | mit | import numpy as np
"""
Explanation: Numpy
End of explanation
"""
d = [1, 2, 3, 4, 5]
np.array(d)
"""
Explanation: The core of the numpy package is the array class. Let's examine that first. We can make an array out of a sequence, like a list.
End of explanation
"""
d = [1, 2, 3.1415, 4, 5]
np.array(d)
"""
Explan... |
oseledets/talks-online | tda-2016/Presentation.ipynb | cc0-1.0 | #import
import tt
import numpy as np
import scipy.linalg as la
import scipy.sparse as ssp
import scipy.sparse.linalg as sla
import math
#Graphics
import matplotlib.pyplot as plt
#import prettyplotlib as ppl
%matplotlib inline
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png')
import matpl... |
ledeprogram/algorithms | class6/donow/Devulapalli_Harsha_Class6_DoNow.ipynb | gpl-3.0 | import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt # package for doing plotting (necessary for adding the line)
import statsmodels.formula.api as smf
"""
Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model
End of explanation
"""
cd C:\User... |
akloster/porekit-python | examples/squiggle_classifier_1/GClassify_Datasets.ipynb | isc | # Please change E-Mail!
from Bio import Entrez
Entrez.email = ""
import os
import porekit
import pandas as pd
import numpy as np
import random
import skbio
import h5py
"""
Explanation: Dataset For Group Classification
This notebook does the following:
Download three bacterial genomes:
E. Coli
M. Tuberculosis
S. Aur... |
usantamaria/iwi131 | ipynb/26-EjerciciosTipoCertamen/Ejercicios.ipynb | cc0-1.0 | m = 'Edkhy`°nmtdun '
s = ""
for c in m:
s += chr(ord(c)+1)
print s
m = 'Mensaje Secreto'
s = ""
for c in m:
s += chr(ord(c)-1)
print s
"""
Explanation: <header class="w3-container w3-teal">
<img src="images/utfsm.png" alt="" align="left"/>
<img src="images/inf.png" alt="" align="right"/>
</header>
<br/><br/... |
paulromano/openmc | examples/jupyter/post-processing.ipynb | mit | %matplotlib inline
from IPython.display import Image
import numpy as np
import matplotlib.pyplot as plt
import openmc
"""
Explanation: Post Processing
This notebook demonstrates some basic post-processing tasks that can be performed with the Python API, such as plotting a 2D mesh tally and plotting neutron source site... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_visualize_epochs.ipynb | bsd-3-clause | import os.path as op
import mne
data_path = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample')
raw = mne.io.read_raw_fif(op.join(data_path, 'sample_audvis_raw.fif'),
add_eeg_ref=False)
raw.set_eeg_reference() # set EEG average reference
events = mne.read_events(op.join(data_path, 'sa... |
vatsalgit/Deep-Learning- | assignment2/Problem_1.ipynb | gpl-3.0 | from lib.rnn import *
from lib.layer_utils import *
from lib.grad_check import *
from lib.optim import *
from lib.train import *
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'... |
camiloenparis/camiloenparis | Car_classifier_with_Google_Cloud_Vision.ipynb | mit | !pip install google-cloud-vision==0.35.2
"""
Explanation: <a href="https://colab.research.google.com/github/camiloenparis/camiloenparis/blob/master/Car_classifier_with_Google_Cloud_Vision.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Nous allons c... |
jmschrei/pomegranate | benchmarks/pomegranate_vs_libpgm.ipynb | mit | %pylab inline
import seaborn, time
seaborn.set_style('whitegrid')
"""
Explanation: pomegranate / libpgm comparison
authors: Jacob Schreiber (jmschreiber91@gmail.com)
<a href="https://github.com/CyberPoint/libpgm">libpgm</a> is a python package for creating and using Bayesian networks. I was unable to figure out how to... |
samgoodgame/sf_crime | iterations/misc/Cha_Goodgame_Kao_Moore_W207_Final_Project_updated_08_20_1945.ipynb | mit | # Import relevant libraries:
import time
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn import preprocessing
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import StandardScaler
from sklearn.naive_bayes import BernoulliNB
from sklearn.na... |
idekerlab/sdcsb-advanced-tutorial | tutorials/answers/Lesson_1_Introduction_to_cyREST_answer.ipynb | mit | # HTTP Client for Python
import requests
# Standard JSON library
import json
# Basic Setup
PORT_NUMBER = 1234 # This is the default port number of CyREST
# IP address of your PHYSICAL MACHINE (NOT VM)
IP = '192.168.100.172'
BASE = 'http://' + IP + ':' + str(PORT_NUMBER) + '/v1/'
# Header for posting data to the s... |
UDST/activitysim | activitysim/examples/example_estimation/notebooks/12_joint_tour_participation.ipynb | bsd-3-clause | import os
import larch # !conda install larch -c conda-forge # for estimation
import pandas as pd
"""
Explanation: Estimating Joint Tour Participation
This notebook illustrates how to re-estimate a single model component for ActivitySim. This process
includes running ActivitySim in estimation mode to read household... |
astro4dev/OAD-Data-Science-Toolkit | Teaching Materials/Machine Learning/ml-training-intro/notebooks/00 - Data Loading.ipynb | gpl-3.0 | from sklearn.datasets import load_digits
import numpy as np
digits = load_digits()
digits.keys()
digits.data.shape
digits.target.shape
digits.target
np.bincount(digits.target)
import matplotlib.pyplot as plt
%matplotlib notebook
# you can also use matplotlib inline
plt.matshow(digits.data[0].reshape(8, 8), cmap=p... |
biosustain/cameo-notebooks | 03-simulate-models.ipynb | apache-2.0 | from cameo import load_model
model = load_model('iJO1366')
"""
Explanation: Simulate models
cameo uses the model data structures defined by cobrapy, our favorite COnstraints-Based Reconstruction and Analysis tool for Python. cameo is thus 100% compatible with cobrapy. For efficiency reasons, however, cameo implements ... |
4dsolutions/Python5 | Annotating YouTubes.ipynb | mit | from IPython.display import YouTubeVideo
YouTubeVideo("3Md5KCCQX-0")
"""
Explanation: Annotating Public Resources Using I-Python Notebook
<h2>A Linear Algebra Example</h2>
End of explanation
"""
import numpy as np
from scipy import linalg
# https://en.wikipedia.org/wiki/Hermitian_matrix
A = np.matrix('2, 2+1j, 4; ... |
slundberg/shap | notebooks/tabular_examples/tree_based_models/Explaining the Loss of a Model.ipynb | mit | import shap
import sklearn
import xgboost
import numpy as np
"""
Explanation: Explaining the Loss of a Tree Model
Explaining the loss of a model can be very useful for debugging and model monitoring. This notebook gives a very simple example of how this works. Note that explaining the loss of a model requires passing ... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session13/Day2/01-Introduction-to-GPs.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
from matplotlib import rcParams
rcParams["figure.dpi"] = 100
rcParams["figure.figsize"] = 12, 4
"""
Explanation: An introduction to Gaussian Processes
End of explanation
"""
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1)
u = np... |
shaypal5/rotten_needles | notebooks/predicting_failed_movies.ipynb | mit | import os
import pandas as pd
import sklearn as skl
import holcrawl.shared
dataset_dir = holcrawl.shared._get_dataset_dir_path()
dataset_path = os.path.join(dataset_dir, 'movies_dataset.csv')
df = pd.read_csv(dataset_path)
"""
Explanation: Prediction Failed Movies
Loading the dataset
End of explanation
"""
df['... |
zenoss/pywbem | docs/notebooks/pulloperations.ipynb | lgpl-2.1 | import pywbem
# Global variables used by all examples:
server = 'http://localhost'
username = 'user'
password = 'password'
namespace = 'root/cimv2'
classname = 'PyWBEM_Person'
max_obj_cnt = 100
conn = pywbem.WBEMConnection(server, (username, password),
default_namespace=namespace,
... |
syednasar/datascience | deeplearning/sentiment-rnn/Sentiment RNN.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment_network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment_network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
NikitaLoik/machineLearning_andrewNg | notebooks/3_neural_networks_I.ipynb | mit | file_path = '../course_materials/ex3data1.mat'
data = loadmat(file_path)
print(f"X {data['X'].shape}")
print(f"y {data['y'].shape}")
np.random.seed(0)
def digitDatum(x):
'''converts vector x (1,400) into a matrix(32,32)'''
# by default order='C', but in this case the lines are assembled in wrong order
retu... |
tensorflow/docs-l10n | site/ko/lattice/tutorials/shape_constraints.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... |
Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE | notebooks/05_01_matplotlib.ipynb | mit | # only for the notebook
%matplotlib inline
# only in the ipython shell
# %matplotlib
"""
Explanation: Visualisation using
Table of Contents
Notebook Setup
Simple Line Plots
Using different styles for plots
Setting x and y limits
Labeling plots
Label formatting
LaTeX labels
Legends
Grids
Axis scales
Ticks
Multiple ... |
Chipe1/aima-python | csp.ipynb | mit | from csp import *
from notebook import psource, plot_NQueens
%matplotlib inline
# Hide warnings in the matplotlib sections
import warnings
warnings.filterwarnings("ignore")
"""
Explanation: CONSTRAINT SATISFACTION PROBLEMS
This IPy notebook acts as supporting material for topics covered in Chapter 6 Constraint Satisf... |
4DGenome/Chromosomal-Conformation-Course | Notebooks/01-Mapping-Copy1.ipynb | gpl-3.0 | from pytadbit.mapping.full_mapper import full_mapping
"""
Explanation: Table of Contents
Iterative vs fragment-based mapping
Advantages of iterative mapping
Advantages of fragment-based mapping
Mapping
Iterative mapping
Fragment-based mapping
Iterative vs fragment-based mapping
Iterative mapping first proposed b... |
syednasar/talks | synthetic-dialog/script_generation-tech-summit.ipynb | mit | """
Get the helper function. Make sure you look at the helper to see what it is doing
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
"""
Explanation: Script Generation
In this session, we'll generate your own Simpsons TV scripts using RNNs. We'll be using par... |
deepchem/deepchem | examples/tutorials/Exploring_Quantum_Chemistry_with_GDB1k.ipynb | mit | !pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Exploring Quantum Chemistry with GDB1k
Most of the tutorials we've walked you through so far have focused on applications to the drug discovery realm, but DeepChem's tool suite works for molecular design problems generally. In this tutor... |
jmarrec/eQSimParsing | eQSimParsing demonstration.ipynb | mit | %run eqsimparsing.py
"""
Explanation: <p style="font-size: 157.1%; font-weight: bold; line-height: 1; margin: 1.27em 0 0;">Table of Contents</p>
<ol class="toc-item">
<li>
<a href="#Run-the-file">Run the file</a>
</li>
<li>
<a href="#Example-of-how-to-manipulate-the-objects-in-IPython">Example of how to manipulate... |
patrick-kidger/diffrax | examples/neural_cde.ipynb | apache-2.0 | import math
import time
import diffrax
import equinox as eqx # https://github.com/patrick-kidger/equinox
import jax
import jax.nn as jnn
import jax.numpy as jnp
import jax.random as jrandom
import jax.scipy as jsp
import matplotlib
import matplotlib.pyplot as plt
import optax # https://github.com/deepmind/optax
ma... |
brclark-usgs/flopy | examples/Notebooks/flopy3_lake_example.ipynb | bsd-3-clause | %matplotlib inline
import os
import sys
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import flopy
workspace = os.path.join('data')
# make sure workspace directory exists
if not os.path.exists(workspace):
os.makedirs(workspace)
print(sys.version)
print('numpy version: {}'.format(np._... |
alasdairtran/mclearn | projects/alasdair/notebooks/contextual_bandits.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import pickle
import seaborn as sns
from pandas import DataFrame, Index
from sklearn import metrics
from sklearn.linear_model import SGDClassifier
from sklearn.svm import SVC
from sklearn.kernel_approximation import RBFSampler, Nystroem
from sklearn.linear_model import PassiveAggr... |
empirical-org/WikipediaSentences | notebooks/BERT-2 Experiments One Model.ipynb | agpl-3.0 | import torch
from pytorch_transformers.tokenization_bert import BertTokenizer
from pytorch_transformers.modeling_bert import BertForSequenceClassification
BERT_MODEL = 'bert-large-uncased'
BATCH_SIZE = 16 if "base" in BERT_MODEL else 2
GRADIENT_ACCUMULATION_STEPS = 1 if "base" in BERT_MODEL else 8
tokenizer = BertT... |
pombredanne/gensim | docs/notebooks/ldaseqmodel.ipynb | lgpl-2.1 | # setting up our imports
from gensim.models import ldaseqmodel
from gensim.corpora import Dictionary, bleicorpus
import numpy
from gensim.matutils import hellinger
"""
Explanation: Dynamic Topic Models
Imagine you have a gigantic corpus which spans over a couple of years. You want to find semantically similar documen... |
py-bootcamp/python-for-beginners | notebooks/part_2.ipynb | cc0-1.0 | age = 29
first_name = 'Christian'
first_name
"""
Explanation: Variables and types in Python
But what is a variable?
A variable is way to store information.
In the print_sum example z is a variable to the result of x + y
Variables are names for values.
In Python the = symbol assigns the value on the right to the name ... |
dipanjank/ml | data_analysis/regression_with_categorical_variables.ipynb | gpl-3.0 | %pylab inline
pylab.style.use('ggplot')
import numpy as np
import pandas as pd
"""
Explanation: <h1 align="center">Regression with Categorical Variables</h1>
End of explanation
"""
smoking_txt = """Wgt Gest Smoke
2940 38 yes
3130 38 no
2420 36 yes
2450 34 no
2760 39 yes
2440 35 yes
3226 40 no
3301 42 yes
2729 37 no
... |
M0nica/datalogues | content/posts/tmdb-api.ipynb | mit | import config # to hide TMDB API keys
import requests # to make TMDB API calls
import locale # to format currency as USD
locale.setlocale( locale.LC_ALL, '' )
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter # to format currency on charts axis
api_key ... |
infilect/ml-course1 | keras-notebooks/AutoEncoders/6.2 NLP and Deep Learning.ipynb | mit | from gensim.models import word2vec
from gensim.models.word2vec import Word2Vec
"""
Explanation: Natural Language Processing using Artificial Neural Networks
“In God we trust. All others must bring data.” – W. Edwards Deming, statistician
Word Embeddings
What?
Convert words to vectors in a high dimensional space. Eac... |
aschaffn/phys202-2015-work | days/day06/Matplotlib.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Visualization with Matplotlib
Learning Objectives: Learn how to make basic plots using Matplotlib's pylab API and how to use the Matplotlib documentation.
This notebook focuses only on the Matplotlib API, rather that the broader que... |
britm92/XR-Seq-Analysis | XR-seq_Analysis_Processed_Files.ipynb | gpl-3.0 | #Packages used in this analysis
import collections
import pandas as pd
from functools import reduce
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde
from scipy.stats import stats
'''
gen_df takes in a list of bedfiles for each sample and seperates alignment coun... |
openfisca/senegal | notebooks/hackathon_ogp_paris.ipynb | agpl-3.0 | import pandas as pd
import os
import pkg_resources
from openfisca_senegal import SenegalTaxBenefitSystem
asset_directory = os.path.join(
pkg_resources.get_distribution('openfisca-senegal').location,
'openfisca_senegal',
'assets',
)
tax_benefit_system = SenegalTaxBenefitSystem()
"""
Explanation: Comp... |
liviu-/notebooks | notebooks/time_series_introduction.ipynb | mit | from collections import OrderedDict
import datetime
import warnings
# Parsing
from bs4 import BeautifulSoup
import requests
# Plotting
import matplotlib.pyplot as plt
# Numerical computation
import pandas as pd
import numpy as np
# Predicting
from statsmodels.tsa.stattools import acf, pacf
from statsmodels.tsa.arima_... |
ARM-software/lisa | ipynb/deprecated/tutorial/UseCaseExamples_SchedTuneAnalysis.ipynb | apache-2.0 | res_dir = '../../results/SchedTuneAnalysis/'
!tree {res_dir}
noboost_trace = res_dir + 'trace_noboost.dat'
boost15_trace = res_dir + 'trace_boost15.dat'
boost25_trace = res_dir + 'trace_boost25.dat'
# trace_file = noboost_trace
trace_file = boost15_trace
# trace_file = boost25_trace
"""
Explanation: Experiments coll... |
piyueh/SEM-Toolbox | solutions/chapter02/exercise02.ipynb | mit | import numpy
import re
from matplotlib import pyplot
from IPython.display import Latex, Math, display
% matplotlib inline
import os, sys
sys.path.append(os.path.split(os.path.split(os.getcwd())[0])[0])
import utils.quadrature as quad
import utils.poly as poly
"""
Explanation: Exercise 2
End of explanation
"""
def ... |
gbtimmon/ase16GBT | code/7/workshop/magoff2_performance.ipynb | unlicense | %matplotlib inline
# All the imports
from __future__ import print_function, division
import pom3_ga, sys
import pickle
# TODO 1: Enter your unity ID here
__author__ = "<magoff2>"
"""
Explanation: Workshop 4 - Performance Metrics
In this workshop we study 2 performance metrics(Spread and Inter-Generational Distance) ... |
streety/biof509 | Wk01-Overview.ipynb | mit | import numpy as np
print("Numpy:", np.__version__)
"""
Explanation: Week 1 - Getting Started
End of explanation
"""
dir(np)
"""
Explanation: Python Summary
Further information
More information is usually available with the help function. Using ? brings up the same information in ipython.
Using the dir function li... |
MingChen0919/learning-apache-spark | notebooks/04-miscellaneous/pipeline.ipynb | mit | import pandas as pd
pdf = pd.DataFrame({
'x1': ['a','a','b','b', 'b', 'c'],
'x2': ['apple', 'orange', 'orange','orange', 'peach', 'peach'],
'x3': [1, 1, 2, 2, 2, 4],
'x4': [2.4, 2.5, 3.5, 1.4, 2.1,1.5],
'y1': [1, 0, 1, 0, 0, 1],
'y2': ['yes', 'no', 'no', 'yes', 'yes', 'ye... |
johnhw/summerschool2017 | static/mcmc_typing.ipynb | mit | # standard imports
import numpy as np
import matplotlib.pyplot as plt
import sys, os, time
import pandas as pd
import pymc as mc
%matplotlib inline
import matplotlib as mpl
mpl.rcParams['figure.figsize'] = (12.0, 8.0)
import scipy.stats
# fix for pydot on windows machines
import os
os.environ["PATH"] += os.pathse... |
dwhswenson/openpathsampling | examples/alanine_dipeptide_tps/AD_tps_2a_run_flex.ipynb | mit | %matplotlib inline
import openpathsampling as paths
"""
Explanation: Running the production TPS simulation
This is file runs the main calculation for the flexible length TPS simulation. It requires the file ad_tps_equil.nc, which is written in the notebook AD_tps_1_trajectory.ipynb.
In this file, you will learn:
how ... |
AlphaGit/deep-learning | tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
msadegh97/machine-learning-course | 03-classification.ipynb | gpl-3.0 | import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
from sklearn.datasets import load_breast_cancer
cancer = load_breast_cancer()
cancer['target_names']
cancer['feature_names']
X = cancer['data'][:, 0]
X = X.reshape((X.shape[0], 1))
y = cancer['target']
y = 1 - y.reshape((y.shape[0], 1))
pl... |
arcyfelix/Courses | 17-09-27-AWS Machine Learning A Complete Guide With Python/05 - Improving the model/02 - ml_quadratic_extra_features_examples.ipynb | apache-2.0 | def quad_func (x):
return 5 * x ** 2 -23 * x + 47
# Training Set: 140 samples
# Eval Set: 60 samples
# Test Set: 60 samples
# Total: 260 samples
np.random.seed(5)
samples = 260
x_vals = pd.Series(np.random.rand(samples) * 20)
x2_vals = x_vals ** 2
x3_vals = x_vals ** 3
x4_vals = x_vals ** 4
y_vals = x_vals.map(q... |
AntonelliLab/seqcap_processor | docs/notebook/subdocs/extract_contigs.ipynb | mit | %%bash
head ../../data/raw/palm_reference_sequences.fasta
"""
Explanation: Extracting target contigs
In order to extract the contigs representing your target sequences (the sequences that were being captured during the sequence capture process), you need to provide a fasta file containing the reference sequences for a... |
boland1992/SeisSuite | seissuite/ant/.ipynb_checkpoints/Preprocess_Example-checkpoint.ipynb | gpl-3.0 | from pysismo.pspreprocess import Preprocess
from obspy import read
from obspy.core import Stream
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
"""
Explanation: Ambient Noise Waveforms Preprocessing Methods Examples
The following notebook contains examples for using the psprocess.py toolbox fo... |
littlewizardLI/Udacity-ML-nanodegrees | Project5-digit-recognition/digit_recognition.ipynb | apache-2.0 | from keras.datasets import mnist
(X_raw, y_raw), (X_raw_test, y_raw_test) = mnist.load_data()
n_train, n_test = X_raw.shape[0], X_raw_test.shape[0]
"""
Explanation: 机器学习工程师纳米学位
深度学习
项目:搭建一个数字识别项目
在此文件中,我们提供给你了一个模板,以便于你根据项目的要求一步步实现要求的功能,进而完成整个项目。如果你认为需要导入另外的一些代码,请确保你正确导入了他们,并且包含在你的提交文件中。以'练习'开始的标题表示接下来你将开始实现你的项目。注意有一... |
VenkatRepaka/deep-learning | intro-to-rnns/Anna_KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
maviator/Kaggle_home_price_prediction | Script/kaggle_home_price_prediction.ipynb | mit | # Handle table-like data and matrices
import numpy as np
import pandas as pd
# Modelling Algorithms
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import S... |
daviddesancho/BestMSM | example/fourstate/fourstate_to_bestmsm.ipynb | gpl-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import fourstate
import itertools
import networkx as nx
import numpy as np
bhs = fourstate.FourState()
"""
Explanation: Four state mapping onto bestmsm
The goal of this script is to map between the results obtained using the Fourstate class and those obtained with the... |
tensorflow/docs-l10n | site/ko/guide/mixed_precision.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... |
econ-ark/HARK | examples/FrameAgentType/FrameModels.ipynb | apache-2.0 | init_parameters = {}
init_parameters['PermGroFac'] = 1.05
init_parameters['PermShkStd'] = 1.5
init_parameters['PermShkCount'] = 5
init_parameters['TranShkStd'] = 3.0
init_parameters['TranShkCount'] = 5
init_parameters['RiskyAvg'] = 1.05
init_parameters['RiskyStd'] = 1.5
init_parameters['RiskyCount'] = 5
init_parameters... |
PyLCARS/PythonUberHDL | myHDL_DigLogicFundamentals/myHDL_LogicGates/myHDL_LogicGates.ipynb | bsd-3-clause | #This notebook also uses the `(some) LaTeX environments for Jupyter`
#https://github.com/ProfFan/latex_envs wich is part of the
#jupyter_contrib_nbextensions package
from myhdl import *
from myhdlpeek import Peeker
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from sympy im... |
strikingmoose/chi_lars_face_detection | notebook/11 - Building & Training Convolutional Neural Network.ipynb | apache-2.0 | import cv2
import numpy as np
import pandas as pd
import urllib
import math
import boto3
import os
import copy
from tqdm import tqdm
from matplotlib import pyplot as plt
%matplotlib inline
# Connect to s3 bucket
s3 = boto3.resource('s3', region_name = 'ca-central-1')
my_bucket = s3.Bucket('2017edmfasatb')
# Get all f... |
jhillairet/documents | notebooks/TP Master Fusion/LH-Hands-on-mode-converter.ipynb | mit | # This line configures matplotlib to show figures embedded in the notebook,
# and also import the numpy library
%pylab
%matplotlib inline
"""
Explanation: Hands-on LH1: the $\mathrm{TE}{10}$-$\mathrm{TE}{30}$ Mode Converter
Introduction
The Tore Supra Lower Hybrid Launchers are equiped by $\mathrm{TE}{10}$-$\mathr... |
unnati-xyz/intro-python-data-science | onion/5-Model.ipynb | mit | # Import the library we need, which is Pandas and Matplotlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Set some parameters to get good visuals - style to ggplot and size to 15,10
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = (15, 10)
# Read the csv file of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.