text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# This is a notebook implementing Danish BERT for NER classification on the DaNE dataset
```
# Loading packages
## Standard packages
import os
import math
import pandas as pd
import numpy as np
## pyTorch
import torch
import torch.nn.functional as F
from torch import nn
from torch.optim import Adam
from torch.util... | github_jupyter |
```
import torch
from torch.autograd import grad
import torch.nn as nn
from numpy import genfromtxt
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.nn.functional as F
sidr_data = genfromtxt('covid_100_pts.csv', delimiter=',') #in the form of [t,S,I,D,R]
torch.manual_seed(1234)
%%time
PATH = ... | github_jupyter |
# Introduction to F# #
F# is an [open-source, cross-platform functional programming language](http://aka.ms/fsharphome) for .NET.
F# has features and idioms to support functional programming while also offering clean interop with C# and existing .NET codebases and systems. It can use anything in the [NuGet](https://w... | github_jupyter |
# Tutorial about drift analysis and correction
Lateral drift correction is useful in most SMLM experiments. To determine the amount of drift a method based on image cross-correlation or an iterative closest point algorithm can be applied.
We demonstrate drift analysis and correction on simulated data.
```
from pathl... | github_jupyter |
# Solutions to the Julia Set Exercises
1: Write down as many questions as you can about material from this section.
What is the _dimension_ of the boundary of the Newton fractal for $z^3-1$? How do you compute a dimension of a boundary, anyway? Which colouring scheme gives the most pleasing results? (We think the sc... | 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 |
# Simon's Algorithm
In this section, we first introduce the Simon problem, and classical and quantum algorithms to solve it. We then implement the quantum algorithm using Qiskit, and run on a simulator and device.
## Contents
1. [Introduction](#introduction)
1.1 [Simon's Problem](#problem)
1.2 [Simon... | github_jupyter |
# Introduction
This notebook provides everything you need to use the swap test to approximate a quantum state. After the necessary functions are introduced, you're encouraged to modify target state and optimizer parameters to observe performance. I'll try to provide some reasoning for my code choices throughout.
# Ge... | github_jupyter |
# 创建张量的快捷函数
- 除了使用Tensor构造器创建Tensor对象外,PyTorch还提供了更加方便快捷的工厂函数方式。
- 这些函数都是根据Tensor构造器封装的,并设置个性化的属性,比如:requires_grad属性;
## tensor函数
- 使用数据data直接构造张量,可以指定类型dtype与设备device,是否进行求导运算requires_grad,指定内存方式pin_memory;
```python
tensor(data, dtype=None, device=None, requires_grad=False, pin_memory=False) -> Tensor
```... | github_jupyter |
```
%matplotlib inline
from galaxy_analysis.plot.plot_styles import *
import matplotlib.pyplot as plt
from galaxy_analysis.analysis import Galaxy
import numpy as np
import yt
from galaxy_analysis.utilities import convert_abundances
#gal = Galaxy('DD0559', wdir = '/home/emerick/work/enzo_runs/pleiades/starIC/run11_30km_... | github_jupyter |
#### *Copyright 2021 The Cirq Developers*
```
#@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 agr... | github_jupyter |
# 量子金融应用:最佳套利机会
<em> Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved. </em>
## 概览
当前量子计算应用到金融问题上的解决方案通常可分为三类量子算法,即量子模拟,量子优化以及量子机器学习 [1,2]。许多的金融问题本质上是一个组合优化问题,解决这些问题的算法通常具有较高的时间复杂度,实现难度较大。得益于量子计算强大的计算性能,未来有望通过量子算法解决这些复杂问题。
量桨的 Quantum Finance 模块主要讨论的是量子优化部分的内容,即如何通过一些量子算法解决实际金融应用中的... | github_jupyter |
<center>
<a href="https://github.com/kamu-data/kamu-cli">
<img alt="kamu" src="https://raw.githubusercontent.com/kamu-data/kamu-cli/master/docs/readme_files/kamu_logo.png" width=270/>
</a>
</center>
<br/>
<center><i>World's first decentralized real-time data warehouse, on your laptop</i></center>
<br/>
<div align="... | github_jupyter |
# 11. Semantics 1: words

### 11.1 [What is (computational) semantics?](#11.1)
### 11.2 [Word meaning](#11.2)
### 11.3 [Lexical relationships: synonymy, homonymy, hypernymy](#11.3)
### 11.4 [Lexical ontologies](#11.4)
### 11.5 [Semantic similarity](#11.5)
# 11.1 What is (computational) s... | github_jupyter |
<a href="https://colab.research.google.com/github/gmxavier/TEP-meets-LSTM/blob/master/tep-meets-lstm.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Step 0 - Setup and helper functions
```
# Setup
# NOTE: Uncomment the lines bellow in order to ... | github_jupyter |
<h1><center>Introduction to Computational Neuroscience</center></h1>
<h1><center> Practice II: Data Analysis </center></h1>
<center>Aqeel Labash, Daniel Majoral, Raul Vicente</center>
### Important:
Make sure that you saved your ipynb file correctly to avoid loss of information. Please submit this **ipynb** file only ... | github_jupyter |
<center><h1> Predict heart failure with Watson Machine Learning</h1></center>

