text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
%matplotlib inline
import pandas as pd
# Import & combine the control & experimental groups!
control = pd.read_csv("control.csv")
control["group"] = 0 # control
experimental = pd.read_csv("experimental.csv")
experimental["group"] = 1 # experimental
data = pd.concat([control,experimental], ignore_index=True)
data... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Essentially" data-toc-modified-id="Essentially-1"><span class="toc-item-num">1 </span>Essentially</a></span><ul class="toc-item"><li><span><a href="#What's-happening?" data-toc-modified-id="What'... | github_jupyter |
# Ridge regression and model selection
Modified from the github repo: https://github.com/JWarmenhoven/ISLR-python which is based on the book by James et al. Intro to Statistical Learning.
## Loading data
```
# %load ../standard_import.txt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sk... | github_jupyter |
# Develop `tide_stn_water_level` Figure Module
Development of functions for `nowcast.figures.fvcom.tide_stn_water_level` web site figure module.
```
from contextlib import suppress
from datetime import timedelta
from pathlib import Path
import shlex
import subprocess
from types import SimpleNamespace
import arrow
im... | github_jupyter |
<a href="https://colab.research.google.com/github/0201shj/CNN-Cats-Dogs/blob/main/4_2_aug_pretrained_ipynb.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import drive
drive.mount('/content/drive')
%matplotlib inline
!ls -l
!un... | github_jupyter |
```
import os
os.environ['CUDA_VISIBLE_DEVICES'] = ''
# !wget https://f000.backblazeb2.com/file/malaya-model/v38/translation/en-ms/base-translation.pb
# !wget https://f000.backblazeb2.com/file/malaya-model/v38/translation/en-ms/small-translation.pb
# !wget https://f000.backblazeb2.com/file/malaya-model/v38/translation/... | github_jupyter |
# Overview of Lux
Lux is designed to be tightly integrated with Pandas and can be used as-is, without modifying your existing Pandas code. To enable Lux, simply add `import lux` along with your Pandas import statement.
```
import pandas as pd
import lux
```
Lux preserves the Pandas dataframe semantics -- which mean... | github_jupyter |
```
'''
For generate Betti_0 and betti_1 of 2017 dailyAmountMatrices, change the format of all matrices according the format of the http://people.maths.ox.ac.uk/nanda/perseus/
format example:
3: the ambient dimension, i.e., the number of coordinates per vertex.
1 0.01 100: the radius scaling factor k=1, the step s... | github_jupyter |
# Exercise Set 3: Strings, requests and APIs
*Morning, August 14, 2018*
In this exercise set you will be working with collecting from the web. We will start out with some basic string operations and build on that to make a query for fetching data.
In addition to DataCamp, you might find [this page](https://pythonpro... | github_jupyter |
```
# Importing all libraries.
from pylab import *
from netCDF4 import Dataset
%matplotlib inline
import os
import cmocean as cm
from trackeddy.tracking import *
from trackeddy.datastruct import *
from trackeddy.geometryfunc import *
from trackeddy.init import *
from trackeddy.physics import *
from trackeddy.plotfunc i... | github_jupyter |
# Replication - Likelihood Approximation: Additional 1 (Large P) - Table
Here we provide a notebook to replicate the simulation results for the likelihood approximations. These are additional simualtions to evaluate the impact of the number of covariates P on the approximation.
This produced the table from the supple... | github_jupyter |
# Exercise 2
## Cleaning the data
Now we have the data downloaded. We can will have to clean the data so that it is appropriate for training.
```
%matplotlib inline
import pandas as pd
bank_data = pd.read_csv('data/bank_data_feats.csv', index_col=0)
bank_data.head(n=20)
```
Numerical columns
- age
- balance
- day
- ... | github_jupyter |
# Arrays
While there are many kinds of collections in Python, we will work primarily
with arrays in this class.
The `numpy` package, abbreviated `np` in programs, provides Python programmers
with convenient and powerful functions for creating and manipulating arrays.
```
import numpy as np
```
Arrays often contain ... | github_jupyter |
In this notebook we will be using the smtd_preprocessing.py file which is a preprocessing pileline for twitter data to pre-process our tweets and then train our own twitter embeddings. <br>
We can find pre-trained twitter embedding
```
import os
import sys
import pandas as pd
from gensim.models import Word2Vec
import ... | github_jupyter |
#### Handling missing attributes at training
If only a small fraction of data points have missing attributes and the amount of data at hand is very large one might as well exclude such *deficient* data points during training. This however is wasteful and is often times a luxury one cannot afford.
A common way of hand... | github_jupyter |
# 1η εργαστηριακή άσκηση: Εισαγωγή στις γλωσσικές αναπαραστάσεις
<h2><center> Περιγραφή </center></h2>
__Σκοπός__ αυτού του μέρους της 1ης εργαστηριακής άσκησης είναι να γίνει μια εισαγωγή σε διαφορετικές γλωσσικές αναπαραστάσεις και τη χρήση τους για γλωσσικά tasks. Στο πρώτο μέρος θα εμπλουτίσουμε τον ορθογράφο που... | github_jupyter |
# Time Series approach
### Methods to be used:
- Auto Correlation Function
- Smoothing via handcrafted Gaussian Kernel
- Gaussian Process Regression
- Cross Validation
- Lomb Scargle (Fast and Generalized)
- Wavelets
```
import os
import sys
import numpy as np
import scipy
import pandas as p... | github_jupyter |
\title{myHDL Combinational Logic Elements: Demultiplexers (DEMUXs))}
\author{Steven K Armour}
\maketitle
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#Refrances" data-toc-modified-id="Refrances-1"><span class="toc-item-num">1&... | github_jupyter |
## Running a simulator using existing data
Consider the case when input data already exists, and that data already has a causal structure.
We would like to simulate treatment assignment and outcomes based on this data.
### Initialize the data
First we load the desired data into a pandas DataFrame:
```
import pandas a... | github_jupyter |
# Implementing kmeans from scratch
```
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from IPython.display import clear_output
import time
k, n = 3, 2
X, y = make_blobs(n_samples=10, centers=k, n_features=n, random_state=0, ... | github_jupyter |
# Inference Data Mount
```
!mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 172.31.91.151:/ ./efs_inference_data
```
# For Docker Run / Sagemaker
```
import sys
sys.executable
```
# Start Local / Sagemaker Imports
```
import os
import rasterio as rio
import numpy as np
... | github_jupyter |
# КТ-2, группа ПМ-1801
## Кирилл Захаров
```
# ТЕМА. Сжание изображений.
# Загрузить лица olivetti
from sklearn.datasets import fetch_olivetti_faces
from sklearn.datasets import load_sample_images
from sklearn.decomposition import PCA
from sklearn.model_selection import train_test_split
from sklearn.ensemble import... | github_jupyter |
```
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# model 1 on suzhou and swiss
x1, y1 = [0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... | github_jupyter |
# Using Variational Autoencoder and Deep Feature Loss to Generate Faces
From the "Using Variational Autoencoder to Generate Faces" example, we see that using VAE, we can generate realistic human faces, but the generated image is a little blury. Though, you can continue to tuning the hyper paramters or using more data ... | 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).
# Challenge Notebook
## Problem: Find the second largest node in a binary search tree.
* [Constraints](#Constraints)
* [Test Cases](#Test... | github_jupyter |
```
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from numpy import linalg as la
from matplotlib import pyplot as plot
```
## Reading the data
First we load the data from the npz file
```
data = np.load('data/data.npz')
x1 = data['x1']
x2 = data['x2']
y = data['y']
```
## Generating model
Then we use th... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (10, 7)
plt.rcParams["font.size"] = 12
import inspect
import numpy as np
import xarray as xr
import xarray_sentinel
from sarsen import apps, geoc... | github_jupyter |
```
# Copyright 2016 Google Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#Choose-a-Topic" data-toc-modified-id="Choose-a-Topic-1"><span class="toc-item-num">1 </span>Choose a Topic</a></span></li><li><span><a href="#Analysis" data-toc-modified-... | github_jupyter |
# Publications markdown generator for academicpages
Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.... | github_jupyter |
# Bidimensional Fourier Transform
The BidimensionalFourierTransform computes FFT of functions defined on bidimensional domain and return a ScalarBidimensionalFunction representing the spectrum and the frequency domain.
```
import matplotlib.pyplot as plt
import numpy as np
from arte.utils.discrete_fourier_transform im... | github_jupyter |
# Adadelta --- 从0开始
我们在[Adagrad](adagrad-scratch.md)里提到,由于学习率分母上的变量$\mathbf{s}$一直在累加按元素平方的梯度,每个元素的学习率在迭代过程中一直在降低或不变。所以在有些问题下,当学习率在迭代早期降得较快时且当前解依然不理想时,Adagrad在迭代后期可能较难找到一个有用的解。我们在[RMSProp](rmsprop-scratch.md)介绍了应对这一问题的一种方法:对梯度按元素平方使用指数加权移动平均而不是累加。
事实上,Adadelta也是一种应对这个问题的方法。有意思的是,它没有学习率参数。
## Adadelta算法
Adadelta算法也... | github_jupyter |
# 18DCE097 Muskaan Pirani
**Project title: Weather Forecast using LSTM**
1. Main aim is to reduce RMSE values for accurate predictions.
2. We have taken dataset from Kaggle to predict the temperature of a particular place.
* Train RMSE: 1.39 RMSE
* Test RMSE: 1.38 RMSE
```
import numpy
import matplotlib.pyplot a... | github_jupyter |
# Python and Data Science
Python is open source, interpreted, high level language and provides great approach for object-oriented programming. It is one of the best language used by data scientist for various data science projects/application. Python provide great functionality to deal with mathematics, statistics and... | github_jupyter |
## RDF
The radial distribution function (RDF) denoted in equations by g(r) defines the probability of finding a particle at a distance r from another tagged particle. The RDF is strongly dependent on the type of matter so will vary greatly for solids, gases and liquids.
<img src="../images/rdf.png" width="60%" height="... | github_jupyter |
In this notebook, we introduce survival analysis and we show application examples using both R and Python. We will compare the two programming languages, and leverage Plotly's Python and R APIs to convert static graphics into interactive `plotly` objects.
[Plotly](https://plotly.com) is a platform for making interacti... | github_jupyter |
```
library(ggplot2) # ggplot
library(ggfortify) # autoplot
library(gridExtra)
library(dplyr) # select
#(a) 수리시간(Minutes) 와 부품의 수(Units) 를 관계시키는 선형 회귀 모형을 적합
setwd('D:/Working/03.Korea/회귀분석/Final-Report/google-play-store-apps')
# kaggle 데이터
# $ 환율은 1177.42
gplay_data <- read.csv(file="googleplaystore.csv", header=TRUE... | github_jupyter |
**Install openclean.**
```
pip install openclean-core
```
**Cloning the data from github repo.**
```
import os
git_folder = 'NYC-Crime'
if not os.path.isdir(git_folder):
!git clone https://github.com/duketran1996/NYC-Crime.git
else:
%cd NYC-Crime/
!git pull
%cd ..
```
**Important import. Run before executi... | github_jupyter |
```
import pandas as pd
import numpy as np
import nltk
import multiprocessing
import difflib
import time
import gc
import xgboost as xgb
import warnings
warnings.filterwarnings('ignore')
from collections import Counter
from sklearn.metrics import log_loss
from scipy.optimize import minimize
from sklearn.cross_validati... | github_jupyter |
### Part4 Variant genotyping from whole genome graphs
In this part, we constructed whole genome graphs for Brown Swiss population, by augmenting ~14.1 M autosomal variants identified from 82 Brown Swiss to the Bovine UCD1.2 Hereford reference.
We then mapped 10 samples (not used for simulation) to this whole genome g... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Gena/hillshade_and_water.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" hre... | github_jupyter |
# FaIR
This notebook gives some simple examples of how to run and use the Finite Amplitude Impulse Response (FaIR) model.
The Finite Amplitude Impulse Response (FaIR) model is a simple emissions-based climate model. It allows the user to input emissions of greenhouse gases and short lived climate forcers in... | github_jupyter |
The datasets used here are taken from [this](https://github.com/Nilabhra/kolkata_nlp_workshop_2019) repository.
```
import pandas as pd
train = pd.read_csv('https://raw.githubusercontent.com/Nilabhra/kolkata_nlp_workshop_2019/master/data/train.csv')
validation = pd.read_csv('https://raw.githubusercontent.com/Nilabhra... | github_jupyter |
<a href="https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/51_cartoee_projections.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/></a>
Uncomment the following line to install [geemap](https://geemap.org) and [cartopy](https://scitool... | github_jupyter |
```
import pandas as pd, json, numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```
Load airports of each country
```
L=json.loads(file('../json/L.json','r').read())
M=json.loads(file('../json/M.json','r').read())
N=json.loads(file('../json/N.json','r').read())
import requests
AP={}
for c in M:
if c... | github_jupyter |
[](https://colab.research.google.com/github/giswqs/GEE-Courses/blob/master/docs/gee_intro/Image/image_styling.ipynb)
```
# !pip install geemap
import ee
import geemap
import geemap.colormaps as cm
```
## Colormap
```
# geemap.update_package()
... | github_jupyter |
```
import numpy as np
import pandas as pd
from sklearn.feature_selection import RFE
from sklearn.tree import DecisionTreeClassifier
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv("eye_movements.csv")
num_missing_values = df.isna().sum()
num_missing_values # No need to remove any tuples or perfo... | github_jupyter |
```
from matplotlib import pyplot as plt
import numpy as np
import random as rn
import csv
import urllib
import matplotlib.dates as mdates
# Video 1 - Introduction and Line
plt.plot([1, 2, 3], [5, 7, 4])
plt.show()
# Video 2 - Legends, titles and labels
x1 = [1, 2, 3]
y1 = [5, 7, 4]
x2 = [1, 2, 3]
y2 = [10, 14, 12]... | github_jupyter |
```
import pandas as pd
import numpy as np
import pymysql
from sqlalchemy import create_engine
import matplotlib.pyplot as plt
import os.path
# set this to True to force download database using SQL,
# else {if `datafile` exists, load it. else download from database}
download = False
datafile = 'data.csv'
engine = None... | github_jupyter |
```
import numpy as np
np.random.seed(42)
import pandas as pd
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
dataset = load_boston()
df = pd.DataFrame(dataset.data, columns=dataset.feature_names)
print(dataset["DESCR"])
```
#### Einfache Li... | github_jupyter |
# Семинар 4
# Линейная классификация
Задача классификации заключается в том, чтобы отнести каждый из объектов выборки к какому-либо классу из данного набора. Более формально, нам нужно построить классификатор - функцию $a \colon X \rightarrow Y$, которая поставит в соответствие каждому объекту $x$ из пространства объ... | github_jupyter |
# Project 1: Linear Regression Model
This is the first project of our data science fundamentals. This project is designed to solidify your understanding of the concepts we have learned in Regression and to test your knowledge on regression modelling. There are four main objectives of this project.
1\. Build Linear Re... | github_jupyter |
# Tutorial 10: Traffic Lights
This tutorial walks through how to add traffic lights to experiments. This tutorial will use the following files:
* Experiment script for RL version of traffic lights in grid: `examples/rllib/traffic_light_grid.py`
* Experiment script for non-RL version of traffic lights in grid: `exampl... | github_jupyter |
<a href="https://www.bigdatauniversity.com"><img src = "https://ibm.box.com/shared/static/cw2c7r3o20w9zn8gkecaeyjhgw3xdgbj.png" width = 400, align = "center"></a>
<h1 align=center><font size = 5>CONTENT-BASED FILTERING</font></h1>
Recommendation systems are a collection of algorithms used to recommend items to users ... | github_jupyter |
## Jupyter Introduction
The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.
http://jup... | github_jupyter |
```
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
plt.rcParams['axes.titlesize'] = 26
plt.rcParams['axes.labelsize']=18
plt.rcParams['xtick.labelsize']=18
plt.rcParams['ytick.labelsize']=18
plt.rcParams['legend.fontsize']=18
plt.rcParams['lines.linewidth'] = 3
plt.rcParams['lines.markersize'] = ... | github_jupyter |
# Introduction to Python
The are several ways to run a python script. That is true for other programming languages as well.
One way is to use the Python interpreter.
# Using the Python interpreter
In the command line type:
```shell
$ python
```
This will start a prompt that looks something like:
, a high-level API to build and train models in Ten... | github_jupyter |
# New Contributor Analysis
```
import psycopg2
import pandas as pd
import sqlalchemy as salc
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
import datetime
import json
warnings.filterwarnings('ignore')
with open("config.json") as config_file:
config = json.load(config_fi... | github_jupyter |
# AceleraDev Codenation - Semana 2
### Túlio Vieira de Souza | Data Scientist
## Manipulando Dados (Pré-Processamento)
#### 1. Importando as Bibliotecas Necessárias
```
#Importing libraries
import pandas as pd
import numpy as np
#Acessing the help from pandas (pd) package
pd?
```
#### 2. Manipulando Dicionários
`... | github_jupyter |
### Trade Demo
#### Goals:
- Login to the Canada domain.
- Select the dataset.
- Cacluate the sum of total of good imported to Egypt.
- Publish the result
- Download the results
### Step 1: Login into the Canada domain
```
%load_ext autoreload
%autoreload 2
# As a Data Scientist we want to perform some analysis on t... | github_jupyter |
# One step univariate model - ARIMA
In this notebook, we demonstrate how to:
- prepare time series data for training an ARIMA times series forecasting model
- implement a simple ARIMA model to forecast the next HORIZON steps ahead (time *t+1* through *t+HORIZON*) in the time series
- evaluate the model on a test datas... | github_jupyter |
## Probemos un poquito Learning to Rank con la librería LightGBM
Seguimos el ejemplo del código en https://mlexplained.com/2019/05/27/learning-to-rank-explained-with-code/
Para eso hay que descargar los datos con el archivo trans_data.py, ejecutando retrieve_30k.sh
#### Para Linux
Si el sistema que corren es Linux,... | github_jupyter |
This tutorial is Part 1 of an introduction to social network analysis in Python. It covers how to structure network data, as well as how to use NetworkX to: construct graphs, explore their features, and implement simple algorithms.
The primary example used for replication is Zachary's (1977) paper on divisions within ... | github_jupyter |
# False positive and false negatives
> This notebook explores the two sources of systematic error that we identify and trim in our datasets.
```
%matplotlib inline
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
```
## False positives
> False positives are defined as algorithms that, for... | github_jupyter |
# Session 3: Unsupervised and Supervised Learning
<p class="lead">
Parag K. Mital<br />
<a href="https://www.kadenze.com/courses/creative-applications-of-deep-learning-with-tensorflow/info">Creative Applications of Deep Learning w/ Tensorflow</a><br />
<a href="https://www.kadenze.com/partners/kadenze-academy">Kadenze... | github_jupyter |
# Save time series of spatially collapsed diagnostics
```
import warnings
warnings.filterwarnings("ignore") # noqa
# Data analysis and viz libraries
import dask
import numpy as np
import xarray as xr
from dask.distributed import Client
# Progress bar
from tqdm.notebook import tqdm
# Local modules
import mypaths
imp... | github_jupyter |
# Extract relevant sentences
In this notebook a method is constructed to extract relevant sentences from a given text and the corresponding abstract. For this method, a score of similarity between sentences would be useful. The Jaccard index is used on top of a BOW (Bag-of-Words) model of a sentence. The Jaccard index... | github_jupyter |
```
import wallycore as wally
def buildTransaction(tx_inputs, tx_outputs):
tx = wally.tx_init(2, 0, 1, 2) # version 2, locktime 0, 1 input, 2 outputs
for tx_input in tx_inputs:
wally.tx_add_input(tx, tx_input)
for tx_output in tx_outputs:
wally.tx_add_output(tx, tx_output)
ret... | github_jupyter |
## Probabilistic Generative Models
### Linear Discriminant Analysis
As we saw in the LR, we were able to explicitly model the conditional distribution of the target class given the input features. Another approaching for modeling this distribution is by implicitly modeling it by using Bayes' theorem. This approach is k... | github_jupyter |
##### Copyright 2018 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
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... | github_jupyter |
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i>
<i>Licensed under the MIT License.</i>
# TF-IDF Content-Based Recommendation on the COVID-19 Open Research Dataset
This demonstrates a simple implementation of Term Frequency Inverse Document Frequency (TF-IDF) content-based recommendation on the [COVID... | github_jupyter |
# Building your Deep Neural Network: Step by Step
Welcome to your week 4 assignment (part 1 of 2)! You have previously trained a 2-layer Neural Network (with a single hidden layer). This week, you will build a deep neural network, with as many layers as you want!
- In this notebook, you will implement all the functio... | github_jupyter |
```
import numpy as np
import matplotlib.pylab as plt
import corner
import numpy as np
import glob
from PTMCMCSampler import PTMCMCSampler
%matplotlib inline
```
## Define the likelihood and posterior
Functions must read in parameter vector and output log-likelihood or log-prior. Usually easiest to use a class if yo... | github_jupyter |
# Exploratory Data Analysis of Cancer Genomics data using TCGA
In this notebook, we will take a look at one of the canonical datasets, if not _the_ dataset, in cancer genomics: TCGA.
We'll start with investigating the RNA Sequencing (rnaseq) and Clinical data available for a type of liver cancer known as hepatocellul... | github_jupyter |
# Ch3.1 Data Indexing and Selection
## Data Selection in Series
### Series as dictionary
```
import pandas as pd
data = pd.Series([0.25, 0.5, 0.75, 1.0],
index=['a', 'b', 'c', 'd'])
data
data['b']
```
We can also use dictionary-like Python expressions and methods to examine the keys/indices and val... | 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 |
# Chapter 13: Going Deeper -- the Mechanics of PyTorch (Part 3/3)
## Higher-level PyTorch APIs: a short introduction to PyTorch-Ignite
### Setting up the PyTorch model
```
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torchvision.datasets import MNIST
from torchvision import t... | github_jupyter |
# T1547.001 - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder
Adversaries may achieve persistence by adding a program to a startup folder or referencing it with a Registry run key. Adding an entry to the "run keys" in the Registry or startup folder will cause the program referenced to be executed ... | github_jupyter |
# croppedImageSender - docs and install
Interactive cropping tool to define region of interest on a video frame and
send the video frames to the Streams application.
This is the cropping tool...
- https://openbits.app/posts/python-interactive-cropping/
You need to install it:
```
pip install interactivecrop
```
``... | github_jupyter |
```
%run "../Retropy_framework.ipynb"
mdf = pd.read_csv("../Research/GemelNet.csv")
mdf["month"] = pd.to_datetime(mdf["month"], format="%Y/%m/%d")
mdf["month_return"] = pd.to_numeric(mdf["month_return"].astype(str).str.replace("%", ""), errors="coerce")
mdf["net_flow"] = series_as_float(mdf["net_flow"])
mdf["AUM"] = se... | github_jupyter |
```
import arviz as az
import pymc3 as pm
import pystan
import emcee
import matplotlib.pyplot as plt
import numpy as np
from multiprocessing import Pool
```
# Model
The model on which to perform the simulation will be the estimation of the mean of a Normal variable having observed a 0. We will use:
$$
p(\theta) = \... | github_jupyter |
# Software Carpentry
# Welcome to Binder
This is where will do all our Python, Shell and Git live coding.
## Jupyter Lab
Let's quickly familiarise ourselves with the enironment ...
- the overal environment (ie your entire browser tab) is called:
*Jupyter Lab*
it contains menus, tabs, toolbars and a file b... | github_jupyter |

# Introduction to Xarray
---
## Overview
This notebook will introduce the basics of gridded, labeled data with Xarray. Since Xarray introduces additional abstractions on top of plain arrays of data, our goal is to show... | github_jupyter |
__Author:__ Bogdan Bintu
__Email:__ bbintu@g.harvard.edu
__Date:__ 3/4/2020
#### Note: This assumes Python 2
```
# Imports
import numpy as np
import glob,os,sys
import matplotlib.pylab as plt
import workers #worker package to parallelize
#Warning: Installing ipyparallel is recomended
```
### 1. Raw imaging data ... | github_jupyter |
# Turtle Recall
A facial recognition model for turtles
https://zindi.africa/competitions/turtle-recall-conservation-challenge/data
# Imports
```
import tensorflow as tf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import datetime
import tqdm
from PIL import Image
print(f'TensorFlo... | github_jupyter |
# Versioning Example (Part 2/3)
In part 1, we trained and logged a tweet sentiment classifier using ModelDB's versioning system.
Now we'll see how that can come in handy when we need to revisit or even revert changes we make.
This workflow requires ``verta>=0.14.4`` and ``spaCy>=2.0.0``.
---
# Setup
As before, imp... | github_jupyter |
```
import os
# Third-party
from astropy.io import fits
import astropy.time as atime
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('apw-notebook')
%matplotlib inline
from ebak.singleline import RVData, OrbitModel
from ebak.units import usys
from ebak import SimulatedRVOrb... | github_jupyter |
# Insider Exfiltration
----
We are looking for this graph pattern in the large data graph referred to as the [LANL Unified Host and Network Dataset](https://datasets.trovares.com/cyber/LANL/index.html), a set of netflow and host event data collected on an internal Los Alamos National Lab network.
The LANL dataset co... | github_jupyter |
### Introduction To Numpy
#### Wait... why am I learning this again? I already know lists!
Untill now, we all know Python lists are powerful!
<ul>
<li>They can hold collection of values</li>
<li>They can hold different types of data</li>
<li>We can change, add or remove the items inside of a list</li>
... | github_jupyter |
# Plot the flash product of the GLM
This jupyter notebook shows how to make a sub-region plot of the flash product of the GLM.
Import the GOES package.
```
import GOES
```
Search GLM files.
```
flist=GOES.locate_files('/home/joao/Downloads/GOES-16/GLM/', 'OR_GLM*.nc',
'20201019-235500', '202... | github_jupyter |
# Lab 3: Bayesian PCA
### Machine Learning II, 2016
* The lab exercises should be made in groups of two people.
* The deadline for part 1 is Sunday, 15 May, 23:59.
* Assignment should be sent to taco.cohen at gmail dot com. The subject line of your email should be "[MLII2016] lab3part1_lastname1\_lastname2".
* Put y... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

import os
os.chdir('/content/gdrive/My Drive/finch/tensorflow2/text_matching/joint/main')
%tensorflow_version 2.x
!pip install transformers
from transformers import BertTokenizer, TFBertModel
from sklearn.metrics import classification_report
import tens... | github_jupyter |
```
from pytorchcv.model_provider import get_model as ptcv_get_model
import torch
import torch.nn.utils.prune as prune
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
net = ptcv_get_model("resnet20_cifar100",... | github_jupyter |
### requirements / ToDo
[x] train/test accuracy total + Fizz/Buzz/FizzBuzz separately
[x] graphs for different hyperparameter options (do graphs)
[x] try different learning algorithms
[ ] include best setting in report
[x] add main.py that creates output.csv
## Logic Based FizzBuzz Function [Softw... | github_jupyter |
<center>
<img src="../../img/ods_stickers.jpg">
## Открытый курс по машинному обучению
</center>
Автор материала: программист-исследователь Mail.ru Group, старший преподаватель Факультета Компьютерных Наук ВШЭ Юрий Кашницкий. Материал распространяется на условиях лицензии [Creative Commons CC BY-NC-SA 4.0](https://crea... | github_jupyter |
Histograms of data often reveal that they do not follow any standard probability distribution. Sometimes we have explanatory variables (or covariates) to account for the different values, and normally distributed errors are adequate, as in normal regression. However, if we only have the data values themselves and no co... | github_jupyter |
# WeatherPy
----
### Analysis
* As expected, the weather becomes significantly warmer as one approaches the equator (0 Deg. Latitude). More interestingly, however, is the fact that the southern hemisphere tends to be warmer this time of year than the northern hemisphere. This may be due to the tilt of the earth.
* The... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.