text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` import matplotlib matplotlib.use('Agg') %matplotlib qt import matplotlib.pyplot as plt import numpy as np import os import SimpleITK as sitk from os.path import expanduser, join from scipy.spatial.distance import euclidean os.chdir(join(expanduser('~'), 'Medical Imaging')) import liversegmentation ``` --- # Read ...
github_jupyter
``` import keras from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, CuDNNLSTM, CuDNNGRU, BatchNormalization, LocallyConnected2D, ...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-credit-card-fraud/auto-ml-classification-credit-card-fraud....
github_jupyter
## Common plotting pitfalls that get worse with large data When working with large datasets, visualizations are often the only way available to understand the properties of that dataset -- there are simply too many data points to examine each one! Thus it is very important to be aware of some common plotting problems...
github_jupyter
``` # GPU: 32*40 in 9.87s = 130/s # CPU: 32*8 in 31.9s = 8/s import os import sys import numpy as np import mxnet as mx from collections import namedtuple print("OS: ", sys.platform) print("Python: ", sys.version) print("Numpy: ", np.__version__) print("MXNet: ", mx.__version__) !cat /proc/cpuinfo | grep processor | wc...
github_jupyter
# Breast Cancer Diagnosis In this notebook we will apply the LogitBoost algorithm to a toy dataset to classify cases of breast cancer as benign or malignant. ## Imports ``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(style='darkgrid', palette='colorblind', color_codes=True) from...
github_jupyter
Title: Are the Warriors better without Kevin Durant? Date: 2019-06-10 12:00 Tags: python Slug: ab_kd In the media, there have been debates about whether or not the Golden State Warriors (GSW) are better without Kevin Durant (KD). From the eye-test, it's laughable to even suggest this, as he's one of the top 3 players...
github_jupyter
``` import requests import arrow import pprint import json from urllib.parse import urlencode from functools import reduce token = open("./NOTION_TOKEN", "r").readlines()[0] notion_version = "2021-08-16" extra_data = {"filter": {"and": [{"property": "标签", "multi_select": {"is_not_empt...
github_jupyter
![](https://images.unsplash.com/photo-1602084551218-a28205125639?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80) <div class = 'alert alert-block alert-info' style = 'background-color:#4c1c84; color:#eeebf1; border-width:5px; ...
github_jupyter
# Регрессия - последняя подготовка перед боем! > 🚀 В этой практике нам понадобятся: `numpy==1.21.2, pandas==1.3.3, matplotlib==3.4.3, scikit-learn==0.24.2, seaborn==0.11.2` > 🚀 Установить вы их можете с помощью команды: `!pip install numpy==1.21.2, pandas==1.3.3, matplotlib==3.4.3, scikit-learn==0.24.2, seaborn==0...
github_jupyter
# Hypothesis Testing From lecture, we know that hypothesis testing is a critical tool in determing what the value of a parameter could be. We know that the basis of our testing has two attributes: **Null Hypothesis: $H_0$** **Alternative Hypothesis: $H_a$** The tests we have discussed in lecture are: * One Popula...
github_jupyter
``` from systemtools.hayj import * from systemtools.basics import * from systemtools.file import * from systemtools.printer import * from systemtools.logger import * from annotator.annot import * from datatools.jsonutils import * from nlptools.tokenizer import * from datatools.htmltools import * from newssource.goodart...
github_jupyter
``` %pylab inline import numpy as np import matplotlib.pyplot as plt # PyTorch imports import torch # This has neural network layer primitives that you can use to build things quickly import torch.nn as nn # This has things like activation functions and other useful nonlinearities from torch.nn import functional as ...
github_jupyter
# Advanced Tutorial: Creating Gold Annotation Labels with BRAT This is a short tutorial on how to use BRAT (Brat Rapid Annotation Tool), an online environment for collaborative text annotation. http://brat.nlplab.org/ ``` %load_ext autoreload %autoreload 2 %matplotlib inline import os # TO USE A DATABASE OTHER THA...
github_jupyter
... ***CURRENTLY UNDER DEVELOPMENT*** ... ## Validation of the total water level inputs required: * historical wave conditions * emulator output - synthetic wave conditions of TWL * emulator output - synthetic wave conditions of TWL with 3 scenarios of SLR in this notebook: * Comparison of the extreme di...
github_jupyter
<small><small><i> All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/02_Python_Datatypes)** </i></small></small> # Python Strings In this class you will learn to create, format, modify and delete strings in Python. Also, you will be introduced to...
github_jupyter
``` import pandas as pd import numpy as np visit = pd.read_csv("visitorCount.csv",dtype=str) a = visit.melt( id_vars=['time']) # a.to_csv("visitorMelt.csv") movement = pd.read_csv("movements.csv") movement = movement.astype('category') len(movement) stations = pd.read_csv("stations.csv") stations['double_count'] = Fals...
github_jupyter
# Time series in Pastas *R.A. Collenteur, University of Graz, 2020* Time series are at the heart of time series analysis, and therefore need to be considered carefully when dealing with time series models. In this notebook more background information is provided on important characteristics of time series and how thes...
github_jupyter
``` #import the necessary modules %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd import scipy import sklearn import itertools from itertools import cycle import os.path as op import timeit import json import math import multiprocessing as m_proc m_proc.cpu_count() # Im...
github_jupyter
# Data Cleaning And Feature Engineering * Data is very dirty so we have to clean our data for analysis. * Also have many missing values represented by -1(have to fix it is very important). ``` import pandas as pd data=pd.read_csv('original_data.csv') data.head() data.shape #droping duplicates data=data.drop_duplicate...
github_jupyter
# Chapter 3: Deep Learning Libraries This chapter discusses the important libraries and frameworks that one needs to get started in artificial intelligence. We'll cover the basic functions of the three most popular deep learning frameworks: Tensorflow, Pytorch, and Keras, and show you how to get up and running in each...
github_jupyter
<table> <tr> <td><img src='SystemLink_icon.png' /></td> <td ><h1><strong>NI SystemLink Python API</strong></h1></td> </tr> </table> ## Test Monitor Service Example *** The Test Monitor Service API provides functions to create, update, delete and query Test results and Test steps. *** # Prerequi...
github_jupyter
<a href="https://colab.research.google.com/github/satyajitghana/PadhAI-Course/blob/master/13_OverfittingAndRegularization.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import numpy as np import matplotlib.pyplot as plt import matplotlib.colors...
github_jupyter
# Marginal Gaussianization * Author: J. Emmanuel Johnson * Email: jemanjohnson34@gmail.com In this demonstration, we will show how we can do the marginal Gaussianization on a 2D dataset using the Histogram transformation and Inverse CDF Gaussian distribution. ``` import os, sys cwd = os.getcwd() # sys.path.insert(0,...
github_jupyter
``` !pip install -q --upgrade jax jaxlib from __future__ import print_function, division import jax.numpy as np from jax import grad, jit, vmap from jax import random key = random.PRNGKey(0) ``` # The Autodiff Cookbook *alexbw@, mattjj@* JAX has a pretty general automatic differentiation system. In this notebook,...
github_jupyter
# Multivariate Resemblance Analysis (MRA) Dataset A In this notebook the multivariate resemblance analysis of Dataset A is performed for all STDG approaches. ``` #import libraries import warnings warnings.filterwarnings("ignore") import numpy as np import pandas as pd from matplotlib import pyplot as plt import os pri...
github_jupyter
``` from qiskit.tools.jupyter import * from qiskit import IBMQ IBMQ.load_account() #provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main') provider=IBMQ.get_provider(hub='ibm-q-research', group='uni-maryland-1', project='main') backend = provider.get_backend('ibmq_armonk') backend_config = backend.con...
github_jupyter
# eICU Experiments ``` import tensorflow as tf import numpy as np import h5py from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import tensorflow_probability as tfp import sklearn from sklearn import metrics import seaborn as sns import random ``` Follow Read-me instruction to downl...
github_jupyter
# TensorFlow Tutorial Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caffe, Ke...
github_jupyter
# 1D Variability hypothesis testing for HBEC IFN experiment ``` import scanpy as sc import seaborn as sns import pandas as pd import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats from pybedtools import BedTool import pickle as pkl %matplotlib inline import sys sys.path.append('/home/ssm-user/...
github_jupyter
``` %matplotlib notebook import numpy as np import matplotlib.pyplot as plt ``` # Utilizando un modelo pre-entrenado [`torchvision.models`](https://pytorch.org/vision/stable/models.html) ofrece una serie de modelos famosos de la literatura de *deep learning* Por defecto el modelo se carga con pesos aleatorios Si in...
github_jupyter
# Tutorial about loading localization data from file ``` from pathlib import Path import locan as lc lc.show_versions(system=False, dependencies=False, verbose=False) ``` Localization data is typically provided as text or binary file with different formats depending on the fitting software. Locan provides functions ...
github_jupyter
``` # 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 required by applicable law or agreed to in writi...
github_jupyter
``` import azureml from azureml.core import Workspace, Experiment, Datastore, Environment from azureml.core.runconfig import RunConfiguration from azureml.data.datapath import DataPath, DataPathComputeBinding from azureml.data.data_reference import DataReference from azureml.core.compute import ComputeTarget, AmlComput...
github_jupyter
# 6.7 门控循环单元(GRU) ## 6.7.2 读取数据集 ``` import numpy as np import torch from torch import nn, optim import torch.nn.functional as F import sys sys.path.append("..") import d2lzh_pytorch as d2l device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') (corpus_indices, char_to_idx, idx_to_char, vocab_size) =...
github_jupyter
# The JupyterLab Interface The JupyterLab interface consists of a main work area containing tabs of documents and activities, a collapsible left sidebar, and a menu bar. The left sidebar contains a file browser, the list of running terminals and kernels, the table of contents, and the extension manager. ![jupyter_lab...
github_jupyter
# Check Cell Population Heterogeneity ## Libraries ``` import MySQLdb import pandas import numpy as np from matplotlib import pylab as plt import os import seaborn as sns from scipy.stats import mannwhitneyu as mw from scipy import stats import operator from sklearn.preprocessing import StandardScaler,RobustScaler fr...
github_jupyter
# Large Scale Kernel Ridge Regression ``` import sys sys.path.insert(0, '/Users/eman/Documents/code_projects/kernellib') sys.path.insert(0, '/home/emmanuel/code/kernellib') import numpy as np from kernellib.large_scale import RKSKernelRidge, KernelRidge as RKernelRidge from kernellib.utils import estimate_sigma, r_ass...
github_jupyter
<a href="https://www.skills.network/?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkDL0120ENSkillsNetwork20629446-2021-01-01"><img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/...
github_jupyter
# Burgers Optimization with a Differentiable Physics Gradient To illustrate the process of computing gradients in a _differentiable physics_ (DP) setting, we target the same inverse problem (the reconstruction task) used for the PINN example in {doc}`physicalloss-code`. The choice of DP as a method has some immediate...
github_jupyter
``` # Automatically reload imported modules that are changed outside this notebook %load_ext autoreload %autoreload 2 # More pixels in figures import matplotlib.pyplot as plt %matplotlib inline plt.rcParams["figure.dpi"] = 200 # Init PRNG with fixed seed for reproducibility import numpy as np np_rng = np.random.defau...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@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.o...
github_jupyter
# Mandala: self-managing experiments ## What is Mandala? Mandala enables new, simpler patterns for working with complex and evolving computational experiments. It eliminates low-level code and decisions for how to save, load, query, delete and otherwise organize results. To achieve this, it lets computational code "m...
github_jupyter
# notebook for processing fully reduced m3 data "triplets" This is a notebook for processing L0 / L1B / L2 triplets (i.e., the observations that got reduced). ## general notes We process the reduced data in triplets simply to improve the metadata on the L0 and L2 products. We convert L1B first to extract several attr...
github_jupyter
# Speed benchmarks This is just for having a quick reference of how the speed of running the program scales ``` from __future__ import print_function import pprint import subprocess import sys sys.path.append('../') # sys.path.append('/home/heberto/learning/attractor_sequences/benchmarking/') import numpy as np impo...
github_jupyter
<!--- <div style="text-align: center;"> <font size="5"> <b>Data-driven Design and Analyses of Structures and Materials (3dasm)</b> </font> </div> <br> </br> <div style="text-align: center;"> <font size="5"> <b>Lecture 1</b> </font> </div> <center> <img src=docs/tudelft_logo.jpg width=550px> </center> ...
github_jupyter
``` import pandas as pd train = pd.read_csv("./datasets/labeledTrainData.tsv", header=0, delimiter='\t', quoting=3) train.head() train.shape train.columns.values train["review"][0] from bs4 import BeautifulSoup example1 = BeautifulSoup(train["review"][0]) example1.get_text() import re letters_only = re.sub("[^a-zA-Z]",...
github_jupyter
<a href="https://colab.research.google.com/github/stephenbeckr/numerical-analysis-class/blob/master/Demos/Ch4_integration.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Numerical Integration (quadrature) - See also Prof. Brown's [integration not...
github_jupyter
``` import gtsam import numpy as np from gtsam.gtsam import (Cal3_S2, DoglegOptimizer, GenericProjectionFactorCal3_S2, NonlinearFactorGraph, Point3, Pose3, Point2, PriorFactorPoint3, PriorFactorPose3, Rot3, SimpleCamera, Values) from utils impo...
github_jupyter
``` # default_exp resimulation ``` # Match resimulation > Simulating match outcomes based on the xG of individual shots ``` #hide from nbdev.showdoc import * #export import collections import itertools import numpy as np ``` Use Poisson-Binomial distribution calculation from https://github.com/tsakim/poibin It lo...
github_jupyter
# Лабораторная работа 9. ООП. ``` import numpy as np import matplotlib.pyplot as plt ``` # 1. Создание классов и объектов В языке программирования Python классы создаются с помощью инструкции `class`, за которой следует произвольное имя класса, после которого ставится двоеточие; далее с новой строки и с отступом реал...
github_jupyter
# Qcodes example with InstrumentGroup driver This notebooks explains how to use the `InstrumentGroup` driver. ## About The goal of the `InstrumentGroup` driver is to combine several instruments as submodules into one instrument. Typically, this is meant to be used with the `DelegateInstrument` driver. An example usag...
github_jupyter
``` from __future__ import print_function import sisl import numpy as np import matplotlib.pyplot as plt from functools import partial %matplotlib inline ``` TBtrans is capable of calculating transport in $N\ge 1$ electrode systems. In this example we will explore a 4-terminal graphene GNR cross-bar (one zGNR, the oth...
github_jupyter
``` #pip install xlwt openpyxl xlsxwriter xlrd import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns ``` # Loading in Calibration datasets ``` #CO2 only df_Eguchi_CO2= pd.read_excel('Solubility_Datasets_V1.xlsx', sheet_name='Eguchi_CO2', index_col=0) d...
github_jupyter
# Обратные связи в контуре управления Для рассмотренных в предыдущих лекциях регуляторов требуется оценивать состояние объекта управления. Для построения таких оценок необходимо реализовать обратные связи в контуре управления. На практике для этого используются специальные устройства: датчики. # Случайные величины ...
github_jupyter
``` import spotipy from spotipy.oauth2 import SpotifyOAuth import pandas as pd import time scope = 'user-top-read user-library-read' sp = spotipy.Spotify(client_credentials_manager=SpotifyOAuth(scope=scope)) sp.user_playlists(sp.current_user()['id']) results = sp.current_user_top_artists(time_range='short_term', limit=...
github_jupyter
# Latitude, Longitude for any pixel in a GeoTiff File How to generate the latitude and longitude for a pixel at any given position in a GeoTiff file. ``` from osgeo import ogr, osr, gdal # opening the geotiff file ds = gdal.Open('G:\BTP\Satellite\Data\Test2\LE07_L1GT_147040_20050506_20170116_01_T2\LE07_L1GT_147040_200...
github_jupyter
``` !pip install unidecode googletrans !pip install squarify import re import time import tweepy import folium import squarify import warnings import collections import numpy as np import pandas as pd from PIL import Image from folium import plugins from datetime import datetime from textblob import TextBlob import ma...
github_jupyter
# Document Classification & Clustering - Lecture What could we do with the document-term-matrices (dtm[s]) created in the previous notebook? We could visualize them or train an algorithm to do some specific task. We have covered both classification and clustering before, so we won't focus on the particulars of algorit...
github_jupyter
``` a = 'ok' b = 'test' print(a+b) print(a*2) name = 'Bob' print(f'Hello, {name}') greeting = 'Hello, {}' with_name = greeting.format(name) print(with_name) size = input('Enter the size of your house: ') integer = int(size) floating = float(size) print(integer, floating) square_meters = integer / 10.8 print(f'{integer}...
github_jupyter
# Kestrel+Model ### A [Bangkit 2021](https://grow.google/intl/id_id/bangkit/) Capstone Project Kestrel is a TensorFlow powered American Sign Language translator Android app that will make it easier for anyone to seamlessly communicate with people who have vision or hearing impairments. The Kestrel model builds on the ...
github_jupyter
# PyTorch: Tabular Classify Binary ![mines](../images/mines.png) ``` import torch import torch.nn as nn from torch import optim import torchmetrics from sklearn.preprocessing import LabelBinarizer, StandardScaler import aiqc from aiqc import datum ``` --- ## Example Data Reference [Example Datasets](example_data...
github_jupyter
<div class="contentcontainer med left" style="margin-left: -50px;"> <dl class="dl-horizontal"> <dt>Title</dt> <dd> Scatter Element</dd> <dt>Dependencies</dt> <dd>Matplotlib</dd> <dt>Backends</dt> <dd><a href='./Scatter.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/Scatter.ipynb'>Bokeh</a></dd> <dd>...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import pandas as pd import sys sys.path.append('../../pyutils') import metrics import utils ``` # Introduction In unsupervised learing, one has a set of $N$ observations $x_i \in \mathbb{R}^p$, having joint density $P(X)$. The goal is to infer properties of th...
github_jupyter
# Wie Sie dieses Notebook nutzen: - Führen Sie diesen Code Zelle für Zelle aus. - Um die Variableninhalte zu beobachten, nutzen Sie in Jupyter-Classic den "Variable Inspektor". Falls Sie dieses Notebook in Jupyter-Lab verwenden, nutzen Sie hierfür den eingebauten Debugger. - Wenn Sie "Code Tutor" zur Visualisierung des...
github_jupyter
# Hinge Loss In this project you will be implementing linear classifiers beginning with the Perceptron algorithm. You will begin by writing your loss function, a hinge-loss function. For this function you are given the parameters of your model θ and θ0 Additionally, you are given a feature matrix in which the rows ar...
github_jupyter
(Feedforward)= # Chapter 8 -- Feedforward Let's take a look at how feedforward is processed in a three layers neural net. <img src="images/feedForward.PNG" width="500"> Figure 8.1 From the figure 8.1 above, we know that the two input values for the first and the second neuron in the hidden layer are $$ h_1^{(1)} = ...
github_jupyter
In this lab, we will optimize the weather simulation application written in Fortran (if you prefer to use C++, click [this link](../../C/jupyter_notebook/profiling-c.ipynb)). Let's execute the cell below to display information about the GPUs running on the server by running the pgaccelinfo command, which ships with t...
github_jupyter
``` import matplotlib import matplotlib.pyplot as plt import os import random import io import imageio import glob import scipy.misc import numpy as np from six import BytesIO from PIL import Image, ImageDraw, ImageFont from IPython.display import display, Javascript from IPython.display import Image as IPyImage impo...
github_jupyter
``` %matplotlib nbagg import os os.environ["PYOPENCL_COMPILER_OUTPUT"]="1" import numpy import fabio import pyopencl from pyopencl import array as cla from matplotlib.pyplot import subplots ctx = pyopencl.create_some_context(interactive=True) queue = pyopencl.CommandQueue(ctx, properties=pyopencl.command_queue_properti...
github_jupyter
``` # default_exp downloaders #export import requests import pathspec import time from pathlib import Path, PurePosixPath from tightai.lookup import Lookup from tightai.conf import CLI_ENDPOINT #hide test = False if test: CLI_ENDPOINT = "http://cli.desalsa.io:8000" #export class DownloadVersion(Lookup): path =...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/Spark%20v2.7.6%20Notebooks/21.Gender_Classi...
github_jupyter
## Load Library And Data ``` # importing the library import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # to know the ecoding type import chardet with open('E:\\Recommendation System\\book.csv', 'rb') as rawdata: result = chardet.detect(rawdata.read(100000)) result ``` - ...
github_jupyter
## Eng+Wales well-mixed example model This is the inference notebook with increased inference window. There are various model variants as encoded by `expt_params_local` and `model_local`, which are shared by the notebooks in a given directory. Outputs of this notebook: (same as `inf` notebook with added `tWin` labe...
github_jupyter
``` #Use this command to run it on floydhub: floyd run --gpu --env tensorflow-1.4 --data emilwallner/datasets/imagetocode/2:data --data emilwallner/datasets/html_models/1:weights --mode jupyter from os import listdir from numpy import array from keras.preprocessing.text import Tokenizer, one_hot from keras.preprocessin...
github_jupyter
# import required library ``` # Import numpy, pandas for data manipulation import numpy as np import pandas as pd # Import matplotlib, seaborn for visualization import matplotlib.pyplot as plt import seaborn as sns import warnings warnings.filterwarnings('ignore') # Import the data weather_data = pd.read_csv('weather...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W2D2_LinearSystems/student/W2D2_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 3: Combining determinism and stochasticity ...
github_jupyter
# String ## `print()` Fungsi `print()` mencetak seluruh argumennya sebagai *string*, dipisahkan dengan spasi dan diikuti dengan sebuah *line break*: ``` name = "Budi" print("Hello World") print("Hello", 'World') print("Hello", name) ``` > Catatan: Fungsi untuk mencetak di Python 2.7 dan Python 3 berbeda. Di Python 2...
github_jupyter
<style>div.container { width: 100% }</style> <img style="float:left; vertical-align:text-bottom;" height="65" width="172" src="../assets/holoviz-logo-unstacked.svg" /> <div style="float:right; vertical-align:text-bottom;"><h2>Tutorial 5. Interactive Pipelines</h2></div> The plots built up over the first few tutorials...
github_jupyter
# Cell Basic Filtering ## Content The purpose of this step is to get rid of cells having **obvious** issues, including the cells with low mapping rate (potentially contaminated), low final reads (empty well or lost a large amount of DNA during library prep.), or abnormal methylation fractions (failed in bisulfite conv...
github_jupyter
``` # i 可能的取值:0、2、4、6、len(A) from collections import Counter class Solution: def canReorderDoubled(self, A): if not A: return True a_freq = Counter(A) seen = set() for a in A: if a in seen: continue if a_freq[a] == 0: seen.add(a) ...
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
# ELG Signal-to-Noise Calculations This notebook provides a standardized calculation of the DESI emission-line galaxy (ELG) signal-to-noise (SNR) figure of merit, for tracking changes to simulation inputs and models. See the accompanying technical note [DESI-3977](https://desi.lbl.gov/DocDB/cgi-bin/private/ShowDocume...
github_jupyter
# Face Generation In this project, you'll define and train a DCGAN on a dataset of faces. Your goal is to get a generator network to generate *new* images of faces that look as realistic as possible! The project will be broken down into a series of tasks from **loading in data to defining and training adversarial net...
github_jupyter
``` """ You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab. Instructions for setting up Colab are as follows: 1. Open a new Python 3 notebook. 2. Import this notebook from GitHub (File -> Upload Notebook -> "GITHUB" tab -> copy/paste GitHub URL) 3. Connect to an in...
github_jupyter
# 빠른 학습을 위한 tfrecords 데이터셋 생성 - 컴페티션 기본 데이터는 data/public 하위 폴더에 있다고 가정합니다. (train.csv, sample_submission.csv, etc) - 또한 train.zip, test.zip 역시 data/public 하위에 압축을 풀어놓았다고 가정하고 시작하겠습니다. ``` import os import os.path as pth import json import shutil import pandas as pd from tqdm import tqdm data_base_path = pth.join('dat...
github_jupyter
## In situ data and trajectories incl. Bepi Colombo, PSP, Solar Orbiter https://github.com/cmoestl/heliocats Author: C. Moestl, IWF Graz, Austria twitter @chrisoutofspace, https://github.com/cmoestl last update: 2021 August 24 needs python 3.7 with the conda helio environment (see README.md) uses heliopy for ge...
github_jupyter
``` import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns import torch from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from xgboost import XGBRegressor from lightgbm import LGBMRegressor from sklearn.metrics import mean_...
github_jupyter
# 深度学习工具 PyTorch 简介 在此 notebook 中,你将了解 [PyTorch](http://pytorch.org/),一款用于构建和训练神经网络的框架。PyTorch 在很多方面都和 Numpy 数组很像。毕竟,这些 Numpy 数组也是张量。PyTorch 会将这些张量当做输入并使我们能够轻松地将张量移到 GPU 中,以便在训练神经网络时加快处理速度。它还提供了一个自动计算梯度的模块(用于反向传播),以及另一个专门用于构建神经网络的模块。总之,与 TensorFlow 和其他框架相比,PyTorch 与 Python 和 Numpy/Scipy 堆栈更协调。 ## 神经网络 深度学习以人工神经网络为...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from bokeh.plotting import * from sklearn.cluster.bicluster import SpectralCoclustering from bokeh.models import HoverTool, ColumnDataSource from itertools import product whisky = pd.read_csv('whiskies.txt') whisky["Region"] = pd.read_csv('regio...
github_jupyter
``` import datetime as dt import panel as pn pn.extension() ``` The ``DateRangeSlider`` widget allows selecting a date range using a slider with two handles. For more information about listening to widget events and laying out widgets refer to the [widgets user guide](../../user_guide/Widgets.ipynb). Alternatively y...
github_jupyter
# MBZ-XML-TO-EXCEL First pubished version May 22, 2019. This is version 0.0004 (revision July 26, 2019) Licensed under the NCSA Open source license Copyright (c) 2019 Lawrence Angrave All rights reserved. Developed by: Lawrence Angrave Permission is hereby granted, free of charge, to any person obtaining a copy ...
github_jupyter
![qiskit_header.png](attachment:qiskit_header.png) # _*Qiskit Finance: Loading and Processing Stock-Market Time-Series Data*_ The latest version of this notebook is available on https://github.com/qiskit/qiskit-tutorial. *** ### Contributors Jakub Marecek<sup>[1]</sup> ### Affiliation - <sup>[1]</sup>IBMQ ### Intr...
github_jupyter
Azure ML & Azure Databricks notebooks by Parashar Shah. Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. We support installing AML SDK as library from GUI. When attaching a library follow this https://docs.databricks.com/user-guide/libraries.html and add the below string as y...
github_jupyter
# 🔢 Vectorizing Guide Firstly, we must import what we need from Relevance AI ``` from relevanceai import Client from relevanceai.utils.datasets import ( get_iris_dataset, get_palmer_penguins_dataset, get_online_ecommerce_dataset, ) client = Client() ``` ## Example 1 For this first example we going to w...
github_jupyter
1. Recap == In the last mission, we explored how to use a simple k-nearest neighbors machine learning model that used just one feature, or attribute, of the listing to predict the rent price. We first relied on the <span style="background-color: #F9EBEA; color:##C0392B">accommodates</span> column, which describes the ...
github_jupyter
``` #convert ``` # babilim.model.layers.roi_ops > Operations for region of interest extraction. ``` #export from babilim.core.annotations import RunOnlyOnce from babilim.core.module_native import ModuleNative #export def _convert_boxes_to_roi_format(boxes): """ Convert rois into the torchvision format. ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys import pathlib sys.path.append(str(pathlib.Path().cwd().parent)) from typing import Tuple from load_dataset import Dataset from plotting import plot_ts dataset = Dataset('../data/dataset/') ``` ### В чем заключаются недостатки полносвязных сетей? * невозможность ула...
github_jupyter
# Milestone2 Document ## Feedback - Introduction: A nice introduction! - Background -0.5: It would be hard for users to understand automatic differentiation, computational graph, and evaluation trace if you don't give the corresponding illustrations in the Background section **Revision: provided a concrete ex...
github_jupyter
``` import pandas as pd from joblib import dump, load import os #set up directory #os.chdir() #Drug dic #open file df_drugs=pd.read_csv(r"C:\Users\mese4\Documents\The Data incubator\project\Drugmap\drugbank vocabulary.csv", encoding='ISO-8859-1') synonyms = [] drug_names = df_drugs['Common_name'].tolist() drug_names...
github_jupyter