text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
--- _You are currently looking at **version 1.1** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-data-analysis/resources/0dhYG) course resource._ --- # Assignment 2 - Pand...
github_jupyter
``` pip install nltk import nltk import string import re texto_original = """Algoritmos inteligentes de aprendizados correndo supervisionados utilizam dados coletados. A partir dos dados coletados, um conjunto de característica é extraído. As características podem ser estruturais ou estatísticas. Correr correste corrid...
github_jupyter
# Was Air Quality Affected in Countries or Regions Where COVID-19 was Most Prevalent? **By: Arpit Jain, Maria Stella Vardanega, Tingting Cao, Christopher Chang, Mona Ma, Fusu Luo** --- ## Outline #### I. Problem Definition & Data Source Description 1. Project Objectives 2. Data Source 3. Datase...
github_jupyter
# Tensorflow Timeline Analysis on Model Zoo Benchmark between Intel optimized and stock Tensorflow This jupyter notebook will help you evaluate performance benefits from Intel-optimized Tensorflow on the level of Tensorflow operations via several pre-trained models from Intel Model Zoo. The notebook will show users a...
github_jupyter
<img src="../../img/logo_amds.png" alt="Logo" style="width: 128px;"/> # AmsterdamUMCdb - Freely Accessible ICU Database version 1.0.2 March 2020 Copyright &copy; 2003-2020 Amsterdam UMC - Amsterdam Medical Data Science # Vasopressors and inotropes Shows medication for artificially increasing blood pressure (vasopr...
github_jupyter
<a href="https://colab.research.google.com/github/EvenSol/NeqSim-Colab/blob/master/notebooks/process/masstransferMeOH.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title Calculation of mass transfer and hydrate inhibition of a wet gas by inj...
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
# Practical Examples of Interactive Visualizations in JupyterLab with Pixi.js and Jupyter Widgets # PyData Berlin 2018 - 2018-07-08 # Jeremy Tuloup # [@jtpio](https://twitter.com/jtpio) # [github.com/jtpio](https://github.com/jtpio) # [jtp.io](https://jtp.io) ![skip](./img/skip.png) # The Python Visualization Lan...
github_jupyter
# Regressão linear ## **TOC:** Na aula de hoje, vamos explorar os seguintes tópicos em Python: - 1) [Introdução](#intro) - 2) [Regressão linear simples](#reglinear) - 3) [Regressão linear múltipla](#multireglinear) - 4) [Tradeoff viés-variância](#tradeoff) ``` # importe as principais bibliotecas de análise de dado...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#Lambda-calcul-implémenté-en-OCaml" data-toc-modified-id="Lambda-calcul-implémenté-en-OCaml-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Lambda-calcul implémenté en OCaml</a></div><div class="lev2 toc-item"><a href="#Expressions" data-toc-modified-id="Exp...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Dimensionality-Reduction" data-toc-modified-id="Dimensionality-Reduction-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Dimensionality Reduction</a></span><ul class="toc-item"><li><span><a href="#The-Pro...
github_jupyter
## 용어 정의 ``` #가설설정 # A hypothesis test is a statistical method that uses sample data to evaluate a hypothesis about a population. 1. First, we state a hypothesis about a population. Usually the hypothesis concerns the value of a population parameter. 2. Before we select a sample, we use the hypothesis to predict the...
github_jupyter
# 自然语言处理实战——命名实体识别 ### 进入ModelArts 点击如下链接:https://www.huaweicloud.com/product/modelarts.html , 进入ModelArts主页。点击“立即使用”按钮,输入用户名和密码登录,进入ModelArts使用页面。 ### 创建ModelArts notebook 下面,我们在ModelArts中创建一个notebook开发环境,ModelArts notebook提供网页版的Python开发环境,可以方便的编写、运行代码,并查看运行结果。 第一步:在ModelArts服务主界面依次点击“开发环境”、“创建” ![create_nb_crea...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np from mvmm.single_view.gaussian_mixture import GaussianMixture from mvmm.single_view.MMGridSearch import MMGridSearch from mvmm.single_view.toy_data import sample_1d_gmm from mvmm.single_view.sim_1d_utils import plot_est_params from mvmm.viz_utils import plot_scat...
github_jupyter
``` %matplotlib inline import seaborn as sns sns.set() tips = sns.load_dataset("tips") sns.relplot(x="total_bill", y="tip", col="time", hue="smoker", style="smoker", size="size", data=tips); ``` ``` import seaborn as sns ``` ``` sns.set() ``` ``` tips = sns.load_dataset("tips") ``` ``` sns.r...
github_jupyter
# <img style="float: left; padding-right: 10px; width: 45px" src="https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/iacs.png"> CS-109B Introduction to Data Science ## Lab 5: Convolutional Neural Networks **Harvard University**<br> **Spring 2019**<br> **Lab instructor:** Eleni Kaxiras<br>...
github_jupyter
# Pragmatic color describers ``` __author__ = "Christopher Potts" __version__ = "CS224u, Stanford, Spring 2020" ``` ## Contents 1. [Overview](#Overview) 1. [Set-up](#Set-up) 1. [The corpus](#The-corpus) 1. [Corpus reader](#Corpus-reader) 1. [ColorsCorpusExample instances](#ColorsCorpusExample-instances) 1. [...
github_jupyter
Uploading an image with graphical annotations stored in a CSV file ====================== We'll be using standard python tools to parse CSV and create an XML document describing cell nuclei for BisQue Make sure you have bisque api installed: > pip install bisque-api ``` import os import csv from datetime import date...
github_jupyter
Copyright © 2017-2021 ABBYY Production LLC ``` #@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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
github_jupyter
``` lat = 40.229730557967 lon = -74.002934930983 profile = [ { "key": "natural", "value": "beach", "distance_within": 15, "type": "bicycle", "weight": 20 }, { "key": "name", "value": "Newark Penn Station", "distance_within": 60, "type"...
github_jupyter
## Dependencies ``` import os import sys import cv2 import shutil import random import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from tensorflow import set_random_seed from sklearn.utils import class_weight from sklearn.model_selection import train_test_split...
github_jupyter
# Exp 43 analysis See `./informercial/Makefile` for experimental details. ``` import os import numpy as np from IPython.display import Image import matplotlib import matplotlib.pyplot as plt` %matplotlib inline %config InlineBackend.figure_format = 'retina' import seaborn as sns sns.set_style('ticks') matplotlib....
github_jupyter
``` !pip install wandb !wandb login from collections import deque import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms import gym import wandb class Actor(nn.Module): def __init__(self, num_actions): super().__ini...
github_jupyter
## Introduction If you've had any experience with the python scientific stack, you've probably come into contact with, or at least heard of, the [pandas][1] data analysis library. Before the introduction of pandas, if you were to ask anyone what language to learn as a budding data scientist, most would've likely said ...
github_jupyter
``` # Load WSC dataset import xml.etree.ElementTree as etree import json import numpy as np import logging import numpy import os def softmax(x): return np.exp(x)/sum(np.exp(x)) tree = etree.parse('WSCollection.xml') root = tree.getroot() original_problems = root.getchildren() problems = list() for original_pr...
github_jupyter
## Analyze A/B Test Results You may either submit your notebook through the workspace here, or you may work from your local machine and submit through the next page. Either way assure that your code passes the project [RUBRIC](https://review.udacity.com/#!/projects/37e27304-ad47-4eb0-a1ab-8c12f60e43d0/rubric). **Ple...
github_jupyter
## Random Forest Classification ### Random Forest #### The fundamental idea behind a random forest is to combine many decision trees into a single model. Individually, predictions made by decision trees (or humans) may not be accurate, but combined together, the predictions will be closer to the mark on average. ###...
github_jupyter
<a href="https://colab.research.google.com/github/thingumajig/colab-experiments/blob/master/RetinaNet_Video_Object_Detection.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # .init ## setup keras-retinanet ``` !git clone https://github.com/fizyr/k...
github_jupyter
# Objective * 20190815: * Given stock returns for the last N days, we do prediction for the next N+H days, where H is the forecast horizon * We use double exponential smoothing to predict ``` %matplotlib inline import math import matplotlib import numpy as np import pandas as pd import seaborn as sns import t...
github_jupyter
# 스파크를 이용한 기본 지표 생성 예제 > 기본 지표를 생성하는 데에 있어, 정해진 틀을 그대로 따라하기 보다, 가장 직관적인 방법을 지속적으로 개선하는 과정을 설명하기 위한 예제입니다. 첫 번째 예제인 만큼 지표의 복잡도를 줄이기 위해 해당 서비스를 오픈 일자는 2020/10/25 이며, 지표를 집계하는 시점은 2020/10/26 일 입니다 * 원본 데이터를 그대로 읽는 방법 * dataframe api 를 이용하는 방법 * spark.sql 을 이용하는 방법 * 기본 지표 (DAU, PU)를 추출하는 예제 실습 * 날짜에 대한 필터를 넣는 방법 * 날짜에 대...
github_jupyter
## AI for Medicine Course 1 Week 1 lecture exercises <a name="counting-labels"></a> # Counting labels As you saw in the lecture videos, one way to avoid having class imbalance impact the loss function is to weight the losses differently. To choose the weights, you first need to calculate the class frequencies. For ...
github_jupyter
``` import psycopg2 import pandas as pd import pandas.io.sql as pd_sql import numpy as np import matplotlib.pyplot as plt def connectDB(DB): # connect to the PostgreSQL server return psycopg2.connect( database=DB, user="postgres", password="Georgetown16", host="database-1.c5vispb...
github_jupyter
# Introduction à Python > présentée par Loïc Messal ## Introduction aux flux de contrôles ### Les tests Ils permettent d'exécuter des déclarations sous certaines conditions. ``` age = 17 if age < 18: print("Mineur") # executé si et seulement si la condition est vraie age = 19 if age < 18: print("Mineur") ...
github_jupyter
# Introduction Linear Regression is one of the most famous and widely used machine learning algorithms out there. It assumes that the target variable can be explained as a linear combination of the input features. What does this mean? It means that the target can be viewed as a weighted sum of each feature. Let’s use ...
github_jupyter
######The Iris flower data set is a multivariate data set introduced by the British statistician and biologist Ronald Fisher in his 1936 paper The use of multiple measurements in taxonomic problems. The dataset consists of 50 samples from each of three species of Iris (Iris Setosa, Iris virginica, and Iris versicolor)....
github_jupyter
``` %load_ext autoreload %autoreload 2 import pathlib import IPython.display import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.interpolate import scipy.signal import pymedphys import pymedphys._wlutz.iview indexed_dir = pathlib.Path(r'S:\DataExchange\iViewDB_decoded\indexed') movie...
github_jupyter
# Flopy MODFLOW Boundary Conditions Flopy has a new way to enter boundary conditions for some MODFLOW packages. These changes are substantial. Boundary conditions can now be entered as a list of boundaries, as a numpy recarray, or as a dictionary. These different styles are described in this notebook. Flopy also n...
github_jupyter
# T81-558: Applications of Deep Neural Networks * Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), School of Engineering and Applied Science, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx) * For more information visit the [class website](https://sites.wust...
github_jupyter
``` import statistics import pprint import pandas as pd import numpy as np from random import uniform from tslearn.utils import to_time_series_dataset from tslearn.metrics import dtw#, gak import plotly.express as px import scipy.stats as st import matplotlib.pyplot as plt from scipy.optimize import curve_fit import s...
github_jupyter
# Reading and writing fields There are two main file formats to which a `discretisedfield.Field` object can be saved: - [VTK](https://vtk.org/) for visualisation using e.g., [ParaView](https://www.paraview.org/) or [Mayavi](https://docs.enthought.com/mayavi/mayavi/) - OOMMF [Vector Field File Format (OVF)](https://ma...
github_jupyter
<img align="center" style="max-width: 1000px" src="banner.png"> <img align="right" style="max-width: 200px; height: auto" src="hsg_logo.png"> ## Lab 05 - "Convolutional Neural Networks (CNNs)" Assignments GSERM'21 course "Deep Learning: Fundamentals and Applications", University of St. Gallen In the last lab we le...
github_jupyter
# Colab FAQ For some basic overview and features offered in Colab notebooks, check out: [Overview of Colaboratory Features](https://colab.research.google.com/notebooks/basic_features_overview.ipynb) You need to use the colab GPU for this assignmentby selecting: > **Runtime**   →   **Change runtime type**   →   **Har...
github_jupyter
``` import numpy as np %%html <style> .pquote { text-align: left; margin: 40px 0 40px auto; width: 70%; font-size: 1.5em; font-style: italic; display: block; line-height: 1.3em; color: #5a75a7; font-weight: 600; border-left: 5px solid rgba(90, 117, 167, .1); padding-left: 6px; } .notes { font-st...
github_jupyter
``` # Copyright 2021 NVIDIA Corporation. 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 by applica...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Vectors/landsat_wrs2_grid.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_b...
github_jupyter
``` import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # set random seed for comparing the two result calculations tf.set_random_seed(1) # this is data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) # hyperparameters lr = 0.001 training_iters = 100000 batch_size = 128 n...
github_jupyter
This notebook shows: * How to launch the [**StarGANv1**](https://arxiv.org/abs/1711.09020) model for inference * Example of results for both * attrubutes **detection** * new face **generation** with desired attributes Here I use [**PyTorch** implementation](https://github.com/yunjey/stargan) of the StarGANv1 m...
github_jupyter
``` import pandas as pd from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.metrics import accuracy_score, confusion_matrix from sklearn.tree import export_text ``` This example uses the [Universal Bank](https://www.kaggle.com/sriharipramod/ba...
github_jupyter
# Finetuning of the pretrained Japanese BERT model Finetune the pretrained model to solve multi-class classification problems. This notebook requires the following objects: - trained sentencepiece model (model and vocab files) - pretraiend Japanese BERT model Dataset is livedoor ニュースコーパス in https://www.rondhuit.com...
github_jupyter
``` import json import math import numpy as np import openrtdynamics2.lang as dy import openrtdynamics2.targets as tg from vehicle_lib.vehicle_lib import * # load track data with open("track_data/simple_track.json", "r") as read_file: track_data = json.load(read_file) # # Demo: a vehicle controlled to follow a gi...
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
# Tabular Datasets As we have already discovered, Elements are simple wrappers around your data that provide a semantically meaningful representation. HoloViews can work with a wide variety of data types, but many of them can be categorized as either: * **Tabular:** Tables of flat columns, or * **Gridded:** Arr...
github_jupyter
# Summarize titers and sequences by date Create a single histogram on the same scale for number of titer measurements and number of genomic sequences per year to show the relative contribution of each data source. ``` import Bio import Bio.SeqIO import matplotlib import matplotlib.pyplot as plt import numpy as np imp...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import wikipedia import xml.etree.ElementTree as ET import re from sklearn.manifold import TSNE from sklearn.decomposition import PCA from sklearn.model_selection import cross_val_score import xgboost as xgb from sklearn.metrics import r2_score ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import yaml from pathlib import Path from collections import defaultdict from pandas.api.types import CategoricalDtype EXPERIMENTS_PATH = Path.home() / "ba" / "experiments" benchmarks_paths = list((EXPERIMENTS_PATH / "C4P4").glob("lb.*/*.benchma...
github_jupyter
### Road Following - Live demo (TensorRT) with collision avoidance ### Added collision avoidance ResNet18 TRT ### threshold between free and blocked is the controller - action: just a pause as long the object is in front or by time ### increase in speed_gain requires some small increase in steer_gain (once a slider is...
github_jupyter
``` # %load hovorka.py import matplotlib.pyplot as plt import numpy as np from scipy.integrate import odeint def model(x, t, t_offset=None): w = 100 ka1 = 0.006 # ka2 = 0.06 # ka3 = 0.03 # kb1 = 0.0034 # kb2 = 0.056 # kb3 = 0.024 # u_b = 0.0555 tmaxI = 55 # VI = 0.12 * ...
github_jupyter
**Chapter 10 – Introduction to Artificial Neural Networks** _This notebook contains all the sample code and solutions to the exercises in chapter 10._ # Setup First, let's make sure this notebook works well in both python 2 and 3, import a few common modules, ensure MatplotLib plots figures inline and prepare a func...
github_jupyter
<!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> *This notebook contains an excerpt from the [Python Data Science Handbook](http://shop.oreilly.com/product/0636920034919.do) by Jake VanderPlas; the content is available [on GitHub](https://github.com/jakevdp/Pytho...
github_jupyter
``` import pandas as pd import numpy as np import os import prody import math from pathlib import Path import pickle import sys from sklearn.externals import joblib from sklearn.metrics import r2_score,mean_squared_error from abpred.Pipeline import PreparePredictions def Kd_2_dG(Kd): if Kd == 0: ...
github_jupyter
# Example of extracting features from dataframes with Datetime indices Assuming that time-varying measurements are taken at regular intervals can be sufficient for many situations. However, for a large number of tasks it is important to take into account **when** a measurement is made. An example can be healthcare, wh...
github_jupyter
``` import yfinance as yf import matplotlib.pyplot as plt import numpy as np import pandas as pd from cloudmesh.common.StopWatch import StopWatch from tensorflow import keras from pandas.plotting import register_matplotlib_converters from sklearn.metrics import mean_squared_error import pathlib from pathlib import Path...
github_jupyter
# Modeling and Simulation in Python Case study. Copyright 2017 Allen Downey License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0) ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an ...
github_jupyter
# Refactor: Wine Quality Analysis In this exercise, you'll refactor code that analyzes a wine quality dataset taken from the UCI Machine Learning Repository [here](https://archive.ics.uci.edu/ml/datasets/wine+quality). Each row contains data on a wine sample, including several physicochemical properties gathered from t...
github_jupyter
# Basic Python Introduction to some basic python data types. ``` x = 1 y = 2.0 s = "hello" l = [1, 2, 3, "a"] d = {"a": 1, "b": 2, "c": 3} ``` Operations behave as per what you would expect. ``` z = x * y print(z) # Getting item at index 3 - note that Python uses zero-based indexing. print(l[3]) # Getting the inde...
github_jupyter
# AMATH 515 Homework 2 **Due Date: 02/08/2019** * Name: Tyler Chen * Student Number: *Homework Instruction*: Please follow order of this notebook and fill in the codes where commented as `TODO`. ``` import numpy as np import scipy.io as sio import matplotlib.pyplot as plt ``` ## Please complete the solvers in `so...
github_jupyter
# Start with simplest problem I feel like clasification is the easiest problem catogory to start with. We will start with simple clasification problem to predict survivals of titanic https://www.kaggle.com/c/titanic # Contents 1. [Basic pipeline for a predictive modeling problem](#1) 1. [Exploratory Data Analysis (E...
github_jupyter
# ディープラーニングに必要な数学と NumPy の操作 # 1. NumPy の基本 ## NumPy のインポート ``` import numpy as np ``` ## ndarray による1次元配列の例 ``` a1 = np.array([1, 2, 3]) # 1次元配列を生成 print('変数の型:',type(a1)) print('データの型 (dtype):', a1.dtype) print('要素の数 (size):', a1.size) print('形状 (shape):', a1.shape) print('次元の数 (ndim):', a1.ndim) print('中身:', a1...
github_jupyter
<a href="https://colab.research.google.com/github/mohameddhameem/TensorflowCertification/blob/main/Natural%20Language%20Processing%20in%20TensorFlow/Lesson%203/NLP_Course_Week_3_Exercise_Question.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #...
github_jupyter
# 01.2 Scattering Compute Speed **NOT COMPLETED** In this notebook, the speed to extract scattering coefficients is computed. ``` import sys import random import os sys.path.append('../src') import warnings warnings.filterwarnings("ignore") import torch from tqdm import tqdm from kymatio.torch import Scattering2D i...
github_jupyter
<!--NOTEBOOK_HEADER--> *This notebook contains material from [nbpages](https://jckantor.github.io/nbpages) by Jeffrey Kantor (jeff at nd.edu). The text is released under the [CC-BY-NC-ND-4.0 license](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode). The code is released under the [MIT license](https://opens...
github_jupyter
Used https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/xgboost/notebooks/census_training/train.py as a starting point and adjusted to CatBoost ``` #Google Cloud Libraries from google.cloud import storage #System Libraries import datetime import subprocess #Data Libraries import pandas as pd import ...
github_jupyter
Final models with hyperparameters tuned for Logistics Regression and XGBoost with selected features. ``` #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 ...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/2_transfer_learning_roadmap/6_freeze_base_network/2.2)%20Understand%20the%20effect%20of%20freezing%20base%20model%20in%20transfer%20learning%20-%202%20-%20pytorch.ipynb" target="_parent"><img src="https://colab.resea...
github_jupyter
## 使用TensorFlow的基本步骤 以使用LinearRegression来预测房价为例。 - 使用RMSE(均方根误差)评估模型预测的准确率 - 通过调整超参数来提高模型的预测准确率 ``` from __future__ import print_function import math from IPython import display from matplotlib import cm from matplotlib import gridspec import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklea...
github_jupyter
# test note * jupyterはコンテナ起動すること * テストベッド一式起動済みであること ``` !pip install --upgrade pip !pip install --force-reinstall ../lib/ait_sdk-0.1.7-py3-none-any.whl from pathlib import Path import pprint from ait_sdk.test.hepler import Helper import json # settings cell # mounted dir root_dir = Path('/workdir/root/ait') ait_n...
github_jupyter
``` %load_ext rpy2.ipython %matplotlib inline import logging logging.getLogger('fbprophet').setLevel(logging.ERROR) import warnings warnings.filterwarnings("ignore") ``` ## Python API Prophet follows the `sklearn` model API. We create an instance of the `Prophet` class and then call its `fit` and `predict` methods. ...
github_jupyter
## TensorFlow 2 Complete Project Workflow in Amazon SageMaker ### Data Preprocessing -> Code Prototyping -> Automatic Model Tuning -> Deployment 1. [Introduction](#Introduction) 2. [SageMaker Processing for dataset transformation](#SageMakerProcessing) 3. [Local Mode training](#LocalModeTraining) 4. [Local Mode en...
github_jupyter
``` import safenet safenet.setup_logger(file_level=safenet.log_util.WARNING) myApp = safenet.App() myAuth_,addData=safenet.safe_utils.AuthReq(myApp.ffi_app.NULL,0,0,id=b'crappy_chat_reloaded',scope=b'noScope' ,name=b'i_love_it',vendor=b'no_vendor',app_container=True,ffi=myApp.ffi_app) encodedAuth...
github_jupyter
# Reader - Implantação Este componente utiliza um modelo de QA pré-treinado em Português com o dataset SQuAD v1.1, é um modelo de domínio público disponível em [Hugging Face](https://huggingface.co/pierreguillou/bert-large-cased-squad-v1.1-portuguese).<br> Seu objetivo é encontrar a resposta de uma ou mais perguntas ...
github_jupyter
# Estimator validation This notebook contains code to generate Figure 2 of the paper. This notebook also serves to compare the estimates of the re-implemented scmemo with sceb package from Vasilis. ``` import pandas as pd import matplotlib.pyplot as plt import scanpy as sc import scipy as sp import itertools import...
github_jupyter
# TRTR and TSTR Results Comparison ``` #import libraries import warnings warnings.filterwarnings("ignore") import numpy as np import pandas as pd from matplotlib import pyplot as plt pd.set_option('precision', 4) ``` ## 1. Create empty dataset to save metrics differences ``` DATA_TYPES = ['Real','GM','SDV','CTGAN',...
github_jupyter
# Generating Simpson's Paradox We have been maually setting, but now we should also be able to generate it more programatically. his notebook will describe how we develop some functions that will be included in the `sp_data_util` package. ``` # %load code/env # standard imports we use throughout the project import n...
github_jupyter
# A Scientific Deep Dive Into SageMaker LDA 1. [Introduction](#Introduction) 1. [Setup](#Setup) 1. [Data Exploration](#DataExploration) 1. [Training](#Training) 1. [Inference](#Inference) 1. [Epilogue](#Epilogue) # Introduction *** Amazon SageMaker LDA is an unsupervised learning algorithm that attempts to describe ...
github_jupyter
``` from skempi_utils import * from scipy.stats import pearsonr df = skempi_df df_multi = df[~np.asarray([len(s)>8 for s in df.Protein])] s_multi = set([s[:4] for s in df_multi.Protein]) s_groups = set([s[:4] for s in G1 + G2 + G3 + G4 + G5]) len(s_multi & s_groups), len(s_multi), len(s_groups) df_multi.head() from skl...
github_jupyter
# Automate loan approvals with Business rules in Apache Spark and Scala ### Automating at scale your business decisions in Apache Spark with IBM ODM 8.9.2 This Scala notebook shows you how to execute locally business rules in DSX and Apache Spark. You'll learn how to call in Apache Spark a rule-based decision servic...
github_jupyter
``` ##World Map Plotly #Import Plotly Lib and Set up Credentials with personal account !pip install plotly import plotly plotly.tools.set_credentials_file(username='igleonaitis', api_key='If6Wh3xWNmdNioPzOZZo') plotly.tools.set_config_file(world_readable=True, sharing='public') import ...
github_jupyter
[this doc on github](https://github.com/dotnet/interactive/tree/master/samples/notebooks/fsharp/Samples) # Machine Learning over House Prices with ML.NET ### Reference the packages ``` #r "nuget:Microsoft.ML,1.4.0" #r "nuget:Microsoft.ML.AutoML,0.16.0" #r "nuget:Microsoft.Data.Analysis,0.2.0" #r "nuget: XPlot.Plo...
github_jupyter
<a href="https://colab.research.google.com/github/jantic/DeOldify/blob/master/ImageColorizerColab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### **<font color='blue'> Artistic Colorizer </font>** #◢ DeOldify - Colorize your own photos! ####**...
github_jupyter
# Airbnb - Rio de Janeiro * Download [data](http://insideairbnb.com/get-the-data.html) * We downloaded `listings.csv` from all monthly dates available ## Questions 1. What was the price and supply behavior before and during the pandemic? 2. Does a title in English or Portuguese impact the price? 3. What features corre...
github_jupyter
<a href="https://colab.research.google.com/github/harvardnlp/pytorch-struct/blob/master/notebooks/Unsupervised_CFG.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install -qqq torchtext -qqq pytorch-transformers dgl !pip install -qqqU git+h...
github_jupyter
# Assignment 9: Implement Dynamic Programming In this exercise, we will begin to explore the concept of dynamic programming and how it related to various object containers with respect to computational complexity. ## Deliverables: 1) Choose and implement a Dynamic Programming algorithm in Python, make sure yo...
github_jupyter
![Python Logo](img/Python_logo.png) # If I have seen further it is by standing on the shoulders of Giants (Newton??) ![Python Logo](img/python-loc.png) (https://www.openhub.net/) ![Python Logo](img/numpy-loc.png) (https://www.openhub.net/) ![Python Logo](img/scipy-loc.png) (https://www.openhub.net/) ![Python Logo]...
github_jupyter
# T1566 - Phishing Adversaries may send phishing messages to elicit sensitive information and/or gain access to victim systems. All forms of phishing are electronically delivered social engineering. Phishing can be targeted, known as spearphishing. In spearphishing, a specific individual, company, or industry will be t...
github_jupyter
``` %matplotlib inline ``` 02: Fitting Power Spectrum Models ================================= Introduction to the module, beginning with the FOOOF object. ``` # Import the FOOOF object from fooof import FOOOF # Import utility to download and load example data from fooof.utils.download import load_fooof_data # Dow...
github_jupyter
## Discretisation Discretisation is the process of transforming continuous variables into discrete variables by creating a set of contiguous intervals that span the range of the variable's values. Discretisation is also called **binning**, where bin is an alternative name for interval. ### Discretisation helps handl...
github_jupyter
## Obligatory imports ``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns import sklearn import matplotlib %matplotlib inline matplotlib.rcParams['figure.figsize'] = (12,8) matplotlib.rcParams['font.size']=20 matplotlib.rcParams['lines.linewidth']=4 matplotlib.rcParams['xtick.major.size'] = 10...
github_jupyter
``` import matplotlib matplotlib.use('nbagg') import matplotlib.animation as anm import matplotlib.pyplot as plt import math import matplotlib.patches as patches import numpy as np class World: ### fig:world_init_add_timespan (1-5行目) def __init__(self, time_span, time_interval, debug=False): self.obj...
github_jupyter
# Exploratory Data Analysis ``` from pyspark import SparkContext, SparkConf from pyspark.sql import SparkSession from pyspark.sql.types import * from pyspark.sql import functions as F spark = SparkSession.builder.master('local[1]').appName("Jupyter").getOrCreate() sc = spark.sparkContext #test if this works import pa...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import retry import seaborn as sns %matplotlib inline current_work...
github_jupyter