text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
<h3 style="text-align: center;"><b>Implementing Binomial Logistic Regression</b></h3> <h5 style="text-align: center;">This notebook follows this wonderful tutorial by Nikhil Kumar: <a href="https://www.geeksforgeeks.org/understanding-logistic-regression/" target="_blank">https://www.geeksforgeeks.org/understanding-logi...
github_jupyter
## This notebook will be focused on using gradient descent to solve simple linear regression and multivariate regression problems Note: This notebook is for educational purposes as using normal equations would be a superior approach to solving the optimization problem for the datasets that I use in this notebook. ```...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt ``` ## Optimal Stopping Problem - [Secretary Problem](https://en.wikipedia.org/wiki/Secretary_problem) - An administrator who wants to hire the best secretary out of n rankable applicants. + The applicants are interviewed one by one + Decision (hire/rejec...
github_jupyter
``` import cPickle,gzip,numpy f=gzip.open('mnist.pkl.gz','rb') train_set,valid_set,test_set=cPickle.load(f) f.close() import theano.tensor as T import numpy as np import theano def shared_dataset(data_xy): data_x,data_y=data_xy shared_x=theano.shared(np.array(data_x,dtype=theano.config.floatX)) shared_y=th...
github_jupyter
# Hands-on RL with Ray’s RLlib ## A beginner’s tutorial for working with multi-agent environments, models, and algorithms <img src="images/pitfall.jpg" width=250> <img src="images/tesla.jpg" width=254> <img src="images/forklifts.jpg" width=169> <img src="images/robots.jpg" width=252> <img src="images/dota2.jpg" width=...
github_jupyter
``` import numpy as np from scipy.integrate import solve_ivp import matplotlib.pyplot as plt from cp_detection.NeuralODE import GeneralModeDataset, LightningTrainer, TrainModel, LoadModel from cp_detection.ForceSimulation import ForcedHarmonicOscillator, DMT_Maugis, SimulateGeneralMode DMT = DMT_Maugis(0.2, 10, 2, 130,...
github_jupyter
# DataCamp Certification Case Study ### Project Brief A housing rental company has hired you for a new project. They are interested in developing an application to help people estimate the money they could earn renting out their living space. The company has provided you with a dataset that includes details about ea...
github_jupyter
<a href="https://colab.research.google.com/github/alirezash97/BraTS/blob/master/results.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # !wget https://www.cbica.upenn.edu/MICCAI_BraTS2020_ValidationData # from google.colab import drive # drive....
github_jupyter
# Collaboration and Competition ### 1. Start the Environment ``` from unityagents import UnityEnvironment import numpy as np ``` **_Before running the code cell below_**, change the `file_name` parameter to match the location of the Unity environment that you downloaded. - **Mac**: `"path/to/Tennis.app"` - **Windo...
github_jupyter
``` import os from tensorflow.keras import layers from tensorflow.keras import Model !wget --no-check-certificate \ https://storage.googleapis.com/mledu-datasets/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5 \ -O /tmp/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5 from tensorflow.keras....
github_jupyter
# McKinsey Analytics Online Hackathon ### Imports ``` import pandas as pd import numpy as np from fbprophet import Prophet import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize']=(20,10) plt.style.use('ggplot') ``` ### Data Loading and Handling ``` sales_df = pd.read_csv('train_aWnotuB.csv...
github_jupyter
# Mutations with Grammars In this notebook, we make a very short and simple introduction on how to use the `fuzzingbook` framework for grammar-based mutation – both for data and for code. **Prerequisites** * This chapter is meant to be self-contained. ## Defining Grammars We define a grammar using standard Python ...
github_jupyter
``` import pandas as pd import numpy as np import re from itertools import accumulate emails = pd.read_csv(r'C:\Users\amrenkumar\Desktop\TestData\full-output1.csv') emails.shape emails_clean = emails[~emails.interaction_content.isnull()] emails_clean = emails_clean.interaction_content emails_clean.drop_duplicates(keep=...
github_jupyter
``` import os import sys import math import json import torch import PIL import numpy as np from tqdm import tqdm import scipy.io from scipy import ndimage import matplotlib # from skimage import io # matplotlib.use("pgf") matplotlib.rcParams.update({ # 'font.family': 'serif', 'font.size':8, }) from matplotlib...
github_jupyter
``` import utils.model import pandas as pd import utils.constants import sklearn import numpy as np train_data = pd.read_parquet("preprocessed_training_features\\part.0.parquet") test_data = pd.read_parquet("preprocessed_validation_features\\part.1.parquet") feature_columns_w_TE = ['a_is_verified', 'b_is_verified', ...
github_jupyter
# Energy Meter Examples ## Linux Kernel HWMon More details can be found at https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements#linux-hwmon. ``` import logging from conf import LisaLogging LisaLogging.setup() ``` #### Import required modules ``` # Generate plots inline %matplotlib inline import os...
github_jupyter
### Nulltity Dataframe - Use either .isnull() or .isna() ### Total missing values - .sum() ### Percentage of missingness - .mean() * 100 ### Graphical analysis of missing data - missingno package ```python import missingno as msno msno.bar(data) # visualize completeness of the dataframe msno.matrix(airquality) #...
github_jupyter
# T1071.004 - Application Layer Protocol: DNS Adversaries may communicate using the Domain Name System (DNS) application layer protocol to avoid detection/network filtering by blending in with existing traffic. Commands to the remote system, and often the results of those commands, will be embedded within the protocol ...
github_jupyter
``` import pandas as pd ``` # Classification We'll take a tour of the methods for classification in sklearn. First let's load a toy dataset to use: ``` from sklearn.datasets import load_breast_cancer breast = load_breast_cancer() ``` Let's take a look ``` # Convert it to a dataframe for better visuals df = pd.Data...
github_jupyter
<h1 align="center"><font size="5">RECOMMENDATION SYSTEM WITH A RESTRICTED BOLTZMANN MACHINE</font></h1> Welcome to the <b>Recommendation System with a Restricted Boltzmann Machine</b> notebook. In this notebook, we study and go over the usage of a Restricted Boltzmann Machine (RBM) in a Collaborative Filtering based r...
github_jupyter
``` import pickle as pk import matplotlib.pyplot as plt import numpy as np import matplotlib.patches as mpatches import os import csv # EDS_files = [ # 'cora_sampling_method=EDS_K_sparsity=100_results.p', # 'cora_sampling_method=EDS_K_sparsity=10_results.p', # 'cora_sampling_method=EDS_K_sparsity=5_results.p' ] Gree...
github_jupyter
# **Neural Word Embedding** > **Word2Vec, Continuous Bag of Word (CBOW)** > **Word2Vec, Skip-gram with negative sampling (SGNS)** > **Main key point: Distributional Hypothesis** > Goal: Predict the context words from a given word # **How to implement SGNS Algorithm:** 1. Data preprocessing 2. Hyperparameters...
github_jupyter
# Introduction to BioPython ``` # Load Biopython library & Functions import Bio from Bio import SeqIO from Bio.Seq import Seq, MutableSeq from Bio.Seq import transcribe, back_transcribe, translate, complement, reverse_complement # Check Biopython version Bio.__version__ ``` ## Sequence Operations ``` # Sequence se...
github_jupyter
# Import Package ``` import math import datetime import numpy as np import pandas as pd from entropy import * from collections import Counter import seaborn as sns import matplotlib.pyplot as plt import matplotlib.colors as colors from scipy.interpolate import interp1d import random import joblib import sklearn from ...
github_jupyter
## Dependencies ``` import glob, json from jigsaw_utility_scripts import * from tensorflow.keras import layers from tensorflow.keras.models import Model from transformers import TFXLMRobertaModel, XLMRobertaConfig ``` ## TPU configuration ``` strategy, tpu = set_up_strategy() print("REPLICAS: ", strategy.num_replica...
github_jupyter
``` ## This note is just for COMP6200, not for general users ## load all experiments and generate Comparative Results to each domain and each agent import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import * %matplotlib inline fr...
github_jupyter
<a href="https://colab.research.google.com/github/CcgAlberta/pygeostat/blob/master/examples/BoundaryModeling.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Boundary Modeling The following notebook is comprised of 7 primary steps: 1. Initialize r...
github_jupyter
# Navigation --- Congratulations for completing the first project of the [Deep Reinforcement Learning Nanodegree](https://www.udacity.com/course/deep-reinforcement-learning-nanodegree--nd893)! In this notebook, you will learn how to control an agent in a more challenging environment, where it can learn directly from...
github_jupyter
# CSE 6040, Fall 2015 [10]: A Large-Data Workflow This notebook derives from an [awesome demo by the makers of plot.ly](https://plot.ly/ipython-notebooks/big-data-analytics-with-pandas-and-sqlite/). In particular, this notebook starts with a large database of complaints filed by residents of New York City since 2010 ...
github_jupyter
``` import os import sys ngames_path = os.path.abspath(os.path.join(os.getcwd(), '../../..', 'ngames')) sys.path.append(ngames_path) import matplotlib.pyplot as plt from extensivegames import ExtensiveFormGame, plot_game from build import build_full_game ``` # Default configuration Both fishers start at the shore. Th...
github_jupyter
# Topopgraphy and rivers map of region (Tibet) ### Database - [Earth2014](http://ddfe.curtin.edu.au/models/Earth2014/) (Arc‐min shape, topography, bedrock and ice‐sheet models) ### Package - [Cartopy](https://scitools.org.uk/cartopy/docs/latest/) (A mapping and imaging package originating from the Met. Office in the...
github_jupyter
# Sentiment Analysis, Part 2: Machine Learning With Spark On Google Cloud --------------- __[1. Introduction](#bullet1)__ __[2. Creating A GCP Hadoop Cluster ](#bullet2)__ __[3. Getting Data From An Atlas Cluter](#bullet3)__ __[4. Basic Models With Spark ML Pipelines](#bullet4)__ __[5. Stemming With Custom Transf...
github_jupyter
## Some useful analogies to SQL operations Data set is a list of two columns, viz., userid and app name. See venn_sample_gen.py to generate this set. Sample given below. | userid | app | |---------|------------| | u000001 | ola | | u000002 | freecharge | | u000002 | mobikwik | | u000002 | fastc...
github_jupyter
### *** Names: [Insert Your Names Here]*** # Lab 4 - Plotting and Fitting with Hubble's Law ``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` <div class=hw> ## Exercise 1 In the cell below, I have transcribed the data from Edwin Hubble's original 1928 paper "A relation between dista...
github_jupyter
# What's new in version 1.5 #### New * Updated the **[`Map Widget`](https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.widgets.html#mapview)** to use the **[ArcGIS API for JavaScript 4x](https://developers.arcgis.com/javascript/)** release * Broader support for authoring and rendering `WebScenes` * Full s...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
``` import sqlite3 import numpy as np import colorspacious from sklearn import linear_model ALL_NUM_COLORS = [6, 8, 10] DB_FILE = "../survey-results/results.db" def to_rgb_jab(color): """ Convert hex color code (without `#`) to sRGB255 and CAM02-UCS. """ rgb = [(int(i[:2], 16), int(i[2:4], 16), int(i[4:...
github_jupyter
``` import selenium from selenium import webdriver from selenium.webdriver.common import keys from time import sleep import os os.environ['PATH'] += ':.' os.environ['DISPLAY'] = ':0' options = webdriver.ChromeOptions() for i in ('--disable-extensions', '--disable-dev-shm-usage', "--no-sandbox", "user-data-dir=/tmp/" ...
github_jupyter
``` !wget --no-check-certificate \ https://storage.googleapis.com/laurencemoroney-blog.appspot.com/horse-or-human.zip \ -O /tmp/horse-or-human.zip ``` The following python code will use the OS library to use Operating System libraries, giving you access to the file system, and the zipfile library allowing you ...
github_jupyter
``` import sys import numpy as np np.random.seed(42) import keras.backend as K from keras.models import Sequential from keras.layers import Dense, Embedding, Lambda from keras.utils import np_utils from keras.preprocessing import sequence from keras.preprocessing.text import Tokenizer from keras.initializers import ...
github_jupyter
# Functional Design: ### 1. Predict the availability of solar and wind energy at various time and location in the future. #### 1.1. Input a specific time and location. ** Component Design: ** 1. function name: get_location_and_time() 2. take the input: DD/MM/YY, zipcode 3. if the input is wrong, output a error mess...
github_jupyter
#### Setup Notebook ``` from IPython.core.display import display, HTML display(HTML("<style>.container { width:80% !important; }</style>")) # Put these at the top of every notebook, to get automatic reloading and inline plotting %reload_ext autoreload %autoreload 2 %matplotlib inline ``` # Predicting Price Movements ...
github_jupyter
# Photon-photon dispersion This tutorial shows how to include photon-photon dispersion off of background photon fields in the ALP-photon propagation calculation. The relevance of photon dispersion for ALP calculations is discussed in [Dobrynina 2015](https://journals.aps.org/prd/abstract/10.1103/PhysRevD.91.083003). A...
github_jupyter
## Multiline string ``` print(""" This is a multi line string this is good """) print("This is a multi line string \n This is too good") ``` ### Sub Strings ``` s = "Namaste World" # test substring membership print("Namaste" in s) print(" World" in s) print("e W" in s) print("Nasdasda" in s) ``` ## Built-in Strin...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
``` import pandas as pd from bs4 import BeautifulSoup as bs import bs4 import requests from pprint import pprint import Memory_Collaborative_Filtering as mem import sqlite3 as sql def url_builder_1(book_title): path = 'https://isbndb.com/search/books/' title_list = book_title.split() final_path_list=[] ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %load_ext autoreload %autoreload 2 %matplotlib inline %config InlineBackend.figure_format = 'retina' ``` # A Fundamental Property of Gaussians A multivariate Gaussian is nothing more than a generalization of the univariate Gaussian. We parameterize univariate ...
github_jupyter
# ipy_table Reference The home page for ipy_table is at [epmoyer.github.com/ipy_table/](http://epmoyer.github.com/ipy_table/) ipy_table is maintained at [github.com/epmoyer/ipy_table](https://github.com/epmoyer/ipy_table) ``` import add_parent_to_path ``` ## Table Creation To create a table call make_table on an a...
github_jupyter
# 7-11. 프로젝트 : 네이버 영화리뷰 감성분석 도전하기 이전 스텝까지는 영문 텍스트의 감정분석을 진행해 보았습니다. 그렇다면 이번에는 한국어 텍스트의 감정분석을 진행해 보면 어떨까요? 오늘 활용할 데이터셋은 네이버 영화의 댓글을 모아 구성된 Naver sentiment movie corpus입니다. 데이터 다운로드 없이 Cloud shell에서 해당 파일의 심볼릭 링크를 연결 해 주세요 ### 평가기준 1. 다양한 방법으로 Text Classification 태스크를 성공적으로 구현하였다. (3가지 이상의 모델이 성공적으로 시도됨) 2. gensim을...
github_jupyter
# Gather statistics about iterative point position & tagger precision estimation procedue Perform $N_e$ experiments, in which data is simulated and used for the estimation procedure: Simulate points $x_j$, tags $x_{ji} \sim N(x_j,\sigma_i^2)$ for N points ($j=1,...,N$) and $N_t$ taggers ($i=1,...,N_t$). Peform the e...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter
## Cloud observations This notebook simulates microwave and sub-mm observations of idealized clouds in the atmosphere. Its purpose is to illustrate the general radiative properties of clouds observed from space- or airborne remote sensing instruments. The simulations are performed using the [parts](https://github.com...
github_jupyter
# Example 01: General Use of XGBoostRegressor [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/slickml/slick-ml/blob/master/examples/regression/example_01_XGBoostRegressor.ipynb) ### Google Colab Configuration ``` # !git clone https://github.com/sli...
github_jupyter
``` import ipywidgets as widgets from sidepanel import SidePanel from regulus.utils import io from regulus.models import * from regulus.measures import * from ipyregulus import DataWidget, TreeWidget, BaseTreeView, DetailsView from ipyregulus.alg.view import * gauss = io.load('data/gauss4_mc') gauss.add_attr('quadra...
github_jupyter
# SageMaker Tensorflow 컨테이너를 사용하여 하이퍼파라미터 튜닝하기 ## [(원본)](https://github.com/awslabs/amazon-sagemaker-examples/tree/master/hyperparameter_tuning/tensorflow_mnist) 이 문서는 **SageMaker TensorFlow container**를 사용하여 [MNIST dataset](http://yann.lecun.com/exdb/mnist/)을 훈련시키기 위해 convolutional neural network 모델을 만드는 방법에 초점을 두고 있...
github_jupyter
<div style="width: 100%; overflow: hidden;"> <div style="width: 150px; float: left;"> <img src="data/D4Sci_logo_ball.png" alt="Data For Science, Inc" align="left" border="0"> </div> <div style="float: left; margin-left: 10px;"> <h1>Graphs and Networks</h1> <h2>Lesson II - Graph Properties</h2> <p>Bruno ...
github_jupyter
# Session 13: Mixtures of Bernoulli distributions ------------------------------------------------------ *Introduction to Data Science & Machine Learning* *Pablo M. Olmos olmos@tsc.uc3m.es* ------------------------------------------------------ In this notebook we will implement the EM algorithm for mixtures of Be...
github_jupyter
# Impressions on the lc_classif python package ## Content 1. Import of Necessary Python Modules 2. Conduct resampling and subsetting of data and mask 3. Import of Data and First Impressions on Classes 4. Analyze and Impute Missing Values 5. Analyze Class Separability 6. Split into Test and Training Dataset 7. Basic R...
github_jupyter
``` # import modules %matplotlib inline import os import pylab as plt import cPickle as pkl import numpy as np import pandas as pd from theano import * from sklearn.utils import shuffle from lasagne import layers, updates, nonlinearities from nolearn.lasagne import NeuralNet, BatchIterator, visualize FTRAIN = '../d...
github_jupyter
Lambda School Data Science, Unit 2: Predictive Modeling # Regression & Classification, Module 1 ## Assignment You'll use another **New York City** real estate dataset. But now you'll **predict how much it costs to rent an apartment**, instead of how much it costs to buy a condo. The data comes from renthop.com, ...
github_jupyter
# Mean Field Theory ## Essence of Mean Field Approximation (MFA): replacing fluctuating terms by averages Let us assume that each spin i independently of each other feels some average effect of a field: $$H_i = -J\sum_{\delta} s_i s_{i+\delta} - h s_i = -\Big(J\sum_{\delta}s_{\delta} +h \Big) s_i$$ Each spin is exp...
github_jupyter
``` """ Implementation of DDPG - Deep Deterministic Policy Gradient Algorithm and hyperparameter details can be found here: http://arxiv.org/pdf/1509.02971v2.pdf The algorithm is tested on the Pendulum-v0 OpenAI gym task and developed with tflearn + Tensorflow Author: Patrick Emami """ import tensorflow as tf...
github_jupyter
## Course Description A picture can tell a thousand words - but only if you use the right picture! This course teaches you the fundamentals of data visualization with Google Sheets. You'll learn how to create common chart types like bar charts, histograms, and scatter charts, as well as more advanced types, such as spa...
github_jupyter
``` # 定义初始变量 from keras.preprocessing.image import load_img, img_to_array target_image_path = '/home/fc/Downloads/fengjing.jpg' style_reference_image_path = '/home/fc/Downloads/fangao_xinkong.jpg' width, height = load_img(target_image_path).size img_height = 400 img_width = int(width * img_height / height) # 辅助函数 impor...
github_jupyter
# Monte Carlo 2D Ising Model Authors: Chris King, James Grant This tutorial aims to help solidify your understanding of the theory underlying the Monte Carlo simulation technique by applying it to model the magnetic properties of a 2D material. ``` # import everything that we will need in this tutorial now import nu...
github_jupyter
# Overfitting and underfitting The fundamental issue in machine learning is the tension between optimization and generalization. "Optimization" refers to the process of adjusting a model to get the best performance possible on the training data (the "learning" in "machine learning"), while "generalization" refers to h...
github_jupyter
# Bounding box using numpy ``` import numpy as np from skimage import transform import matplotlib.pyplot as plt import cv2 def fill_oriented_bbox(img, fill_threshold=None, color=1): _, contours, _ = cv2.findContours(img, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) out = np.zeros_like(img, dtype=np.uint8) for c...
github_jupyter
# LAB 4c: Create Keras Wide and Deep model. **Learning Objectives** 1. Set CSV Columns, label column, and column defaults 1. Make dataset of features and label from CSV files 1. Create input layers for raw features 1. Create feature columns for inputs 1. Create wide layer, deep dense hidden layers, and output layer ...
github_jupyter
# Pipeline for AutoML Inference Azure Machine Learning Pipeline を利用して、再利用可能なパイプラインを作成することができます。本 Notebook では AutoML で構築したモデルの推論のパイプラインを作成します。 # 1. 事前準備 ## 1.1 Python SDK のインポート Azure Machine Learning の Python SDK などをインポートします。 ``` import pandas as pd from azureml.core import Workspace, Experiment, Dataset, Model fro...
github_jupyter
## 1. Welcome! <p><img src="https://assets.datacamp.com/production/project_1170/img/office_cast.jpeg" alt="Markdown">.</p> <p><strong>The Office!</strong> What started as a British mockumentary series about office culture in 2001 has since spawned ten other variants across the world, including an Israeli version (2010-...
github_jupyter
# Mining of Parallel query/Anchor Text: Similarity ``` DATA_FILE='/mnt/ceph/storage/data-in-progress/data-research/web-search/ECIR-22/ecir21-anchor2query/tmp' from tqdm import tqdm import pandas as pd import json unpopular = 0 unpopular_and_non_identical = 0 df = [] with open(DATA_FILE) as f: for l in tqdm(f): ...
github_jupyter
###### Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2019 by D. Koehn, notebook style sheet by L.A. Barba, N.C. Clementi ``` # Execute this cell to load the notebook's style sheet, then ignore it from IPython.core.display import HTML css_file = '../style/custom.css' HT...
github_jupyter
- Tensor board projection - Visualizing loss and network on tensorboard - Comments ``` %reload_ext autoreload %autoreload 2 %matplotlib inline import mpld3 mpld3.enable_notebook() from pylab import rcParams rcParams['figure.figsize'] = 10, 10 import sys import numpy as np import random import math import tensorflow ...
github_jupyter
<a href="https://colab.research.google.com/github/Priyam145/MLprojects/blob/main/notebooks/LinearRegression_maths.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import numpy as np X = 2 * np.random.rand(100, 1) y = 4 + 3 * X + np.random.randn(1...
github_jupyter
# TV Script Generation In this project, you'll generate your own [Seinfeld](https://en.wikipedia.org/wiki/Seinfeld) TV scripts using RNNs. You'll be using part of the [Seinfeld dataset](https://www.kaggle.com/thec03u5/seinfeld-chronicles#scripts.csv) of scripts from 9 seasons. The Neural Network you'll build will ge...
github_jupyter
``` import networkx as nx import pandas as pd import numpy as np from statsmodels.distributions.empirical_distribution import ECDF import matplotlib.pyplot as plt from scipy.stats import poisson import scipy.stats as stats from scipy.spatial import distance from dragsUtility import * import json import twitter import ...
github_jupyter
Varying the values assigned to max_iter for experimentation. ``` #Import the libraries import pandas as pd import numpy as np from tqdm import tqdm from sklearn import linear_model, metrics, preprocessing, model_selection from sklearn.preprocessing import StandardScaler import xgboost as xgb #Load the data modeling_d...
github_jupyter
# Symbolic mathematics with Sympy [Sympy](http://www.sympy.org/en/index.html) is described as a: > "... Python library for symbolic mathematics." This means it can be used to: - Manipulate symbolic expressions; - Solve symbolic equations; - Carry out symbolic Calculus; - Plot symbolic function. It has other capabi...
github_jupyter
# Climate Data from Home System ``` from erddapy import ERDDAP import pandas as pd import datetime # for secondary/derived parameters from metpy.units import units import metpy.calc as mpcalc server_url = 'http://raspberrypi.local:8080/erddap' #server_url = 'http://192.168.2.3:8080/erddap' e = ERDDAP(server=server_ur...
github_jupyter
&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&ensp; [Home Page](../Start_Here.ipynb) [Previous Notebook](Approach_to_the_Problem_&_Inspecting_and_Cleaning_the_Required_Data.ipynb) &emsp;&emsp;&ems...
github_jupyter
``` # Helper libraries import numpy as np import matplotlib.pyplot as plt # TensorFlow and tf.keras import tensorflow as tf from tensorflow import keras ``` ### Train More on model saving: https://www.tensorflow.org/alpha/guide/keras/saving_and_serializing ``` # %run 102_mnist_fashion.py --output outputs/102_mnist_f...
github_jupyter
##### Copyright 2021 The TensorFlow Authors. ``` #@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 ...
github_jupyter
``` from images.scripts_helper import RobotStats import cPickle as pickle import matplotlib.pyplot as plt import matplotlib.pylab as pylab import matplotlib import numpy as np import inspect from numbers import Number %matplotlib inline f = open('/Users/beijbom/Dropbox/dummyfigs/rs3.pkld', 'r') db = pickle.load(f) de...
github_jupyter
# Reproducible Data Analysis in Jupyter *Jake VanderPlas, March 2017* Jupyter notebooks provide a useful environment for interactive exploration of data. A common question, though, is how you can progress from this nonlinear, interactive, trial-and-error style of analysis to a more linear and reproducible analysis ba...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import pandas_profiling as pp %matplotlib inline ``` # Load The Data from UCI Machine Learning Repository in CSV The UCI Machine Learning Repository is a collection of databases, domain theories, and data generators that ...
github_jupyter
``` import re import numpy as np import pandas as pd import collections from sklearn import metrics from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from unidecode import unidecode from nltk.util import ngrams from tqdm import tqdm import time permulaan = [ 'bel', ...
github_jupyter
``` import analysis import test_features import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib from matplotlib.pyplot import subplots,scatter import matplotlib.patches as mpatches import seaborn as sns from sklearn.externals import joblib from sklearn.cluster import KMeans from sklear...
github_jupyter
``` import matplotlib %matplotlib nbagg from matplotlib import pyplot from statiskit import (linalg, core, pgm) import math import os %reload_ext rpy2.ipython %%R library(glasso) if not 'K' in os.environ: os.environ['K'] = str(10) K = int(os.environ.get('K')) simulation...
github_jupyter
**Chapter 13 – Loading and Preprocessing Data with TensorFlow** _This notebook contains all the sample code and solutions to the exercises in chapter 13._ <table align="left"> <td> <a href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/13_loading_and_preprocessing_data.ipynb" target="_...
github_jupyter
# Tutorial Let us consider chapter 7 of the excellent treatise on the subject of Exponential Smoothing By Hyndman and Athanasopoulos [1]. We will work through all the examples in the chapter as they unfold. [1] [Hyndman, Rob J., and George Athanasopoulos. Forecasting: principles and practice. OTexts, 2014.](https://...
github_jupyter
# Self Study 4 In this self study we implement and test a simple Markov network model for node prediction, and a Gibbs sampling inference (prediction) process. For this material there is no direct support from scikit learn, so we have to do a little more coding ourselves than before ... For basic network functiona...
github_jupyter
##### Let's change gears and talk about Game of thrones or shall I say Network of Thrones. It is suprising right? What is the relationship between a fatansy TV show/novel and network science or python(it's not related to a dragon). ![](images/got.png) Andrew J. Beveridge, an associate professor of mathematics at Mac...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/nyc-taxi-data-regression-model-building/nyc-taxi-data-regression-model-bu...
github_jupyter
# Plotting with [cartopy](https://scitools.org.uk/cartopy/docs/latest/) From Cartopy website: * Cartopy is a Python package designed for geospatial data processing in order to produce maps and other geospatial data analyses. * Cartopy makes use of the powerful PROJ.4, NumPy and Shapely libraries and includes a progr...
github_jupyter
Probabilistic Programming and Bayesian Methods for Hackers ======== Welcome to *Bayesian Methods for Hackers*. The full Github repository is available at [github/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers](https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers)....
github_jupyter
``` import numpy as np from scipy.stats import laplace from scipy.optimize import minimize import matplotlib.pyplot as plt %matplotlib inline from Master_Functions import CondExtBivNegLogLik from DeltaLaplaceFuncs import DeltaLaplace # For module development %load_ext autoreload %autoreload 2 print('\n'.join(f'{m.__na...
github_jupyter
# Basic Synthesis of Single-Qubit Gates ``` from qiskit import * from qiskit.tools.visualization import plot_histogram %config InlineBackend.figure_format = 'svg' # Makes the images look nice import numpy as np ``` ## 1 Show that the Hadamard gate can be written in the following two forms $$H = \frac{X+Z}{\sqrt{2...
github_jupyter
@[TOC] ## 库 ``` import os import csv import requests import xlwt import re import json import time ``` ### 配置 ``` #根据个人浏览器信息进行修改 headers = { 'User-Agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Mobile Safari/537.36' , 'Cookie':...
github_jupyter
``` import matplotlib import numpy as np import matplotlib.pyplot as plt %matplotlib inline import time from IPython.display import clear_output import ipywidgets as widgets import os plt.rcParams["figure.figsize"] = (16,8) dirs = [d for d in os.listdir('.') if os.path.isdir(d)] dirs = np.sort(dirs) wFolder = widgets.D...
github_jupyter
``` %load_ext autoreload %autoreload 2 import csv import ujson, os import json from tqdm import tqdm import os.path import pandas as pd import time from collections import Counter, defaultdict, OrderedDict import random import ast prefix = "concurrentqa/" # FILL IN PATH TO REPOSITORY ``` # Load original data ``` st =...
github_jupyter