text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
## Node Classification on Citation Network As a start, we present a end to end example, demonstrating how GraphScope process node classification task on citation network by combining analytics, interactive and graph neural networks computation. In this example, we use [ogbn-mag](https://ogb.stanford.edu/docs/nodeprop...
github_jupyter
``` from IPython.core.debugger import set_trace import gzip import struct import matplotlib as mpl import matplotlib.pyplot as plt # pre-requirement: MNIST data files stored in local directory under $folder/mnist/ # after downloaded from http://yann.lecun.com/exdb/mnist/ class MnistInput: def __init__(self, da...
github_jupyter
# Resample Data ## Pandas Resample You've learned about bucketing to different periods of time like Months. Let's see how it's done. We'll start with an example series of days. ``` import numpy as np import pandas as pd dates = pd.date_range('10/10/2018', periods=11, freq='D') close_prices = np.arange(len(dates)) cl...
github_jupyter
# Average data on group level We average each z-scored time series, weighted with the design (rest is inverted before averaging). We then average over all patients of one group. This excludes patients deemed inconclusive by the 2D-LI method performed in the previous step. The results of this notebook will not be use...
github_jupyter
# Epidemilogical analysis Lab Notebook (to edit this notebook and the associated python files, `git checkout` the corresponding commit by its hash, e.g. `git checkout 422024d`) ``` from IPython.display import display, Markdown from datetime import datetime cur_datetime = datetime.now() display(Markdown(f'# {cur_datet...
github_jupyter
# MNIST Image Classification with TensorFlow on Cloud AI Platform This notebook demonstrates how to implement different image models on MNIST using the [tf.keras API](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/keras). ## Learning objectives 1. Understand how to build a Dense Neural Network (DNN) for ...
github_jupyter
# Calibration Procedure * Compute center offset: - Set $\lambda_{\rm center}$ to set of known spectral lines - Measure pixel position of each: - average each to determine central pixel $n_o$ | $\lambda_{\rm center}$ | Pixel | | ----------------------: |:------:| | 0 nm | 5.2 | ...
github_jupyter
# Distribuição Normal Gaussiana, curva de sino * simétrica * média = mediana = moda * variáveis contínuas Ex: * altura e peso de uma população * tamanho do crânio de recém nascidos * pressão sanguínea $$ p(x|\mu,\sigma) = \frac{1}{\sqrt{2\pi\sigma^2}}\exp\left[-\frac{(x-\mu)^2}{2\sigma^2}\right] $$ ``` import matp...
github_jupyter
``` import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 16}) import numpy as np import torch import os import networkx as nx co_dir = "../results/2021-09-07_21-01_dist_mnist_complete" cy_dir = "../results/2021-09-05_14-27_dist_mnist_v3" r3_dir = "../results/2021-09-07_20-11_dist_mnist_random3" r8_dir = "....
github_jupyter
``` %matplotlib inline ``` # Pyplot tutorial An introduction to the pyplot interface. Intro to pyplot =============== :mod:`matplotlib.pyplot` is a collection of functions that make matplotlib work like MATLAB. Each ``pyplot`` function makes some change to a figure: e.g., creates a figure, creates a plotting area...
github_jupyter
# Prepare and Deploy a TensorFlow Model to AI Platform for Online Serving This Notebook demonstrates how to prepare a TensorFlow 2.x model and deploy it for serving with AI Platform Prediction. This example uses the pretrained [ResNet V2 101](https://tfhub.dev/google/imagenet/resnet_v2_101/classification/4) image clas...
github_jupyter
<a href="https://colab.research.google.com/github/SAK90/HousingPrices/blob/main/first_project.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import os import tarfile from six.moves import urllib DOWNLOAD_ROOT = "https://raw.githubusercontent.co...
github_jupyter
# Video Classification Video classification is one of the many tasks in the field of _video understanding_, technologies that automatically extract information from video. You can read more about the great, wide world of video understanding in our blog post [An Introduction to Video Understanding: Capabilities and App...
github_jupyter
## Import packages ``` import numpy as np import matplotlib.pyplot as plt from scipy.signal import savgol_filter import cline_analysis as ca import pandas as pd import seaborn as sns import datetime import os from scipy.signal import medfilt import functools from scipy.optimize import bisect from scipy import stats s...
github_jupyter
``` import numpy as np import tensorflow as tf from tensorflow import keras def split_sequence(sequence, n_steps): X, y = list(), list() for i in range(len(sequence)): end_ix = i + n_steps if end_ix > len(sequence) - 1: break seq_x, seq_y = sequence[i:end_ix], sequence[end_ix...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` #Configurable parameters for pure pursuit + How fast do you want the robot to move? It is fixed at $v_{max}$ in this exercise + When can we declare the goal has been reached? + What is the lookahead distance? Determines the next position on ...
github_jupyter
``` import json json.loads('{"coef0":0}') #%%writefile ../../src/data/data_utils.py # %load ../../src/data/data_utils.py # %%writefile ../../src/data/data_utils.py """ Author: Jim Clauwaert Created in the scope of my PhD """ import pandas as pd import numpy as np import itertools def CreatePairwiseRankData(dfDatase...
github_jupyter
``` from sklearn import datasets import pandas as pd # Load the boston house-prices dataset (regression). boston = datasets.load_boston() boston_target_name = 'MEDV' boston_features_names = boston.feature_names boston_df = pd.DataFrame(boston.data, columns=boston_features_names) boston_df[boston_target_name] = boston....
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from datetime import datetime, timedelta, date from mpl_toolkits.axes_grid1 import make_axes_locatable # from matplotlib.ticker import FuncFormatter import geopandas as gpd ox_data_url = r'https://ocgptweb.azurewebsites.ne...
github_jupyter
# Kernel-based Time-varying Regression - Part III The tutorials **I** and **II** described the **KTR** model, it's fitting procedure, and diagnostics / validation methods (visualizations of the **KTR** regression). This tutorial covers more **KTR** configurations for advanced users. In particular, it describes how t...
github_jupyter
## Markov switching autoregression models This notebook provides an example of the use of Markov switching models in statsmodels to replicate a number of results presented in Kim and Nelson (1999). It applies the Hamilton (1989) filter the Kim (1994) smoother. This is tested against the Markov-switching models from E...
github_jupyter
``` # License: BSD # Author: Sasank Chilamkurthy from __future__ import print_function, division import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable import numpy as np import torchvision from torchvision import models, transforms imp...
github_jupyter
# Ejemplo paso a paso Vamos a hacer un ejercicio con datos de verdad ### 1. Importamos las librerías de Pandas y Numpy ``` import pandas as pd import numpy as np ``` ### 2. Leemos el fichero Si es un documento online, podremos leerlo directamente, si es un fichero, tendremos que guardarlo en esta misma carpeta o,...
github_jupyter
# Reading SETI Hackathon Data This tutorial will show you how to programmatically download the SETI code challenge data to your local file space and start to analyze it. Please see the [Step_1_Get_Data.ipynb](https://github.com/setiQuest/ML4SETI/blob/master/tutorials/Step_1_Get_Data.ipynb) notebook on information ab...
github_jupyter
<a href="https://colab.research.google.com/github/huggingface/nlp/blob/master/notebooks/Overview.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # HuggingFace `nlp` library - Quick overview Models come and go (linear models, LSTM, Transformers, ......
github_jupyter
# Kwargs optimization wrapper TAGS: Optimization and fitting ## This ia a method to implement optimization for functions taking keywords instead of a vector (python 3 only since 2 doesn't support multiple dictionnary unpacking simultaneously) This was mostly implemented out of the need to optimize a ml algorythm's hy...
github_jupyter
# Querying online data with astroquery and PyVO There are two main general packages for accessing online data from Python in the Astropy ecosystem: * The [astroquery](https://astroquery.readthedocs.io/en/latest/) coordinated package, which offers access to many services, including a number that are not VO compatible....
github_jupyter
``` %pylab inline %load_ext autoreload %autoreload 2 import jax import jax.numpy as jnp import numpy as onp import haiku as hk from jax.experimental import optix from nsec.datasets.two_moons import get_two_moons from nsec.utils import display_score_two_moons from nsec.models.dae.ardae import ARDAE from nsec.normaliz...
github_jupyter
``` # ls -l| tail -10 # #G4 # from google.colab import drive # drive.mount('/content/gdrive') # cp fingerspelling5.tar.bz2 /media/datastorage/Phong/fingerspelling5.tar.bz2 # rm fingerspelling5.tar.bz2 cd /media/datastorage/Phong/ !tar xjf fingerspelling5.tar.bz2 cd dataset5 ls -l mkdir surrey/B mv dataset5/* surrey/B/ ...
github_jupyter
# Git and GitHub ## Lesson Goals - Understand the purpose of version control systems - Create a GitHub account - Upload your first code to GitHub ## Prequisites - None ## Code Management Some new considerations come up as we build larger projects that eventually go into production... - What happens if our computer...
github_jupyter
# Curve Fitting and Interpolation Teng-Jui Lin Content adapted from UW AMATH 301, Beginning Scientific Computing, in Spring 2020. - Curve fitting - Curve fitting using error functions and [`scipy.optimize.fmin()`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin.html) - Sum of squ...
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
# Sparse Approximations The `gp.MarginalSparse` class implements sparse, or inducing point, GP approximations. It works identically to `gp.Marginal`, except it additionally requires the locations of the inducing points (denoted `Xu`), and it accepts the argument `sigma` instead of `noise` because these sparse approx...
github_jupyter
# Simple Linear Model - OCR By Gaetano Bonofiglio, Veronica Iovinella ## Introduction We'll start by developing a simple linear model for classification of handwritten digits (OCR) using MNIST data-set and then plot the results. This will later be compared with a Convolutional Neural Network for the same task. ## Imp...
github_jupyter
## Working with RDDs (ch 3) You control a Spark process by means of a Spark Context. In Python, the `Spark context` is a built-in variable, already bound to the Context. When using Java (or Scala), you need to do the binding yourself ``` sc ``` you will use `sc` to ask Spark to load the content of a file into memory...
github_jupyter
# t-SNE for community composition ``` # Housekeeping library(caret) library(gridExtra) library(reshape2) library(Rtsne) library(tidyr) # Read in data species_composition = read.table("../../../data/amplicon/species_composition_relative_abundance.txt", sep = "\t", ...
github_jupyter
# Using your own object detector for detection images <table align="left"><td> <a target="_blank" href="https://colab.research.google.com/github/TannerGilbert/Tutorials/blob/master/Tensorflow%20Object%20Detection/object_detection_with_own_model.ipynb"> <img src="https://www.tensorflow.org/images/colab_logo_32px...
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
``` #default_exp api ``` # API > High level functions for easy interaction This module defines the building blocks for the CLI. These functions can be leveraged to define other custom workflows more easily. ``` #export import importlib import inspect from collections import defaultdict from pathlib import Path from...
github_jupyter
# Perform Bayesian optimization of CrabNet hyperparameters using Ax ###### Created January 8, 2022 # Description We use [(my fork of) CrabNet](https://github.com/sgbaird/CrabNet) to adjust various hyperparameters for the experimental band gap matbench task (`matbench_expt_gap`). We chose this task because `CrabNet` ...
github_jupyter
# Team 6a - Final Project - Phase 3 ## Title : US and Japan YouTube trending videos ## Problem: Our goal is to analyze US and Japan YouTube trending videos and present how the video categories and country culture correlate with the video’s popularity in 2018 and 2020. We will analyze the characteristics, inc...
github_jupyter
<a href="https://colab.research.google.com/github/ProfessorPatrickSlatraigh/CST2312/blob/main/CST2312_Class08.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **CST2312 Class 08 - Dictionaries and Tuples** updated 27-Feb-2022 by Professor Patrick ...
github_jupyter
## Airline Passenger Volume This model predicts the volume of airline passengers using historical data from January 1949 to December 1960, with a total of 144 observations. Even with this modest data set, surprisingly accurate predictions are possible. This is time series data, which is well suited to Long-Short Term...
github_jupyter
``` # Word2vec basics using tensorflow import numpy as np import tensorflow as tf corpus_raw = 'He is the king . The King is royal . She is the royal queen ' corpus_raw = corpus_raw.lower() corpus_raw words = [] for word in corpus_raw.split(): # we can't treat '.' as a word if word != '.': words.append...
github_jupyter
``` import shap import pandas as pd import numpy as np import tensorflow as tf import tensorflow.keras.backend as K import matplotlib.pyplot as plt plt.style.use('ggplot') from PIL import Image from sklearn.model_selection import train_test_split from tensorflow.keras.preprocessing.image import ImageDataGenerator fro...
github_jupyter
``` #In this tutorial, you will further explore #the NASA Exoplanet Archive and practice making simple plots. #To guide you, here is the tutorial from in class: import matplotlib.pyplot as plot #import the matplotlib.pyplot module (library) as 'plot' import pandas as pd #import the 'pandas' module (library) as pd dat...
github_jupyter
# Train WaveGlow Model with custom training step ## Boilerplate Import ``` import tensorflow as tf from tensorflow.python.eager import profiler print("GPU Available: ", tf.test.is_gpu_available()) tf.keras.backend.clear_session() import os, sys root_dir, _ = os.path.split(os.getcwd()) script_dir = os.path.join(root_d...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt from pandas_profiling import ProfileReport # Set style and settings plt.style.use('ggplot') pd.set_option('display.max_columns', 50) pd.set_option('display.max_rows', 15) # Load data and set Datetime column collisions = pd.read_csv('../data/external/Collisions.cs...
github_jupyter
# Simple symbol plotting with text on Cartesian projection Symbol plotting in Magics is the plotting of different types of symbols at selected locations. A symbol in this context is a number (the value at the location), a text string (given by the user) or a Magics marker. List of all **msymbol** parameters you can...
github_jupyter
**Parameters to reproduce the paper's results**: * change the optimizer from SGD to Adam in `lib/models.py`, * change the size of the vocabulary from 1000 to 10000 in `train.keep_top_words()` below. ``` %load_ext autoreload %autoreload 2 import sys, os sys.path.insert(0, '..') from lib import models, graph, coarsenin...
github_jupyter
# The $N$-body problem. Maximum: 80 pts + 25 bonus pts ## Problem 0 (Problem statement) 5 pts Consider the $N$-body problem $$ V({\bf y}_j) = \sum_{i=1}^N G({\bf x}_i, {\bf y}_j) q_i, \quad j=1,\dots,N, $$ where ${\bf x}_i$ is the location of source charges and ${\bf y}_j$ is the location of receivers where the p...
github_jupyter
<img src="images/utfsm.png" alt="" width="100px" align="right"/> # USM Numérica # Licencia y configuración del laboratorio Ejecutar la siguiente celda mediante *`Ctr-S`*. ``` """ IPython Notebook v4.0 para python 3.0 Librerías adicionales: Contenido bajo licencia CC-BY 4.0. Código bajo licencia MIT. (c) Sebastian F...
github_jupyter
### This notebook trains a N2V network in the first step and then trains a 3-class U-Net for segmentation using the denoised images as input. ``` # We import all our dependencies. import warnings warnings.filterwarnings('ignore') import sys sys.path.append('../../') from voidseg.models import Seg, SegConfig from n2v.m...
github_jupyter
# Mask R-CNN - Train FCN using MRCNN in Predict Mode ``` from IPython.core.display import display, HTML display(HTML("<style>.container { width:95% !important; }</style>")) %matplotlib inline %load_ext autoreload %autoreload 2 import sys,os, pprint pp = pprint.PrettyPrinter(indent=2, width=100) print('Current working ...
github_jupyter
``` %load_ext autoreload %autoreload 2 %aimport utils_1_1 import pandas as pd import numpy as np import altair as alt from altair_saver import save import datetime import dateutil.parser from os.path import join from constants_1_1 import SITE_FILE_TYPES from utils_1_1 import ( get_site_file_paths, get_site_fi...
github_jupyter
``` import warnings warnings.filterwarnings('ignore') import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` ## МНК для линейной регрессии $\mathbf{w}=(A^TA)^{-1}(A^T\mathbf{y})$ Загрузите файл food_trucks.txt. В нём два столбца значений — количество жителей в городе и доход гру...
github_jupyter
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![PyPI version](https://badge.fury.io/py/geoshapes.svg)](https://badge.fury.io/py/geoshapes) [![Binder](https://mybinde...
github_jupyter
# Steady State Material Balances On a Separation Train This is the second problem of the famous set of [Ten Problems in Chemical Engineering](https://www.polymath-software.com/ASEE/Tenprobs.pdf). Here, the goal is to solve a set of simultaneous linear equations. Jacob Albrecht, 2019 # Problem Setup A distillation t...
github_jupyter
# Sci-Hub coverage of referenced (cited) articles Based on [OpenCitations](http://opencitations.net/). ``` import json import pathlib import pandas with open('00.configuration.json') as read_file: config = json.load(read_file) path = pathlib.Path('data/doi.tsv.xz') doi_df = pandas.read_table(path, compression='x...
github_jupyter
<a href="https://colab.research.google.com/github/TangJiahui/6.036_Machine_Learning/blob/main/MIT_6_036_HW08_CNN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #MIT 6.036 Fall 2020: Homework 8# This colab notebook provides code and a framework for...
github_jupyter
``` from pitas import power, flipper_tools from orphics import maps as omaps from pixell import enplot, enmap, curvedsky import numpy as np from cosmikyu import stats, mpi, datasets, config, utils, gan, transforms from cosmikyu import nn as cnn import os from itertools import product import healpy as hp import matplotl...
github_jupyter
``` from sklearn import linear_model import glob import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import sys sys.path.append("../../") from mfilter.types import FrequencySamples, TimeSeries, FrequencySeries, TimesSamples # functions # read file def read_file(): # folder MLensing...
github_jupyter
# Multiclass Example This example show shows how to use `tsfresh` to extract and select useful features from timeseries in a multiclass classification example. The underlying control of the false discovery rate (FDR) has been introduced by [Tang et al. (2020, Sec. 3.2)](https://doi.org/10.1140/epjds/s13688-020-00244-...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '2' import sys sys.path.insert(0, "/home/husein/parsing/self-attentive-parser/src") sys.path.append("/home/husein/parsing/self-attentive-parser") import tensorflow as tf from transformers import AlbertTokenizer from transformers import AlbertTokenizer tokenizer = Alber...
github_jupyter
### Setup ``` # IMPORTS & OTHER SETTINGS %run 'settings.py' %matplotlib inline !pwd from scipy.spatial import distance from sklearn.preprocessing import QuantileTransformer # File paths data_path = '../data/' pickle_path = os.path.join(data_path, 'pickles') if not os.path.exists(data_path): raise Exception('Hold ...
github_jupyter
``` import pandas as pd pd.set_option("display.max_rows", None) pd.set_option("display.max_columns", None) import os import shutil shutil.rmtree("lending-club-data") os.mkdir("lending-club-data") os.mkdir("lending-club-data/risk-engine") ``` # Original data ``` df = pd.read_csv("source-data/loan.csv", dtype=str, par...
github_jupyter
##### Copyright 2021 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
``` from fit.datamodules.super_res import MNIST_SResFITDM, CelebA_SResFITDM from fit.utils import convert2DFT, pol2cart from fit.utils.tomo_utils import get_polar_rfft_coords_2D from fit.transformers.PositionalEncoding2D import PositionalEncoding2D from matplotlib import pyplot as plt import torch import numpy as np...
github_jupyter
``` import os import shutil # We do not need a dataset so we load the fake input from meta_learning.backend.tensorflow.dataset import noop as _dataset_noop # We load the optimizers we care about. from meta_learning.backend.tensorflow import meta_optimizer as _meta_optimizer # The memory types we want to use. from me...
github_jupyter
``` import sys import pandas # local imports sys.path.insert(0, '../') import utils ``` ## Read DO Slim ``` commit = '72614ade9f1cc5a5317b8f6836e1e464b31d5587' url = utils.rawgit('dhimmel', 'disease-ontology', commit, 'data/slim-terms.tsv') disease_df = pandas.read_table(url) disease_df = disease_df.rename(columns=...
github_jupyter
``` from data import load_data clinical, _, genes, treatments, outcome = load_data() clinical.head() treatments.columns = [c.replace('therapy_first_line_Non-therapy', 'therapy_first_line_Non-treatment') for c in treatments.columns] treatments.head() ``` # THERAPY SENSITIVITY MODELLI...
github_jupyter
This workbook is a Python coding example utilizing the SAS QKB for data quality, enrichment, and entity resolution ``` # import swat (SAS Scripting Language for Analytics Transfer), # and pandas import swat import pandas as pd # Create a connection to CAS, specifying host name or url # the SAS Viya server...
github_jupyter
# Lecture 33: AlexNet ``` %matplotlib inline import tqdm import copy import time import torch import numpy as np import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import matplotlib.pyplot as plt import torchvision from torchvision import transforms,datasets, models print(torch.__versio...
github_jupyter
# Advanced Ray Tutorial - Exercise Solutions © 2019-2020, Anyscale. All Rights Reserved ![Anyscale Academy](../../images/AnyscaleAcademy_Logo_clearbanner_141x100.png) First, import everything we'll need and start Ray: ``` import ray, time, sys import numpy as np sys.path.append("../..") from util.printing import pd...
github_jupyter
# Applying Deep Batch Active Learning to your own learning task In this notebook, we show how our implemented batch mode deep active learning (BMDAL) methods can be applied to a custom NN. We will first change the working directory from the examples subfolder to the main folder, which is required for the imports to wo...
github_jupyter
# Recommendation System Student Name: Dacheng Wen (dachengw) ## Introduction This tutorial will introduce a approach to build a simple recommendation system. Accroding to the definition from Wikipedia, recommendation system is a subclass of information filtering system that seek to predict the "rating" or "preference...
github_jupyter
<!-- dom:TITLE: Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis --> # Data Analysis and Machine Learning: Linear Regression and more Advanced Regression Analysis <!-- dom:AUTHOR: Morten Hjorth-Jensen at Department of Physics, University of Oslo & Department of Physics and Ast...
github_jupyter
##FlightPredict Package management Run these cells only when you need to install the package or update it. Otherwise go directly the next section 1. !pip show flightPredict: provides information about the flightPredict package 2. !pip uninstall --yes flightPredict: uninstall the flight predict package. Run before insta...
github_jupyter
``` #!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd from Bio import Entrez from Rules_Class import Rules import functions as fn from sklearn.metrics import confusion_matrix import os import sys start=0 end=10 input_directory=os.path.realpath('../Data') result_directory=os.path.realpath('../Data') lis...
github_jupyter
# Counting Objects: Part III In our [last notebook](https://github.com/JoshVarty/ImageClassification/blob/master/3_CountingAgain.ipynb) we saw that with enough data and sensible transforms we can train convolutional neural networks to classify pictures according to the number of cirlces in them. Even after adding circ...
github_jupyter
<table width = "100%"> <tr style="background-color:white;"> <!-- QWorld Logo --> <td style="text-align:left; padding:0px; width:200px;"> <img src="images/QWorld.png"> </td> <!-- Padding --> <td width="*">&nbsp;&nbsp;&nbsp;&nbsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</td> <td style="padding:0px;wi...
github_jupyter
# Latent Semantic Indexing Here, we apply the technique *Latent Semantic Indexing* to capture the similarity of words. We are given a list of words and their frequencies in 9 documents, found on [GitHub](https://github.com/ppham27/MLaPP-solutions/blob/master/chap12/lsiDocuments.pdf). ``` %matplotlib inline import nu...
github_jupyter
# Gluon example with DALI ## Overview This is a modified [DCGAN example](https://gluon.mxnet.io/chapter14_generative-adversarial-networks/dcgan.html), which uses DALI for reading and augmenting images. ## Sample ``` import os.path import matplotlib as mpl import tarfile import matplotlib.image as mpimg from matplot...
github_jupyter
**Chapter 7 – Ensemble Learning and Random Forests** _This notebook contains all the sample code and solutions to the exercises in chapter 7._ <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/07_ensemble_learning_and_random_forests.ipynb"...
github_jupyter
``` Copyright 2020 The IREE Authors Licensed under the Apache License v2.0 with LLVM Exceptions. See https://llvm.org/LICENSE.txt for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ``` # Training and Executing an MNIST Model with IREE ## Overview This notebook covers installing IREE an...
github_jupyter
# `pretty_midi` tutorial This tutorial goes over the functionality of [pretty_midi](http://github.com/craffel/pretty_midi), a Python library for creating, manipulating, and extracting information from MIDI files. For more information, check [the docs](http://craffel.github.io/pretty-midi/). ``` import pretty_midi im...
github_jupyter
# Multivariate Joint Use Case (Single DataFrameCase) In this vignette a use case of the Multivariate Channel Entropy Triangle is presented. We are going to evaluate the effectiveness of feature transformation using PCA in entropic terms. ### Importing Libraries We import the package entropytriangle, which will impor...
github_jupyter
# Reconstruction de synonymes - énoncé Ce notebook est plus un jeu. On récupère d'abord des synonymes via la base [WOLF](http://alpage.inria.fr/~sagot/wolf-en.html). On ne garde que les synonymes composé d'un seul mot. On prend ensuite un texte quelconque qu'on découpe en phrase. Pour chaque phrase qu'on rencontre, on...
github_jupyter
``` # 파이썬은 요렇게 샾으로 주석을 만듬 print("Hello Python") print('Hello Python') # 보는 바와 같이 쌍따옴표나 홑따옴표 구별이 없음 num = 1 Num = 10 print(num, Num) # Shift + Enter: 실행 # dd: 셀 삭제 # b: 아래쪽 셀 생성 z = 3 - 4j print(type(z)) print(z.imag) print(z.real) print(z.conjugate()) # / 는 일반적인 나누기 # // 는 나머지를 버림 (몫만 취함) num1 = 3 // 7 num2 = 3333 // ...
github_jupyter
# 1. Python performance <br><br><br><br><br> ## Python is now mainstream Below is an analysis of GitHub repos created by CMS physicists (i.e. "everyone who forked cms-sw/cmssw"). GitHub labels these repos as C/C++, Python, or Jupyter: the Python and Jupyter categories are now the most common. <img src="img/lhlhc-g...
github_jupyter
``` ! conda install geopandas -qy import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import geopandas as gpd from shapely.geometry import Point, Polygon from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection im...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Deep Learning ## Project: Build a Traffic Sign Recognition Classifier In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included i...
github_jupyter
# Pairs Trading with Machine Learning Jonathan Larkin August, 2017 In developing a Pairs Trading strategy, finding valid, eligible pairs which exhibit unconditional mean-reverting behavior is of critical importance. This notebook walks through an example implementation of finding eligible pairs. We show how popular a...
github_jupyter
# Equilibrium Properties and Partial Ordering (Al-Fe and Al-Ni) ``` # Only needed in a Jupyter Notebook %matplotlib inline # Optional plot styling import matplotlib matplotlib.style.use('bmh') import matplotlib.pyplot as plt from pycalphad import equilibrium from pycalphad import Database, Model import pycalphad.varia...
github_jupyter
``` %matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import csv import sklearn.feature_extraction.text from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split import itertools from sklearn import preprocessing im...
github_jupyter
# `Практикум по программированию на языке Python` <br> ## `Занятие 9: Web-разработка на Python` <br><br> ### `Роман Ищенко (roman.ischenko@gmail.com)` #### `Москва, 2021` ``` import warnings warnings.filterwarnings('ignore') ``` ### `HTTP` HTTP (HyperText Transfer Protocol) — это протокол, позволяющий получать ра...
github_jupyter
# HEART DISEASE PREDICTION # OVERVIEW : ## PREDICTING HEART DISESES BASED ON TARGET VARIABLE # IMPORTING THE DATASET AND REQ LIB ``` import pandas as pd import pandas as pd import matplotlib.pyplot as plt from matplotlib import rcParams from matplotlib.cm import rainbow %matplotlib inline import warnings warnings...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') 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 torch.nn as nn import torch.nn.functional as F import torch.optim as optim from matp...
github_jupyter
``` import networkx as nx import numpy as np import pandas as pd import random import scipy.stats import matplotlib.pyplot as plt from sklearn.neural_network import MLPClassifier from sklearn import svm from sklearn.metrics import accuracy_score, precision_recall_fscore_support, roc_curve, auc from sklearn.model_select...
github_jupyter
``` from __future__ import print_function from imp import reload ``` ## UAT for NbAgg backend. The first line simply reloads matplotlib, uses the nbagg backend and then reloads the backend, just to ensure we have the latest modification to the backend code. Note: The underlying JavaScript will not be updated by this ...
github_jupyter