repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
GoogleCloudPlatform/mlops-on-gcp
workshops/tfx-caip-tf23/lab-02-tfx-pipeline/solutions/lab-02.ipynb
apache-2.0
import yaml # Set `PATH` to include the directory containing TFX CLI and skaffold. PATH=%env PATH %env PATH=/home/jupyter/.local/bin:{PATH} """ Explanation: Continuous training with TFX and Google Cloud AI Platform Learning Objectives Use the TFX CLI to build a TFX pipeline. Deploy a TFX pipeline version without tun...
RobinKa/tfga
notebooks/em.ipynb
mit
ga = GeometricAlgebra([-1, 1, 1, 1]) """ Explanation: Introduction Classical electromagnetism is most often described using maxwell's equations. Instead, we can also describe it using a Lagrange density and an action which is the spacetime integral over the Lagrange density. The field is represented by a 4-vector in t...
NYUDataBootcamp/Projects
MBA_S17/Pittman-Renewable+Energy (2).ipynb
mit
import sys # system module import pandas as pd # data package import matplotlib.pyplot as plt # graphics module import datetime as dt # date and time module import numpy as np # foundation for Pandas %matplotlib inline # ch...
sdpython/ensae_teaching_cs
_doc/notebooks/expose/expose_vigenere.ipynb
mit
def code_vigenere ( message, cle, decode = False) : message_code = "" for i,c in enumerate(message) : d = cle[ i % len(cle) ] d = ord(d) - 65 if decode : d = 26 - d message_code += chr((ord(c)-65+d)%26+65) return message_code def DecodeVigenere(message, cle): return ...
benneely/qdact-basic-analysis
notebooks/primarydiagnoses.ipynb
gpl-3.0
from IPython.core.display import display, HTML;from string import Template; HTML('<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>') css_text2 = ''' #main { float: left; width: 750px;}#sidebar { float: right; width: 100px;}#sequence { width: 600px; height: 70px;}#legend { padding: 10px 0 0 3px;}...
stanfordnmbl/osim-rl
examples/legacy/train.arm.ipynb
mit
import osim import numpy as np import sys # Keras libraries from keras.optimizers import Adam import numpy as np from helpers import * from rl.agents import DDPGAgent from rl.memory import SequentialMemory from rl.random import OrnsteinUhlenbeckProcess from keras.optimizers import RMSprop import argparse import m...
enlighter/learnML
mini-projects/p0 - titanic survival exploration/.ipynb_checkpoints/Titanic_Survival_Exploration-checkpoint.ipynb
mit
import numpy as np import pandas as pd # RMS Titanic data visualization code from titanic_visualizations import survival_stats from IPython.display import display %matplotlib inline # Load the dataset in_file = 'titanic_data.csv' full_data = pd.read_csv(in_file) # Print the first few entries of the RMS Titanic data...
Benedicto/ML-Learning
Classifier_5_boosting_assignment_2.ipynb
gpl-3.0
import graphlab import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Boosting a decision stump The goal of this notebook is to implement your own boosting module. Brace yourselves! This is going to be a fun and challenging assignment. Use SFrames to do some feature engineering. Modify the decision tree...
gfrubi/FM2
Notebooks/Ejemplo-Serie-Fourier-Epiciclos.ipynb
gpl-3.0
from presentation import * import numpy as np """ Explanation: Epiciclos y series de Fourier El código usado en este notebook ha sido adaptado desde la versión original disponible aquí. Una introducción general a los epiciclos y su historia puede encontrarse en la correspondiente página en Wikipedia. Un buen video (e...
jamesjia94/BIDMach
tutorials/NVIDIA/.ipynb_checkpoints/GeneralDNNregression-checkpoint.ipynb
bsd-3-clause
import BIDMat.{CMat,CSMat,DMat,Dict,IDict,Image,FMat,FND,GDMat,GMat,GIMat,GSDMat,GSMat,HMat,IMat,Mat,SMat,SBMat,SDMat} import BIDMat.MatFunctions._ import BIDMat.SciFunctions._ import BIDMat.Solvers._ import BIDMat.JPlotting._ import BIDMach.Learner import BIDMach.models.{FM,GLM,KMeans,KMeansw,ICA,LDA,LDAgibbs,Model,NM...
NekuSakuraba/my_capstone_research
subjects/em/multivariate t - draft05 - Mixtures.ipynb
mit
def find_df(v, p, u, tau): return -digamma(v/2.) + log(v/2.) + (tau * (log(u) - u)).sum()/tau.sum() + 1 + (digamma((v+p)/2.)-log((v+p)/2.)) u_test = np.array([[1,1], [2,2], [3,3]]) tau_test = np.array([[4,4], [5,5], [6,6]]) find_df(1, 2, u_test, tau_test) def get_random(X): size = len(X) idx = np.random....
ondrolexa/sg2
11_Strain_ellipse.ipynb
mit
%pylab inline from sg2lib import * """ Explanation: Strain ellipse Polar decomposition Pluging LEFT polar decomposition $\boldsymbol{F} = \boldsymbol{V} \cdot \boldsymbol{R}$ to equation for LEFT Cauchy-Green deformation tensor $\boldsymbol{B}=\boldsymbol{F}\cdot\boldsymbol{F}^T$ results in: $$\boldsymbol{B}=\boldsymb...
ocelot-collab/ocelot
demos/ipython_tutorials/7_lattice_design.ipynb
gpl-3.0
# the output of plotting commands is displayed inline within # frontends, directly below the code cell that produced it. %matplotlib inline from time import time # this python library provides generic shallow (copy) # and deep copy (deepcopy) operations from copy import deepcopy # import from Ocelot main modules...
ocean-color-ac-challenge/evaluate-pearson
evaluation-participant-b.ipynb
apache-2.0
w_412 = 0.56 w_443 = 0.73 w_490 = 0.71 w_510 = 0.36 w_560 = 0.01 """ Explanation: E-CEO Challenge #3 Evaluation Participant B Weights Define the weight of each wavelength End of explanation """ run_id = '0000002-150625115710650-oozie-oozi-W' run_meta = 'http://sb-10-16-10-55.dev.terradue.int:50075/streamFile/ciop/ru...
esa-as/2016-ml-contest
esaTeam/esa_Submission01b.ipynb
apache-2.0
# Import from __future__ import division get_ipython().magic(u'matplotlib inline') import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['figure.figsize'] = (20.0, 10.0) inline_rc = dict(mpl.rcParams) from classification_utilities import make_facies_log_plot import pandas as pd import numpy as np impo...
ageron/ml-notebooks
15_autoencoders.ipynb
apache-2.0
# To support both python 2 and python 3 from __future__ import division, print_function, unicode_literals # Common imports import numpy as np import os import sys try: # %tensorflow_version only exists in Colab. %tensorflow_version 1.x except Exception: pass # to make this notebook's output stable across...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/gfdl-esm4/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-esm4', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: GFDL-ESM4 Topic: Landice Sub-Topics: Glaciers, Ice. P...
tensorflow/docs-l10n
site/zh-cn/hub/tutorials/spice.ipynb
apache-2.0
#@title Copyright 2020 The TensorFlow Hub 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 ...
tclaudioe/Scientific-Computing
SC1v2/Bonus - 07-08 - Gradient Descent and Nonlinear Least-Square.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import scipy.linalg as spla %matplotlib inline # https://scikit-learn.org/stable/modules/classes.html#module-sklearn.datasets from sklearn import datasets import ipywidgets as widgets from ipywidgets import interact, interact_manual, RadioButtons import matplotlib as m...
UDST/activitysim
activitysim/examples/example_estimation/notebooks/19_atwork_subtour_dest.ipynb
bsd-3-clause
import larch # !conda install larch #for estimation import pandas as pd import numpy as np import yaml import larch.util.excel import os """ Explanation: Estimating At-Work Subtour Destination Choice This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes runnin...
seewhydee/ntuphys_nb
jupyter/gradqm/entanglement.ipynb
gpl-3.0
import numpy as np a = np.array([2., -1.]) # vector in a 2D space b = np.array([1., 2., 3.]) # vector in a 3D space psi = np.kron(a, b) # vector in the 6D tensor product space print(psi) """ Explanation: Numerical Studies of Quantum Entanglement In this notebook, we will perform some numerical stu...
nehal96/Deep-Learning-ND-Exercises
Sentiment Analysis/Handwritten Digit Recognition with TFLearn and MNIST/handwritten-digit-recognition-with-tflearn.ipynb
mit
# Import Numpy, TensorFlow, TFLearn, and MNIST data import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist """ Explanation: Handwritten Number Recognition with TFLearn and MNIST In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9. This...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/text_classification/solutions/custom_tf_hub_word_embedding.ipynb
apache-2.0
!pip freeze | grep tensorflow-hub==0.7.0 || pip install tensorflow-hub==0.7.0 import os import tensorflow as tf import tensorflow_hub as hub """ Explanation: Custom TF-Hub Word Embedding with text2hub Learning Objectives: 1. Learn how to deploy AI Hub Kubeflow pipeline. 1. Learn how to configure the run paramete...
NeuroDataDesign/seelviz
albert/prob/Probability+Based.ipynb
apache-2.0
%matplotlib inline import matplotlib.pyplot as plt from dipy.data import read_stanford_labels from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel from dipy.tracking import utils from dipy.tracking.local import (ThresholdTissueClassifier, LocalTracking) hardi_img, gtab, labels_img = read_stanford_labels(...
cyucheng/skimr
jupyter/4_LDA_analysis.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import csv from textblob import TextBlob, Word import pandas as pd import sklearn import pickle import numpy as np import scipy import nltk.data from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.naive_bayes import MultinomialNB from sklearn.svm im...
raphaelshirley/regphot
examples/XID+R.ipynb
mit
from regphot import git_version print("This notebook was run with regphot version: \n{}".format(git_version())) from regphot.utils import getPlateFits from astropy.table import Table from astropy.wcs import WCS from astropy.io import fits from astropy.coordinates import SkyCoord from astropy.nddata import Cutout2D fr...
hetland/python4geosciences
materials/5_maps.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import cartopy import cartopy.crs as ccrs # commonly used shorthand import cartopy.feature as cfeature """ Explanation: Maps 1. Introduction Maps are a way to present information on a (roughly) spherical earth on a flat plane, like a page or a sc...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/custom/sdk-custom-image-classification-batch.ipynb
apache-2.0
import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = "--user" ! pip install {U...
GoogleCloudPlatform/training-data-analyst
quests/endtoendml/labs/5_train_keras.ipynb
apache-2.0
# Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.1 """ Explanation: <h1>Training Keras model on Cloud AI Platform</h1> <h2>Learning Objectives</h2> <ol> <li> Create a BigQuery Dataset and Google Cloud Storage Bucket</li> <li> Export from BigQuery to CSVs in GCS</li> <li> Trainin...
prk327/CoAca
7_Lambda_Functions_Pivot_Tables.ipynb
gpl-3.0
# Loading libraries and files import numpy as np import pandas as pd market_df = pd.read_csv("../global_sales_data/market_fact.csv") customer_df = pd.read_csv("../global_sales_data/cust_dimen.csv") product_df = pd.read_csv("../global_sales_data/prod_dimen.csv") shipping_df = pd.read_csv("../global_sales_data/shipping_...
neuro-data-science/neuroML
notebooks/introductory_nilearn.ipynb
apache-2.0
from nilearn import datasets # By default 2nd subject will be fetched haxby_dataset = datasets.fetch_haxby() """ Explanation: Nilearn If you're working on NeuroImaging data, you should check another Python library, Nilearn, that is design for fast and easy statistical learning on NeuroImaging data. It leverages the ...
kingb12/languagemodelRNN
report_notebooks/encdec_noing6_bow_200_512_04drb.ipynb
mit
report_file = '/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing6_bow_200_512_04drb/encdec_noing6_bow_200_512_04drb.json' log_file = '/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing6_bow_200_512_04drb/encdec_noing6_bow_200_512_04drb_logs.json' import json import matp...
ES-DOC/esdoc-jupyterhub
notebooks/cams/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cams', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: CAMS Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-3/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-3', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-3 Topic: Atmoschem Sub-Topics: Trans...
mercybenzaquen/foundations-homework
databases_hw/Homework_3_graded.ipynb
mit
!pip3 install bs4 from bs4 import BeautifulSoup from urllib.request import urlopen html_str = urlopen("http://static.decontextualize.com/widgets2016.html").read() info = BeautifulSoup(html_str, "html.parser") """ Explanation: Graded = 9/9 Homework assignment #3 These problem sets focus on using the Beautiful Soup lib...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/sdk/sdk_automl_text_sentiment_analysis_batch.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex SDK: AutoML training text sentiment analysis model for batch prediction <table align="le...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/gapic/custom/showcase_custom_tabular_regression_online_container.ipynb
apache-2.0
import os import sys # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install -U google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex client library: Custom training tabular regression model with custom container for o...
johnnycakes79/pyops
dashboard/pandas-highcharts-examples.ipynb
bsd-3-clause
%matplotlib inline import string import numpy as np import pandas as pd print pd.__version__ """ Explanation: Pandas DataFrame plotting with Highcharts pandas_highcharts is a Python library to turn your pandas DataFrame into a suited JSON for Highcharts, a Javascript library for interactive charts. Before introducin...
13522364778/liupengyuan.github.io
chapter1/homework/localization/3-22/201611680254,3-22.ipynb
mit
name=input('请输入你的姓名') print('hello',name) birthday=float(input('请输入你的生日')) if 3.20<birthday<4.20: print(name,'你是非常热情的白羊座') elif 4.20<birthday<5.21: print(name,'你是非常稳重的金牛座') elif 5.21<birthday<6.22: print(name,'你是非常纠结的双子座') elif 6.22<birthday<7.23: print(name,'你是非常暖心的巨蟹座') elif 7.23<birthday<8.23: p...
zhuanxuhit/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...
aryarohit07/machine-learning-with-python
linear_regression/linear_regression_gradient_descent_with_multiple_variables.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D df = pd.read_csv('ex1data2.txt', header=None) print(df.head()) #Lets try to visualize the data fig = plt.figure() ax = Axes3D(fig) ax.scatter(df[0], df[1], df[2]) ax.set_zlabel('price') plt.xlabel('size of the house (in squar...
PMEAL/OpenPNM
examples/simulations/percolation/D_meniscus_model_comparison.ipynb
mit
import matplotlib %matplotlib inline import matplotlib.pyplot as plt import numpy as np import sympy as syp from sympy import lambdify, symbols from sympy import atan as sym_atan from sympy import cos as sym_cos from sympy import sin as sym_sin from sympy import sqrt as sym_sqrt from sympy import pi as sym_pi from ipyw...
nagordon/mechpy
tutorials/Curve_fitting_and_Optimization_with_python.ipynb
mit
# import modules import numpy as np from numpy import * import matplotlib.pyplot as plt from matplotlib.pyplot import * import scipy from scipy.optimize import curve_fit from scipy.optimize import fmin %matplotlib inline import matplotlib as mpl mpl.rcParams['figure.figsize'] = (12,8) mpl.rcParams['font.size'] = 14 mpl...
IanHawke/maths-with-python
02-programs.ipynb
mit
import math x = math.sin(1.2) """ Explanation: Programs Using the Python console to type in commands works fine, but has serious drawbacks. It doesn't save the work for the future. It doesn't allow the work to be re-used. It's frustrating to edit when you make a mistake, or want to make a small change. Instead, we wan...
johnhw/summerschool2017
dynamic/kalman_filter.ipynb
mit
# import the things we need from __future__ import print_function, division import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pykalman import ipywidgets import IPython import matplotlib, matplotlib.colors matplotlib.rcParams['figure.figsize'] = (14.0, 8.0) %matplotlib inline from scipy....
TheMitchWorksPro/DataTech_Playground
PY_Basics/TMWP_List_Comprehension_Examples.ipynb
mit
# libraries used in the Notebook import numpy as np [i for i in range(3,10)] # in real code, range(3,10) would probably be a list or iterable that is the source print([i for i in range(3,10)]) [i**2 for i in range(3,10) if i > 6] # squares all values in range(3,10) but only if original value was > 6 # example from...
zauonlok/cs231n
assignment1/knn.ipynb
mit
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inline plt.rcParams['figure.figsize'] = (10....
Intel-Corporation/tensorflow
tensorflow/lite/g3doc/tutorials/model_maker_audio_classification.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...
christophmark/bayesloop
docs/source/tutorials/hyperstudy.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt # plotting import seaborn as sns # nicer plots sns.set_style('whitegrid') # plot styling import numpy as np import bayesloop as bl S = bl.HyperStudy() S.loadExampleData() L = bl.om.Poisson('accident_rate', bl.oint(0, 6, 1000)) T = bl.tm.SerialTransit...
suresh/notes
python/Monte Carlo Explainer.ipynb
mit
simple = stats.uniform(loc=2, scale=3) errscale = 0.25 err = stats.norm(loc=0, scale=errscale) # cannot analytically convolve continuous PDFs in general. # so we now make a probability mass function on a fine grid for fft convolution delta = 1e-4 big_grid = np.arange(-10, 10, delta) pmf1 = simple.pdf(big_grid) * del...
mathemage/h2o-3
h2o-py/demos/Predict_w_Unseen_Categorical_Levels.ipynb
apache-2.0
import h2o, pandas, pprint, operator, numpy as np, matplotlib.pyplot as plt from h2o.estimators.glm import H2OGeneralizedLinearEstimator from h2o.estimators.gbm import H2OGradientBoostingEstimator from h2o.estimators.random_forest import H2ORandomForestEstimator from h2o.estimators.deeplearning import H2ODeepLearningEs...
tdeoskar/NLP1-2017
pytorch-tutorial/intro_pytorch_for_nlp.ipynb
gpl-3.0
%matplotlib inline import torch """ Explanation: Introduction to Pytorch for NLP1 This notebook is meant to give a short introduction to Pytorch basics. You do not have to hand in this tutorial. It is just to help you get started with the projects. We assume that you have pytorch installed with Python 3. See http://ww...
brettc/causalinfo
notebooks/wet_grass.ipynb
mit
from causalinfo import * # You only need this if you want to draw pretty pictures of the Networksa from nxpd import draw, nxpdParams nxpdParams['show'] = 'ipynb' """ Explanation: Is the Grass Wet? This is an example used by Pearl in his book 'Causality'. I've used the conditional probability tables from here: https://...
intel-analytics/BigDL
python/orca/colab-notebook/quickstart/ncf_dataframe.ipynb
apache-2.0
# Install jdk8 !apt-get install openjdk-8-jdk-headless -qq > /dev/null import os # Set environment variable JAVA_HOME. os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64" !update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java !java -version """ Explanation: <a href="https://cola...
martinandersen/opfsdr
notebooks/demo.ipynb
gpl-3.0
import json, re import requests testcases = {} clist = [] # Retrieve list of MATPOWER test cases response = requests.get('https://api.github.com/repos/MATPOWER/matpower/contents/data') clist += json.loads(response.text) # Retrieve list of pglib-opf test cases response = requests.get('https://api.github.com/repos/powe...
mne-tools/mne-tools.github.io
0.24/_downloads/82d9c13e00105df6fd0ebed67b862464/ssp_projs_sensitivity_map.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD-3-Clause import matplotlib.pyplot as plt from mne import read_forward_solution, read_proj, sensitivity_map from mne.datasets import sample print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' fname = data_p...
StudyExchange/Udacity
MachineLearning(Advanced)/p1_boston_housing/boston_housing.ipynb
mit
# Import libraries necessary for this project # 载入此项目所需要的库 import numpy as np import pandas as pd import visuals as vs # Supplementary code from sklearn.model_selection import ShuffleSplit from IPython.display import display # Pretty display for notebooks # 让结果在notebook中显示 %matplotlib inline # Load the Boston housing...
sampathweb/movie-sentiment-analysis
02-logisitc-regression-intro.ipynb
mit
from __future__ import print_function # Python 2/3 compatibility from IPython.display import Image import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Objective Overview of ML Model Build Process Logistic Regression Introduction Model Evaluations End of expla...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session11/Day1/IntroductionToBasicStellarPhotometrySolutions.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib notebook """ Explanation: Introduction to Basic Stellar Photometry Measuring Flux in 1D Version 0.1 In this notebook we will introduce some basic concepts related to measuring the flux of a point source. As this is an introduction, several challenges asso...
hhain/sdap17
notebooks/robin_ue1/03_Cross_validation_and_grid_search.ipynb
mit
# imports import pandas import matplotlib.pyplot as plt from timeit import default_timer as timer from sklearn.cross_validation import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn.grid_search import GridSearchCV """ Explanation: Aufgabe 3: Cross Validation and Grid Search We use skl...
d-k-b/udacity-deep-learning
autoencoder/Simple_Autoencoder.ipynb
mit
%matplotlib inline 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', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
AutuanLiu/Python
fastai_notes/LinearAlgebra/speech03.ipynb
mit
# 多行结果输出支持 from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" """ Explanation: Background Removal with Robust PCA 视频数据集 BMC | Background Models Challenge https://www.cs.utexas.edu/~chaoyeh/web_action_data/dataset_list.html Background Subtraction Website End of e...
melissawm/oceanobiopython
exemplos/exemplo_6/Diagrama TS.ipynb
gpl-3.0
import gsw """ Explanation: Diagrama TS Vamos elaborar um diagrama TS com o auxílio do pacote gsw [https://pypi.python.org/pypi/gsw/3.0.3], que é uma alternativa em python para a toolbox gsw do MATLAB: End of explanation """ import numpy as np import matplotlib.pyplot as plt sal = np.linspace(0, 42, 100) temp = np....
google/eng-edu
ml/cc/prework/tensorflow_programming_concepts.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...
Hyperparticle/deep-learning-foundation
lessons/tensorboard/Anna_KaRNNa_Name_Scoped.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...
weikang9009/pysal
notebooks/explore/segregation/aspatial_examples.ipynb
bsd-3-clause
%matplotlib inline import geopandas as gpd from pysal.explore import segregation import pysal.lib """ Explanation: PySAL segregation module for aspatial indexes This is an example notebook of functionalities for aspatial indexes of the segregation module. Firstly, we need to import the packages we need. End of explan...
ledeprogram/algorithms
class7/homework/shuyao_xiao_7_assignment.ipynb
gpl-3.0
import pandas as pd import pydotplus import numpy as np import matplotlib.pyplot as plt %matplotlib inline from sklearn import datasets, tree, metrics from sklearn.cross_validation import train_test_split from pandas.tools.plotting import scatter_matrix """ Explanation: We covered a lot of information today and I'd ...
tritemio/FRETBursts
notebooks/FRETBursts - 8-spot smFRET burst analysis.ipynb
gpl-2.0
from fretbursts import * sns = init_notebook() import lmfit; lmfit.__version__ import phconvert; phconvert.__version__ """ Explanation: FRETBursts - 8-spot smFRET burst analysis This notebook is part of a tutorial series for the FRETBursts burst analysis software. For a step-by-step introduction to FRETBursts usag...
KECB/learn
machine_learning/数据预处理.ipynb
mit
iris.data from sklearn.preprocessing import StandardScaler # 标准化, 返回值为标准化后的数据 iris_standard = StandardScaler().fit_transform(iris.data) """ Explanation: 数据预处理 通过特征提取,我们能得到未经处理的特征,这时的特征可能有以下问题: 不属于同一量纲:即特征的规格不一样,不能够放在一起比较。无量纲化可以解决这一问题。 信息冗余:对于某些定量特征,其包含的有效信息为区间划分,例如学习成绩,假若只关心“及格”或不“及格”,那么需要将定量的考分,转换成“1”和“0”表示及格和未及格。...
RaRe-Technologies/gensim
docs/notebooks/ensemble_lda_with_opinosis.ipynb
lgpl-2.1
elda_logger = logging.getLogger(EnsembleLda.__module__) elda_logger.setLevel(logging.INFO) elda_logger.addHandler(logging.StreamHandler()) def pretty_print_topics(): # note that the words are stemmed so they appear chopped off for t in elda.print_topics(num_words=7): print('-', t[1].replace('*',' ').re...
mne-tools/mne-tools.github.io
stable/_downloads/efd09079125b2bd222e2dd62aaaccfa4/source_space_snr.ipynb
bsd-3-clause
# Author: Padma Sundaram <tottochan@gmail.com> # Kaisu Lankinen <klankinen@mgh.harvard.edu> # # License: BSD-3-Clause import mne from mne.datasets import sample from mne.minimum_norm import make_inverse_operator, apply_inverse import numpy as np import matplotlib.pyplot as plt print(__doc__) data_path = samp...
tensorflow/text
docs/tutorials/uncertainty_quantification_with_sngp_bert.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...
camillescott/ucd-ecs253
ECS253 - Homework 3.ipynb
cc0-1.0
%pylab inline %config InlineBackend.figure_format='retina' import numpy as np import networkx as nx import seaborn as sns sns.set_style('ticks') sns.set_context('poster') np.set_printoptions(precision=4, linewidth=100) """ Explanation: This is the common problem set for Homework 3 from the spring quarter Network Theo...
CAChemE/curso-python-datos
notebooks/051-Pandas-Ejercicios.ipynb
bsd-3-clause
!head ../data/model.txt import pandas as pd import numpy as np %matplotlib inline import matplotlib.pyplot as plt import matplotlib as mpl from IPython.display import display model = pd.read_csv( "../data/model.txt", delim_whitespace=True, skiprows = 3, parse_dates = {'Timestamp': [0, 1]}, index_col = 'Time...
csdms/dakota
examples/hydrotrend-sampling-study.ipynb
mit
from dakotathon import Dakota """ Explanation: <img src="http://csdms.colorado.edu/mediawiki/images/CSDMS_high_res_weblogo.jpg"> HydroTrend Study with Sampling HydroTrend is a numerical model that creates synthetic river discharge and sediment load time series as a function of climate trends and basin morphology. In t...
CalPolyPat/phys202-2015-work
assignments/assignment07/AlgorithmsEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import seaborn as sns import numpy as np """ Explanation: Algorithms Exercise 2 Imports End of explanation """ def find_peaks(a): """Find the indices of the local maxima in a sequence.""" peaks = [] data = np.array(a) deriv = np.diff(data) i...
psychemedia/parlihacks
notebooks/Quantity Parsing.ipynb
mit
sentences = [ '4 years and 6 months’ imprisonment with a licence extension of 2 years and 6 months', 'No quantities here', 'I measured it as 2 meters and 30 centimeters.', "four years and six months' imprisonment with a licence extension of 2 years and 6 months", 'it cost £250... bargain...', 'i...
histogrammar/histogrammar-python
histogrammar/notebooks/histogrammar_tutorial_exercises.ipynb
apache-2.0
%%capture # install histogrammar (if not installed yet) import sys !"{sys.executable}" -m pip install histogrammar import histogrammar as hg import pandas as pd import numpy as np import matplotlib """ Explanation: Histogrammar exercises Histogrammar is a Python package that allows you to make histograms from numpy...
fmfn/BayesianOptimization
examples/advanced-tour.ipynb
mit
from bayes_opt import BayesianOptimization """ Explanation: Advanced tour of the Bayesian Optimization package End of explanation """ # Let's start by defining our function, bounds, and instanciating an optimization object. def black_box_function(x, y): return -x ** 2 - (y - 1) ** 2 + 1 """ Explanation: 1. Sugg...
grfiv/MNIST
svm.scikit/svm_rbf_pca.scikit_random_gridsearch.ipynb
mit
from __future__ import division import os, time, math, csv import cPickle as pickle from operator import itemgetter from tabulate import tabulate import matplotlib.pyplot as plt import numpy as np import scipy from print_imgs import print_imgs # my own function to print a grid of square images from sklearn.utils ...
trangel/Data-Science
deep_learning_ai/Tensorflow+Tutorial+dropout.ipynb
gpl-3.0
import math import numpy as np import h5py import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.python.framework import ops from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict %matplotlib inline np.random.seed(1) """ Explanation: TensorFlow Tutorial Welcome to this w...
mne-tools/mne-tools.github.io
0.24/_downloads/f574d1e7527e4460eb09a16f6f836e35/60_maxwell_filtering_sss.ipynb
bsd-3-clause
import os import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np import mne from mne.preprocessing import find_bad_channels_maxwell sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', ...
steven-murray/halomod
devel/robust_hankel_transforms.ipynb
mit
import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline as spline import warnings def pfunc_linear(logk, p, lnk, power_pos): spl = spline(lnk, p, k=3) result = np.zeros_like(logk) inner_mask = (lnk.min() <= logk) & (logk <= lnk.max()) result[inner_mask] = spl(logk[inner_mask]) ...
OzgurBagci/pythonlessons
lesson1/jupyter1.ipynb
unlicense
2 #Integer yani tam sayı 2.0 #Float yani ondalıklı sayı 1.67 #Yine bir float 4 #Yine bir int(Integer) 'Bu bir string' "Bu da bir string" True #Boolean False #Boolean """ Explanation: Data Typelar Aslında Data Type çok geniş bir kavram. datetime mesela, bir data type. Biz data type derken built-in typelardan, te...
ray-project/ray
doc/source/tune/examples/bohb_example.ipynb
apache-2.0
# !pip install ray[tune] !pip install ConfigSpace==0.4.18 !pip install hpbandster==0.7.4 """ Explanation: Running Tune experiments with BOHB In this tutorial we introduce BOHB, while running a simple Ray Tune experiment. Tune’s Search Algorithms integrate with BOHB and, as a result, allow you to seamlessly scale up a ...
austinburks/data-science-bowl-2017
src/data/get_raw_data.ipynb
mit
from urllib import request import zipfile, io from pathlib import Path import os import re from pyunpack import Archive """ Explanation: Raw Data Download This scripts downloads all of the stage 1 raw data for the Kaggle Data Science Bowl 2017 (https://www.kaggle.com/c/data-science-bowl-2017) We are pulling the raw d...
nikbearbrown/Deep_Learning
NEU/Singh_Palod_DL/Autoencoders/Autoencoder for Text in TensorFlow.ipynb
mit
import os from random import randint from collections import Counter os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import numpy as np import tensorflow as tf corpus = "the quick brown fox jumped over the lazy dog from the quick tall fox".split() test_corpus = "the quick brown fox jumped over the lazy dog from the quick tall...
phoebe-project/phoebe2-docs
2.2/tutorials/fti.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Finite Time of Integration (fti) Setup Let's first make sure we have the latest version of PHOEBE 2.2 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 explanation """ %matplo...
jserenson/Python_Bootcamp
Regular Expressions.ipynb
gpl-3.0
import re # List of patterns to search for patterns = [ 'term1', 'term2' ] # Text to parse text = 'This is a string with term1, but it does not have the other term.' for pattern in patterns: print 'Searching for "%s" in: \n"%s"' % (pattern, text), #Check for match if re.search(pattern, text): ...
junhwanjang/DataSchool
Lecture/10. 기초 확률론 4 - 상관관계/2) 확률 밀도 함수의 독립.ipynb
mit
np.set_printoptions(precision=4) pmf1 = np.array([[0, 1, 2, 3, 2, 1], [0, 2, 4, 6, 4, 2], [0, 4, 8,12, 8, 4], [0, 2, 4, 6, 4, 2], [0, 1, 2, 3, 2, 1]]) pmf1 = pmf1/pmf1.sum() pmf1 sns.heatmap(pmf1) plt.xlabel("x") plt.ylabel("y") plt.title("Joint Proba...
Naereen/notebooks
Demo_of_RISE_for_slides_with_Jupyter_notebooks__Python.ipynb
mit
from sys import version print(version) """ Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Demo-of-RISE-for-slides-with-Jupyter-notebooks-(Python)" data-toc-modified-id="Demo-of-RISE-for-slides-with-Jupyter-notebooks-(Python)-1"><span class...
GoogleCloudPlatform/bigquery-notebooks
notebooks/community/analytics-componetized-patterns/retail/propensity-model/bqml/bqml_kfp_retail_propensity_to_purchase.ipynb
apache-2.0
# 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, so...
zhuanxuhit/deep-learning
dcgan-svhn/DCGAN_Exercises.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...
diegocavalca/Studies
dsa-deep-learning-ii/1. Introducao/GridSearch/GridSearch.ipynb
cc0-1.0
# Forçando o Keras a utilizar a CPU import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "" # Import dos Módulos import numpy from sklearn.model_selection import GridSearchCV from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn i...
BjornFJohansson/pydna-examples
notebooks/golden_gate/golden_gate1.ipynb
bsd-3-clause
from pydna.all import * """ Explanation: Golden gate cloning simulation using pydna The objective is to assemble three 50 bp sequences into one circular sequence. We will use the assembly_fragments function and the Assembly class. End of explanation """ frags = parse(''' >1|random sequence|A: 0.25|C: 0.25|G: 0.25|...
flowersteam/explauto
notebook/full_tutorial.ipynb
gpl-3.0
from __future__ import print_function from explauto.environment import environments environments.keys() """ Explanation: Explauto, an open-source Python library to study autonomous exploration in developmental robotics Explauto is an open-source Python library providing a unified API to design and compare various exp...
gsnyder206/mock-surveys
mocks_from_publicdata/summer2020/results/Early_pairs.ipynb
mit
from astropy.io import ascii import photutils ; print("Photutils version:",photutils.__version__) import numpy as np ; print("Numpy version:",np.__version__) import matplotlib.pyplot as plt import seaborn as sns; print("Seaborn version:",sns.__version__) sns.set() import tng_api_utils as tau import os """ Explanati...
jpilgram/phys202-2015-work
assignments/midterm/AlgorithmsEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact """ Explanation: Algorithms Exercise 3 Imports End of explanation """ def char_probs(s): """Find the probabilities of the unique characters in the string s. Parameters ---------- ...
ComputationalModeling/spring-2017-danielak
past-semesters/fall_2016/day-by-day/day23-agent-based-modeling-day1/Numpy_2D_array_tutorial.ipynb
agpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import random """ Explanation: Numpy 2D arrays - some examples This notebook demonstrates how to work with 2D numpy arrays, including array slicing, random numbers, and making plots with them. Note that this works with higher-dimensional arrays as ...
ML4DS/ML4all
R_lab1_ML_Bay_Regresion/Pract_regression_student.ipynb
mit
# Import some libraries that will be necessary for working with data and displaying plots # To visualize plots in the notebook %matplotlib inline import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np import scipy.io # To read matlab files from scipy import spatial imp...