text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
## Frauchiger-Renner thought experiment in the collapse theories ### Installation instruction It is recommended that you clone the qthought repository to your local machine and then run in the qthought folder. If you did not pip install qthought, you can use the following quick-fix by uncommenting and adapting to yo...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import seaborn as sns ipl = pd.read_csv('matches.csv') ipl.head() ipl.shape ipl.describe() # Getting the frequency of most man of the match awards ipl['player_of_match'].value_counts() # Getting the frequency of top 10 most man of the match awards ipl['player_of_m...
github_jupyter
# Keras Tutorial : Facial Expression Recognition Challenge ### Using FER2013 faces dataset By Yash # About this notebook This notebook consists of a detailed tutorial in keras for a kaggle problem called [Facial Expression Recognition](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-...
github_jupyter
``` import pandas as pd import numpy as np #for data visualisation import matplotlib.pyplot as plt import seaborn as sns malData=pd.read_csv("MalwareData.csv",sep="|",low_memory = True) X = malData.drop(['Name','md5','legitimate'],axis=1).values y = malData['legitimate'].values malData.shape malData.describe() malData....
github_jupyter
# 2. Tool to identify some components that have caused the electrical events <p> This jupyter notebook was used to manually identify some of the componennts that have caused the electrical events, that were previously hand-labeled. The components identified are <b> pumps, grinders (motor) and heaters </b>in the coffee...
github_jupyter
``` import os import json from pandas.io.json import json_normalize from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import warnings # current version of seaborn generates a bunch of warnings that ...
github_jupyter
## Tutorial on Units and UnitConverters in Parcels In most applications, Parcels works with `spherical` meshes, where longitude and latitude are given in degrees, while depth is given in meters. But it is also possible to use `flat` meshes, where longitude and latitude are given in meters (note that the dimensions ar...
github_jupyter
``` import nltk from nltk.stem.lancaster import LancasterStemmer stemmer = LancasterStemmer() # Import package import tensorflow as tf import json import tflearn import numpy as np import random import pickle with open('intents.json') as jsonFile: data = json.load(jsonFile) print(data['intents']) try: with ope...
github_jupyter
# Feature importance per signature type This notebooks analyses which characters are more important for each individual signature type. In other words, what makes each cluster unique compared to all the other. ``` import numpy as np import pandas as pd import geopandas as gpd import dask.dataframe import matplotlib.p...
github_jupyter
# Contents * [Plot](#Plot) * [Subplot](#Subplot) * [Placement of ticks and custom tick labels](#Placement-of-ticks-and-custom-tick-labels) * [Annotate](#Annotate) * [Axis Grid](#Axis-Grid) * [Axis spines](#Axis-spines) * [Twin axes](#Twin-axes) * [Axes where x and y is zero](#Axes-where-x-and-y...
github_jupyter
# Stemming (and Inverse Stemming) words from multiple languages For more information on the inner workings of the algorithm, refer to: http://snowball.tartarus.org/algorithms/french/stemmer.html The following content is derived from the quickstart guide [here](https://github.com/snowballstem/pystemmer/blob/master/do...
github_jupyter
# Run BASICs on simulated data For 40 genes and 10 spikes - 500: 77.340, 235.535 - 1000: 149.159 451.640 - 5000: 1398.347 - 10000: 2433.064 - 20000: 4021.876 - 50000: 8715.963 - 100000: 16965.28, 30328.91 For 200 genes and 10 spikes - 500: 294.071, 911.659 ==scHOT== For 3 genes - 500: 1780.265 - 1000: 6474.038 - 5...
github_jupyter
#### New to Plotly? Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/). <br>You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-fo...
github_jupyter
# Example: CanvasXpress splom Chart No. 7 This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at: https://www.canvasxpress.org/examples/splom-7.html This example is generated using the reproducible JSON obtained from the above page and ...
github_jupyter
# Exploratory Factor Analysis We created a relatively large set of variables during feature building, several of which are correlated with one another. For instance, being born in the USA correlates highly with being born on the continent of North America. Now we would like to: 1. **Reduce the dimensionality of the f...
github_jupyter
``` #hide %reload_ext autoreload %autoreload 2 %matplotlib inline ``` # Examples - Quantum Annealing > Various Quantum Annealing examples using Quixotic By default, these examples use simulated annealing as a local solver to allow execution on a laptop. To use quantum annealing on a D-Wave quantum device managed b...
github_jupyter
# Gradient Checking Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking. You are part of a team working to make mobile payments available globally, and are asked to build a deep learning model to detect fraud--whenever someone makes a payment, you w...
github_jupyter
# HERA Data Analysis Part I ## Workshop Leaders: Carina & Josh # A) Warm-Up Load HERA data file `zen.2458098.40887.xx.HH.uvOCR` (which is on your laptop in the `data` folder) using the `read_miriad` function from the `UVData` object in the `pyuvdata` module. Then answer these basic questions about the data: i) Whic...
github_jupyter
# Lesson 06 ## Analysis Module within ArcPy # Objectives - Examine the Analysis Tools - Examine the Feature Analysis Tools - Learn about the `tempfile` module ## Analysis Toolbox - Collection of tools that perform the most fundamental GIS operations - Five toolsets + Extract + Overlay + Pairwise Overla...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#ARTIFICIAL-INTELLIGENCE-AND-LIFE-IN-2030" data-toc-modified-id="ARTIFICIAL-INTELLIGENCE-AND-LIFE-IN-2030-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>ARTIFICIAL INTELLIGENCE AND LIFE IN 2030</a></div><div class="lev2 toc-item"><a href="#Preface" data-toc...
github_jupyter
## Business Understanding I am interested in using a data analysis approach to know more about the situation of Women in Computer Programming. I hope to use the analysis results to provide some useful information to anyone who need this kind of research. The key questions I would like to answer are: - what is the sit...
github_jupyter
## Dogs v Cats super-charged! ``` # Put these at the top of every notebook, to get automatic reloading and inline plotting %reload_ext autoreload %autoreload 2 %matplotlib inline # This file contains all the main external libs we'll use from fastai.imports import * from fastai.transforms import * from fastai.conv_lea...
github_jupyter
##### Copyright 2018 The TensorFlow Hub Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
github_jupyter
``` %matplotlib inline import gym import matplotlib import numpy as np import sys from collections import defaultdict if "../" not in sys.path: sys.path.append("../") from lib.envs.blackjack import BlackjackEnv from lib import plotting matplotlib.style.use('ggplot') env = BlackjackEnv() def make_epsilon_greedy_po...
github_jupyter
# Advection-Diffusion In this example, we will learn how to perform an advection-diffusion simulation of a given chemical species through a `Cubic` network. The algorithm can be applied to more complex networks in the same manner as described in this example. For the sake of simplicity, a one layer 3D cubic network is...
github_jupyter
# ZenML: Create production-ready ML pipelines Our goal here is to help you to get the first practical experience with our tool and give you a brief overview on some basic functionalities of ZenML. We will start local in the jupyter notebook but will transition over to a more robust environment with Kubeflow pipelines....
github_jupyter
# Exercise 2.01: Exploring Bitcoin Dataset We explore the Bitcoin dataset in this Jupyter Notebook. First, we start by importing the required libraries. ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt ``` #### Magic Commands Magic commands (those that start with `%`) are commands that modif...
github_jupyter
Antes de empezar, asegúrate de que todo va segun lo esperado. Primero, **reinicia el kernel** (en la barra de menu, selecciona Kernel$\rightarrow$Restart) y entonces **ejecuta todas las celdas** (en la barra de menu, selecciona Cell$\rightarrow$Run All). Asegurate de rellenar cualquier lugar donde aparezca `YOUR CODE ...
github_jupyter
``` from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> <form action="javascript:code_toggle()"><input type="submit" value="Click ...
github_jupyter
# TF Ranking In this Notebook, we run through a simplified example to highlight some of the features of the TF Ranking library and demonstrate an end-to-end execution. The general recipe is a short list of four main steps: 1. Compose a function to **read** input data and prepare a Tensorflow Dataset; 2. Define a...
github_jupyter
[![AWS Data Wrangler](_static/logo.png "AWS Data Wrangler")](https://github.com/awslabs/aws-data-wrangler) # 32 - AWS Lake Formation - Glue Governed tables ### This tutorial assumes that your IAM user/role has the required Lake Formation permissions to create and read AWS Glue Governed tables ## Table of Contents * ...
github_jupyter
``` from __future__ import division import collections import numpy as np import matplotlib.pyplot as plt ## NN libs import keras from keras import backend as K from keras import regularizers from keras.utils import to_categorical from keras.optimizers import SGD, Adam from keras.layers import * from keras.preprocess...
github_jupyter
``` #!/usr/bin/python import sys import pickle import pandas as pd import numpy as np from functools import partial from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler # from sklearn.experimental import enable_iterative_imputer from sklearn.impute import SimpleImputer#,...
github_jupyter
<!--BOOK_INFORMATION--> <a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;"></a> *This notebook contains an ex...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#TensorFlow-Tutorial" data-toc-modified-id="TensorFlow-Tutorial-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>TensorFlow Tutorial</a></div><div class="lev2 toc-item"><a href="#1---Exploring-the-Tensorflow-Library" data-toc-modified-id="1---Exploring-the-Te...
github_jupyter
# Analog vs Digital Transmission In this notebook we will explore the potential advantages of digital transmission over analog transmission. We will consider the case of transmission over a long (e.g. transoceanic) cable in which several repeaters are used to compensate for the attenuation introduced by the transmis...
github_jupyter
# Introduction In this notebook, we will do a comprehensive analysis of the Android app market by comparing thousands of apps in the Google Play store. ``` ``` # About the Dataset of Google Play Store Apps & Reviews **Data Source:** <br> App and review data was scraped from the Google Play Store by Lavanya Gupta in...
github_jupyter
# Data Engineering in Python with databolt - Quickly Load Any Type of CSV (d6tlib/d6tstack) Vendors often send large datasets in multiple files. Often there are missing and misaligned columns between files that have to be manually cleaned. With DataBolt File Stack you can easily stack them together into one consisten...
github_jupyter
## Dependencies ``` !pip install --quiet /kaggle/input/kerasapplications !pip install --quiet /kaggle/input/efficientnet-git import warnings, glob from tensorflow.keras import Sequential, Model import efficientnet.tfkeras as efn from cassava_scripts import * seed = 0 seed_everything(seed) warnings.filterwarnings('ig...
github_jupyter
Basis Pursuit DeNoising ======================= This example demonstrates the use of class [admm.bpdn.BPDN](http://sporco.rtfd.org/en/latest/modules/sporco.admm.bpdn.html#sporco.admm.bpdn.BPDN) to solve the Basis Pursuit DeNoising (BPDN) problem [[16]](http://sporco.rtfd.org/en/latest/zreferences.html#id16) $$\math...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from collections import OrderedDict import time from sklearn.metrics import mean_squared_error,roc_auc_score,mean_absolute_error,log_loss import sys sys.path.append('benchmark/') from gammli_test import gammli from xgb_test ...
github_jupyter
## Tools that we will use - **Pip** Python's official package manager, and is most commonly used to install packages published on the Python Package Index (PyPI). Run: ```bash pip --version ``` - **Conda** Anaconda package manager that automates the process of installing...
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
# Web Scraping with APIs ### What is API? An **Application Programming Interface (API)** enables developers to create repetitive but highly sophisticated software with minimal code. APIs act as prepacked functionality that developer can drop into their code. An example would be apps that use map based location. Almost...
github_jupyter
# 02.01 - BASIC STRUCTURES ``` !wget --no-cache -O init.py -q https://raw.githubusercontent.com/rramosp/20201.xai4eng/master/content/init.py import init; init.init(force_download=False); init.get_weblink() ``` ## Introduction to Python Python is **interpreted** and **dynamically typed**. Observe in the following lin...
github_jupyter
``` import pickle import sys import cv2 import numpy as np import os import os.path import torch import torch.utils.data as data sys.path.append('/home/raymond/project/DOTA_PyTorch/DOTA_devkit') # 保证DOTA_devkit可用的关键 import torchvision.transforms as transforms from PIL import Image from DOTA_devkit import dota_utils as...
github_jupyter
# Bring your own pipe-mode algorithm to Amazon SageMaker _**Create a Docker container for training SageMaker algorithms using Pipe-mode**_ --- ## Contents 1. [Overview](#Overview) 1. [Preparation](#Preparation) 1. [Permissions](#Permissions) 1. [Code](#Code) 1. [train.py](#train.py) 1. [Dockerfile](#Dockerfile...
github_jupyter
``` from __future__ import print_function import numpy as np import tensorflow as tf import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report,confusion_matrix # https://machinelearningmastery....
github_jupyter
# DNA complement and reverse This notebook was used to benchmark the different approach of computing the complement of a sequence. Takes about 15ms to analyse a 1e7 long sequence. ``` # First, let us create a sequence. from biokit.sequence.benchmark import SequenceBenchmark def create_sequence(expectedLength=1e6): ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import pickle from glob import glob from concurrent.futures import ProcessPoolExecutor, as_completed import numpy as np import pandas as pd from scipy import stats import settings as conf from utils import is_number, chunker ``` # Load S-PrediXcan results ## From Rap...
github_jupyter
``` import numpy as np import torch from torch.utils.data import Dataset, DataLoader from torch.nn import functional as F import torch.nn as nn import torchvision.transforms as transforms import torch.optim as optim from torch.autograd import Function from torchvision import models from torchvision import utils from ma...
github_jupyter
# Gentle Introduction to Pytorch Autograd with Linear Regression #### By Michael Przystupa ** By the end of this tutorial students will be able to:**: - Analytically solve a linear regression - Explain what pytorch automatically handles with it's autograd library - Construct a linear model using the pytorch module ##...
github_jupyter
In this demo, we use knowledge distillation to train a ResNet-18 model for image classification. We will show how to provide teacher model, student model, data loaders, inference pipeline and other arguments to the toolkit and start knowledge distillation training. ``` !pip install pytorch-lightning ``` ## Download t...
github_jupyter
# NLP Techniques ## Input -> clean data, check if the data makes sense ## NLP Techniques -> specifically designed for text data ## Output -> plot can help to check if we have what we are looking for ### 1) Sentiment Analysis ### We use the Corpus(original text) to have all words ### We use TextBlob (nltk) ### We use N...
github_jupyter
# Text Similarity <div class="alert alert-info"> This tutorial is available as an IPython notebook at [Malaya/example/similarity](https://github.com/huseinzol05/Malaya/tree/master/example/similarity). </div> <div class="alert alert-info"> This module trained on both standard and local (included social media) l...
github_jupyter
# Essential Extensions for Jupyter NB ## Introduction #### Too long, didn't read: - Table of Contents 2 - Dynamic table of contents for navigating notebooks - Collapsible Headings - Easily collapse whole sections of your notebook - Snippets Menu - Menu to insert common code snippets from the most popular libraries. ...
github_jupyter
# Python Dictionaries ## Dictionaries * Collection of Key - Value pairs * also known as associative array * also known as map * HashMap is another alias * unordered * the order of insertion is preserved in Python since 3.6+ * keys unique in one dictionary * dictionaries can be nested (could have lists inside, diction...
github_jupyter
``` import json import pandas as pd try: import requests except: !pip install requests import requests try: from tqdm import tqdm except: !pip install tqdm from tqdm import tqdm # Playlists df_spotify = pd.read_csv('../data/2000_spotify_sample.csv.gz') df_spotify # Se crean las querys para obtener re...
github_jupyter
### Machine Learning for Engineers: [DecisionTree](https://www.apmonitor.com/pds/index.php/Main/DecisionTree) - [Decision Tree](https://www.apmonitor.com/pds/index.php/Main/DecisionTree) - Source Blocks: 4 - Description: Introduction to Decision Tree - [Course Overview](https://apmonitor.com/pds) - [Course Schedule](...
github_jupyter
### Load Input Data ``` PROCESSED_DATA = "./processed-data" import torch import pandas as pd import numpy as np dataset = pd.read_csv('{}/latestSequence.csv'.format(PROCESSED_DATA), header = 0) dataset.set_index(dataset.columns[0], inplace=True) print(dataset[-24:]) input_data = np.array(dataset) mean = np.mean(inpu...
github_jupyter
### Stock Market Prediction And Forecasting Using Stacked LSTM ### Import the Libraries ``` import numpy as np import pandas as pd from pandas_datareader import data, wb from pandas.util.testing import assert_frame_equal import matplotlib.pyplot as plt import seaborn as sns import tensorflow as tf import math import ...
github_jupyter
# Classify Genres and Emotions in Songs Using Deep Learning ## Description: The goal of this lab is to recognize the genre and extract the emotions from spectrograms of music songs. We are given 2 datasets: - Free Music Archive (FMA) genre that contains 3834 samples from 20 music genres. - Multitask music dataset tha...
github_jupyter
``` %matplotlib inline import numpy as np import scipy.stats as st import matplotlib.pyplot as plt ``` ### Skewness --- The <font color='red'>skewness</font> of a random variable is defined as \begin{equation*} \beta_1 = \mathrm{E}\left[\left(\frac{X-\mu}{\sigma}\right)^3\right], \end{equation*} where $\mu=\mathrm...
github_jupyter
# Composite Can a composite pattern make templating easier? ## Templating There are three template targets: * plain text * PDF * Word That's because some of the uses for this are lawyers that use Word documents. I'm building the templating system up from low principles, because everyone tries to start in the midd...
github_jupyter
## Pyspark ``` import pyspark from pyspark.context import SparkContext # sc = SparkContext('yarn-client', 'pyspark') from pyspark.sql import SparkSession spark = SparkSession \ .builder \ .appName("Python Spark SQL basic example") \ .config("spark.some.config.option", "some-value") \ .getOrCreate() df...
github_jupyter
<h1> Preprocessing using tf.transform and Dataflow </h1> This notebook illustrates: <ol> <li> Creating datasets for Machine Learning using tf.transform and Dataflow </ol> <p> While Pandas is fine for experimenting, for operationalization of your workflow, it is better to do preprocessing in Apache Beam. This will also...
github_jupyter
``` # Render our plots inline %matplotlib inline # Import modules for reading and plotting data import pandas as pd import matplotlib.pyplot as plt ``` # Reading data from a csv file You can read data from a CSV file using the `read_csv` function. By default, it assumes that the fields are comma-separated. We're go...
github_jupyter
# Crossentropy method This notebook will teach you to solve reinforcement learning problems with crossentropy method. We'll follow-up by scaling everything up and using neural network policy. ``` # XVFB will be launched if you run on a server import os if type(os.environ.get("DISPLAY")) is not str or len(os.environ.g...
github_jupyter
# R: Cluster Robust Double Machine Learning ## Motivation In many empirical applications, errors exhibit a clustered structure such that the usual i.i.d. assumption does not hold anymore. In order to perform valid statistical inference, researchers have to account for clustering. In this notebook, we will shortly e...
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
<a href="https://colab.research.google.com/github/rim-yu/Keras-GAN/blob/master/team_project_dcgan.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> https://blog.naver.com/dong961015/221839396386 참고하였음. ``` from __future__ import print_function, divis...
github_jupyter
# Artificial test set preparation This notebook prepares the synthetic test set based on the Lakh MIDI Dataset (LMD). Run `../note_seq/prepare.ipynb` and `../audio_train/prepare.ipynb` first. Copyright 2020 InterDigital R&D and Télécom Paris. Author: Ondřej Cífka ``` import collections import concurrent.futures as...
github_jupyter
# Variational Monte Carlo with Neural Networks In this tutorial we will use NetKet to obtain the ground state of the J1-J2 model in one-dimension with periodic boundary conditions, using a Neural Network variational wave-function. The Hamiltonian of the model is given by: $$ H = \sum_{i=1}^{L} J_{1}\vec{\sigma}_{i} \...
github_jupyter
# Pandas与绘图基础知识点 作者:杨岱川 时间:2019年9月 最新编辑:2020年5月 github:https://github.com/DrDavidS/basic_Machine_Learning 开源协议:[MIT](https://github.com/DrDavidS/basic_Machine_Learning/blob/master/LICENSE) ## 导入pandas ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt ``` ## Pandas的两种主要数据结构 ### Series ...
github_jupyter
「PyTorch入門 8. クイックスタート」 =============================================================== 【原題】Learn the Basics 【原著】 [Suraj Subramanian](https://github.com/suraj813)、[Seth Juarez](https://github.com/sethjuarez/) 、[Cassie Breviu](https://github.com/cassieview/) 、[Dmitry Soshnikov](https://soshnikov.com/)、[Ari Bornstein](...
github_jupyter
# Midterm report: Heart disease Shuangyi Tan s1889983 Shuangyi Tan's dataset is about heart disease. And it came from [Kaggle](https://www.kaggle.com/dileep070/heart-disease-prediction-using-logistic-regression/kernels). The source dataset is publicly available on the Kaggle website from an ongoing cardiovascular stu...
github_jupyter
# Submitting calculations #### Create a structure, kpoints, and input parameters and submit a Quantum ESPRESSO (PW) calculation Time: 3 mins <div class="alert alert-box alert-info"> This example expects that you have already imported the sample data provided with the demos (to have the SSSP pseudopotential library). <...
github_jupyter
``` import numpy as np from scipy.integrate import solve_ivp import autograd from autograd.numpy import cos,sin import math import matplotlib.pyplot as plt %matplotlib inline from new_data_builder import get_system def get_hamiltonian(sys): if sys == 'pendulum': def hamiltonian_fn(coords): ...
github_jupyter
``` # helper functions def plot_dataset(X, y, axes): plt.plot(X[:, 0][y==0], X[:, 1][y==0], "bs") plt.plot(X[:, 0][y==1], X[:, 1][y==1], "g^") plt.axis(axes) plt.grid(True, which='both') plt.xlabel(r"$x_1$", fontsize=20) plt.ylabel(r"$x_2$", fontsize=20, rotation=0) def plot_predictions(c...
github_jupyter
# Анализ данных на Python ### Семинар 5. Множества и словари # Что такое Хэш-таблица? Вы - продавец в магазине. Когда покупатель что-то у вас покупает, вы проверяете стоимость товара по книге. ``` book = [('яйца', 60), ('чай', 16), ('кофе', 35), ('лён', 20), ('петрушка', 15), ('торт', 10), ('арбуз', 60), ...
github_jupyter
# Hypothesis Testing In this project we'll be exploring basic hypothesis testing. What is a hypothesis test? It's a way to check the likliehood of a proposed statistical outcome. What follows are some examples of hypothesis tests and the way we can characterise the evidence we have to support some statistical conjectu...
github_jupyter
``` import database_tables as tables import pandas as pd import os import dautil as dl import ch7util import sqlite3 import matplotlib.pyplot as plt import seaborn as sns from IPython.display import HTML def populate_date_dim(session): for d in pd.date_range(start='19000101', end='20250101'): adate = tables...
github_jupyter
# 1. Description This notebook will performe the subgrouping algorithm shown in Figure S1 in the paper "Prediction of the ICU mortality based on the missing events.". # 2. Before running... Before proceeding the followings, plaease solve the python environment accordingly first. This program requires the following l...
github_jupyter
# Planar data classification with one hidden layer Welcome to your week 3 programming assignment. It's time to build your first neural network, which will have a hidden layer. You will see a big difference between this model and the one you implemented using logistic regression. **You will learn how to:** - Implemen...
github_jupyter
### TCLab Overview ![pdc_overview.png](attachment:pdc_overview.png) ### Generate Step Test Data ``` import numpy as np import pandas as pd import tclab import time import os.path # generate step test data on Arduino filename = 'data.csv' # redo data collection? redo = False # check if file already exists if os.pa...
github_jupyter
``` #Multimodal models for processing all data which is preprocessed %cd /content/drive/MyDrive import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import pandas as pd from sklearn.model_selection import train_test_split synth_df=pd.read_csv("nlpGendata.csv") X=sy...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns train = pd.read_csv('Train.csv') test = pd.read_csv('Test.csv') train.head() test.head() train.info() def points(row): return row.replace("." , ":") train.STA = train.STA.apply(points) test.STA = test.STA.apply(points) ...
github_jupyter
# Project 3: Implement SLAM --- ## Project Overview In this project, you'll implement SLAM for robot that moves and senses in a 2 dimensional, grid world! SLAM gives us a way to both localize a robot and build up a map of its environment as a robot moves and senses in real-time. This is an active area of research...
github_jupyter
``` import os import cv2 import math import warnings import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix, fbeta_score from keras import optimizers from keras...
github_jupyter
# <font color='orange'>Word2Vec Introduction </font> The Natural Languahe Processing for data science that was introduced in class discusses the ideas of topics as Bag of words and N-grams with a key note by professor mentioning “this lecture may be subject to change in the upcoming years, as massive improvements in “...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W0D4_Calculus/student/W0D4_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 1: Differentiation and Integration **Week 0, Day...
github_jupyter
###### The probability of an eccentricity GIVEN that a planet is transiting (P(e|b)) and the probability of a longitude of periastron GIVEN that a planet is transiting (P(w|b)) are different than P(e) and P(w). https://academic.oup.com/mnras/article/444/3/2263/1053015 ``` import numpy as np import matplotlib.pyplot a...
github_jupyter
### Meshwork: linking meshes, skeletons, and annotations There are many ways to describe neuroanatomy. We often work with three of them: * Meshes. Meshes provide high resolution 3d structure of the surface of a cell. This is important for understanding the fine details of a neuron, like how long spines are or how the ...
github_jupyter
# Chapter 5 - Resampling Methods - [Load dataset](#Load-dataset) - [Cross-Validation](#5.1-Cross-Validation) ``` # %load ../standard_import.txt import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import sklearn.linear_model as skl_lm from sklearn.metrics import mean_squared_e...
github_jupyter
<a href="https://colab.research.google.com/github/pragmatizt/DS-Unit-1-Sprint-3-Statistical-Tests-and-Experiments/blob/master/IRA_E_LS_DS_131_Statistics_Probability_Assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <img align="left" src="ht...
github_jupyter
This is a notebook with all experiments in the DEDPUL paper on behcnmark data sets: UCI, MNIST, CIFAR-10. At the end of the notebook you can play with DEDPUL on specific data sets. ``` import numpy as np import pandas as pd from scipy.stats import norm, laplace import torch.nn as nn import torch.optim as optim import...
github_jupyter
``` import pandas as pd import pickle import json import seaborn as sns import pprint import json import glob import os import numpy as np from ast import literal_eval pp = pprint.PrettyPrinter(depth=6) import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['figure.figsize'] = (15.0, 5.0) pd.set_option('...
github_jupyter
``` import pandas as pd import matplotlib import matplotlib.pyplot as plt import re import requests import time import numpy as np from collections import defaultdict from matplotlib import lines, markers from ipywidgets import interact, interactive, fixed, interact_manual import ipywidgets as widgets plt.style.use('...
github_jupyter
``` # Initialize Otter import otter grader = otter.Notebook("quiz01.ipynb") ``` # Quiz 1 ## Data 94, Spring 2021 This quiz is meant to be completed in **50 minutes**, from 11:10AM-12:00PM on Friday, February 12th. ### Test Cases Unlike in the homework assignments, the test cases that you see in this notebook **are ...
github_jupyter
``` import warnings warnings.simplefilter("ignore") from altaipony.lcio import from_mast import numpy as np import matplotlib.pyplot as plt ``` Find and download the LightCurveFile for your light curve: ``` flc = from_mast("TIC 29780677", mode="LC", c=2, cadence="short", mission="TESS", author="SPOC") flc ``` De-t...
github_jupyter