text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` import os import tifffile import numpy as np import phathom.phenotype.mesh as mesh import phathom.phenotype.niche as niche import matplotlib.pyplot as plt working_dir = '/media/jswaney/SSD EVO 860/organoid_phenotyping/20181210_eF9_A34_2' ``` # Load centers and cell-type labels ``` centers_path = 'centers.npy' sox...
github_jupyter
# Feature Transformation with Scikit-Learn In This Notebook ## Saving Features into the SageMaker Feature Store In this notebook, we convert raw text into BERT embeddings. This will allow us to perform natural language processing tasks such as text classification. We save the features into the SageMaker Feature Store...
github_jupyter
<a href="https://colab.research.google.com/github/adasegroup/ML2021_seminars/blob/master/seminar7/seminar_GB.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Seminar: Gradient Boosting Course: Machine Learning by professor Evgeny Burnaev <br> Autho...
github_jupyter
# GEE score tests This notebook uses simulation to demonstrate robust GEE score tests. These tests can be used in a GEE analysis to compare nested hypotheses about the mean structure. The tests are robust to miss-specification of the working correlation model, and to certain forms of misspecification of the variance...
github_jupyter
``` import json import altair as alt from altair import expr, datum import matplotlib.pyplot as plt import numpy as np import pandas as pd import requests colors = ["#FFC759", "#FF7B9C", "#607196", "#BABFD1"] alt.themes.enable("dark") n = 24 w = 15 x = [i for i in range(8, n + 1)] y = [w / (n / 24) * (n - i) for i in x...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy import stats import datetime import calendar ``` ### variable - PatientId - 환자를 식별할수 식별자 - AppointmentID - 예약의 식별자 - Gender = 성별 (여성의 비율이 크다, woman takes way more care of they health in comparison to man.) - S...
github_jupyter
# Pentode Modeling * Model Parameter Extraction * Model Parameter Verification This experiment uses data extracted from a vacuum tube datasheet and scipy.optimize to calculate the [Child-Langmuir](http://www.john-a-harper.com/tubes201/) parameters used for circuit simulation. $$I_a = K (V_{g1k} + D_{g2}V_{g2k} + D_aV...
github_jupyter
# Read data and create timeseries using PICES LME Look at SST, ocean currents, chl-a ``` import xarray as xr import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs import sys import pandas as pd sys.path.append('./../subroutines/') import piceslocal adir_data = './../data/' ``` ## Read in da...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set() plt.rcParams["figure.figsize"] = (10, 6) df = pd.read_csv('crawler/data/data.csv') df = df[df['published_date'] < '2020-01-23'] # an article age more than 1 month (to stable ratings) df['published_date'] = pd.to_d...
github_jupyter
*Accompanying code examples of the book "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python" by [Sebastian Raschka](https://sebastianraschka.com). All code examples are released under the [MIT license](https://github.com/rasbt/deep-learning-book/blob/master/LICEN...
github_jupyter
``` import gdal, osr import numpy as np from skimage.graph import route_through_array import pandas as pd import matplotlib.pyplot as plt from scipy import stats import os import math from osgeo import ogr import fiona def raster2array(rasterfn): #print('converting raster to array...') raster = gdal.Open(raster...
github_jupyter
<hr> # [cknowledge.org](http://cknowledge.org): Community-driven benchmarking and optimization of computing systems - from classical to quantum <hr> [Quantum Computing](https://github.com/ctuning/ck-quantum/wiki) * [CK-QISKit](https://github.com/ctuning/ck-qiskit) (IBM) * [CK-Rigetti](https://github.com/ctuning/ck-rig...
github_jupyter
<a href="http://landlab.github.io"><img style="float: left" src="../../../landlab_header.png"></a> # Component Overview: `DepthDependentTaylorDiffuser` <hr> <small>For more Landlab tutorials, click here: <a href="https://landlab.readthedocs.io/en/latest/user_guide/tutorials.html">https://landlab.readthedocs.io/en/lat...
github_jupyter
``` # !wget https://raw.githubusercontent.com/huseinzol05/Malaya-Dataset/master/dictionary/dialect/kelantan.csv import pandas as pd kelantan = pd.read_csv('kelantan.csv') import malaya malays = malaya.texts._malay_words._malay_words import re from unidecode import unidecode def cleaning(string): string = unideco...
github_jupyter
``` # Goal: Predict if an individual is currently diagnosed with Mental Health disorder based on participant answer. # The machine learning algorithm use clean_machine_learning.csv as data entries. import pandas as pd import warnings warnings.filterwarnings('ignore') import numpy as np # Dependencies for interaction w...
github_jupyter
## Area level model: empirical best linear unbiased predictor (EBLUP) Small area estimation (SAE) are useful techniques when the sample sizes are not sufficient to provide reliable direct domain estimates given the sampling design. In this tutorial, the direct estimates refer to estimates obtained from the design-base...
github_jupyter
``` # @title Copyright & License (click to expand) # Copyright 2021 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 r...
github_jupyter
# This notebook produces Figure 2, 3 and 4: **Figure 2: CDF of pairwise cosine similarity of traffic profiles across <span style="color:blue; font-size:large">device types</span> (vertical lines denote medians.) Figure 3: CDF of pairwise cosine similarity of traffic profiles in <span style="color:blue; font-size:larg...
github_jupyter
# Panel Data Models --- ``` import pandas as pd import numpy as np import statsmodels.api as sm from linearmodels import PooledOLS from linearmodels import RandomEffects from linearmodels import PanelOLS from linearmodels import FirstDifferenceOLS from stargazer.stargazer import Stargazer # Import crime data from N...
github_jupyter
<a href="https://colab.research.google.com/github/hila-chefer/Transformer-Explainability/blob/main/Transformer_explainability.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **Transformer Interpretability Beyond Attention Visualization** ``` !git...
github_jupyter
# Performance Overview Here, we will example the performance of FNGS as a function of time on several datasets. These investigations were performed on a 4 core machine (4 threads) with a 4.0 GhZ processor. These investigations were performed on the version of FNGS in ndmg/eric-dev-gkiar-fmri on 03/27. ``` %%script fa...
github_jupyter
# 12. 사이킷런으로 구현해 보는 머신러닝 **머신러닝의 다양한 알고리즘에 대해 알아보고 사이킷런 라이브러리 사용법을 익힙니다. 사이킷런에서 제공하는 모듈을 이해하고, 머신러닝에 적용해 봅니다.** ## 12-1. 들어가며 ## 12-2. 머신러닝 알고리즘 ## 12-3. 사이킷런에서 가이드하는 머신러닝 알고리즘 ## 12-4. Hello Scikit-learn ```bash $ pip install scikit-learn ``` ``` import sklearn print(sklearn.__version__) ``` ## 12-5. 사이킷런의 주요 ...
github_jupyter
<h1 align="center">Segmentation Evaluation</h1> **Summary:** 1. SimpleITK supports two ways of combining expert segmentations to obtain a reference segmentation. 2. A variety of criteria used for evaluating a segmentation result are readily available or implemented in SimpleITK. <u>Reference Segmentation</u> Evalua...
github_jupyter
# Spatial and temporal characteristics of a movement pattern > Marcos Duarte > Laboratory of Biomechanics and Motor Control ([http://demotu.org/](http://demotu.org/)) > Federal University of ABC, Brazil The measurement of spatial and temporal characteristics of a movement pattern is an important resource for the ...
github_jupyter
``` import numpy as np from lapy import TetMesh, TetIO, FuncIO from lapy.Plot import plot_tet_mesh import plotly plotly.offline.init_notebook_mode(connected=True) T = TetIO.import_vtk('../data/cubeTetra.vtk') #T.is_oriented() T.orient_() from lapy import Solver fem = Solver(T,lump=True) evals, evec = fem.eigs(10) #...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt %matplotlib inline import seaborn as sns import re data = pd.read_csv("./dataset/final_training.csv") ## path data.head() data.drop(["Unnamed: 0"],axis=1,inplace=True) data.describe() ``` #### 1 for toxic 0 for normal ``` toxic = data[da...
github_jupyter
``` #mounting drive from google.colab import drive drive.mount('/content/drive') #importing required lib import nltk from nltk.tokenize import sent_tokenize, word_tokenize nltk.download('punkt') nltk.download('wordnet') import numpy as np import random import string import warnings warnings.simplefilter("ignore") text...
github_jupyter
# Linear SVM Model for model analysis ``` import pandas as pd import numpy as np import re from tqdm import tqdm import warnings warnings.filterwarnings("ignore") import matplotlib.pyplot as plt import seaborn as sns from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text impor...
github_jupyter
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/training-data-analyst/blob/master/courses/fast-and-lean-data-science/02_Dataset_playground.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Imports ``` import os, math import n...
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
#Imports/Permissions to load data ``` # Python ≥3.5 is required import sys assert sys.version_info >= (3, 5) # Scikit-Learn ≥0.20 is required import sklearn assert sklearn.__version__ >= "0.20" # Common imports import numpy as np import os # to make this notebook's output stable across runs np.random.seed(42) # To...
github_jupyter
# Getting started with DeBaCl ## 1. Create some data Our first step is to create some data using the scikit-learn `make_blobs` and `make_circles` utility. To make this a hard (but not impossible) clustering problem, we set the random state of the blob so that it's always outside the two concentric circles. ``` impor...
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 pd.set_option('display.max_columns', None) df = pd.read_csv('https://raw.githubusercontent.com/niravjdn/Software-Measurement-Project/master/data/pit/lang/mutations.csv', error_bad_lines=False, names = ["Class", "Package", "gc1", "gc2","gc3","Coverage","gc4"]) df.head() df.drop('gc1', axis=1, inp...
github_jupyter
<a href="https://colab.research.google.com/github/Kanghee-Lee/Mask-RCNN_TF/blob/master/Mask_RCNN(RPN).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #Imports import numpy as np import os import glob import cv2 !pip install xmltodict import xmlt...
github_jupyter
**3장 – 분류** _이 노트북은 3장의 모든 샘플 코드와 연습 문제 정답을 담고 있습니다._ <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/rickiepark/handson-ml2/blob/master/03_classification.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" />구글 코랩에서 실행하기</a> </td> </table> # 설정...
github_jupyter
``` from qiskit.aqua.algorithms import VQE, NumPyEigensolver import matplotlib.pyplot as plt import numpy as np from qiskit.chemistry.components.variational_forms import UCCSD from qiskit.chemistry.components.initial_states import HartreeFock from qiskit.circuit.library import EfficientSU2 from qiskit.aqua.components.o...
github_jupyter
``` !pip install dynet !git clone https://github.com/neubig/nn4nlp-code.git from __future__ import print_function import time from collections import defaultdict import random import math import sys import argparse import dynet as dy import numpy as np # format of files: each line is "word1|tag1 word2|tag2 ..." train...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sb import matplotlib.pyplot as plt import xgboost as xgb from xgboost.sklearn import XGBClassifier from sklearn.ensemble import RandomForestClassifier from sklearn import model_selection, metrics from sklearn import tree from sklearn.metrics import accuracy_s...
github_jupyter
# Node representation learning with GraphSAGE and UnsupervisedSampler <table><tr><td>Run the latest release of this notebook:</td><td><a href="https://mybinder.org/v2/gh/stellargraph/stellargraph/master?urlpath=lab/tree/demos/embeddings/graphsage-unsupervised-sampler-embeddings.ipynb" alt="Open In Binder" target="_par...
github_jupyter
# 1. FeatureExtraction_data Reference: - https://www.kaggle.com/asraful70/talkingdata-new-features-in-lightgbm-lb-0-9784 - https://www.kaggle.com/danieleewww/talkingdata-added-new-features-in-lightg-50cf9b/code - https://www.kaggle.com/anttip/talkingdata-wordbatch-fm-ftrl-lb-0-9769 - https://www.kaggle.com/pranav84/ta...
github_jupyter
``` from reconciler import reconcile import pandas as pd original_data = "../../analysis/data/panglaodb/" results_path = "../../analysis/results/true_matches/" original_cells_organs = pd.read_csv(f"{original_data}cells_organs_germlayers.csv") original_cells_organs.head() cell_types = original_cells_organs["cell_type...
github_jupyter
# Exploring routing tools for calculating paths for a set of origin-destination pairs. In this notebook, I explore OSRM service, OSMnx python library, and googlemaps python library (requests made to Google Maps Directions API) for computing routes and corresponding travel times and distances for a set of origin and de...
github_jupyter
<a href="https://colab.research.google.com/github/pb111/Python-tutorials-and-projects/blob/master/Python_List_Comprehension.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **Python List Comprehension** - In this article, we will learn about Pytho...
github_jupyter
# Betting Framework In this notebook, I am evaluating the score prediction models versus the betting odds of bookmakers. I identify the best betting opportunity (the one with the highest expected value) and then place a bet using risk management: using the Kelly criterion, I am riding the maximum growth curve. ``` im...
github_jupyter
# End-to-End FINN Flow for a Simple Convolutional Net ----------------------------------------------------------------- In this notebook, we will go through the FINN steps needed to take a binarized convolutional network all the way down to a heterogeneous streaming dataflow accelerator running on the FPGA. It's rec...
github_jupyter
# Gaussian XOR and Gaussian R-XOR Experiment with Task Unaware Settings ``` # import dependencies import numpy as np import random from proglearn.sims import generate_gaussian_parity import matplotlib.pyplot as plt import seaborn as sns # functions to perform the experiments in this notebook import functions.xor_rxor...
github_jupyter
``` # NLTK 토큰화 하기 import nltk # NLTK 다운 nltk.download('punkt') sent = "don't worry, be happy. please wake up everbody come on" from nltk.tokenize import word_tokenize print(word_tokenize(sent)) word_tokenize(sent) from nltk.tokenize import wordpunct_tokenize print(wordpunct_tokenize(sent)) !pip install konlpy from ...
github_jupyter
``` ######################################################################################################################## # Filename: RNN_Models.ipynb # # Purpose: Multi-label Text-categorization via recurrent neural networks # Author(s): Bobby (Robert) Lumpkin # # Library Dependencies: numpy, pandas, scikit-learn,...
github_jupyter
``` # Import pyNBS modules from pyNBS import data_import_tools as dit from pyNBS import network_propagation as prop from pyNBS import pyNBS_core as core from pyNBS import pyNBS_single from pyNBS import consensus_clustering as cc from pyNBS import pyNBS_plotting as plot # Import other needed packages import os import t...
github_jupyter
``` #------------------------------------------------------------------------------------ import numpy as np import pycuda.gpuarray as gpuarray from pycuda.tools import make_default_context import matplotlib as matplotlib import pylab as plt from mpl_toolkits.mplot3d import Axes3D #-----------------------------------...
github_jupyter
# Simple MIDI Chorder *** ### A simple, yet very capable MIDI chords detector and annotator *** ### Based upon Yating Music repo/code: https://github.com/YatingMusic/compound-word-transformer ### And chorder repo/code by Joshua Chang: https://github.com/joshuachang2311/chorder *** #### Project Los Angeles ##...
github_jupyter
*Accompanying code examples of the book "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python" by [Sebastian Raschka](https://sebastianraschka.com). All code examples are released under the [MIT license](https://github.com/rasbt/deep-learning-book/blob/master/LICEN...
github_jupyter
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/notebooks/lvm/dcgan_fashion_tf.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Deep convolutional generative adversarial networks (DCGAN) This tutorial fits a DC-GAN to...
github_jupyter
``` %matplotlib inline ``` Transfer Learning Tutorial ========================== **Author**: `Sasank Chilamkurthy <https://chsasank.github.io>`_ In this tutorial, you will learn how to train your network using transfer learning. You can read more about the transfer learning at `cs231n notes <http://cs231n.github.io/...
github_jupyter
# Random Signals and LTI-Systems *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).* ## Introduction The response of a system $y[k] ...
github_jupyter
# Worksheet A-5: Working With Factors & Tibble Joins ## Getting Started Load the requirements for this worksheet: ``` suppressPackageStartupMessages(library(tidyverse)) suppressPackageStartupMessages(library(tsibble)) suppressPackageStartupMessages(library(gapminder)) suppressPackageStartupMessages(library(testthat)...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Challenge Notebook ## Problem: Find the lowest common ancestor in a binary tree. * [Constraints](#Constraints) * [Test Cases](#Test-Cas...
github_jupyter
# Fit NED to Pixels Map This is an example of scaling local North East coordinates to pixel to plot on a sattlelite Google Map Image to ``` %matplotlib inline # Import important libraries import matplotlib.pyplot as plt from math import cos, sin, pi, sqrt, atan2, degrees, hypot, pi # Plotting the original top view im...
github_jupyter
``` import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import pickle import random from tqdm.notebook import tqdm from sklearn.metrics import roc_curve, auc from sklearn.preprocessing import label_binarize from skimage.transform import resize from skimage.io import imread from skimage import col...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline import os import os.path as Path data_dir = Path.join('..','data') url = Path.join(data_dir,'raw','hvc_annotations.csv') url # if Path.isfile(url): # df = pd.read_csv(url) # df.head(2) try: ...
github_jupyter
``` import ( "fmt" "os" "bufio" "strings" "strconv" ) const numVertices int = 10 type Adjacency struct { a string b string } func loadData() (map[string]int, []Adjacency) { f, err := os.Open("input_data") input := bufio.NewReader(f) scanner := bufio.NewScanner(input) vert...
github_jupyter
## En este ejercicio vamos a clusterizar con kmeans ## **Aprendizaje no supervisado** es aquel en el que no sabemos nada sobre los datos. **Clusterizar** es hallar grupos de clases de iguales, dentro de un dataset. <div class="alert alert-block alert-info"> Para clusterizar, se suele usar el algoritmo del kmea...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set() import pandas as pd import sys import exman def last(s): return s.values[-1] from itertools import product def plot_alot(x, ys, data, hue, col, row, ylims=None, ylabel=None, std=True): row_grid = sorte...
github_jupyter
``` import csv import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator from google.colab import files ``` The data for this exercise is available at: https://www.kaggle.com/datamunge/sign-language-mnist/home Sign up and download to find 2 CSV files: sign_mnist_te...
github_jupyter
``` import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import tqdm import wandb import torch from torch import nn, optim import torch.nn.functional as F from torchvision import datasets, transforms mode = 'disabled' # mode = 'online' wandb.init(project='leafsnap', entity='dianna-ai', mod...
github_jupyter
#Titanic: Machine Learning from Disaster Olivier RISSER-MAROIX (VieVie31) ``` import graphlab as gl data_train = gl.load_sframe("train.csv") data_test = gl.load_sframe("test.csv") data_train.head(3) ``` ##Cleanning trainning data ``` data_train["male"] = data_train["Sex"] == "male" data_train["female"] = data_train[...
github_jupyter
I dati utilizzati in questo notebook sono stati presi dalla competizione di Kaggle [Twitter Sentiment Analysis](https://www.kaggle.com/c/twitter-sentiment-analysis2). # Analisi del sentimento ## Indice 1. [Twitter Sentiment Analysis](#twitter)<br> 1.1 [Descrizione](#descrizione)<br> 2. [Analisi lessicale](#lessi...
github_jupyter
## 1. Setting up the environment ``` import numpy as np import gym #pytorch import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Normal # setting manual seed torch.manual_seed(0) from unityagents import UnityEnvironment #matplotlib import mat...
github_jupyter
<a href="https://colab.research.google.com/github/ahmedhisham73/deep_learningtuts/blob/master/deeplearningtutorialCNN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import tensorflow as tf mnist = tf.keras.datasets.fashion_mnist (training_image...
github_jupyter
# STATE Data Transformation Task: use Pandas to transform csv files into DataFrames that match desired tables for database schema Tables: - STATE (done) - STATE_DATES (done) - STATE_CONTIGUITY (done) - STATE_RESOURCE (done) ``` import pandas as pd import numpy as np !ls SourceData/CorrelatesOfWar/ ``` ## Create 'S...
github_jupyter
### Deep Kung-Fu with advantage actor-critic In this notebook you'll build a deep reinforcement learning agent for Atari [Kung-Fu Master](https://gym.openai.com/envs/KungFuMaster-v0/) that uses a recurrent neural net. ![https://upload.wikimedia.org/wikipedia/en/6/66/Kung_fu_master_mame.png](https://upload.wikimedia.o...
github_jupyter
# Function arguments In this article we will talk about function parameters and function arguments in detail. We will learn: - The difference between arguments and parameters - Positional and keyword arguments - Default arguments - Variable-length arguments (`*args` and `**kwargs`) - Container unpacking into function ...
github_jupyter
**Group Members**\ **Cherukuri Nikhilesh - S20180010040**\ **Kore Nithish Kumar - S20180010086**\ **Pulla Nagendra Babu - S20180010138**\ **Rishab Tripati - S20180010147** ``` import pandas as pd import statistics import numpy as np import matplotlib.pyplot as plt from pandas.plotting ...
github_jupyter
``` import pandas as pd from numpy import array from numpy import argmax from keras.utils import to_categorical user_features=pd.read_csv("users.csv") user_features["gender"][8]=="M" for i in range(len(user_features["gender"])): if(user_features["gender"][i]=="M"): user_features["gender"][i]=0 else: ...
github_jupyter
# User's Guide, Chapter 36: Clients and Weak References This chapter explains some of the underlying aspects of `music21`'s functioning that may be helpful for someone doing advanced work in understanding how the system works. ## It pays to have good references I've mentioned several times indirectly or directly the...
github_jupyter
<!-- # Copyright Amazon.com, Inc. or its affiliates. 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 # # ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import pickle import os import random from sklearn.metrics import balanced_accuracy_score, precision_score, recall_score, accuracy_score !pip install -U mlxtend from mlxtend.evaluate import confusion_matrix from mlxtend.plotting import plot_conf...
github_jupyter
``` # Erasmus+ ICCT project (2018-1-SI01-KA203-047081) # Toggle cell visibility from IPython.display import HTML tag = HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide() } else { $('div.input').show() } code_show = !code_show } $( document...
github_jupyter
``` #@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 agreed to in writing, software # distributed u...
github_jupyter
# Movie Recommendations using Content Based Filtering In this kernel we'll be building a baseline Movie Recommendation System using TMDB 5000 Movie Dataset. For novices like me this kernel will pretty much serve as a foundation in recommendation systems and will provide you with something to start with. In this ker...
github_jupyter
# Introduction To GradCAM (Part 1) - Lecture Notebook In this lecture notebook we'll be looking at an introduction to Grad-CAM, a powerful technique for interpreting Convolutional Neural Networks. Grad-CAM stands for Gradient-weighted Class Activation Mapping. CNN's are very flexible models and their great predictive...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Visualization/nlcd_land_cover.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank"...
github_jupyter
``` from IPython.display import HTML HTML(""" <br><br> <a href=http://wwwgong.pythonanywhere.com/cuspea/default/list_talks target=new> <font size=+3 color=blue>CUSPEA Talks</font> </a> <br><br> <img src=images/jupyter-notebook-wen-gong.jpg><br> """) ``` # Fun with [Jupyter](http://jupyter.org/) ## Table of Contents ...
github_jupyter
# Bangalore House Price Prediction - Outlier Detection ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns pd.set_option("display.max_columns", None) pd.set_option("display.max_rows", None) """from google.colab import files files=files.upload() df = pd.read_csv('oh_encoded_...
github_jupyter
``` # Data Type : Microarray data # Dependent Variable : 0 or 1 # Human Acute Myeloid Leukemia (AML) or Acute Lymphoblast Leukemia (ALL)) library(spikeslab) data(leukemia) library(glmnet) x <- as.matrix(leukemia[,-1]) y <- leukemia[,1] # 행, 열 cat( nrow(leukemia), ncol(leukemia) ) lasso.leukemia <- glmnet(x, y, family ...
github_jupyter
##### Copyright 2019 The TensorFlow Probability Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of th...
github_jupyter
``` # import community import numpy as np import networkx as nx import matplotlib as mpl from matplotlib.pyplot import imshow from matplotlib import pyplot as plt import matplotlib.image as mpimg import graphviz from networkx.drawing.nx_agraph import write_dot, graphviz_layout import random import pydoc import sys sys....
github_jupyter
# Comparison to iPRG2012 consensus ``` import os import sys src_dir = os.path.abspath('../src') if src_dir not in sys.path: sys.path.append(src_dir) %matplotlib inline import math import Levenshtein import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import squarify from ...
github_jupyter
# 1 - Sequence to Sequence Learning with Neural Networks In this series we'll be building a machine learning model to go from once sequence to another, using PyTorch and TorchText. This will be done on German to English translations, but the models can be applied to any problem that involves going from one sequence to...
github_jupyter
# Stat 222: Finance Project (Spring 2016) ##### Team: Fengshi Niu, Shamindra Shrotriya, Yueqi (Richie) Feng, Thibault Doutre ## Abstract We created an open source Python Package 'lobpredictrst' to predict mid price movements for the AAPL LOB stock - In data preprocessing part, we follow closely to the Kercheval and...
github_jupyter
<!-- img src="http://cognitiveclass.ai/wp-content/uploads/2017/11/cc-logo-square.png" width="150"--> <h1 align=center>R BASICS</h1> ### Welcome! By the end of this notebook, you will have learned the basics of R! ## Table of Contents <ul> <li><a href="#About-the-Dataset">About the Dataset</a></li> <li><a href="#S...
github_jupyter
# Environment Setup Guide to work with Qiskit Textbook This is a comprehensive guide for setting up your environment on your personal computer for working with Qiskit Textbook. This will help you reproduce the results as you see them on the textbook website. The Qiskit Textbook is written in [Jupyter notebooks](https:...
github_jupyter
<img src="../../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> # _*Qiskit Aqua: Pricing European Call Options*_ The latest version of this notebook is available on https://github.com/Qiskit/qis...
github_jupyter
``` # note - you will need to be able to run the UNIX ffmpeg utility to run this notebook #pip install google-cloud-storage #!pip install google-cloud-language #!pip install google-cloud-speech import urllib.request import os import glob from google.cloud import storage from google.cloud import speech from google.proto...
github_jupyter
# **ArtLine** **Create** **amazing** **lineart** **portraits** ``` import torch import torch.nn as nn import fastai from fastai.vision import * from fastai.callbacks import * from fastai.vision.gan import * from torchvision.models import vgg16_bn from fastai.utils.mem import * from PIL import Image import matplotlib.p...
github_jupyter
``` %matplotlib notebook import numpy as np import matplotlib.pyplot as plt ``` # Vocabulary In the previous parts, you learned how matplotlib organizes plot-making by figures and axes. We broke down the components of a basic figure and learned how to create them. You also learned how to add one or more axes to a fig...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') path = '/content/drive/MyDrive/Research/AAAI/complexity/5D_elliptical_zeroth/200_50/' import numpy as np import pandas as pd import torch import torchvision from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import...
github_jupyter
### Where Art Thou Min'ral? In this notebook, we'll be using [H2o's AutoMl](https://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html) algorithm to train our first **Binary Classification Model** on the data we prepared in our earlier notebook. Before we begin, make sure you install h2o in your system. You can refer...
github_jupyter