text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
# Erasmus+ ICCT project (2018-1-SI01-KA203-047081)
# Hide the code completely
from IPython.display import HTML
tag = HTML('''<style>div.input{display:none;}</style>''')
display(tag)
```
<table>
<td style="width:140px; height:140px"><img src='examples/02/img/logo-ICCT.PNG'></td>
</table>
<center><h1>Interakt... | github_jupyter |
# MagPySV example workflow - high latitude observatories
# Setup
```
# Setup python paths and import some modules
from IPython.display import Image
import sys
import os
import datetime as dt
import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
# Impo... | github_jupyter |
```
%reload_ext autoreload
%autoreload 2
from fastai.basics import *
```
# Rossmann
## Data preparation / Feature engineering
In addition to the provided data, we will be using external datasets put together by participants in the Kaggle competition. You can download all of them [here](http://files.fast.ai/part2/les... | github_jupyter |
# Introduction to the jupyter notebook
**Authors**: Thierry D.G.A Mondeel, Stefania Astrologo, Ewelina Weglarz-Tomczak & Hans V. Westerhoff <br/>
University of Amsterdam <br/>
2016 - 2019
**Acknowledgements:** This material is heavily based on [Learning IPython for Interactive Computing and Data Visualization, second... | github_jupyter |
Neuromorphic engineering I
## Lab 8: Silicon Synaptic Circuits
Team member 1: Jan Hohenheim
Team member 2: Maxim Gärtner
Date:
----------------------------------------------------------------------------------------------------------------------
This week, we will see how synaptic circuits generate currents when ... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_12_01_ai_gym.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# T81-558: Applications of Deep Neural Networks
**Module 12: Reinforcement Lear... | github_jupyter |
# Using Python and NumPy more efficiently
As with any programming language, there are more efficient and less efficient ways to write code that has the same functional behavior. In Python, it can be particularly jarring that `for` loops have a relatively high per-loop cost. For simple `for` loops, there can be alter... | github_jupyter |
# Bias, variance, K-fold cross validation and Leaning curves
This notebook explores the relationship between the number of K folds, the bias, variance and learning curve for a simple toy data set. The code in python was used to generate the plots and simulations used for the following stats.stackexchange post
- https... | github_jupyter |
# Python
Kevin J. Walchko
created 16 Nov 2017
----
Here we will use python as our programming language. Python, like any other language, is really vast and complex. We will just cover the basics we need.
## Objectives
- Understand
- general syntax
- for/while loops
- if/elif/else
- functions
- data type... | github_jupyter |
# GDL - Steerable CNNs
**Filled notebook:**
[](https://github.com/phlippe/uvadlc_notebooks/blob/master/docs/tutorial_notebooks/DL2/Geometric_deep_learning/tutorial2_steerable_cnns.ipynb)
[![Open In... | github_jupyter |
### What is Jupyter Notebooks?
Jupyter is a web-based interactive development environment that supports multiple programming languages, however most commonly used with the Python programming language.
The interactive environment that Jupyter provides enables students, scientists, and researchers to create reproducibl... | github_jupyter |
```
import pandas as pd
import numpy as np
import math
from IPython.display import display
from bokeh.io import show, output_notebook
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool, ranges
output_notebook()
def readtrace(infile):
ret = {}
name = None
cols = None
t... | github_jupyter |
```
import collections
import numpy as np
import pickle
experiments = ['BM25', 'PACRR', 'MP', 'KNRM', 'ConvKNRM'
]
metrics = ['RaB', 'ARaB']
methods = ['tf', 'bool']
qry_bias_paths = {}
for metric in metrics:
qry_bias_paths[metric] = {}
for exp_name in experiments:
qry_bias_paths[metri... | github_jupyter |
```
import sys
from pathlib import Path
curr_path = str(Path().absolute())
parent_path = str(Path().absolute().parent)
sys.path.append(parent_path) # 添加路径到系统路径
import gym
import torch
import math
import datetime
import numpy as np
from collections import defaultdict
from envs.gridworld_env import CliffWalkingWapper
fr... | github_jupyter |
## Multi-Fidelity BO with Discrete Fidelities using KG
In this tutorial, we show how to do multi-fidelity BO with discrete fidelities based on [1], where each fidelity is a different "information source." This tutorial uses the same setup as the [continuous multi-fidelity BO tutorial](https://botorch.org/tutorials/mul... | github_jupyter |
___
<a href='https://www.prosperousheart.com/'> <img src='files/learn to code online.png' /></a>
___
DataFrames are the true workhorse of pandas. You'll learn more here.
The DataFrame has the following input options:
- data
- index
- columns
- dtype
- copy
Learn more about these options <a href="https://pandas.pyda... | github_jupyter |
# Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural network that performs sentiment analysis.
>Using an RNN rather than a strictly feedforward network is more accurate since we can include information about the *sequence* of words.
Here we'll use a dataset of movie reviews, accomp... | github_jupyter |
```
import pandas as pd
import librosa
import numpy as np
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score
import IPython.display as ipd
import matplotlib.pyplot as plt
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import shuffle
# Imp... | github_jupyter |
# Supervised Learning - Linear Regression
Do you remember the recipe for Machine Learning? Let me remind you once again!
* Define Problem : We start by defining the problem we are trying to solve. This can be as simple as prediction of your next semester's result based on your previous results.
* Collect Data : Next ... | github_jupyter |
# Clustered Multitask GP (w/ Pyro/GPyTorch High-Level Interface)
## Introduction
In this example, we use the Pyro integration for a GP model with additional latent variables.
We are modelling a multitask GP in this example. Rather than assuming a linear correlation among the different tasks, we assume that there is... | github_jupyter |
```
import pandas as pd
from sklearn.model_selection import train_test_split, cross_validate, StratifiedKFold, cross_val_predict
from sklearn.neural_network import MLPClassifier
from sklearn.dummy import DummyClassifier
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_curve
from... | github_jupyter |
```
import numpy as np
import libpysal as ps
from stwr.gwr import GWR, MGWR,STWR
from stwr.sel_bw import *
from stwr.utils import shift_colormap, truncate_colormap
import geopandas as gp
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import pyplot
import pandas as pd
import math
from matplo... | github_jupyter |
```
# Before scrap go there and put linkedin/robots.txt
# or type this in any website to get their resective rules for web scrapping
from bs4 import BeautifulSoup
# beautiful soup 4 for web scraping
# import lxml
with open("basic_+_class_selector_vs_tag_+_web.html", encoding="utf8") as file:
contents = file.read()... | github_jupyter |
# PyQtGraph
## Fast Online Plotting in Python
---------------------------------------------
"PyQtGraph is a pure-python graphics and GUI library built on PyQt4 / PySide and numpy. It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is ver... | github_jupyter |
<a id="title_ID"></a>
# Using Kepler Data to Plot a Light Curve
<br>This notebook tutorial demonstrates the process of loading and extracting information from Kepler light curve FITS files to plot a light curve and display the photometric aperture.
<img style="float: right;" src="./light_curve_tres2.png" alt="light_c... | github_jupyter |
# License
***
Copyright (C) 2017 J. Patrick Hall, jphall@gwu.edu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,... | github_jupyter |
# Add model: translation attention ecoder-decocer over the b4 dataset
```
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchtext import data
import pandas as pd
import unicodedata
import string
import re
import random
import copy
from contra_qa.plots.functions import simp... | github_jupyter |
```
from sklearn.neighbors import KNeighborsClassifier
from scipy.signal import resample
def squeeze_stretch(s,y,scale=1.1):
n_old =s.shape[0]
knn=KNeighborsClassifier(n_neighbors=3,weights='uniform')
if scale >=1:
n_new = scale * s.shape[0]
s_new = resample(s,int(n_new))
y_new = re... | github_jupyter |
The decimal module implements fixed and floating point arithmetic using the model familiar to most people, rather than the IEEE floating point version implemented by most computer hardware and familiar to programmers. A Decimal instance can represent any number exactly, round up or down, and apply a limit to the number... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
# Statistical Independence
The word “independence” generaly means free from external control or influence, but it also has a lot of connotations in US culture, as it probably does throughout the world. We will apply the concept of independence to many random phenomena, and the implication of independence is generally ... | github_jupyter |
# Locality Sensitive Hashing
Locality Sensitive Hashing (LSH) provides for a fast, efficient approximate nearest neighbor search. The algorithm scales well with respect to the number of data points as well as dimensions.
In this assignment, you will
* Implement the LSH algorithm for approximate nearest neighbor searc... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/gdrive')
```
## Download the image assets( FG, FG_MASK, BG) from drive
```
# Background Images
!cp -r /content/gdrive/My\ Drive/Assignment15/A/Input/bg /content/
# Foreground Images
!cp -r /content/gdrive/My\ Drive/Assignment15/A/Input/fg150 /content/
# Foreg... | github_jupyter |
```
import numpy as np
import pandas as pd
import patsy as pt
import seaborn as sns
import matplotlib.pyplot as plt
import statsmodels.formula.api as smf
import statsmodels.api as sm
from sklearn.preprocessing import PolynomialFeatures
from sklearn import linear_model
import warnings
warnings.filterwarnings('ignore')
`... | github_jupyter |
# Deploy a Trained TensorFlow V2 Model
In this notebook, we walk through the process of deploying a trained model to a SageMaker endpoint. If you recently ran [the notebook for training](get_started_mnist_deploy.ipynb) with %store% magic, the `model_data` can be restored. Otherwise, we retrieve the
model artifact fro... | github_jupyter |
# Robot Class
In this project, we'll be localizing a robot in a 2D grid world. The basis for simultaneous localization and mapping (SLAM) is to gather information from a robot's sensors and motions over time, and then use information about measurements and motion to re-construct a map of the world.
### Uncertainty
A... | github_jupyter |
<a href="https://colab.research.google.com/github/imiled/DeepLearningMaster/blob/master/Tensorflow_Utils.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!apt-get update > /dev/null 2>&1
!apt-get install cmake > /dev/null 2>&1
!pip install --upgr... | github_jupyter |
# Testing Code with pytest
In this lesson we will be going over some of the things we've learned so far about testing and demonstrate how to use pytest to expand your tests. We'll start by looking at some functions which have been provided for you, and then move on to testing them.
In your repo you should find a Pyth... | github_jupyter |
```
!pip install dask
import dask.array as da
a = da.arange(18,chunks=4)
a.compute()
a.chunks
a
import pandas as pd
%time temp = pd.read_csv('HR_comma_sep.csv')
import dask.dataframe as dd
%time df = dd.read_csv('HR_comma_sep.csv')
import dask.dataframe as dd
import pandas as pd
df = pd.DataFrame({'P':[10,20,30], 'Q':[... | github_jupyter |
```
import numpy as np
from numpy.random import normal, uniform
from scipy.stats import multivariate_normal as mv_norm
from collections import OrderedDict
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits import mplot3d
%matplotlib inline
```
## Functio... | github_jupyter |
## Dependencies
```
import os
import sys
import cv2
import shutil
import random
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from tensorflow import set_random_seed
from sklearn.utils import class_weight
from sklearn.model_selection import train_test_split... | github_jupyter |
# Building NMF Model Using Spruce Eats Data
I used the scraped and cleaned Spruce Eats data to build a recommender engine in this notebook. It loads the **se_df.pk** pickle data created in the **scrape_spruce_eats** notebook.
### Table of Contents
* [1. Imports and Functions](#sec1)
* [2. Load DataFrame From Pickle](#... | github_jupyter |
```
# default_exp callback.PredictionDynamics
```
# PredictionDynamics
> Callback used to visualize model predictions during training.
This is an implementation created by Ignacio Oguiza (timeseriesAI@gmail.com) based on a [blog post](http://localhost:8888/?token=83bca9180c34e1c8991886445942499ee8c1e003bc0491d0) by ... | github_jupyter |
```
import os
rutaBase = os.getcwd().replace('\\', '/') + '/'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
rutaMETEO = 'F:/OneDrive - Universidad de Cantabria/Series/AEMET/2016_pet080_UNICAN/data/Precipitacion/'
METEO = pd.read_csv(rutaMETEO + 'pcp_1950.csv', pa... | github_jupyter |
```
import re
import numpy as np
import pandas as pd
import collections
from sklearn import metrics
from sklearn.preprocessing import LabelEncoder
import tensorflow as tf
from sklearn.cross_validation import train_test_split
from unidecode import unidecode
from nltk.util import ngrams
from tqdm import tqdm
import time
... | github_jupyter |
```
import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
import numpy as np
import os
types_names = {90:'Ia', 67: '91bg', 52:'Iax', 42:'II', 62:'Ibc',
95: 'SLSN', 15:'TDE', 64:'KN', 88:'AGN', 92:'RRL', 65:'M-dwarf',
16:'EB',53:'Mira', 6:'MicroL', 991:'MicroLB', 992:'IL... | github_jupyter |
# [Code Hello World](https://academy.dqlab.id/main/livecode/45/110/524)
```
print(10*2+5)
print("Academy DQLab")
```
# [Melakukan Comment Pada Python](https://academy.dqlab.id/main/livecode/45/110/525)
```
print(10*2+5) #fungsi matematika
print("Academy DQLab") #fungsi mencetak kalimat
```
# [Printing Data Type](ht... | github_jupyter |
```
import random
from collections import Counter
import numpy as np
from googletrans import Translator
from nltk.tokenize import word_tokenize
import codecs
hm_lines = 5000000
translator = Translator()
stopwords = codecs.open("hindi_stopwords.txt", "r", encoding='utf-8', errors='ignore').read().split('\n')
def create... | github_jupyter |
## 开发环境搭建
### Anaconda
Anaconda是用于大规模数据处理、预测分析和科学计算的 Python和R编程语言的免费平台,旨在简化包管理和部署。
它集成了很多用 于数据处理和科学计算的第三方库,使得我们不用额外再去安装。同 时,Anaconda提供了强大的安装包管理功能。
Anaconda官网(https://www.anaconda.com/download) 下载对应版本的安装文件
### Anaconda navigator

### TIPS:
... | github_jupyter |
## Plotting of profile results
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# common
import os
import os.path as op
# pip
import numpy as np
import pandas as pd
import xarray as xr
import matplotlib.pyplot as plt
from matplotlib import gridspec
# DEV: override installed teslakit
import sys
sys.path.insert(0, o... | github_jupyter |
```
# reload packages
%load_ext autoreload
%autoreload 2
```
### Choose GPU (this may not be needed on your computer)
```
%env CUDA_DEVICE_ORDER=PCI_BUS_ID
%env CUDA_VISIBLE_DEVICES=0
import tensorflow as tf
gpu_devices = tf.config.experimental.list_physical_devices('GPU')
if len(gpu_devices)>0:
tf.config.experim... | github_jupyter |
# High-Performance Pandas: eval() and query()
As we've already seen in previous sections, the power of the PyData stack is built upon the ability of NumPy and Pandas to push basic operations into C via an intuitive syntax: examples are vectorized/broadcasted operations in NumPy, and grouping-type operations in Pandas.... | github_jupyter |
# Visualization: Trading Session
```
import pandas as pd
import numpy as np
import altair as alt
import seaborn as sns
```
### 1. Define parameters and Load model
```
from trading_bot.agent import Agent
model_name = 'model_GOOG_50'
test_stock = 'data/GOOG_2019.csv'
window_size = 10
debug = True
agent = Agent(wind... | github_jupyter |
```
cc.VerificationHandler.close_browser()
```
## Time to crack in and find some more mother elements
#### Dont let complexity ruin tempo
```
% run contactsScraper.py
orgsForToday = ['National Association for Multi-Ethnicity In Communications (NAMIC)',
'Association for Women in Science',
... | github_jupyter |
# Lesson 1.2:
# Introduction to GridAPPS-D
This tutorial provides a first look at the GridAPPS-D Platform and ecosystem for data integration and accelerated application development
__Learning Objectives:__
At the end of the tutorial, the user should be able to
* Explain some advantages of application development us... | github_jupyter |
# 关于 GDAL 库的补充
栅格数据处理一个很重要的基础库就是 GDAL,有不少现有程序是直接依据该库写的,所以有必要补充了解下其基本内容,官方资料稍微有些晦涩,然而更简易的资料还比较少,能找到的相对较好地如下所示。
参考资料:
- [Python GDAL课程笔记](https://www.osgeo.cn/python_gdal_utah_tutorial/)
- [Geoprocessing with Python using Open Source GIS](https://www.gis.usu.edu/~chrisg/python/2009/)
- [Python GDAL/OGR Cookbook](https... | github_jupyter |
```
import os
import wandb
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=2., style='whitegrid')
def get_metrics(sweep_id, keys=None, config_keys=None):
api = wandb.Api()
sweep = api.sweep(sweep_id)
if isinstance(keys, list):
keys.extend(['_runtime', '_step', '_... | 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 |
A notebook to demonstrate the use of the analysis functions for lda dictionaries
```
original_dict_file = '/Users/simon/Dropbox/BioResearch/Meta_clustering/KRD/mzml sylvia/molnet130918/carnegie_lda.dict'
```
Load the dictionary
```
import pickle
with open(original_dict_file,'r') as f:
lda_dict = pickle.loads(f.r... | github_jupyter |
<a href="https://colab.research.google.com/github/thatgeeman/pybx/blob/master/nbs/pybx_walkthrough.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
>⚠ Note: walkthrough for v0.1.3 ⚠
>
>run `! pip freeze | grep pybx` to see the installed version.
# P... | github_jupyter |
# Code for capsule_layers.py
```
"""
Some key layers used for constructing a Capsule Network. These layers can used to construct CapsNet on other dataset,
not just MNIST.
*NOTE*: Some functions may be implemented in multiple ways, I keep all of them. You can try them for youself just by
uncommenting them and commentin... | github_jupyter |
# Link Prediction
Build a GNN to predict links in a citation graph of academic papers.
The citation graph we will use for training this GNN is the [CORA Dataset](https://relational.fit.cvut.cz/dataset/CORA) available from the `torch_geometric.datasets.Planetoid` package.
## Setup
The following two cells import Pyto... | github_jupyter |
```
checkpoint = "/home/pzhu/data/qa/squad2_model"
predict_file = "data/squad2/dev-v2.0.json"
device = "cuda:0"
from pytorch_transformers import XLNetForQuestionAnswering
model = XLNetForQuestionAnswering.from_pretrained(checkpoint)
model.to(device)
model.eval()
print("loaded")
from xlnet_qa.squad2_reader import SQuAD2... | github_jupyter |
```
import pandas as pd
import numpy as np
import tensorflow as tf
from sklearn.model_selection import train_test_split
from sklearn.model_selection import train_test_split
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.utils import to_categorical
from tensorflow.keras import ... | github_jupyter |
# Matrix and compartive statistics review
The following notebook is a review of matrices and comparative statistics with examples in python.
The equations and examples are from the following book I highly recommend using to brush up on mathamtics commonly used in economics coursework:
- Dowling, E. T. (2012). Introdu... | github_jupyter |
# HiddenLayer Graph Demo - TensorFlow
```
import os
import tensorflow as tf
import tensorflow.contrib.slim.nets as nets
import hiddenlayer as hl
import hiddenlayer.transforms as ht
# Hide GPUs. Not needed for this demo.
os.environ["CUDA_VISIBLE_DEVICES"] = ""
```
## VGG 16
```
with tf.Session() as sess:
with tf... | github_jupyter |
# Overlap matrices
This notebook will look at different ways of plotting overlap matrices and making them visually appealing.
One way to guarantee right color choices for color blind poeple is using this tool: https://davidmathlogic.com/colorblind
```
%pylab inline
import pandas as pd
import seaborn as sbn
sbn.set_st... | github_jupyter |
```
!git clone 'https://github.com/kevincong95/cs231n-emotiw.git'
# Switch to TF 1.x and navigate to the directory
%tensorflow_version 1.x
!pwd
import os
os.chdir('cs231n-emotiw')
!pwd
# Install required packages
!pip install -r 'requirements.txt'
cp '/content/drive/My Drive/Machine-Learning-Projects/cs231n-project/d... | github_jupyter |
# MixedStream objects and thermodynamic equilibrium
MixedStream is an extention of [Stream](https://biosteam.readthedocs.io/en/latest/Stream.html) with 's' (solid), 'l' (liquid), 'L' (LIQUID), and 'g' (gas) flow rates. The upper case 'LIQUID' denotes that it is a distinct phase from 'liquid'.
### Create MixedStream O... | github_jupyter |
```
import random
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn
import torch,torchvision
from torch.nn import *
from torch.optim import *
# Model Eval
from sklearn.compose import make_column_transformer
from sklearn.model_selection import GridSearchCV
from ... | github_jupyter |
## Writing Reviews to Postgres from CSV
```
import csv
from time import time
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, Integer, JSON, String, Text, text, Date
# from models import Review
from cred... | github_jupyter |
```
import numpy as np
import pandas as pd
import tensorflow as tf
import pickle
```
## Data Preprocessing
```
# Loading formatted data
# I use format the data into pd dataframe
# See data_formatting.ipynb for details
train_data = pd.read_pickle("../dataset/train.pickle")
validate_data = pd.read_pickle("../dataset/v... | github_jupyter |
[](https://colab.research.google.com/github/Rishit-dagli/Android-Stream-Day-2020/blob/master/Rock_Paper_Scissors.ipynb)
# Rock Paper Scissors with TF Model Maker
Model Maker library simplifies the process of adapting and converting a TensorFlow... | github_jupyter |
**PROBLEM STATEMENT**
<br/>Predict the Survival of people from Titanic based on the gender, class, age etc.
<br/>Get Sample data from Source- https://data.world/nrippner/titanic-disaster-dataset
<br/>
<br/>**COLUMN DEFINITION**
<br/>survival - Survival (0 = No; 1 = Yes)
<br/>class - Passenger Class (1 = 1st; 2 = 2nd; 3... | github_jupyter |
<a href="https://colab.research.google.com/github/pg1992/IA025_2022S1/blob/main/ex05/pedro_moreira/solution.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
nome = "Pedro Guilherme Siqueira Moreira"
print(f'Meu nome é {nome}')
```
Este exercicío... | github_jupyter |
```
import numpy as np
import pandas as pd
import scanpy as sc
import perturbseq as perturb
sc.logging.print_versions()
```
Annotate perturbations
==
Input:
- scanpy object with gene expression
- cell2guide file:
- file annotating which guide is present in each cell. binary with 0 when the guide is absent and 1 ... | github_jupyter |
<a href="https://colab.research.google.com/github/BrittonWinterrose/DS-Unit-1-Sprint-4-Statistical-Tests-and-Experiments/blob/master/Drug_Data_NLP_notebook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Concrete solutions to real problems
## An N... | github_jupyter |
# Deep Neural Network for Image Classification: Application
When you finish this, you will have finished the last programming assignment of Week 4, and also the last programming assignment of this course!
You will use use the functions you'd implemented in the previous assignment to build a deep network, and apply i... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import os
import sys
import pandas as pd
sys.path.append('..')
from data.utils import tables
from data import cro_dataset
df_master.groupby("year").count()
```
# Initial Data descriptive table - All reports
```
df_master = pd.read_csv("/Users/david/Nextcloud/Dokumente/Educatio... | github_jupyter |
# Ray RLlib - Introduction to Reinforcement Learning
© 2019-2021, Anyscale. All Rights Reserved

_Reinforcement Learning_ is the category of machine learning that focuses on training one or more _agents_ to achieve maximal _rewards_ while operating in an environm... | github_jupyter |
```
import numpy as np
import pandas as pd
DATA_DIR = '/home/ubuntu/data/patterns'
TMP_DATA_DIR = '../../data'
brands = pd.read_csv(f'{DATA_DIR}/brand_info.csv')
brands.head()
brands.top_category.value_counts().iloc[:20]
```
### May 2021 data for trial workflow
```
tmp_outfile = f'{TMP_DATA_DIR}/cleaned_202105.csv'
`... | github_jupyter |
# Prediction: Beyond Simple Random Walks
The tracking algorithm, at its simplest level, takes each particle in the previous frame and tries to find it in the current frame. This requires knowing where to look for it; if we find an actual particle near that spot, it's probably a match. The basic algorithm (Crocker & Gr... | github_jupyter |
# Least Squares
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by/4.0/80x15.png" /></a><br />This notebook by Xiaozhou Li is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4... | github_jupyter |
# Predicting reaction performance in C–N cross-coupling using machine learning
DOI: 10.1126/science.aar5169
Ahneman, D. T.; Estrada, J. G.; Lin, S.; Dreher, S. D.; Doyle, A. G. *Science*, **2018**, *360*, 186-190.
Import schema and helper functions
```
import ord_schema
from datetime import datetime
from ord_schema... | github_jupyter |
```
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torchvision import transforms, datasets, models
import numpy as np
import matplotlib.pyplot as plt
from torch.autograd import Variable
from collections import namedtuple
from IPython.display import Image
%matplotlib inline
np... | github_jupyter |
# Investigating the effect of Company Announcements on their Share Price following COVID-19 (using the S&P 500)
A lot of company valuation speculation has come about since the C0rona-VIrus-Disease-2019 (COVID-19 or COVID for short) started to impact the stock market (estimated on the 20$^{\text{th}}$ of February 2020,... | github_jupyter |
# Neural Network for Hadronic Top Reconstruction
This file creates a feed-forward binary classification neural network for hadronic top reconstruction by classifying quark jet triplets as being from a top quark or not.
```
from __future__ import print_function, division
import pandas as pd
import numpy as np
import to... | github_jupyter |
# A brief, basic introduction to Python for scientific computing - Chapter 3
## Background/prerequisites
This is part of a brief introduction to Python; please find links to the other chapters and authorship information [here](https://github.com/MobleyLab/drug-computing/blob/master/other-materials/python-intro/README.... | github_jupyter |
# Regularization
Welcome to the second assignment of this week. Deep Learning models have so much flexibility and capacity that **overfitting can be a serious problem**, if the training dataset is not big enough. Sure it does well on the training set, but the learned network **doesn't generalize to new examples** that... | github_jupyter |
# Predictive performance comparison
The idea of this notebook is to take a look at the predictive performance on cell lines for all the drugs. The idea is two-fold:
<ul>
<li> Assessing that the source top PVs can yield same predictive performance as a direct ridge on the source data. It would mean that the top PVs ... | github_jupyter |
<a href="https://colab.research.google.com/github/vgaurav3011/100-Days-of-ML/blob/master/DCGAN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow a... | github_jupyter |
# Python Guide
## Loading Data
The XGBoost python module is able to load data from:
- LibSVM text format file
- Comma-separated values (CSV) file
- NumPy 2D array
- SciPy 2D sparse array
- cuDF DataFrame
- Pandas data frame, and
- XGBoost binary buffer file.
### Loading LibSVM text file
```
dtrain = xgb.DMat... | github_jupyter |
# Setup Machine
```
# @markdown ## Install python 3
!env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq python3 python3-dev python3-venv python3-pip > /dev/null
!python --version
# @markdown ## Upgrade pip
!python -m pip install -qq --upgrade pip
!pip --version
# @markdown ## Install dependencies
!pip install -... | github_jupyter |
# Contour Plots
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(0)
def f(x, y):
return x**2 + y**2
x = np.arange(-5, 5.0, 0.25)
y = np.arange(-5, 5.0, 0.25)
print(x[:10])
print(y[:10])
```
### Meshgrid
```python
np.meshgrid(
*xi,
copy=True,
sparse=False,
... | github_jupyter |
# ThreadBuffer Performance
This notebook demonstrates the use of `ThreadBuffer` to generate batches of data asynchronously from the training thread.
Under certain circumstances the main thread can be busy with the training operations, that is interacting with GPU memory and invoking CUDA operations, which is indepen... | github_jupyter |
# Analyze a large dataset with Google BigQuery
**Learning Objectives**
In this lab, you use BigQuery to:
- Access an ecommerce dataset
- Look at the dataset metadata
- Remove duplicate entries
- Write and execute queries
___
## Introduction
BigQuery is Google's fully managed, NoOps, low cost analytics database. Wit... | github_jupyter |
# Papermill
Link and material:
- https://papermill.readthedocs.io/en/latest/
- https://towardsdatascience.com/introduction-to-papermill-2c61f66bea30
- https://medium.com/capital-fund-management/automated-reports-with-jupyter-notebooks-using-jupytext-and-papermill-619e60c37330
- https://medium.com/ai³-theory-practice-b... | github_jupyter |
# 4 - Hybdrid Absorbing Boundary Condition (HABC)
# 4.1 - Introduction
In this notebook we describe absorbing boundary conditions and their use combined with the *Hybdrid Absorbing Boundary Condition* (*HABC*). The common points to the previous notebooks <a href="01_introduction.ipynb">Introduction to Acoustic Proble... | github_jupyter |
### Convert 9 bands CRs to 5 bands
```
#==========================================
# Gain to compression ratio (CR) conversion
# Author: Nasim Alamdari
# Date: Dec. 2020
#==========================================
import numpy as np
# Example:
# Audiogram = [10, 10, 20,20,25,30,35,40,40]
# Soft gains = [4.0, 3... | github_jupyter |
# TV Script Generation
In this project, you'll generate your own [Seinfeld](https://en.wikipedia.org/wiki/Seinfeld) TV scripts using RNNs. You'll be using part of the [Seinfeld dataset](https://www.kaggle.com/thec03u5/seinfeld-chronicles#scripts.csv) of scripts from 9 seasons. The Neural Network you'll build will ge... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.