code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# BetterReads: Optimizing GoodReads review data This notebook explores how to achieve the best results with the BetterReads algorithm when using review data scraped from GoodReads. It is a short follow-up to the exploration performed in the `03_optimizing_reviews.ipynb` notebook. We have two options when scraping rev...
github_jupyter
## Load data ``` from sklearn import datasets import pandas as pd boston = datasets.load_boston() dat = pd.DataFrame(boston.data, columns=boston.feature_names) dat.head() target = pd.DataFrame(boston.target, columns=["MEDV"]) target.head() ``` ## Analyse data ``` df = dat.copy() df = pd.concat([df, target], axis=1)...
github_jupyter
# 2.18 Programming for Geoscientists class test 2016 # Test instructions * This test contains **4** questions each of which should be answered. * Write your program in a Python cell just under each question. * You can write an explanation of your solution as comments in your code. * In each case your solution program...
github_jupyter
# OGGM flowlines: where are they? In this notebook we show how to access the OGGM flowlines location before, during, and after a run. Some of the code shown here will make it to the OGGM codebase [eventually](https://github.com/OGGM/oggm/issues/1111). ``` from oggm import cfg, utils, workflow, tasks, graphics from o...
github_jupyter
# Data ingestion & inspection ## 1. NumPy and pandas working together Pandas depends upon and interoperates with NumPy, the Python library for fast numeric array computations. For example, you can use the DataFrame attribute .values to represent a DataFrame df as a NumPy array. You can also pass pandas data structures...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import sys sys.path.append("..") import datetime import pathlib from collections import OrderedDict import numpy as np import pandas as pd # Pytorch import torch from torch.optim import lr_scheduler import torch.optim as optim from torch.autograd import Variable # C...
github_jupyter
# MNIST - Syft Duet - Data Scientist 🥁 ## PART 0: Optional - Google Colab Setup ``` %%capture # This only runs in colab and clones the code sets it up and fixes a few issues, # you can skip this if you are running Jupyter Notebooks import sys if "google.colab" in sys.modules: branch = "master" # change to th...
github_jupyter
Implementation of double deep-Q learning initially taken from https://github.com/fg91/Deep-Q-Learning/blob/master/DQN.ipynb ``` import os import random import gym import tensorflow as tf import numpy as np class FrameProcessor: """Resizes and converts RGB Atari frames to grayscale""" def __init__(self, frame_h...
github_jupyter
# Overview This is a python package that helps process, filter, and analyze the Global Historical Climatology Network Daily dataset. # I. Import The first step is to import all the modules. Do this by using the following import statement. This will give you access to all available modules and classes that the packag...
github_jupyter
``` import torch import numpy as np data = [[1, 2], [3, 4]] x_data = torch.tensor(data) np_array = np.array(data) x_np = torch.from_numpy(np_array) x_ones = torch.ones_like(x_data) # retains the properties of x_data print(f"Ones Tensor: \n {x_ones} \n") x_rand = torch.rand_like(x_data, dtype=torch.float) # overrides t...
github_jupyter
<a href="https://colab.research.google.com/github/VikriAulia/Tensorflow-Deep-Learning-Speech-Recognition/blob/master/Speech_emotion_classification.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Importing the required libraries ``` import libros...
github_jupyter
# Introduction to Machine Learning Nanodegree ## Project: Finding Donors for *CharityML* In this project, we employ several supervised algorithms to accurately model individuals' income using data collected from the 1994 U.S. Census. The best candidate algorithm is then chosen from preliminary results and is further o...
github_jupyter
``` '''Try Euler time-stepping for a simple array Print pe,u's as said by Shubham G. Initial conditions also same ''' def Async_sim(num_grid): import delay_file import probability_initial import error_file import analytical_file import ic_file import numpy as np import matplotlib.pyplot as ...
github_jupyter
# Image features exercise *Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.* We have see...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import r2_score from sklearn.linear_model import SGDRegressor # # load the data # df = pd.read_csv('../Datasets/synth_temp.csv') # # slice 1902 and forward # df = df.loc[df.Year > 1901] # # roll up by year # df_group_year = ...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/ArunkumarRamanan/Exercises-Machine-Learning-Crash-Course-Google-Developers/blob/master/validation.ipynb) #### Copyright 2017 Google LLC. ``` # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import os import sys from hawkes import hawkes, sampleHawkes, plotHawkes, iterative_sampling, extract_samples, sample_counterfactual_superposition, check_monotonicity_hawkes sys.path.append(os.path.abspath('../')) from sampling_utils import thinning_T ``` This not...
github_jupyter
# Two Layer QG Model Example # Here is a quick overview of how to use the two-layer model. See the :py:class:`pyqg.QGModel` api documentation for further details. First import numpy, matplotlib, and pyqg: ``` import numpy as np from matplotlib import pyplot as plt %matplotlib inline import pyqg ``` ## Initialize an...
github_jupyter
### Importing libraries ``` # Import default libraries import pandas as pd import numpy as np import math from matplotlib import pyplot as plt import seaborn as sns import time import random import warnings import os import requests import json import time import zipfile import logging # Import Biopython utils from Bi...
github_jupyter
## Starting Off Looking at the confusion matrix below, and answer the following questions. 1. How many oranges are there in the dataset? 12 2. How many fruits were predicted by the model to be an orange? 6 3. Of the fruits that were predicted to be an orange, how many were actually mangoes? 3 4. Of the fruits that ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt ``` This notebook provides a basic example of using the `blg_strain` package to calculate the magnetoelectric susceptibility for strained bilayer graphene. # Strained Lattice ``` from blg_strain.lattice import StrainedLattice sl = StrainedLattice(eps=0.01, thet...
github_jupyter
# Transfer Learning Most of the time you won't want to train a whole convolutional network yourself. Modern ConvNets training on huge datasets like ImageNet take weeks on multiple GPUs. Instead, most people use a pretrained network either as a fixed feature extractor, or as an initial network to fine tune. In this not...
github_jupyter
``` %matplotlib inline import sys import os import json from glob import glob from collections import defaultdict, OrderedDict import dinopy import yaml import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator import seaborn import numpy import pandas as pd import networkx from scipy.special impo...
github_jupyter
<a href="https://colab.research.google.com/github/wisrovi/03MAIR---Algoritmos-de-Optimizacion---2019/blob/master/Seminario/WilliamSteveRodriguezVillamizar_Seminario-2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Algoritmos de optimización - Sem...
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
# Hive Command Note **Outline** * [Introduction](#intro) * [Syntax](#syntax) * [Reference](#refer) --- Hive is a data warehouse infrastructure tool to process structured data in Hadoop. It resides on top of Hadoop to summarize Big Data, and makes querying and analyzing easy. * **Access Hive**: in cmd, type *`hive...
github_jupyter
# Loading and working with data in sktime Python provides a variety of useful ways to represent data, but NumPy arrays and pandas DataFrames are commonly used for data analysis. When using NumPy 2d-arrays or pandas DataFrames to analyze tabular data the rows are commony used to represent each instance (e.g. case or ob...
github_jupyter
This notebook will show an example of text preprocessing applied to RTL-Wiki dataset. This dataset was introduced in [1] and later recreated in [2]. You can download it in from http://139.18.2.164/mroeder/palmetto/datasets/rtl-wiki.tar.gz -------- [1] "Reading Tea Leaves: How Humans Interpret Topic Models" (NIPS 200...
github_jupyter
``` import pandas as pd import numpy as np from sklearn import metrics from sklearn import preprocessing from sklearn.linear_model import LogisticRegression from sklearn.pipeline import Pipeline from sklearn.preprocessing import OneHotEncoder, StandardScaler from bedrock_client.bedrock.analyzer.model_analyzer import ...
github_jupyter
# Ex2 - Getting and Knowing your Data Check out [Chipotle Exercises Video Tutorial](https://www.youtube.com/watch?v=lpuYZ5EUyS8&list=PLgJhDSE2ZLxaY_DigHeiIDC1cD09rXgJv&index=2) to watch a data scientist go through the exercises This time we are going to pull data directly from the internet. Special thanks to: https:/...
github_jupyter
``` # 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 writi...
github_jupyter
## Explore one-hit vs. two-hit samples in expression space ``` from pathlib import Path import pickle as pkl import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler import sys; sys.path.append('..') import config as cfg from data_u...
github_jupyter
<table style="float:left; border:none"> <tr style="border:none"> <td style="border:none"> <a href="http://bokeh.pydata.org/"> <img src="http://bokeh.pydata.org/en/latest/_static/bokeh-transparent.png" style="width:70px" > </a> ...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import pymc3 as pm import theano from scipy.integrate import odeint from theano import * THEANO_FLAGS = "optimizer=fast_compile" ``` # Lotka-Volterra with manual gradients by [Sanmitra Ghosh](https://www.mrc-bsu.cam.ac.uk/people/in-alphabetical-order/a-to-g/san...
github_jupyter
# Quantum Teleportation This notebook demonstrates quantum teleportation. We first use Qiskit's built-in simulators to test our quantum circuit, and then try it out on a real quantum computer. ## 1. Overview <a id='overview'></a> Alice wants to send quantum information to Bob. Specifically, suppose she wants to send...
github_jupyter
<img src="https://pm1.narvii.com/5887/02b61b74eaec1060b56a3fcfed42ecc24a457a2e_hq.jpg"> In this hands-on, we will use the Marvel dataset to practice using different plots to visualize distributions of values between groups. You are free to come up with you own questions and use one of the categorical plots to help ans...
github_jupyter
# Train convolutional network for sentiment analysis. Based on "Convolutional Neural Networks for Sentence Classification" by Yoon Kim http://arxiv.org/pdf/1408.5882v2.pdf For `CNN-non-static` gets to 82.1% after 61 epochs with following settings: embedding_dim = 20 filter_sizes = (3, 4) num_filters = 3 dr...
github_jupyter
``` #==========Imports========== import numpy as np import matplotlib.pyplot as plt import astropy.constants as const import time from scipy import interpolate import Zach_OPTIMIZER.EBMFunctions as opt import Bell_EBM as ebm #==========Set Up System========== planet = ebm.Planet(rad=1.500*const.R_jup.value, mass=1.170...
github_jupyter
### STEPS: #### Pipeline - 1 1. Tokenization 1. Remove StopWords and Punctuation 1. Stemming #### Pipeline - 2 1. Tokenization 1. POS Tagger 1. Lemmatization ***Remember to Deal With Everything in Lower Cases*** ``` import nltk nltk.download('punkt') # For Tokenizing nltk.download('stopwords') # For...
github_jupyter
[![img/pythonista.png](img/pythonista.png)](https://www.pythonista.io) # Esquema de *OpenAPI*. https://swagger.io/docs/specification/basic-structure/ ## Estructura. * Versión de *OpenAPI*. * Información (```info```). * Etiquetas (```tags```). * Servidores (```servers```). * Componentes (```components```). * Esque...
github_jupyter
``` # Copyright 2019 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 writi...
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
# COVIDvu - US regions visualizer <img src='resources/American-flag.png' align = 'right'> --- ## Runtime prerequisites ``` %%capture --no-stderr requirementsOutput displayRequirementsOutput = False %pip install -r requirements.txt from covidvu.utils import autoReloadCode; autoReloadCode() if displayRequirementsOutp...
github_jupyter
``` import urllib.request import os from PIL import Image,ImageStat import numpy as np import matplotlib.pyplot as plt import torch.optim as optim import torchvision import torch import torch.nn as nn from torch.utils.data import DataLoader import torchvision.transforms as transforms import torch.functional as F impor...
github_jupyter
<a href="https://colab.research.google.com/github/psuto/TensorFlow2ForDL/blob/main/Welcome_to_Colaboratory.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # New section <p><img alt="Colaboratory logo" height="45px" src="/img/colab_favicon.ico" alig...
github_jupyter
<!--COURSE_INFORMATION--> <img align="left" style="padding-right:10px;" src="https://sitejerk.com/images/google-earth-logo-png-5.png" width=5% > <img align="right" style="padding-left:10px;" src="https://colab.research.google.com/img/colab_favicon_256px.png" width=6% > >> *This notebook is part of the free course [EE...
github_jupyter
## Libraries ``` ### Uncomment the next two lines to, ### install tensorflow_hub and tensorflow datasets #!pip install tensorflow_hub #!pip install tensorflow_datasets import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import tensorflow_hub as hub import tensorflow_datasets as tfds from tens...
github_jupyter
## 1. The World Bank's international debt data <p>It's not that we humans only take debts to manage our necessities. A country may also take debt to manage its economy. For example, infrastructure spending is one costly ingredient required for a country's citizens to lead comfortable lives. <a href="https://www.worldba...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Project: **Finding Lane Lines on the Road** *** In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j...
github_jupyter
``` import math import numpy as np import pandas as pd from matplotlib import pyplot as plt from scipy.stats import bayes_mvs as bayesest import os import time from szsimulator import Szsimulator %matplotlib inline mean_size = 3 # micron doubling_time = 18 #min tmax = 180 #min sample_time = 2 #min div_steps = 10 n...
github_jupyter
# Text Data in scikit-learn ``` import matplotlib.pyplot as plt import sklearn sklearn.set_config(display='diagram') from pathlib import Path import tarfile from urllib import request data_path = Path("data") extracted_path = Path("data") / "train" imdb_path = data_path / "aclImdbmini.tar.gz" def untar_imdb(): ...
github_jupyter
``` import tensorflow as tf import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder import pandas as pd import math gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: try: # Currently, memory growth needs to be the sam...
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
# DeepLab Demo This demo will demostrate the steps to run deeplab semantic segmentation model on sample input images. ``` #@title Imports import os from io import BytesIO import tarfile import tempfile from six.moves import urllib from matplotlib import gridspec from matplotlib import pyplot as plt import numpy as ...
github_jupyter
## Import libraries ``` import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.model_selection import ShuffleSplit from sklearn.metrics import mean_absolute_error, r2_score ...
github_jupyter
# Viele Dateien **Inhalt:** Massenverarbeitung von gescrapten Zeitreihen **Nötige Skills:** Daten explorieren, Time+Date Basics **Lernziele:** - Pandas in Kombination mit Scraping - Öffnen und zusammenfügen von vielen Dateien (Glob) - Umstrukturierung von Dataframes (Pivot) - Plotting Level 4 (Small Multiples) ## D...
github_jupyter
# Create a general MODFLOW model from the NHDPlus dataset Project specific variables are imported in the model_spec.py and gen_mod_dict.py files that must be included in the notebook directory. The first first includes pathnames to data sources that will be different for each user. The second file includes a dictionar...
github_jupyter
# Lesson 2 Exercise 2: Creating Denormalized Tables <img src="images/postgresSQLlogo.png" width="250" height="250"> ## Walk through the basics of modeling data from normalized from to denormalized form. We will create tables in PostgreSQL, insert rows of data, and do simple JOIN SQL queries to show how these multiple...
github_jupyter
``` %matplotlib inline ``` Advanced: Making Dynamic Decisions and the Bi-LSTM CRF ====================================================== Dynamic versus Static Deep Learning Toolkits -------------------------------------------- Pytorch is a *dynamic* neural network kit. Another example of a dynamic kit is `Dynet <ht...
github_jupyter
# Network Visualization (PyTorch) In this notebook we will explore the use of *image gradients* for generating new images. When training a model, we define a loss function which measures our current unhappiness with the model's performance; we then use backpropagation to compute the gradient of the loss with respect ...
github_jupyter
## Sparse logistic regression $\newcommand{\n}[1]{\left\|#1 \right\|}$ $\newcommand{\R}{\mathbb R} $ $\newcommand{\N}{\mathbb N} $ $\newcommand{\Z}{\mathbb Z} $ $\newcommand{\lr}[1]{\left\langle #1\right\rangle}$ We want to minimize $$\min_x J(x) := \sum_{i=1}^m \log\bigl(1+\exp (-...
github_jupyter
# Dateien ## Eine Textdatei lesen und ihren Inhalt ausgeben ``` # Wir öffnen die Datei lesen.txt zum Lesen ("r") und speichern ihren Inhalt in die Variable file file = open("lesen.txt", "r") # Wir gehen alle Zeilen nacheinander durch # In der txt-Datei stehen für uns nicht sichtbare Zeilenumbruchszeichen, durch die ...
github_jupyter
``` from functools import partial import torch import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize from src.utils import generate_y from src.MLP import MLP ``` ## Tutorial for `Type2` problem The usage of `type 1` problems are prominent. However it is often true that without const...
github_jupyter
# Ibis Integration (Experimental) The [Ibis project](https://ibis-project.org/docs/) tries to bridge the gap between local Python and [various backends](https://ibis-project.org/docs/backends/index.html) including distributed systems such as Spark and Dask. The main idea is to create a pythonic interface to express SQ...
github_jupyter
##### Copyright 2018 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
### Homework: going neural (6 pts) We've checked out statistical approaches to language models in the last notebook. Now let's go find out what deep learning has to offer. <img src='https://raw.githubusercontent.com/yandexdataschool/nlp_course/master/resources/expanding_mind_lm_kn_3.png' width=300px> We're gonna use...
github_jupyter
# Identification of modal parametes using extended Morlet-Wave method from MDOF system ver. 0.1 ``` import numpy as np import matplotlib.pyplot as plt from morlet_wave import * ``` **Steps required by the user:** 1. Load Impulse Response Functions as a numpy array of the shape: \ `x[(number_of_samples, measure_point...
github_jupyter
# Bevezetés ### Python programozási nyelv A Python egy open-source (OS), interpretált, általános célú programozási nyelv (vagy script-nyelv). **Tulajdonságai:** - Objektum orientált - Interpretált - Nem szükséges fordítani (mint a pl a *C++*-t), elég csak beírni a parancsot, és már futtatható is a kód - Alka...
github_jupyter
# One Shot Learning with Siamese Networks This is the jupyter notebook that accompanies ## Imports All the imports are defined here ``` %matplotlib inline import torchvision import torchvision.datasets as dset import torchvision.transforms as transforms from torch.utils.data import DataLoader,Dataset import matplotl...
github_jupyter
# Naive Bayes $$ \begin{split} \mathop{argmax}_{c_k}p(y=c_k|x) &= \mathop{argmax}_{c_k}p(y=c_k)p(x|y=c_k) \\ & \left( due to: p(y=c_k|x) = \frac{p(y=c_k)p(x|y=c_k)}{p(x)} \right) \\ &= \mathop{argmax}_{c_k}p(y=c_k)\prod_jp(x^{(j)}|y=c_k) \end{split} $$ Use Maximum Likelihood Estimate(MLE) to evaluate $ p(y=c_k)$ and $ ...
github_jupyter
# How To: Crop type classification for Austria This example notebook shows the steps towards constructing an automated machine learning pipeline for crop type identification in an area of interest in Austria. Along the pipeline, two different approaches are applied and compared. The first one, the LightGBM, represents...
github_jupyter
# Classwork 6 ### Critique another group's classwork 5 ### Group Eric-Lance #### Is it clear how the code is organized? We, the people of Datacats, believe this module is very well organized and easy to follow. We can clearly see what each function does, where each function lies, i.e. nothing looks confusing or out ...
github_jupyter
# Working with Streaming Data Learning Objectives 1. Learn how to process real-time data for ML models using Cloud Dataflow 2. Learn how to serve online predictions using real-time data ## Introduction It can be useful to leverage real time data in a machine learning model when making a prediction. However, doing ...
github_jupyter
# Build GAN (Generative Adversarial Networks) with PyTorch and SageMaker ### About GAN Generative Adversarial Network (GAN) i is a generative machine learning model, which is widely used in advertising, games, entertainment, media, pharmaceuticals and other industries. It can be used to create fictional characters an...
github_jupyter
We attempt to build an encoder-decoder system for abstractive text summarization with a Bahdanau attention layer. 100-D GloVe Embeddings are used to initialize the encoder-decoder design, with LSTM and CNN architectures tested for the intermediary layers. The overarching idea of the design is: ![Image of encoder-decod...
github_jupyter
# Quantization of Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Characteristic of a Linear Uniform Quantizer The ch...
github_jupyter
``` import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from tensorflow.contrib.tensorboard.plugins import projector # 载入数据集 mnist = input_data.read_data_sets(r"C:\Users\zdwxx\Downloads\Compressed\MNIST_data", one_hot=True) # 运行次数 max_steps = 550 * 21 # 图片数量 image_num = 3000 # 定义会话 ses...
github_jupyter
# Diseño de software para cómputo científico ---- ## Unidad 5: Integración con lenguajes de alto nivel con bajo nivel. ## Agenda de la Unidad 5 - JIT (Numba) - Cython. - Integración de Python con FORTRAN. - **Integración de Python con C.** ## Recapitulando - Escribimos el código Python. - Pasamos todo a numpy. -...
github_jupyter
# An Introduction to Python using Jupyter Notebooks <a id='toc'></a> ## Table of Contents: ### Introduction * [Python programs are plain text files](#python-programs) * [Use the Jupyter Notebook for editing and running Python](#jn-editing-python) * [How are Jupyter Notebooks stored](#how-its-stored) * [What you need t...
github_jupyter
``` # HIDDEN from datascience import * from prob140 import * import numpy as np import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') %matplotlib inline import math from scipy import stats from scipy import misc from itertools import permutations # HIDDEN # The alphabet alph = make_array('a', 'd', 't') # HID...
github_jupyter
<a href="https://colab.research.google.com/github/vndee/pytorch-vi/blob/master/chatbot_tutorial.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## CHATBOT **Tác giả**: [Matthew Inkawhich](https://github.com/MatthewInkawhich) Trong hướng dẫn này chú...
github_jupyter
# In-Class Coding Lab: Dictionaries The goals of this lab are to help you understand: - How to use Python Dictionaries - Basic Dictionary methods - Dealing with Key errors - How to use lists of Dictionaries - How to encode / decode python dictionaries to json. ## Dictionaries are Key-Value Pairs. The **key** ...
github_jupyter
# Tema 4.1 <a class="tocSkip"> # Imports ``` import math import numpy as np import pandas as pd import matplotlib.pyplot as plt import graphviz import sklearn.tree import sklearn.neighbors import sklearn.naive_bayes import sklearn.svm import sklearn.metrics import sklearn.preprocessing import sklearn.model_selectio...
github_jupyter
<a href="https://colab.research.google.com/github/mikvikpik/DS-Unit-1-Sprint-2-Data-Wrangling-and-Storytelling/blob/master/module1-join-and-reshape-data/LS_DS_121_Join_and_Reshape_Data.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # used for m...
github_jupyter
# Super Resolution with PaddleGAN and OpenVINO This notebook demonstrates converting the RealSR (real-world super-resolution) model from [PaddlePaddle/PaddleGAN](https://github.com/PaddlePaddle/PaddleGAN) to OpenVINO's Intermediate Representation (IR) format, and shows inference results on both the PaddleGAN and IR mo...
github_jupyter
# Imports ``` from datetime import datetime from b2 import B2 ``` # B2 kick-off and data loading `fire_earlier.csv` and `fire_later.csv` are samples of the "[1.88 Million US Wildfires](https://www.kaggle.com/rtatman/188-million-us-wildfires)" dataset made available on Kaggle by Rachael Tatman. ``` b2 = B2() data ...
github_jupyter
# Treinando LSTMs com o dataset IMDB ``` import tensorflow as tf import keras from keras.models import Sequential from keras.layers import Dense, LSTM, Conv1D, MaxPool1D, Dropout, Embedding from keras.preprocessing import sequence from keras.callbacks import EarlyStopping import matplotlib.pyplot as plt import sys imp...
github_jupyter
``` %load_ext autoreload %autoreload 2 import importlib import vsms import torch import torch.nn as nn import clip from vsms import * from vsms import BoxFeedbackQuery class StringEncoder(object): def __init__(self): variant ="ViT-B/32" device='cpu' jit = False self.device = device ...
github_jupyter
<a name="top"></a> # Examples of Tables ## Table of Content 1. [Tabel 1 - No Alignment](#table1) <br> 2. [Tabel 2 - Center Alignment](#table2) <br> 3. [Tabel 3 - Left Alignment](#table3) <br> 4. [Tabel 4 - Right Alignment](#table4) <br> 5. [Table 5 - HTML](#table5) <br> 5a. [Html Table](#table5)<br> 5b. [Addi...
github_jupyter
# Car Price Prediction:: Download dataset from this link: https://www.kaggle.com/hellbuoy/car-price-prediction # Problem Statement:: ``` # mount google drive in to your Colab enviornment from google.colab import drive drive.mount('/content/drive') cd /content/drive/MyDrive/AI_assignment/ ``` A Chinese automobile c...
github_jupyter
# [AI达人创造营第二期] 从电影推荐系统出发了解基于用户的协同过滤算法 ## 1. 项目背景介绍 ### 1.1 协同过滤算法 协同过滤算法是推荐算法领域中基础但非常重要的部分, 它从1992年开始投入推荐算法的研究过程中, 并在AMAZON等大型电子商务的推荐系统中起到了非常出色的效果. 协同过滤算法可以被分为基于用户的协同过滤算法以及基于项目的协同过滤算法. 本项目将从电影推荐系统的简单构建出发来介绍基于用户的协同过滤算法 ### 1.2 以用户为基础(User-based)的协同过滤 用相似统计的方法得到具有相似爱好或者兴趣的相邻用户, 所以称之为以用户为基础(User-based)的协同过滤或基于邻居的协同过滤(N...
github_jupyter
``` import sys, os import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pandas_profiling as pp sys.path.insert(0, os.path.abspath('..')) from script.functions import * ``` #### First, we import the data and display it after passing it through the function. ``` df = load...
github_jupyter
# 確率ロボティクス課題 ## 参考 + [詳解 確率ロボティクス](https://www.amazon.co.jp/%E8%A9%B3%E8%A7%A3-%E7%A2%BA%E7%8E%87%E3%83%AD%E3%83%9C%E3%83%86%E3%82%A3%E3%82%AF%E3%82%B9-Python%E3%81%AB%E3%82%88%E3%82%8B%E5%9F%BA%E7%A4%8E%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0%E3%81%AE%E5%AE%9F%E8%A3%85-KS%E7%90%86%E5%B7%A5%E5%AD%A6%E5%B...
github_jupyter
<a href="https://colab.research.google.com/github/wesleybeckner/technology_fundamentals/blob/main/C4%20Machine%20Learning%20II/SOLUTIONS/SOLUTION_Tech_Fun_C4_S2_Computer_Vision_Part_2_(Defect_Detection_Case_Study).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In C...
github_jupyter
- Usar o algorithmo Isolation Forest ( IF ) para identificar comportamentos outliers no dataset de dívidas - Hipótese : um comportamento outlier pode indicar um usuário de alto risco/fraudulento ``` import pandas as pd import numpy as np from datetime import datetime from sklearn.ensemble import IsolationForest from s...
github_jupyter
``` from selenium import webdriver from bs4 import BeautifulSoup import time import csv import os import shutil import codecs import pandas as pd import numpy as np import random data = r'C:\Users\preya\Downloads\Telegram Desktop\ChatExport_2021-06-27 (1)' file_paths = [] #loop to get append file_paths for root, dire...
github_jupyter
# Data Manipulation and Plotting with `pandas` ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns ``` ![pandas](https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Pandas_logo.svg/2880px-Pandas_logo.svg.png) ## Learning Goals - Load .csv files into `pandas` DataFr...
github_jupyter
# KCWI_calcs.ipynb functions from Busola Alabi, Apr 2018 ``` from __future__ import division import glob import re import os, sys from astropy.io.fits import getheader, getdata from astropy.wcs import WCS import astropy.units as u import numpy as np from scipy import interpolate import logging from time import time i...
github_jupyter
## MIC Demo 1 - Basic steps for measurement This simple demonstration of the MIC toolbox uses two simulated bivariate VAR(2) models from the ["Macroeconomic simulation comparison with a multivariate extension of the Markov Information Criterion"](https://www.kent.ac.uk/economics/documents/research/papers/2019/1908.pdf...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.utils import shuffle import seaborn as sns import matplotlib.pyplot as plt from nltk.corpus import stopwords from nltk import word_tokenize from collections import Counter import nltk, string import matplotlib from wordcloud import WordCloud from sklearn.feature_e...
github_jupyter