text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` import dgl import torch graphs, _ = dgl.load_graphs('/afs/inf.ed.ac.uk/user/s20/s2041332/mlp_project/graph/dev_graphs_200.dgl') print(len(graphs)) a = torch.tensor([[[0, 1], [1, 2], [2, 3]], [[3,4],[4,5],[5,6]]],dtype=torch.float) print(a.shape) print(a.mean(0).shape) print(a) torch.stack([a.me...
github_jupyter
# MAT281 - Laboratorio 7 ## Aplicaciones de la Matemática en la Ingeniería ## __Intrucciones__ * Completa tus datos personales (nombre y rol USM). * Debes enviar este .ipynb con el siguiente formato de nombre: 07_formato_datos_NOMBRE_APELLIDO.ipynb con tus respuestas a alonso.ogueda@gmail.com y sebastian.flores@usm....
github_jupyter
<a href="https://colab.research.google.com/github/fabxy/course-content-dl/blob/main/tutorials/W2D5_GenerativeModels/W2D5_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 3: Conditional GANs and Implications of GAN Technology **W...
github_jupyter
# High-level PyTorch Example ``` import os import sys import numpy as np import math import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as data_utils import torch.nn.init as init from torch.autograd import Variable from common.params import * from com...
github_jupyter
``` import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import plotly.figure_factory as FF from datetime import datetime import glob import os.path import pymysql import sqlconfig # From sqlconfig.py import pandas as pd import sqlalchemy import psycopg2 from...
github_jupyter
``` cd /content/drive/My Drive/Spam Classifier import nltk import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.naive_bayes import MultinomialNB from sklearn.model_selection import train_test_split from nltk.corpus import stopwords from nltk.stem import PorterStemmer,WordNetLemmatizer fro...
github_jupyter
``` # Copyright 2020 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 tensorflow as tf import numpy as np #打印时间分割线 @tf.function def printbar(): ts = tf.timestamp() today_ts = ts%(24*60*60) hour = tf.cast(today_ts//3600+8,tf.int32)%tf.constant(24) minite = tf.cast((today_ts%3600)//60,tf.int32) second = tf.cast(tf.floor(today_ts%60),tf.int32) ...
github_jupyter
# Incremental modeling with decision optimization This tutorial includes everything you need to set up decision optimization engines, build a mathematical programming model, then incrementally modify it. You will learn how to: - change coefficients in an expression - add terms in an expression - modify constraints and...
github_jupyter
``` %matplotlib inline import os import sys # Modify the path sys.path.append("..") import yellowbrick as yb import matplotlib.pyplot as plt ``` # Using Yellowbrick to Explore Book Reviews This notebook is for the Yellowbrick user study. About the data: [Amazon book reviews Data Set](http://archive.ics.uci.edu...
github_jupyter
# Results - CIViC smMIPs panel rescues clinically relevant variants ## Tools ``` #!/usr/bin/env python3 import numpy as np import pandas as pd import matplotlib.pyplot as plt import glob import scipy.stats as ss import seaborn as sns sns.set(style='white') sns.set_context("talk") from pyliftover import LiftOver lo =...
github_jupyter
# Table of Contents 1. The competition 2. Summary of my approach and results 3. Algorithm details 4. Instructions for running my code 5. What I've learned about competing # 1. The competition In the [Kaggle Passenger Description Algorithm Challenge](https://www.kaggle.com/c/passenger-screening-algorithm-challenge), ...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Cost-vs-qubits-size" data-toc-modified-id="Cost-vs-qubits-size-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Cost vs qubits size</a></span></li></ul></div> ``` import numpy as np import networkx as nx ...
github_jupyter
``` %matplotlib inline ``` # The double pendulum problem This animation illustrates the double pendulum problem. Double pendulum formula translated from the C code at http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c ``` from numpy import sin, cos import numpy as np import matplotlib.pyplot as plt im...
github_jupyter
# Boosting In this section, we will construct a boosting classifier with the `AdaBoost` algorithm and a boosting regressor with the `AdaBoost.R2` algorithm. These algorithms can use a variety of weak learners but we will use decision tree classifiers and regressors, constructed in {doc}`Chapter 5 </content/c5/concept>...
github_jupyter
## import modules ``` import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader from torchvision import datasets, transforms import matplotlib.pyplot as plt ``` ## define model architecture ``` class ConvNet(nn.Module): def __init__(se...
github_jupyter
# Homework 5 - Liberatori Benedetta This exercise contains a modified version of the **magnitude_pruning** function from notebook 05-pruning.ipynb, to allow iterative pruning. The implementation of magnitude pruning is mask-based and the function takes as input a previously computed mask (default is None for the on...
github_jupyter
# DataFrames Pt. 1 > DataFrames are the workhorse of pandas and are directly inspired by the R programming language. We can think of a DataFrame as a bunch of Series objects put together to share the same index. Let's use pandas to explore this topic! # In Pt. 1 we cover the following : * Create a basic DataFrame * ...
github_jupyter
<table> <tr> <td width=15%><img src="./img/UGA.png"></img></td> <td><center><h1>Introduction to Python for Data Sciences</h1></center></td> <td width=15%><a href="http://www.iutzeler.org" style="font-size: 16px; font-weight: bold">Franck Iutzeler</a> </td> </tr> </table> <br/><br/> <center><a style="font-size: 40pt;...
github_jupyter
``` ''' Two Inputs : (i) a directory containing all images, (ii) scenic scenario script Output : a list of image_file names that belongs to the scenario''' import os import scenic from scenic.simulators.gta.nusc_query_api import NuscQueryAPI directory = "/Users/edwardkim/Desktop/nuScenes_data/samples/CAM_FRO...
github_jupyter
# Evolutionary Grammar Fuzzing In this chapter, we introduce how to implement [search-based test generation](SearchBasedFuzzing.ipynb) on grammars, using _genetic improvement_ operators such as mutation and cross-over on derivation trees. **Prerequisites** * You should have read the [chapter on search-based test gen...
github_jupyter
# Human Brain samples - MS Nature 2019 Rowitch dataset reprocessed ## Please download the input data before proceed Please extract the tarball to current working directory, input data would be in **./data** **Download link https://bit.ly/2F6o5n7** ``` import scanpy as sc import numpy as np import scipy as sp import ...
github_jupyter
# Mimblewimble ## Resources: ### Software: - Get rust at: [www.rust-lang.org](https://www.rust-lang.org) - Get jupyter notebook directly at [jupyter.org](https://www.jupyter.org) or through anaconda distribution at [anaconda.com](https://www.anaconda.com) - get rust jupyter kernel at [https://github.com/google/evcxr...
github_jupyter
``` import networkx as nx import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline def golden_figsize(height): """ Assuming height dimension is the shorter one, the width should be: (1 + 5**0.5)/2 This function thus returns the (width, height) tuple which is c...
github_jupyter
# Module 6. Amazon SageMaker Deployment for EIA(Elastic Inference Accelerator) --- ***[주의] 본 모듈은 PyTorch EIA 1.3.1 버전에서 훈련을 수행한 모델만 배포가 가능합니다. 코드가 정상적으로 수행되지 않는다면, 프레임워크 버전을 동일 버전으로 맞춰 주시기 바랍니다.*** 본 모듈에서는 Elastic Inference Accelerator(EIA)를 사용하여 모델을 배포해 보겠습니다. ### Elastic Inference Accelerator 훈련 인스턴스와 달리 실시간 추론 인...
github_jupyter
# Agent prototype: Create ML training set from PPPDB ``` import json import os import pandas as pd import transfer_auth import search_client from globus_sdk import TransferData, GlobusError from gmeta_utils import gmeta_pop, format_gmeta s_client = search_client.SearchClient("https://search.api.globus.org/", "mdf") tr...
github_jupyter
# OLS regressions - baseline for Capstone analysis In this notebook, I perform OLS regressions using systemwide CaBi trips as the dependent variable. ``` from util_functions import * import numpy as np import pandas as pd import statsmodels.formula.api as smf import matplotlib.pyplot as plt import seaborn as sns; sns....
github_jupyter
# Table of Contents <p><div class="lev1"><a href="#Introduction"><span class="toc-item-num">1&nbsp;&nbsp;</span>Introduction</a></div><div class="lev2"><a href="#random-process"><span class="toc-item-num">1.1&nbsp;&nbsp;</span>random process</a></div><div class="lev2"><a href="#probability"><span class="toc-item-num">...
github_jupyter
# BPM ESTIMATION ON REAL VIDEO Explanation of the script for testing on real data in the same condition as pyVHR ## Import librairies Previously , you have to install theses python librairies : * tensorflow (2.2.0) * matplotlib * scipy * numpy * opencv-python * Copy * pyVHR (0.0.1) ``` ## ## Importing libraries ## ...
github_jupyter
<a href="https://colab.research.google.com/github/luislauriano/Data_Science/blob/master/An%C3%A1lise_coronav%C3%ADrus.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **Análise dos dados do Coronavírus** O novo coronavírus de 2019 (2019-nCoV) é um...
github_jupyter
Copyright (c) 2020-2021. All rights reserved. Licensed under the MIT License. # Troubleshooting HPO for fine-tuning pre-trained language models ## 1. Introduction In this notebook, we demonstrate a procedure for troubleshooting HPO failure in fine-tuning pre-trained language models (introduced in the following pap...
github_jupyter
# Cell Problem: In GDS format - each cell must have a unique name. Ideally the name is also consitent from different run times, in case you want to merge GDS files that were created at different times or computers. - two cells stored in the GDS file cannot have the same name. Ideally they will be references to the s...
github_jupyter
# GeoEnrichment GeoEnrichment provides the ability to get facts about a location or area. Using GeoEnrichment, you can get information about the people and places in a specific area or within a certain distance or drive time from a location. It enables you to query and use information from a large collection of data s...
github_jupyter
# Riskfolio-Lib Tutorial: <br>__[Financionerioncios](https://financioneroncios.wordpress.com)__ <br>__[Orenji](https://www.orenj-i.net)__ <br>__[Riskfolio-Lib](https://riskfolio-lib.readthedocs.io/en/latest/)__ <br>__[Dany Cajas](https://www.linkedin.com/in/dany-cajas/)__ <a href='https://ko-fi.com/B0B833SXD' target='...
github_jupyter
**Source of the materials**: Biopython cookbook (adapted) # Quick Start This section is designed to get you started quickly with Biopython, and to give a general overview of what is available and how to use it. All of the examples in this section assume that you have some general working knowledge of Python, and that...
github_jupyter
# Active Learning (VST ATLAS) ``` # remove after testing %load_ext autoreload %autoreload 2 import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import PolynomialFeatures from sklearn.mo...
github_jupyter
# Tuples -> A tuple is similar to list -> The diffence between the two is that we can't change the elements of tuple once it is assigned whereas in the list, elements can be changed # Tuple creation ``` #empty tuple t = () #tuple having integers t = (1, 2, 3) print(t) #tuple with mixed datatypes t = (1, 'raju', 2...
github_jupyter
``` import sys, os sys.path.insert(1, '/home/ning_a/Desktop/CAPTCHA/base_solver/base_solver_char') import numpy as np import torch from torch.autograd import Variable import captcha_setting import my_dataset from captcha_cnn_model import CNN, Generator from torchvision.utils import save_image import cv2 as cv from matp...
github_jupyter
# EventVestor: Index Changes In this notebook, we'll take a look at EventVestor's *Index Changes* dataset, available on the [Quantopian Store](https://www.quantopian.com/store). This dataset spans January 01, 2007 through the current day, and documents index additions and deletions to major S&P, Russell, and Nasdaq 10...
github_jupyter
## Matching catalogues to the VAST Pilot Survey This notebook gives an example of how to use vast-tools in a notebook environment to perform a crossmatch between a catalogue and the VAST Pilot Survey. **Note** The settings and filters applied in this notebook, while sensible, are somewhat generic - always consider yo...
github_jupyter
# Harvesting collections of text from archived web pages <p class="alert alert-info">New to Jupyter notebooks? Try <a href="getting-started/Using_Jupyter_notebooks.ipynb"><b>Using Jupyter notebooks</b></a> for a quick introduction.</p> This notebook helps you assemble datasets of text extracted from all available cap...
github_jupyter
# Name Batch prediction using Cloud Machine Learning Engine # Label Cloud Storage, Cloud ML Engine, Kubeflow, Pipeline, Component # Summary A Kubeflow Pipeline component to submit a batch prediction job against a deployed model on Cloud ML Engine. # Details ## Intended use Use the component to run a batch p...
github_jupyter
``` import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import shutil from skimage.external.tifffile import imsave,imread myDir=r'/project/hackathon/hackers03/shared/patches/raw_20X' fileList=os.listdir(myDir) fileList newDir=r'/project/hackathon/hackers03/shared/si...
github_jupyter
# Desafio 4 Neste desafio, vamos praticar um pouco sobre testes de hipóteses. Utilizaremos o _data set_ [2016 Olympics in Rio de Janeiro](https://www.kaggle.com/rio2016/olympic-games/), que contém dados sobre os atletas das Olimpíadas de 2016 no Rio de Janeiro. Esse _data set_ conta com informações gerais sobre 11538...
github_jupyter
# 4. Theory and Mathematical Details Interaction Primitives [1] are basic building blocks that model the movements between multiple agents in an interaction. This section will give a brief literature overview of the origins of Interaction Primitives before delving into a mathematical treatment of the three supported I...
github_jupyter
### List Comprehensions We've used list comprehensions throughout this course quite a bit, so the concept should not be new, but let's recap quickly what we have seen so far with list comprehensions. A list comprehension is language construct that allows to easily build a list by transforming, and optionally, filteri...
github_jupyter
# Amazon SageMaker で PyTorch の GNN を使ったノード分類を行う このサンプルノートブックは、[PyTorch geometric のサンプルコード](https://pytorch-geometric.readthedocs.io/en/latest/notes/colabs.html)を参考にしました。 ## Node Classification with Graph Neural Networks [Previous: Introduction: Hands-on Graph Neural Networks](https://colab.research.google.com/drive/1...
github_jupyter
--- _You are currently looking at **version 1.1** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-social-network-analysis/resources/yPcBs) course resource._ --- # Assignmen...
github_jupyter
# ML algorithms: Logistic Regression Source: https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression From the sklearn handbook: >Logistic regression, despite its name, is a linear model for classification rather than regression. Logistic regression is also known in the literature as logit regre...
github_jupyter
# Full pipeline (quick) This notebook explains the full pipeline in a detailed manner, including the preprocessing steps, the summerization steps and the classification ones. ## Loading the dataset under the Pandas Dataframe format Because Melusine operates Pandas Dataframes by applying functions to certain columns ...
github_jupyter
``` # export from nbdev.imports import * from nbdev.sync import * from nbdev.export import * from nbdev.showdoc import * from nbdev.template import * from html.parser import HTMLParser from nbconvert.preprocessors import ExecutePreprocessor, Preprocessor from nbconvert import HTMLExporter,MarkdownExporter import trait...
github_jupyter
# Quantum Autoencoder <em> Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved. </em> ## Overview This tutorial will show how to train a quantum autoencoder to compress and reconstruct a given quantum state (mixed state) [1]. ### Theory The form of the quantum autoencoder is very sim...
github_jupyter
<a href="https://colab.research.google.com/github/yukinaga/bert_nlp/blob/main/section_4/02_fine_tuning_for_classification.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## ファインチューニングによる感情分析 ファインチューニングを活用し、文章の好悪感情を判別できるようにモデルを訓練します。 ## ライブラリのインストール...
github_jupyter
### Why ibis? For me, it is mainly about achieving higher performance when handling large data already residing in databases. ibis uses the actual database's compute resources. In contrast, pandas' `read_sql` uses just your PC's resources. It is well known by Python ETL developers that pandas is slow for retrieving...
github_jupyter
# Building, Training and Evaluating Models with TensorFlow Decision Forests ## Overview In this lab, you use TensorFlow Decision Forests (TF-DF) library for the training, evaluation, interpretation and inference of Decision Forest models. ## Learning Objective In this notebook, you learn how to: 1. Train a binary ...
github_jupyter
``` %run ./resources/library.py style_notebook() ``` # Notebook 3: Exploring TB and Socio-economic Indicators, Part 2 ## Review Goals Our goal for this TB exploration notebook is to construct a "gapminder" for TB data and a time series choropleth map. See figures below. ![Gapminder for TB](images/gapminder-for-tb.p...
github_jupyter
# Demagnetisation using periodic boundary conditions ## Setting the simulation ``` import dolfin as df import numpy as np import matplotlib.pyplot as plt from finmag import Simulation as Sim from finmag.energies import Demag from finmag import MacroGeometry %matplotlib inline ``` The mesh unit cell is a box with edg...
github_jupyter
# Introduction This notebook does not run in **binder**. The OOI data system features an extension called Data Explorer. This sub-system is intended to facilitate data exploration and use. For more detail see notebook **Ocean 01 B**. This notebook cleans up Level 1+ NetCDF files obtained from Data Explorer. The res...
github_jupyter
# BERT **Bidirectional Encoder Representations from Transformers.** _ | _ - | - ![alt](https://pytorch.org/assets/images/bert1.png) | ![alt](https://pytorch.org/assets/images/bert2.png) ### **Overview** BERT was released together with the paper [BERT: Pre-training of Deep Bidirectional Transformers for Language Un...
github_jupyter
# Weather Underground Hurricane Data ----- ## Processed Data Research A notebook for researching the processed Weather Underground data from the ```src/process_data.py``` script. ``` processed_data_dir = '../data/processed/' media_dir = '../media' figsize_width = 12 figsize_height = 8 output_dpi = 72 # Imports impo...
github_jupyter
# Setup initial *O slabs to run --- # Import Modules ``` import os print(os.getcwd()) import sys import json import pickle from shutil import copyfile import numpy as np import pandas as pd from ase import io from tqdm.notebook import tqdm from IPython.display import display # ###################################...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import pandas_profiling data=pd.read_csv("/home/manikanta/Documents/ML/classification/Random Forest/hcvdat0.csv") data.head() data.tail() data['Category'].value_counts(normalize=True) data.shape # Import label encoder from...
github_jupyter
##### Copyright 2020 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
# Concolic Fuzzing We have previously seen how one can use dynamic taints to produce more intelligent test cases than simply looking for program crashes. We have also seen how one can use the taints to update the grammar, and hence focus more on the dangerous methods. While taints are helpful, uninterpreted strings i...
github_jupyter
# Approximate q-learning In this notebook you will teach a __pytorch__ neural network to do Q-learning. ``` # in google colab uncomment this import os os.system('apt-get update') os.system('apt-get install -y xvfb') os.system('wget https://raw.githubusercontent.com/yandexdataschool/Practical_DL/fall18/xvfb -O ../xv...
github_jupyter
# Lecture 16: Classification # Problem setting ## Review In last few lectures we have learned the linear regression, where we explore the possibility of using a linear function (or higher degree polynomials) to represent the relation of the features in the samples (aka labels, $x$ values, or training data `X_train`) ...
github_jupyter
# Modeling and Simulation in Python Milestone: Queueing theory Copyright 2017 Allen Downey License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0) ``` # If you want the figures to appear in the notebook, # and you want to interact with them, use # %matplotlib notebook...
github_jupyter
## Grid Manipulations (merge, split, refine, transform) ### Notes Most grid transformations such as `merge` and `transpose` return a new object, allowing consecutive operations to be chained together. Optionally, you can pass `inplace=True` to the call signature to modify the existing object and return `None`. Both app...
github_jupyter
``` import osmnx as ox import networkx as nx import pandas as pd import numpy as np import matplotlib.cm as cm import matplotlib.colors as colors import json #)载入“一 · 简单地图匹配算法预处理”工作中所获得的道路网路数据,以及San Francisco 数据集中的一个子数据 G = ox.load_graphml('graph.graphml') #list1 = list() #with open("D:\\cabspottingdata\\cabspottingdat...
github_jupyter
# TASK #1: UNDERSTAND VARIABLES ASSIGNMENT ``` # Define a variable named "x" and assign a number (integer) to it # integer is a whole number (no decimals) that could be positive or negative x = 20 # Let's view "x" print(x) # Define a variable named "y" and assign a number (float) to it # Float are real numbers with a...
github_jupyter
# Sample Size Experiment using Random Forest and Deep Networks ### Random Forest (RF) vs. Deep Networks (DN) Random forest is inherently a non-parametric model, meaning that the algorithm requires no assumptions about the data distribution. With infinitely many trees and n &rarr; $\infty$, RF will follow non-parametr...
github_jupyter
![DeepNeuro](https://github.com/QTIM-Lab/DeepNeuro/raw/master/package_resources/logos/DeepNeuro_alt.PNG?raw=true) # Wrapping Around External Packages with DeepNeuro Conducting machine learning research in the field of medical imaging poses unique challenges. One of the most pernicious challenges is the wide variety o...
github_jupyter
``` #IMPORT SEMUA LIBRARY DISINI #IMPORT LIBRARY PANDAS import pandas as pd #IMPORT LIBRARY POSTGRESQL import psycopg2 from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT #IMPORT LIBRARY CHART from matplotlib import pyplot as plt from matplotlib import style #IMPORT LIBRARY PDF from fpdf import FPDF #IMPORT LIBR...
github_jupyter
# Data Science with Python and Dask ## Chapter 5: Cleaning and Transforming DataFrames ``` # Before beginning, set your working directory to where the data resides import os os.chdir('/Users/jesse/Documents') ``` ### Intro Section ``` # Listing 5.1 import dask.dataframe as dd from dask.diagnostics import ProgressBar...
github_jupyter
# Ipyleaflet with vaex ## Repository: https://github.com/vaexio/vaex ## Installation: `conda install -c conda-forge vaex` ``` import vaex import numpy as np np.warnings.filterwarnings('ignore') dstaxi = vaex.open('src/nyc_taxi2015.hdf5') # mmapped, doesn't cost extra memory dstaxi.plot_widget("pickup_longitude", "pic...
github_jupyter
# Ch `10`: Concept `02` ## Recurrent Neural Network Import the relevant libraries: ``` import numpy as np import tensorflow as tf from tensorflow.contrib import rnn ``` Define the RNN model: ``` class SeriesPredictor: def __init__(self, input_dim, seq_size, hidden_dim=10): # Hyperparameters se...
github_jupyter
<h1>Today Lesson Outline (28 June 2020) </h1> ## Tuples က ဘာလဲ။ ဘယ်လိုတည်ဆောက်သလဲ။ Tuples ဆိုတာ အစီအစဥ်အတိုင်းစီထားသော ကိန်းစဥ်တစ်မျိုးပါ။ Tuples တွေကို ( ၀ိုက်ကွင်း ) တွေထဲမှာ , ခြားပြီး သတ်မှတ်နိုင်ပါတယ်။ ``` Ratings = (10,9,6,5,10,8,9,6,2) ``` Tuples က Data types တွေကို ရောပြီးသိမ်းထားနိုင်တယ်။ ``` cars = ('Ho...
github_jupyter
``` import os os.environ['TRKXINPUTDIR']="/global/cfs/projectdirs/atlas/xju/heptrkx/trackml_inputs/train_all" os.environ['TRKXOUTPUTDIR']= "/global/cfs/projectdirs/m3443/usr/caditi97/iml2020/outtest" import pkg_resources import yaml import pprint import random import time import pickle random.seed(1234) import numpy as...
github_jupyter
# Internal Datastructure: Bus branch model, Admittance and Jacobian Matrix This jupyter notebooks explains how to access and interpret the internal datastructure with relevant matrices. ### Internal Datastructure We use the simple example network from the create_simple tutorial as an example for how to access intern...
github_jupyter
``` ## Done from google.colab import drive; drive.mount("/content/drive") import pandas as pd import numpy as np import nltk import re nltk.download("stopwords");nltk.download("punkt") import sklearn data1 = pd.read_excel("/content/drive/My Drive/DimasASu/Data Latih BDC.xlsx") data2 = pd.read_ csv("/content/driv...
github_jupyter
# Demo This notebook demonstrates the basic functionality of the `perfectns` package; for background see the dynamic nested sampling paper [(Higson at al., 2019a)](https://doi.org/10.1007/s11222-018-9844-0). ### Running nested sampling calculations The likelihood $\mathcal{L}(\theta)$, prior $\pi(\theta)$ and calcul...
github_jupyter
<a id='start'></a> # Introduction to Python #### In questo primo notebook introdurremo i concetti fondamentali per iniziare ad usare Python Il notebook è così suddiviso: <br> 1) [Hello, Python](#section1)<a href='#section1'></a> <br> 2) [Le funzioni](#section2)<a href='#section2'></a><br> 3) [Booleans & Condizioni](#...
github_jupyter
``` """ Demo showing how km_dict and insegtprobannotator may be used together for interactive segmentation. @author: vand and abda """ import sys import skimage.io import skimage.data import skimage.transform import numpy as np %gui qt patch_dir = '/Users/vand/Documents/PROJECTS2/InSegt/pycode' import sys if patch_d...
github_jupyter
# McStas ## First time setup McStas Script ``` from mcstasscript.interface import functions # Each time a new conda env is created and used McStas must be configured my_configurator = functions.Configurator() my_configurator.set_mcrun_path("/usr/local/bin/") my_configurator.set_mcstas_path("/usr/local/mcstas/2.5/") ...
github_jupyter
<small><small><i> All the IPython Notebooks in **[Python Seaborn Module](https://github.com/milaan9/12_Python_Seaborn_Module)** lecture series by **[Dr. Milaan Parmar](https://www.linkedin.com/in/milaanparmar/)** are available @ **[GitHub](https://github.com/milaan9)** </i></small></small> <a href="https://colab.resea...
github_jupyter
# Basic Logistic Regression Vamos a considerar los datos de [Kaggle](https://www.kaggle.com/c/tabular-playground-series-jun-2021/code?competitionId=26480), para ajustar un modelo de regresión logística que haga predicciones sobre la categoría. Ideas para este ajuste son de [aquí](https://www.kaggle.com/whenthetidegoe...
github_jupyter
# Object Detection using Haar feature-based cascade classifiers in openCV ``` import numpy as np import cv2 import matplotlib.pyplot as plt %matplotlib inline ``` Object Detection using Haar feature-based cascade classifiers is an effective object detection method proposed by Paul Viola and Michael Jones in their pap...
github_jupyter
# OpenPredict API examples Example calls to the OpenPredict Smart API accessible at https://openpredict.semanticscience.org ## Get predictions for a list of MONDO diseases Example to convert multiple MONDO IDs to OMIM with Translator NodeNormalization API, then query the OpenPredict API, for predicted drugs. ``` im...
github_jupyter
``` import open3d as o3d import numpy as np import matplotlib.pyplot as plt import copy import os import sys # only needed for tutorial, monkey patches visualization sys.path.append('..') import open3d_tutorial as o3dtut # change to True if you want to interact with the visualization windows o3dtut.interactive = not "...
github_jupyter
# Quick Start This notebook demonstrates how to use MARO's reinforcement learning (RL) toolkit to solve the container inventory management ([CIM](https://maro.readthedocs.io/en/latest/scenarios/container_inventory_management.html)) problem. It is formalized as a multi-agent reinforcement learning problem, where each p...
github_jupyter
# Using PyTorch for simple regression [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/parrt/fundamentals-of-deep-learning/blob/main/notebooks/2.pytorch-nn-training-cars.ipynb) By [Terence Parr](https://explained.ai). Once we can implement our own ...
github_jupyter
``` import sys import pandas as pd import botometer import os ``` # VARIABLE INITIATION ## arg 1 = 'rs' or 'sn' ## arg 2 = hour file 6,7 or 8 ? ## arg 3 = start row ## arg 4 = end row ## arg 5 = key selection, 1,2,3,4 ## sn 7 : total row 33277 ## sn 8 : total row 53310 ## rs 7 : 7230 ## rs 8 : 10493 ``` sys.argv = [...
github_jupyter
## SimCLR: A Simple Framework for Contrastive Learning of Visual Representations This colab demonstrates how to load pretrained/finetuned SimCLR models from checkpoints or hub modules. It contains two parts: * Part I - Load checkpoints and print parameters (count) * Part II - Load hub module for inference The checkp...
github_jupyter
# Udacity Machine Learning Nanodegree # Capstone Project Hello there! This is my capstone project on building a model to make better prosthetics. This project is for an open source prosthetic control system which would enable prosthetic devices to have multiple degrees of freedom. https://github.com/cyber-punk-me ...
github_jupyter
# Using Twitter API with Tweepy To interface with Twitter API, we can use third-party package such as Tweepy. To use the package, we will need to register and get keys from twitter developer portal. Then, we use these keys to authenticate with OAuth2 to access twitter API. ``` import tweepy import pandas as pd impor...
github_jupyter
# Nu-Support Vector Classification with RobustScaler ### Required Packages ``` !pip install imblearn import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as se import warnings from sklearn.model_selection import train_test_split from imblearn.over_sampling import RandomOverSampler fr...
github_jupyter
## Keywords using RAKE We will use the RAKE algorithm (A Python implementation of the Rapid Automatic Keyword Extraction (RAKE) algorithm as described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010). Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan (Eds.), Text Mining: Theory ...
github_jupyter
# <div style="text-align: center"> Santander ML Explainability </div> ### <div style="text-align: center">CLEAR DATA. MADE MODEL. </div> <img src='https://galeria.bankier.pl/p/b/5/215103d7ace468-645-387-261-168-1786-1072.jpg' width=600 height=600> <div style="text-align:center"> last update: <b> 10/03/2019</b></...
github_jupyter
``` import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline import numpy as np import pickle simulated = pd.read_csv('../fitness_model/simulation/simulated_freqs.csv', index_col=0) colors = pickle.load(open('../figures/colors.p', 'rb')) sns.set(style='whitegrid', font_scale=1.2) # ...
github_jupyter
``` %matplotlib inline import pyvisa import numpy as np from pylabnet.utils.logging.logger import LogClient import pylabnet.hardware.spectrum_analyzer.agilent_e4405B as sa from pylabnet.network.client_server.agilent_e4405B import Client import matplotlib.pyplot as plt ``` # Instantiate and Connect Client ``` sa_clie...
github_jupyter