code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# Guide for Authors ``` print('Welcome to "The Fuzzing Book"!') ``` This notebook compiles the most important conventions for all chapters (notebooks) of "The Fuzzing Book". ## Organization of this Book ### Chapters as Notebooks Each chapter comes in its own _Jupyter notebook_. A single notebook (= a chapter) sh...
github_jupyter
# Appendix A. Creating custom list of stop words. ``` # Basic data science packages import pandas as pd import numpy as np import matplotlib.pyplot as plt import joblib from sklearn.feature_extraction import text # load data data = pd.read_pickle('data/cleaned_data.pkl') data.head() ``` *** ## Adding adjectives a...
github_jupyter
``` import os import json import re import ast import json from graphviz import Digraph import pandas as pd # color the graph import graph_tool.all as gt import copy import matplotlib.colors as mcolors import sys import matplotlib.colors as mcolors import matplotlib.pyplot as plt import numpy as np import seaborn a...
github_jupyter
### How To Break Into the Field Now you have had a closer look at the data, and you saw how I approached looking at how the survey respondents think you should break into the field. Let's recreate those results, as well as take a look at another question. ``` import numpy as np import pandas as pd import matplotlib....
github_jupyter
The notebook is meant to help the user experiment with different models and features. This notebook assumes that there is a saved csv called 'filteredAggregateData.csv' somewhere on your local harddrive. The location must be specified below. The cell imports all of the relevant packages. ``` ############## imports # ...
github_jupyter
``` import pandas as pd df = pd.read_csv('queryset_CNN.csv') print(df.shape) print(df.dtypes) preds = [] pred = [] for index, row in df.iterrows(): doc_id = row.doc_id author_id = row.author_id import ast authorList = ast.literal_eval(row.authorList) candidate = len(authorList) algo ...
github_jupyter
# Introduction to NumPy This notebook is the first half of a special session on NumPy and PyTorch for CS 224U. Why should we care about NumPy? - It allows you to perform tons of operations on vectors and matrices. - It makes things run faster than naive for-loop implementations (a.k.a. vectorization). - We use it...
github_jupyter
# Latent Dirichlet Allocation for Text Data In this assignment you will * apply standard preprocessing techniques on Wikipedia text data * use GraphLab Create to fit a Latent Dirichlet allocation (LDA) model * explore and interpret the results, including topic keywords and topic assignments for documents Recall that...
github_jupyter
``` # -*- coding: utf-8 -*- # # 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 law or agreed to in writing, so...
github_jupyter
``` library(e1071) library(ggplot2) # reading data svm_data <- read.csv("../../datasets/knn.csv") head(svm_data) # building SVM model svm_model <- svm(level~., data = svm_data, kernel = "linear") svm_model # visualizing the model options(repr.plot.width=6, repr.plot.height=5) plot(svm_model, svm_data) # accuracy of the...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import time import seaborn as sns import urllib.request from tqdm import tqdm import pandas as pd %matplotlib inline ``` # Quadratic Assignment Problem ## 1. Read data Popular QAP with loss function minimums: <br> - Nug12 12 578 (OPT) (12,7,9,3,4,8,11,1,5,6,10...
github_jupyter
``` from sympy import * EI, a, q = var("EI, a, q") pprint("\nFEM-Solution:") # 1: Stiffness Matrices: # Element 1 l = 2*a l2 = l*l l3 = l*l*l K = EI/l3 * Matrix( [ [ 4*l2 , -6*l , 2*l2 , 6*l , 0 , 0 ], [ -6*l , 12 , -6*l , -12 , 0 , 0 ], [ 2*l2 , -6*l , 4*l2 , ...
github_jupyter
``` import enum from abc import ABCMeta, abstractmethod, abstractproperty import numpy as np import pandas as pd from matplotlib import pyplot as plt %matplotlib inline ``` # Bayesian bandits Let us explore a simple task of multi-armed bandits with Bernoulli distributions and several strategies for it. Bandits hav...
github_jupyter
``` import os from google.colab import drive drive.mount('/content/gdrive') !mkdir train_local !unzip /content/gdrive/MyDrive/NFL_Helmet/nfl-health-and-safety-helmet-assignment.zip -d train_local/ import random import numpy as np from pathlib import Path import datetime import pandas as pd from tqdm.notebook import tqd...
github_jupyter
# k-Nearest Neighbor (kNN) 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.* ...
github_jupyter
``` %matplotlib inline ``` Training a Classifier ===================== This is it. You have seen how to define neural networks, compute loss and make updates to the weights of the network. Now you might be thinking, What about data? ---------------- Generally, when you have to deal with image, text, audio or vide...
github_jupyter
# Boltzmann Machine ## Downloading the dataset ### ML-100K ``` # !wget "http://files.grouplens.org/datasets/movielens/ml-100k.zip" # !unzip ml-100k.zip # !ls ``` ### ML-1M ``` # !wget "http://files.grouplens.org/datasets/movielens/ml-1m.zip" # !unzip ml-1m.zip # !ls ``` ## Importing the libraries ``` import ...
github_jupyter
<div style='background: #FF7B47; padding: 10px; border: thin solid darblue; border-radius: 5px; margin-bottom: 2vh'> # Session 01 - Notebook Like most session notebooks in this course, this notebook is divided into two parts. Part one is a 'manual' that will allow you to code along with the new code that we intro...
github_jupyter
# Autobatching log-densities example [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/jax/blob/master/docs/notebooks/vmapped_log_probs.ipynb) This notebook demonstrates a simple Bayesian inference example where autobatching makes user code eas...
github_jupyter
# PCA with Cary5000 data for deep-UV spectra (190-300 nm) ``` # Import packages import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from mpl_toolkits import mplot3d from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler plt.style.use('ggplot'...
github_jupyter
<a href="https://colab.research.google.com/github/agungsantoso/deep-learning-v2-pytorch/blob/master/intro-to-pytorch/Part%201%20-%20Tensors%20in%20PyTorch%20(Exercises).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Introduction to Deep Learning ...
github_jupyter
## **University of Toronto - CSC413 - Neural Networks and Deep Learning** ## **Programming Assignment 4 - StyleGAN2-Ada** This is a self-contained notebook that allows you to play around with a pre-trained StyleGAN2-Ada generator Disclaimer: Some codes were borrowed from StyleGAN official documentation on Githu...
github_jupyter
``` #all_slow ``` # Tutorial - Migrating from Lightning > Incrementally adding fastai goodness to your Lightning training We're going to use the MNIST training code from Lightning's 'Quick Start' (as at August 2020), converted to a module. See `migrating_lightning.py` for the Lightning code we are importing here. `...
github_jupyter
``` # Import Required Libraries try: import tensorflow as tf import os import random import numpy as np from tqdm import tqdm from skimage.io import imread, imshow from skimage.transform import resize import matplotlib.pyplot as plt from tensorflow.keras.models import load_model ...
github_jupyter
# Lesson 6: pets revisited ``` %reload_ext autoreload %autoreload 2 %matplotlib inline from fastai.vision import * ``` Set a batch size of 64. Untar the data at `URLs.PETS`, and set the variable `path` to the returned path with `images` appended to the end. ## Data augmentation Create a variable `tfms` that captu...
github_jupyter
# Deploy a previously created model in SageMaker Sagemaker decouples model creation/fitting and model deployment. **This short notebook shows how you can deploy a model that you have already created**. It is assumed that you have already created the model and it appears in the `Models` section of the SageMaker console...
github_jupyter
# Autonomous driving - Car detection Welcome to your week 3 programming assignment. You will learn about object detection using the very powerful YOLO model. Many of the ideas in this notebook are described in the two YOLO papers: [Redmon et al., 2016](https://arxiv.org/abs/1506.02640) and [Redmon and Farhadi, 2016](h...
github_jupyter
# Licences / Notes ``` # Copyright 2019 Google Inc. # 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 law or a...
github_jupyter
# Country Comparison Australia - New Zealand In the following the data of Australia and New Zealand will be cleaned, preprocessed and compared. We chose these two countries for its geographical proximity, historical, political and economic ties as well as for our domain knowledge of the area. Moreover, the data we see...
github_jupyter
# Retail Demo Store Messaging Workshop - Amazon Pinpoint In this workshop we will use [Amazon Pinpoint](https://aws.amazon.com/pinpoint/) to add the ability to dynamically send personalized messages to the customers of the Retail Demo Store. We'll build out the following use-cases. - Send new users a welcome email af...
github_jupyter
# Kqlmagic - __parametrization__ features *** Explains how to emebed python values in kql queries *** *** ## Make sure that you have the lastest version of Kqlmagic Download Kqlmagic from PyPI and install/update (if latest version ims already installed you can skip this step) ``` #!pip install Kqlmagic --no-cache-...
github_jupyter
``` # !pip install graphviz ``` To produce the decision tree visualization you should install the graphviz package into your system: https://stackoverflow.com/questions/35064304/runtimeerror-make-sure-the-graphviz-executables-are-on-your-systems-path-aft ``` # Run one of these in case you have problems with graphviz...
github_jupyter
## Interpreting Ensemble Compressed Features **Gregory Way, 2019** The following notebook will assign biological knowledge to the compressed features using the network projection approach. I use the model previously identified that was used to predict TP53 inactivation. I observe the BioBombe gene set enrichment scor...
github_jupyter
Plot Antarctic Tidal Currents ============================= Demonstrates plotting hourly tidal currents around Antarctica OTIS format tidal solutions provided by Ohio State University and ESR - http://volkov.oce.orst.edu/tides/region.html - https://www.esr.org/research/polar-tide-models/list-of-polar-tide-models/...
github_jupyter
# Algoritmos de Otimização No Deep Learning temos como propósito que nossas redes neurais aprendam a aproximar uma função de interesse, como o preço de casas numa regressão, ou a função que classifica objetos numa foto, no caso da classificação. No último notebook, nós programos nossa primeira rede neural. Além disso...
github_jupyter
``` # -*- coding: utf-8 -*- ``` # 📝 Exercise M6.03 The aim of this exercise is to: * verifying if a random forest or a gradient-boosting decision tree overfit if the number of estimators is not properly chosen; * use the early-stopping strategy to avoid adding unnecessary trees, to get the best generalization p...
github_jupyter
# Movie recommendation Objective: Based on movies list and user ratings estimate how user would rate other movies References: https://medium.com/@jdwittenauer/deep-learning-with-keras-recommender-systems-e7b99cb29929 ``` import pandas as pd import numpy as np from pandas_profiling import ProfileReport import seabo...
github_jupyter
Adopted from GDELT Data Wrangle by James Houghton https://nbviewer.jupyter.org/github/JamesPHoughton/Published_Blog_Scripts/blob/master/GDELT%20Wrangler%20-%20Clean.ipynb Additional GDELT resources: GDELT library overview: https://colab.research.google.com/drive/1rnKEHKV1StOwGtFPsCctKDPTBB_kHOc_?usp=sharing ...
github_jupyter
# 07 - Serving predictions The purpose of the notebook is to show how to use the deployed model for online and batch prediction. The notebook covers the following tasks: 1. Test the `Endpoint` resource for online prediction. 2. Use the custom model uploaded as a `Model` resource for batch prediciton. 3. Run a the bat...
github_jupyter
# Wildfire Damage Assessment (binary classification) ``` #First rescale data to minmax and convert to uint8 #!gdal_translate -scale 0 13016 0 255 -ot Byte data/SantaRosa/Sent2/post/B08_clip_post.tif data/SantaRosa/Sent2/post/B08_clip_scale_post.tif #!gdal_translate -scale 0 13016 0 255 -ot Byte data/SantaRosa/Sent2/pr...
github_jupyter
## NMF [2.5. Decomposing signals in components (matrix factorization problems) — scikit-learn 1.0.2 documentation](https://scikit-learn.org/stable/modules/decomposition.html?highlight=nmf#non-negative-matrix-factorization-nmf-or-nnmf) ``` from sklearn.decomposition import NMF from sklearn.datasets import make_blobs im...
github_jupyter
``` # reload packages %load_ext autoreload %autoreload 2 ``` ### Choose GPU ``` %env CUDA_DEVICE_ORDER=PCI_BUS_ID %env CUDA_VISIBLE_DEVICES=0 import tensorflow as tf gpu_devices = tf.config.experimental.list_physical_devices('GPU') if len(gpu_devices)>0: tf.config.experimental.set_memory_growth(gpu_devices[0], Tr...
github_jupyter
# MNIST With SET This is an example of training an SET network on the MNIST dataset using synapses, pytorch, and torchvision. ``` #Import torch libraries and get SETLayer from synapses import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, trans...
github_jupyter
# ** IMPORT PACKAGES: ** ``` # Python peripherals import os import random # Scipy import scipy.io import scipy.stats as ss # Numpy import numpy # Matplotlib import matplotlib.pyplot as plt import matplotlib.collections as mcoll import matplotlib.ticker as ticker # PyTorch import torch from torch.utils.data.sampler...
github_jupyter
This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Challenge Notebook ## Problem: Implement merge sort. * [Constraints](#Constraints) * [Test Cases](#Test-Cases) * [Algorithm](#Algorithm) * [Cod...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Import-pandas-and-load-the-NLS-data" data-toc-modified-id="Import-pandas-and-load-the-NLS-data-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Import pandas and load the NLS data</a></span></li><li><span>...
github_jupyter
## RNN Time Series Classification ### Importing Required Libraries and Data ``` import pandas as pd import numpy as np #to plot the data import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline import matplotlib as mpl mpl.rcParams.update(mpl.rcParamsDefault) import time import os os.chdir("C:/Data/...
github_jupyter
# Regression Errors Let's talk about errors in regression problems. Typically, in regression, we have a variable $y$ for which we want to learn a model to predict. The prediction from the model is usually denoted as $\hat{y}$. The error $e$ is thus defined as follows - $e = y - \hat{y}$ Since we have many pairs of t...
github_jupyter
## Practice: Sentiment Analysis Classification In this notebook we will try to solve a classification problem where the goal is to classify movie reviews based on sentiment, negative or positive. This notebook presents the problem in its simplest terms unlike the sophisticated sentiment analysis which is done based o...
github_jupyter
# Tutorial 04: Visualizing Experiment Results This tutorial describes the process of visualizing and replaying the results of Flow experiments run using RL. The process of visualizing results breaks down into two main components: - reward plotting - policy replay Note that this tutorial only talks about visualizati...
github_jupyter
## Extend jupyterlab-lsp > Note: the API is likely to change in the future; your suggestions are welcome! ### How to add a new LSP feature? Features (as well as other parts of the frontend) reuse the [JupyterLab plugins system](https://jupyterlab.readthedocs.io/en/stable/developer/extension_dev.html#plugins). Each p...
github_jupyter
# merge_sim&copy; Tutorial * This tutorial shows how to use merge_sim to reproduce the result in my graduate thesis. * Author: [chaonan99](chaonan99.github.io) * Date: 2017/06/10 * Code for this tutorial and the project is under MIT license. See the license file for detail. ``` from game import Case1VehicleGenerator, ...
github_jupyter
# UCI Dodgers dataset ``` import pandas as pd import numpy as np import os from pathlib import Path from config import data_raw_folder, data_processed_folder from timeeval import Datasets import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (20, 10) dataset_collection_name = "Dodgers" so...
github_jupyter
# Train a ready to use TensorFlow model with a simple pipeline ``` import os import sys import warnings warnings.filterwarnings("ignore") import numpy as np import matplotlib.pyplot as plt # the following line is not required if BatchFlow is installed as a python package. sys.path.append("../..") from batchflow impo...
github_jupyter
``` from __future__ import print_function import keras from keras.datasets import cifar10 from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, Lambda from keras.layers import Conv2D, MaxPooling2D from keras.layers.normalization import BatchNormalization as BN from keras.laye...
github_jupyter
``` %pip install bs4 %pip install lxml %pip install nltk %pip install textblob import urllib.request as ur from bs4 import BeautifulSoup ``` ## STEP 1: Read data from HTML and parse it to clean string ``` #We would extract the abstract from this HTML page article articleURL = "https://www.washingtonpost.com/news/the-...
github_jupyter
## Import and export of data from different sources in GRASS GIS GRASS GIS Location can contain data only in one coordinate reference system (CRS) in order to have full control over reprojection and avoid issues coming from on-the-fly reprojection. When starting a project, decide which CRS you will use. Create a new...
github_jupyter
``` from Bio import pairwise2 as pw from Bio import Seq from Bio import SeqIO import Bio from Bio.Alphabet import IUPAC import numpy as np import pandas as pd import re import time from functools import wraps def fn_timer(function): @wraps(function) def function_timer(*args, **kwargs): t0 = time.time() ...
github_jupyter
# Just-in-time Compilation with [Numba](http://numba.pydata.org/) ## Numba is a JIT compiler which translates Python code in native machine language * Using special decorators on Python functions Numba compiles them on the fly to machine code using LLVM * Numba is compatible with Numpy arrays which are the basis of m...
github_jupyter
``` import sys sys.path.append('../input/shopee-competition-utils') sys.path.insert(0,'../input/pytorch-image-models') import numpy as np import pandas as pd import torch from torch import nn from torch.nn import Parameter from torch.nn import functional as F from torch.utils.data import Dataset, DataLoader import a...
github_jupyter
# 7. előadás *Tartalom:* Függvények, pár további hasznos library (import from ... import ... as szintaktika, time, random, math, regex (regular expressions), os, sys) ### Függvények Találkozhattunk már függvényekkel más programnyelvek kapcsán. De valójában mik is azok a függvények? A függvények: • újrahasználh...
github_jupyter
<a href="https://colab.research.google.com/github/google/neural-tangents/blob/master/notebooks/phase_diagram.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); y...
github_jupyter
`Дисциплина: Методы и технологии машинного обучения` `Уровень подготовки: бакалавриат` `Направление подготовки: 01.03.02 Прикладная математика и информатика` `Семестр: осень 2021/2022` # Лабораторная работа №3: Линейные модели. Кросс-валидация. В практических примерах ниже показано: * как пользова...
github_jupyter
# Lab 12: Epidemics, or the Spread of Viruses ``` %matplotlib inline import matplotlib.pyplot as plt import matplotlib.image as img import numpy as np import scipy as sp import scipy.stats as st import networkx as nx from scipy.integrate import odeint from operator import itemgetter print ('Modules Imported!') ``` ##...
github_jupyter
### Genarating names with character-level RNN In this notebook we are going to follow the previous notebook wher we classified name's nationalities based on a character level RNN. This time around we are going to generate names using character level RNN. Example: _given a nationality and three starting characters we w...
github_jupyter
# Shashank V. Sonar ## Task 5: Exploratory Data Analysis - Sports ### Step -1: Importing the required Libraries ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns %matplotlib inline from sklearn.cluster import KMeans from sklearn import datasets import warnings warnings...
github_jupyter
# Random 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).* ## Independent Processes The independence of random signals is ...
github_jupyter
# Training Neural Networks The network we built in the previous part isn't so smart, it doesn't know anything about our handwritten digits. Neural networks with non-linear activations work like universal function approximators. There is some function that maps your input to the output. For example, images of handwritt...
github_jupyter
# Recommendations with IBM In this notebook, you will be putting your recommendation skills to use on real data from the IBM Watson Studio platform. 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 ...
github_jupyter
# Model Development V1 - This is really more like scratchwork - Divide this into multiple notebooks for easier reading **Reference** - http://zacstewart.com/2014/08/05/pipelines-of-featureunions-of-pipelines.html ``` import json import pickle from pymongo import MongoClient import numpy as np import pandas as pd from...
github_jupyter
``` """The file needed to run this notebook can be accessed from the following folder using a UTS email account: https://drive.google.com/drive/folders/1y6e1Z2SbLDKkmvK3-tyQ6INO5rrzT3jp """ ``` ##Task-1: Installation of Google Object Detection API and required packages ### Step 1: Import packages ``` #Mount the driv...
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
``` import numpy as np import pandas as pd from keras.models import * from keras.layers import Input, merge, Conv2D, MaxPooling2D, UpSampling2D, Dropout, Cropping2D from keras.optimizers import * from keras.callbacks import ModelCheckpoint, LearningRateScheduler, EarlyStopping, ReduceLROnPlateau from datetime import d...
github_jupyter
``` from neo4j import GraphDatabase import json with open('credentials.json') as json_file: credentials = json.load(json_file) username = credentials['username'] pwd = credentials['password'] ``` ### NOTE ❣️ * BEFORE running this, still need to run `bin\neo4j console` to enable bolt on 127.0.0.1:7687 * When the ...
github_jupyter
``` import matplotlib.pyplot as plt from tensorflow.keras.layers import Input,Conv2D from tensorflow.keras.layers import MaxPool2D,Flatten,Dense from tensorflow.keras import Model ``` ![](https://lh3.googleusercontent.com/-WuPVxynI_ss/X_6DG-R179I/AAAAAAAAsSc/S0rVDJtOW_Q7bbPdOC2xnvRn3DpRbbe6wCK8BGAsYHg/s0/2021-01-12.pn...
github_jupyter
This notebook shows the MEP quickstart sample, which also exists as a non-notebook version at: https://bitbucket.org/vitotap/python-spark-quickstart It shows how to use Spark (http://spark.apache.org/) for distributed processing on the PROBA-V Mission Exploitation Platform. (https://proba-v-mep.esa.int/) The sample in...
github_jupyter
``` CRISP_DM = "C:/Users/kaivl/data_science_covid-19/CRISP_DM.png" from PIL import Image import glob Image.open(CRISP_DM) import pandas as pd import subprocess import os import ntpath pd.set_option('display.max_rows', 500) ``` ### Data Understanding * RKI, webscrape (webscraping) https://www.rki.de/DE/Content/InfAZ/...
github_jupyter
``` import torch import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import random %matplotlib inline import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader import glob import os.path fr...
github_jupyter
``` from google.colab import drive ROOT = "/content/drive" drive.mount(ROOT) %cd "/content/drive/My Drive/Learning/deep-learning-v2-pytorch/intro-to-pytorch" ``` # Loading Image Data So far we've been working with fairly artificial datasets that you wouldn't typically be using in real projects. Instead, you'll like...
github_jupyter
``` from statsmodels.stats.outliers_influence import variance_inflation_factor from sklearn.model_selection import KFold from sklearn.datasets import make_regression from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score from sklearn.model_selection import cross_val_score %matplotlib i...
github_jupyter
# Title **Exercise: B.1 - MLP by Hand** # Description In this exercise, we will **construct a neural network** to classify 3 species of iris. The classification is based on 4 measurement predictor variables: sepal length & width, and petal length & width in the given dataset. <img src="../img/image5.jpeg" style="wi...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from pathlib import Path import os import random import matplotlib.pyplot as plt import seaborn as sns # classification metric from scipy.stats import spearmanr model_type = 'roberta' pretrained_model_n...
github_jupyter
# Code for Chapter 1. In this case we will review some of the basic R functions and coding paradigms we will use throughout this book. This includes loading, viewing, and cleaning raw data; as well as some basic visualization. This specific case we will use data from reported UFO sightings to investigate what, if a...
github_jupyter
# Attempting to load higher order ASPECT elements An initial attempt at loading higher order element output from ASPECT. The VTU files have elements with a VTU type of `VTK_LAGRANGE_HEXAHEDRON` (VTK ID number 72, https://vtk.org/doc/nightly/html/classvtkLagrangeHexahedron.html#details), corresponding to 2nd order (q...
github_jupyter
<img src="resources/titanic_sinking.gif" alt="Titanic sinking gif" style="margin: 10px auto 20px; border-radius: 15px;" width="100%"/> <a id="project-overview"></a> _**Potonuće Titanika** jedno je od najozloglašenijih brodoloma u istoriji._ _15. aprila 1912. godine, tokom njegovog prvog putovanja, široko smatrani „ne...
github_jupyter
# Индекс поиска ``` import numpy as np import pandas as pd import datetime import matplotlib from matplotlib import pyplot as plt import matplotlib.patches as mpatches matplotlib.style.use('ggplot') %matplotlib inline ``` ### Описание: Индекс строится на основе кризисных дескрипторов, взятых из [статьи Столбова.]...
github_jupyter
``` import os import json import pickle import random from collections import defaultdict, Counter from indra.literature.adeft_tools import universal_extract_text from indra.databases.hgnc_client import get_hgnc_name, get_hgnc_id from adeft.discover import AdeftMiner from adeft.gui import ground_with_gui from adeft.m...
github_jupyter
# 1. Deep learning: Pre-requisites #### Understanding gradient descent, autodiff, and softmax ### Gradiant Descent Optimization technique for finding best parameters (Model parameters) for a giving problem - Cost function to reduce the error, for example, as the image. The neural network is trained with gradient des...
github_jupyter
# Generación de observaciones aleatorias a partir de una distribución de probabilidad La primera etapa de la simulación es la **generación de números aleatorios**. Los números aleatorios sirven como el bloque de construcción de la simulación. La segunda etapa de la simulación es la **generación de variables aleatorias...
github_jupyter
# Amount Spend by a User on an E-Commerce Website In this machine learning project, I have collected the dataset from Kaggle (https://www.kaggle.com/iyadavvaibhav/ecommerce-customer-device-usage?select=Ecommerce+Customers) and I will be using Machine Learning to make predictions of amount spent by a user on E-commerce ...
github_jupyter
``` import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import matplotlib.pyplot as plt import random import backwardcompatibilityml.loss as bcloss import backwardcompatibilityml.scores as scores # Initialize random seed random.seed(123) torch.manual_seed(...
github_jupyter
Find out how many orders, how many products and how many sellers are in the data. How many products have been sold at least once? Which is the product contained in more orders? ``` import pyspark from pyspark.context import SparkContext from pyspark.sql import SparkSession spark = SparkSession.builder \ .master("l...
github_jupyter
# ICLV This demonstrates an integrated choice and latent variable in [biogeme](http://biogeme.epfl.ch), using the biogeme example data. ``` %matplotlib inline %config InlineBackend.figure_format = 'retina' import pandas as pd import numpy as np import matplotlib.pyplot as plt import biogeme.database as bdb import bi...
github_jupyter
<a href="https://colab.research.google.com/github/NichaRoj/cubems-data-pipeline/blob/master/colab/example_ltsm.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Pre Step ``` import pandas as pd import numpy as np import seaborn as sns import matplot...
github_jupyter
``` import numpy as np import os from astropy.table import Table from astropy.cosmology import FlatLambdaCDM from matplotlib import pyplot as plt from astropy.io import ascii from astropy.coordinates import SkyCoord import healpy import astropy.units as u import pandas as pd import matplotlib import pyccl from scipy i...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/nikolay-bushkov/kaist_internship/blob/master/active_learning_for_question_classification.ipynb) # Predicting question type on the Yahoo dataset Based on https://developers.google.com/machine-learning/guides/text-classification/, https://github.com/cosmic...
github_jupyter
## Imports And Setting UP the Jupyter ``` import os from bs4 import BeautifulSoup as bs import requests import pymongo from splinter import Browser from webdriver_manager.chrome import ChromeDriverManager from splinter import Browser import pandas as pd #I am having a lot of issues with chromedriver so im including b...
github_jupyter
``` from __future__ import print_function import sys import numpy as np from time import time import matplotlib.pyplot as plt from tqdm import tqdm import math import struct import binascii sys.path.append('/home/xilinx') from pynq import Overlay from pynq import allocate def float2bytes(fp): packNo = struct.pac...
github_jupyter
**NOTE: An version of this post is on the PyMC3 [examples](https://docs.pymc.io/notebooks/blackbox_external_likelihood.html) page.** <!-- PELICAN_BEGIN_SUMMARY --> [PyMC3](https://docs.pymc.io/index.html) is a great tool for doing Bayesian inference and parameter estimation. It has a load of [in-built probability dis...
github_jupyter
![Panel HighCharts Logo](https://raw.githubusercontent.com/MarcSkovMadsen/panel-highcharts/main/assets/images/panel-highcharts-logo.png) # 📈 Panel HighMap Reference Guide The [Panel](https://panel.holoviz.org) `HighMap` pane allows you to use the powerful [HighCharts](https://www.highcharts.com/) [Maps](https://www....
github_jupyter