<p>This notebook contains steps and code to create a predictive model to predict heart failure and then deploy that model to Watson Machine Learning so it can be ... | github_jupyter |
# Particle-Field interaction example
This notebook illustrates a simple way to make particles interact with a ``` Field``` object and modify it. The ``` Field``` will thus change at each step of the simulation, and will be written using the same time resolution as the particle outputs, in as many ```netCDF``` files.
... | github_jupyter |
```
%matplotlib inline
```
# Image tutorial
A short tutorial on plotting images with Matplotlib.
Startup commands
===================
First, let's start IPython. It is a most excellent enhancement to the
standard Python prompt, and it ties in especially well with
Matplotlib. Start IPython either directly at a ... | github_jupyter |
# Handling categorical variables with KernelSHAP
<div class="alert alert-info">
To enable SHAP support, you may need to run
```bash
pip install alibi[shap]
```
</div>
## Introduction
In this example, we show how the KernelSHAP method can be used for tabular data, which contains both numerical (continuous) and ... | github_jupyter |
<a href="https://cognitiveclass.ai"><img src = "https://ibm.box.com/shared/static/9gegpsmnsoo25ikkbl4qzlvlyjbgxs5x.png" width = 400> </a>
<h1 align=center><font size = 5>Generating Maps with Python</font></h1>
## Introduction
In this lab, we will learn how to create maps for different objectives. To do that, we will... | github_jupyter |
## Training our own embeddings
In this notebook we will train our own text embeddings and subsequently put them through evaluation using code we wrote in the earlier notebooks.
To train our embeddings let us use [fastai](https://github.com/fastai/fastai).
I looked for the Google News corpus dataset, the one that wor... | github_jupyter |
# Sanitation Data
This notebook was loaded with:
```bash
PYSPARK_DRIVER_PYTHON=jupyter PYSPARK_DRIVER_PYTHON_OPTS=notebook ./dse/bin/dse pyspark --num-executors 5 --driver-memory 6g --executor-memory 6g
```
The general plan is to do some exploration and cleaning in jupyter notebooks, then run our actual models by su... | github_jupyter |
# Build and Train
Now we're ready to begin building our sentiment classifier and begin training. We will be building out what is essentially a *frame* around Bert, that will allow us to perform language classification. First, we can initialize the Bert model, which we will load as a pretrained model from transformers.... | github_jupyter |
This notebook shows a sample workflow for running hydrology simulations using the GSSHA rectangularly gridded simulator, supported by a suite of primarily open-source Python libraries. The workflow consists of:
1. Selecting parameters using widgets in a Jupyter notebook to control the model to simulate, including a w... | github_jupyter |
```
!pip install -q torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cu111.html
!pip install -q torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu111.html
!pip install -q git+https://github.com/pyg-team/pytorch_geometric.git
!git clone https://github.com/MarioniLab/sagenet
%cd sagenet
!pip install .
impor... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_04_1_feature_encode.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 4: Training for... | github_jupyter |
<font size="+5">#01 | Basic Elements of Programming</font>
- <ins>Python</ins> + <ins>Data Science</ins> Tutorials in [YouTube ↗︎](https://www.youtube.com/c/PythonResolver)
# The Registry (aka the `environment`)
> - Type `your name` and execute ↓
```
jesus
```
> - Type `sum` and execute ↓
```
len
sum
```
> - [ ]... | github_jupyter |
<div style="text-align: center;" ><a href="https://www.atoti.io/?utm_source=gallery&utm_content=multidimensional" target="_blank" rel="noopener noreferrer"><img src="https://data.atoti.io/notebooks/multidimension/img/atoti-banner-v3.jpg" width = 70%></a></div>
# Multidimensional analysis allows users to observe data f... | 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 |
# scsRPA 的频域与绝热耦合系数积分实现
> 创建日期:2020-08-24
这篇文档中,我们会回顾 scsRPA 的实现过程 Zhang, Xu [^Zhang-Xu.JPCL.2019.10]。对于其理论推导,我们基本不作的讨论。
我们会大量使用 [前一篇文档](dRPA_Comprehense.ipynb) 的结论与程序。但需要注意,这篇文档中,我们所使用的参考态是 PBE0 而非 PBE,并且分子会选用开壳层分子。
```
%matplotlib notebook
from pyscf import gto, dft, scf, cc, mcscf, df
import numpy as np
import ... | github_jupyter |
## Python and Jupyter notebooks
Python is a programming language where you don't need to compile. You can just run it line by line (which is how we can use it in a notebook). So if you are quite new to programming, Python is a great place to start. The current version is Python 3, which is what we'll be using here.
O... | github_jupyter |
```
from shared_notebook_utils import *
from scipy.stats import gaussian_kde
from sklearn import svm, cross_validation, tree
from sklearn.externals import joblib
from sklearn.externals.six import StringIO
seaborn.set(style="whitegrid")
%matplotlib inline
datasets = load_datasets(dirnames=None, clean=True)
METHOD = 'Per... | github_jupyter |
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.
# Train a linear regression model
In this notebook, we are going to use the tensor module from PySINGA to train a linear regression model. We use this example to illustr... | github_jupyter |
# Bokeh
<a href="https://colab.research.google.com/github/jdhp-docs/notebooks/blob/master/python_bokeh_en.ipynb"><img align="left" src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" title="Open and Execute in Google Colaboratory"></a>
<a href="https://mybinder.org/v2/gh/jdhp-docs/noteb... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import functools
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.svm import SVC
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn import preprocessing
from sklearn.linear... | github_jupyter |
<img src="images/usm.jpg" width="480" height="240" align="left"/>
# MAT281 - Laboratorios N°01
## Objetivos del laboratorio
* Reforzar conceptos básicos de regresión lineal.
## Contenidos
* [Problema 01](#p1)
<a id='p1'></a>
## I.- Problema 01
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/... | github_jupyter |
# Intro to SML
This is based on the notebook file [01 in Aurélien Geron's github page](https://github.com/ageron/handson-ml)
```
# Import the necessary packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
# Where to save the figures
PROJECT_ROOT_D... | github_jupyter |
# Table: Retrieved Documents per query
```
from trectools import TrecRun
import pandas as pd
from tqdm import tqdm
from glob import glob
RUN_DIR='/mnt/ceph/storage/data-in-progress/data-teaching/theses/wstud-thesis-probst/retrievalExperiments/runs-ecir22/runs-retrieval-homogenity/'
topics = {int(i.split()[0]): i.split... | github_jupyter |
Boundary Value Problem
======================
```
import torch
import os
import pytorch_lightning as pl
import torchphysics as tp
os.environ["CUDA_VISIBLE_DEVICES"] = "0" # select GPUs to use
torch.cuda.is_available()
# First define all parameters:
L = 1 # length of domain
u_m = 3.5 #m/s
beta = 2.2e-08 # m^2/N
nu0 = ... | github_jupyter |
# STIPS Advanced Usage Example
This notebook will demonstrate a number of ways of modifying STIPS observations. It assumes that you already have STIPS installed, and that you are able to create and run basic STIPS observations. If not, the STIPS Tutorial notebook is a recommended starting point. This notebook includes... | github_jupyter |
#### SageMaker Pipelines Lambda Step and Hugging Face
This notebook demonstrates how to use [SageMaker Pipelines](https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-sdk.html) to train and deploy a [Hugging Face](https://docs.aws.amazon.com/sagemaker/latest/dg/hugging-face.html) transformer using a Lambda functi... | github_jupyter |
# Sequence classification by multi-layered RNN with dropout
* Creating the **data pipeline** with `tf.data`
* Preprocessing word sequences (variable input sequence length) using `tf.keras.preprocessing`
* Using `tf.nn.embedding_lookup` for getting vector of tokens (eg. word, character)
* Creating the model as **Class*... | github_jupyter |
## Crypto Arbitrage
#### This application considers arbitrage opportunities in Bitcoin and other cryptocurrencies. As Bitcoin and other cryptocurrencies trade on markets across the globe, the Crypto Arbitrage application identifies arbitrage opportunities by sorting through historical trade data for Bitcoin on both Bi... | github_jupyter |

# Impute missing values
Azure ML Data Prep has the ability to impute missing values in specified columns. In this case, we will attempt to impute... | github_jupyter |
## Purpose: to render sketch gallery for paper figure
```
import os
import urllib, cStringIO
import pymongo as pm
import matplotlib
from matplotlib import pylab, mlab, pyplot
%matplotlib inline
from IPython.core.pylabtools import figsize, getfigs
plt = pyplot
import seaborn as sns
sns.set_context('poster')
sns.set_s... | github_jupyter |
```
from pycalphad import Database, variables as v
from pycalphad.variables import Species
dbf = Database('AlCoCrNi-2016Liu-minified.TDB')
import itertools
import string
import sympy
import numpy as np
def genericize(mapping, const_array):
new_array = []
for subl in const_array:
new_array.append(tuple... | github_jupyter |
```
%matplotlib inline
```
Speech Recognition with Wav2Vec2
================================
**Author**: `Moto Hira <moto@fb.com>`__
This tutorial shows how to perform speech recognition using using
pre-trained models from wav2vec 2.0
[`paper <https://arxiv.org/abs/2006.11477>`__].
Overview
--------
The process o... | github_jupyter |
## Logistic Regression
### When to use Logistic Regression ?
- Used for predicting classes or categories from the data.
- Its a common technique in classification prediciton problems.
- The Y variable / response variable always has to be a categorical variable
### Limitations of Linear Regression Model in Classifica... | github_jupyter |
## OSR test for case 1a - m3/h + outdoor temperature
> ### model performance is similar to Model 001. The inclusion of outdoor temperature does not increase the model performance above the effect of the m3/h in Model 001 and Modell 003.
apparently the outdoor temperature does not fit the MW usage. Potentially the o... | github_jupyter |
#Implementing K-Nearest Neighbors Algorithm using deepC
```
!pip install deepC
```
## Import deepC
```
#import necessary dependencies
import deepC.dnnc as dc
from sklearn.datasets import load_iris
import random
```
## KNN Algorithm
---
**Constructor:**
1. load iris dataset
1. Initialize variables
**Fit**
... | github_jupyter |
```
import re
import tarfile # tar压缩包出库
import os # 操作系统功能模块
import numpy as np
from bs4 import BeautifulSoup # 用于XML格式化处理
from sklearn.feature_extraction.text import HashingVectorizer # 文本转稀疏矩阵
from sklearn.naive_bayes import MultinomialNB # 贝叶斯分类器
from sklearn.metrics import accuracy_score # 分类评估指标
# 全角转半角
def ... | github_jupyter |
# Loading EEG data and plotting an ERP
Welcome to this IPython notebook. This page is a live interface to a running Python instance, where we create 'cells'. A cell is either some text (which can include images and formulas) or code, in which case we can execute that code by pressing `shift+enter`. See the [notebook d... | github_jupyter |
```
# The code was removed by Watson Studio for sharing.
```
## The Battle of the Neighborhoods - Week 2
### Part 4 Download and Explore Farmers Market dataset
#### Download all the dependencies needed
```
import numpy as np # library to handle data in a vectorized manner
import pandas as pd # library for data ana... | github_jupyter |
___
<a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>
___
<center><em>Copyright Pierian Data</em></center>
<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>
# NumPy Operations
## Arithmetic
You can easily perform *ar... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from load_utils import *
from analysis_utils import *
from collections import OrderedDict
sns.set(font_scale=2)
```
#... | github_jupyter |
<a href="https://colab.research.google.com/github/dd-open-source/ml-projects/blob/main/shell-ai-hackathon-weather-data/Level2/L2_ShellAI_Hackathon_2021_V1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Python modules used for the hackathon.
```
# ... | github_jupyter |
# 03 - Sentence Classification with BERT
**Status: Work in progress. Check back later.**
In this notebook, we will use pre-trained deep learning model to process some text. We will then use the output of that model to classify the text. The text is a list of sentences from film reviews. And we will calssify each sent... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
... | github_jupyter |
# Webscraping intro
## Scraping rules
- You should check a site's terms and conditions before you scrape them. It's their data and they likely have some rules to govern it.
- Be nice - A computer will send web requests much quicker than a user can. Make sure you space out your requests a bit so that you don't hammer t... | github_jupyter |
# Python для анализа данных
использован блокнот: *Алла Тамбовцева, НИУ ВШЭ*
дополнения +++ : *Ян Пиле, НИУ ВШЭ*
### Автоматизация работы в браузере: библиотека `selenium`
Библиотека `selenium` – набор инструментов для интерактивной работы в браузере средствами Python. Вообще Selenium ‒ это целый проект, в котором е... | github_jupyter |
```
row_keys = ["subj", "act"]
expected_keys = ["subj", "act", "score", "eta", "#ex"]
def get_value_from(row, metric):
if metric == 'seta':
return 0.5* (get_value_from(row, 'score') + get_value_from(row, 'eta'))
val = row[expected_keys.index(metric)]
#if metric == 'eta':
# convert eta from [... | github_jupyter |
```
import os
import sys
import yaml
import copy
import warnings
import importlib as imp
from datetime import datetime
warnings.simplefilter('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# import pcl
import pyntcloud
sys.path.append('/home/jovyan/work/')
with open('../config.yaml')... | github_jupyter |
##### Copyright 2019 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
___
<a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
___
# Matplotlib Overview Lecture
## Introduction
Matplotlib is the "grandfather" library of data visualization with Python. It was created by John Hunter. He created it to try to replicate MatLab's (another programming language) pl... | github_jupyter |
### Download the Data
http://files.grouplens.org/datasets/movielens/ml-latest-small.zip
```
!pip install wget
import wget
fn = wget.download('http://files.grouplens.org/datasets/movielens/ml-latest-small.zip')
fn
!unzip ml-latest*
```
### Basic Info About Data
```
PATH = 'ml-latest-small'
!find $PATH -name '*.csv' |... | github_jupyter |
# ***Introduction to Radar Using Python and MATLAB***
## Andy Harrison - Copyright (C) 2019 Artech House
<br/>
# Power Aperture Product
***
Referring to Equation 4.54
\begin{equation}\label{eq:radar_equation_search_final}
{SNR}_o = \frac{P_{av}\, A_e\, \sigma }{(4\pi)^3\, k\, T_0\, F\, L\, r^4} \, \frac{T_{scan}... | github_jupyter |
```
import yt
import os
import cProfile
import pandas as pd
ddir = "/home/chavlin/src/temp/"
```
function to convert cProfile output to pandas dataframe:
```
def get_df(pr):
attrs = ['code','callcount','reccallcount','totaltime','inlinetime','calls']
rows = []
for st in pr.getstats():
rows.appen... | github_jupyter |
# Generating Qubit Hamiltonians
```
import tequila as tq
from utility import *
import time
```
Specify the Qubit Hamiltonian of a molecule by its name, internuclear distances, basis set, and fermion-to-qubit transformation.
Here, we go beyond showing the resulting Hamiltonian for $H_2$ in STO-3G with $1\overset{\cir... | github_jupyter |
# ConvNet-LSTM Stack Sentiment Classifier
In this notebook, we stack an LSTM on top of a convolutional layer to classify IMDB movie reviews by their sentiment.
#### Load dependencies
```
import keras
from keras.datasets import imdb
from keras.preprocessing.sequence import pad_sequences
from keras.models import Seque... | github_jupyter |
# 4. Ensemble_XGBoostGPU_GSCV
Kaggle score:
Conclusion: 即使是只有两个结果,进行简单的加权平均,也可以使结果得到提升。本结论还需要进一步的实验验证。
## Run names
```
import time
project_name = 'ic_furniture2018'
step_name = 'Ensemble_XGBoostGPU_GSCV'
time_str = time.strftime("%Y%m%d_%H%M%S", time.localtime())
run_name = project_name + '_' + step_name + '_' + ... | github_jupyter |
```
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
import seaborn as sns
import scipy.stats as ss
# Make plots larger
plt.rcParams['figure.figsize'] = (15, 9)
AAPL = pd.read_csv('AAPL_New.csv')
AAPL.set_index('Date')
AAPL['open_tmr'] = AAPL['Open'].shift(-1)
AAPL['OpenCl... | github_jupyter |
# Matplotlib Tutorial Notebook
---
Welcome to the Matplotlib Tutorial notebook. In this notebook we will be taking a look at how we can visualize data with help of Matplotlib. It is the one of the most important libraries that helps you out with data visualization task. We will begin by importing this library and then ... | github_jupyter |
# Disease Outbreak Response Decision-making Under Uncertainty: A retrospective analysis of measles in Sao Paulo
```
%matplotlib inline
import pandas as pd
import numpy as np
import numpy.ma as ma
from datetime import datetime
import matplotlib.pyplot as plt
import pdb
from IPython.core.display import HTML
def css_sty... | github_jupyter |
<a href="https://colab.research.google.com/github/agungsantoso/deep-learning-v2-pytorch/blob/master/sentiment-analysis-network/Sentiment_Classification_Projects.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Sentiment Classification & How To "Fra... | github_jupyter |
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Solution Notebook
## Problem: Given a knapsack with a total weight capacity and a list of items with weight w(i) and value v(i), determi... | github_jupyter |
## Application: Illustrating the use of the package by imputing the race of the campaign contributors recorded by FEC for the years 2000 and 2010
a) what proportion of contributors were black, whites, hispanics, asian etc.
b) and proportion of total donation given by blacks, hispanics, whites, and asians.
... | github_jupyter |
```
import os
from nipype import Workflow, Node, Function
# Create a workflow with one node that adds two numbers together
def sum (a, b):
return a + b
wf = Workflow ('hello')
adder = Node (Function (input_names = ['a', 'b'],
output_names = ['sum'],
function = sum),... | github_jupyter |
# Weight Sampling Tutorial
If you want to fine-tune one of the trained original SSD models on your own dataset, chances are that your dataset doesn't have the same number of classes as the trained model you're trying to fine-tune.
This notebook explains a few options for how to deal with this situation. In particular... | github_jupyter |
<!--BOOK_INFORMATION-->
<a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;"></a>
*This notebook contains an ex... | github_jupyter |
<a href="https://colab.research.google.com/github/nnuncert/nnuncert/blob/master/notebooks/NLM_toy.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Git + Repo Installs
```
!git clone https://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@github.com/nnunc... | github_jupyter |
This notebook covers the cleaning and exploration of data for 'Google Play Store Apps'
### Imporing Libraries
```
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt # for plots
import os
print(os.listdir("../input"))
```
### Rea... | github_jupyter |
<a href="https://colab.research.google.com/github/krmiddlebrook/intro_to_deep_learning/blob/master/machine_learning/lesson%200%20-%20machine%20learning/Intro_to_Machine_Learning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Learning by Doing: To... | github_jupyter |
## Introduction
The goal of this lab is to learn TCP and UDP socket programming by building a simple network application program (chat application) and analyzing TCP and UDP connections. The lab has several **milestones**. Make sure you reach each one before advancing to the next.
For delivery, see Milestone 5.
... | github_jupyter |
# StyleGAN2-ADA-PyTorch
## Please Read
This StyleGAN2-ADA-PyTorch repository (including this Colab notebook) was forked from [Derrick Schultz](https://github.com/dvschultz/stylegan2-ada-pytorch), which was forked from [Nvidia's original repo](https://github.com/NVlabs/stylegan2-ada-pytorch). A huge thank you to Derric... | github_jupyter |
## Simple Implementation of Gradient Boosted Decision Tree For Regression
#### for this implementation we use squared loss divided by 2 as loss function for GBDT
$$L(y^{true}, y^{pred}) = \frac{1}{2} (y^{true} - y^{pred})^2 $$
so that our loss function gradient is
$$y^{true} - y^{pred}$$
we will use this to comput... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive')
!cp -r '/content/drive/My Drive/Colab Notebooks/[Kaggle] Understanding Clouds from Satellite Images/Scripts/.' .
!unzip -q '/content/drive/My Drive/Colab Notebooks/[Kaggle] Understanding Clouds from Satellite Images/Data/train_images320x480.zip'
```
### ... | github_jupyter |
经验证:
* 1、test的时间顺序并不是全部都是时序的,排行榜是按时序排列后取前0.78为public,后0.22为private,所以以后的工作重心将落到train的后44%
* 2、测试集中私有部分从2018-07-24 09:00:00开始,有9173472条数据,包含全部的building_id
* 3、测试集中公共部分与私有部分对应的数据从2017-07-24 09:00:00开始,有9174900条数据,包含全部的building_id
* 4、重点为训练集中2017-07-24 09:00:00后的数据建模,有9003109条数据,占训练集0.445
* 5、为防止测试集中不评分的那部分不知道算不算在0.22里面,也... | github_jupyter |
# Le Brown Corpus
Le *Brown University Standard Corpus of Present-Day American English* est le premier grand corpus structuré et étiqueté de textes en anglais. Il a posé les bases pour l’étude scientifique de la fréquence et de la distribution des catégories de mots dans l’usage quotidien de la langue.
Exemple de phr... | github_jupyter |
```
from datetime import datetime
import argparse
import socket
import sys
import numpy as np
import random as random
from random import sample
import copy as cp
from HandEvaluator import HandEvaluator
from Brains import RationalBrain
from Brains import AdaptiveBrain
#sys.path.add("/Users/sbiswas/GitHub/poker/PokerBo... | github_jupyter |
```
import pandas as pd
import numpy as np
import geopandas as gpd
import psycopg2
from geoalchemy2 import Geometry, WKTElement
from sqlalchemy import *
from shapely.geometry import MultiPolygon
from zipfile import ZipFile
import requests
import sys
%matplotlib inline
import yaml
with open('../../config/postgres.yaml... | github_jupyter |
# Rendering images in matplotlib
Images rendered by **fresnel** can be converted to RGBA arrays for display with the **imshow** command in **matplotlib**. This example shows how to build subplots that display the geometries of the Platonic Solids.
```
import numpy as np
import fresnel
import matplotlib
import matplotl... | github_jupyter |
```
#import required libraries
#import OpenCV library
import cv2
#import matplotlib library
import matplotlib.pyplot as plt
#importing time library for speed comparisons of both classifiers
import time
%matplotlib inline
# cv2.cvtColor is an OpenCV function to convert images to different color spaces
def convertToRGB... | github_jupyter |
# SBTi-Finance Tool for Temperature Scoring & Portfolio Coverage
***Do you want to understand what drives the temperature score of your portfolio to make better engagement and investment decisions?***
... | github_jupyter |
```
import nuclio
# nuclio: start-code
import mlrun.feature_store as fs
from mlrun.feature_store.steps import *
import mlrun
import os
import datetime
def handler(context, event):
context.logger.info("Reading features from feature vector")
# Reading the data from feature service
start = datetime.datetime.no... | github_jupyter |
# Load the Pretrained Model and the dataset
We use ernie-1.0 as the model and chnsenticorp as the dataset for example. More models can be found in [PaddleNLP Model Zoo](https://paddlenlp.readthedocs.io/zh/latest/model_zoo/transformers.html#transformer).
Obviously, PaddleNLP is needed to run this notebook, which is eas... | github_jupyter |
# Sleep stage classification: Random Forest & Hidden Markov Model
____
This model aims to classify sleep stages based on two EEG channel. We will use the features extracted in the `pipeline.ipynb` notebook as the input to a Random Forest. The output of this model will then be used as the input of a HMM. We will implem... | github_jupyter |
```
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.WARN)
import pickle
import numpy as np
import os
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score
import os
from tensorflow.python.client import device_lib
from collections... | github_jupyter |
```
import numpy as np
```
# The padding function in Numpy
- We want to show this function how to be utilized on the padding operations of convolutional neural networks.
## No channel
- Example for no channel with 2-dimensional matrix.
```
a_2d = np.arange(1,10).reshape(3,3)
print("(Original) 2d feature map=>\n{0}\n... | github_jupyter |
**Exercise set 6**
==================
>The goal of this exercise is to go through some of the steps required
>to make a predictive regression model. We will here try different types
>of models, and we will also assess the models in greater detail, compared to the
>previous exercises. In particular, this exercise will ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.