text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# Section 1.2: Dimension reduction and principal component analysis (PCA)
One of the iron laws of data science is know as the "curse of dimensionality": as the number of considered features (dimensions) of a feature space increases, the number of data configurations can grow exponentially and thus the number observati... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/geemap/tree/master/examples/notebooks/geemap_and_ipyleaflet.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href=... | github_jupyter |
# An Introduction to SageMaker LDA
***Finding topics in synthetic document data using Spectral LDA algorithms.***
---
1. [Introduction](#Introduction)
1. [Setup](#Setup)
1. [Training](#Training)
1. [Inference](#Inference)
1. [Epilogue](#Epilogue)
# Introduction
***
Amazon SageMaker LDA is an unsupervised learning ... | github_jupyter |
# Word2Vec
**Learning Objectives**
1. Compile all steps into one function
2. Prepare training data for Word2Vec
3. Model and Training
4. Embedding lookup and analysis
## Introduction
Word2Vec is not a singular algorithm, rather, it is a family of model architectures and optimizations that can be used to learn wo... | github_jupyter |
# Numbers and Integer Math
Watch the full [C# 101 video](https://www.youtube.com/watch?v=jEE0pWTq54U&list=PLdo4fOcmZ0oVxKLQCHpiUWun7vlJJvUiN&index=5) for this module.
## Integer Math
You have a few `integers` defined below. An `integer` is a positive or negative whole number.
> Before you run the code, what should c... | github_jupyter |
## **Nigerian Music scraped from Spotify - an analysis**
Clustering is a type of [Unsupervised Learning](https://wikipedia.org/wiki/Unsupervised_learning) that presumes that a dataset is unlabelled or that its inputs are not matched with predefined outputs. It uses various algorithms to sort through unlabeled data a... | github_jupyter |
# B - A Closer Look at Word Embeddings
We have very briefly covered how word embeddings (also known as word vectors) are used in the tutorials. In this appendix we'll have a closer look at these embeddings and find some (hopefully) interesting results.
Embeddings transform a one-hot encoded vector (a vector that is 0... | github_jupyter |
```
# second notebook for Yelp1 Labs 18 Project
# data cleanup
# imports
# dataframe
import pandas as pd
import json
# NLP
import gensim
from gensim.utils import simple_preprocess
from gensim.parsing.preprocessing import STOPWORDS
from gensim import corpora
# import review.json file from https://www.yelp.com/dataset
... | 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 |
```
import pickle
from misc import *
import SYCLOP_env as syc
from RL_brain_b import DeepQNetwork
import cv2
import time
from mnist import MNIST
mnist = MNIST('/home/bnapp/datasets/mnist/')
images, labels = mnist.load_training()
# some_mnistSM =[ cv2.resize(1.+np.reshape(uu,[28,28]), dsize=(256, 256)) for uu in images... | github_jupyter |
```
import lifelines
import pymc as pm
from pyBMA.CoxPHFitter import CoxPHFitter
import matplotlib.pyplot as plt
import numpy as np
from numpy import log
from datetime import datetime
import pandas as pd
%matplotlib inline
```
The first step in any data analysis is acquiring and munging the data
Our starting data set... | github_jupyter |
# Probability Distributions
# Some typical stuff we'll likely use
```
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
```
# [SciPy](https://scipy.org)
### [scipy.stats](https://docs.scipy.org/doc/scipy-0.14.0/reference/stats.html)
```
import s... | github_jupyter |
### Dr. Ignaz Semmelweis
```
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display
# Read datasets/yearly_deaths_by_clinic.csv into yearly
yearly = pd.read_csv('datasets/yearly_deaths_by_clinic.csv')
# Print out yearly
display(yearly)
```
### The alarming number of deaths
```
# Cal... | github_jupyter |
```
# Import the necessary libraries
import numpy as np
import pandas as pd
import os
import time
import warnings
import gc
gc.collect()
import os
from six.moves import urllib
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import datetime
warnings.filterwarnings('ignore')
%matplotlib inline
plt... | github_jupyter |
# What's this PyTorch business?
You've written a lot of code in this assignment to provide a whole host of neural network functionality. Dropout, Batch Norm, and 2D convolutions are some of the workhorses of deep learning in computer vision. You've also worked hard to make your code efficient and vectorized.
For the ... | github_jupyter |
<a id=top></a>
# Analysis of Engineered Features
## Table of Contents
**Note:** In this notebook, the engineered features are referred to as "covariates".
----
1. [Preparations](#prep)
2. [Analysis of Covariates](#covar_analysis)
1. [Boxplots](#covar_analysis_boxplots)
2. [Forward Mapping (onto Shape Space... | github_jupyter |
```
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy
from fastai.script import *
from fastai.vision import *
from fastai.callbacks import *
from fastai.distributed import *
from fastprogress import fastprogress
from torchvision.models import *
from fastai.vision.models.xresnet import *
fr... | github_jupyter |
# [모듈 2.1] SageMaker 클러스터에서 훈련 (No VPC에서 실행)
이 노트북은 아래의 작업을 실행 합니다.
- SageMaker Hosting Cluster 에서 훈련을 실행
- 훈련한 Job 이름을 저장
- 다음 노트북에서 모델 배포 및 추론시에 사용 합니다.
---
SageMaker의 세션을 얻고, role 정보를 가져옵니다.
- 위의 두 정보를 통해서 SageMaker Hosting Cluster에 연결합니다.
```
import os
import sagemaker
from sagemaker import get_execution_ro... | github_jupyter |
<a href="https://colab.research.google.com/github/iotanalytics/IoTTutorial/blob/main/code/preprocessing_and_decomposition/Matrix_Profile.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Matrix Profile
## Introduction
The matrix profile (MP) is a... | github_jupyter |
## Python Modules
```
%%writefile weather.py
def prognosis():
print("It will rain today")
import weather
weather.prognosis()
```
## How does Python know from where to import packages/modules from?
```
# Python imports work by searching the directories listed in sys.path.
import sys
sys.path
## "__main__" usage
... | github_jupyter |
```
%matplotlib inline
```
What is `torch.nn` *really*?
============================
by Jeremy Howard, `fast.ai <https://www.fast.ai>`_. Thanks to Rachel Thomas and Francisco Ingham.
We recommend running this tutorial as a notebook, not a script. To download the notebook (.ipynb) file,
click `here <https://pytorch.o... | github_jupyter |
# ART for TensorFlow v2 - Keras API
This notebook demonstrate applying ART with the new TensorFlow v2 using the Keras API. The code follows and extends the examples on www.tensorflow.org.
```
import warnings
warnings.filterwarnings('ignore')
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
import numpy ... | github_jupyter |
# Prophet
Time serie forecasting using Prophet
Official documentation: https://facebook.github.io/prophet/docs/quick_start.html
Procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It is released by Fac... | github_jupyter |
```
from PyEIS import *
```
## Frequency range
The first first step needed to simulate an electrochemical impedance spectra is to generate a frequency domain, to do so, use to build-in freq_gen() function, as follows
```
f_range = freq_gen(f_start=10**10, f_stop=0.1, pts_decade=7)
# print(f_range[0]) #First 5 points ... | github_jupyter |
# Scalable GP Classification in 1D (w/ KISS-GP)
This example shows how to use grid interpolation based variational classification with an `ApproximateGP` using a `GridInterpolationVariationalStrategy` module. This classification module is designed for when the inputs of the function you're modeling are one-dimensional... | github_jupyter |
# Showing uncertainty
> Uncertainty occurs everywhere in data science, but it's frequently left out of visualizations where it should be included. Here, we review what a confidence interval is and how to visualize them for both single estimates and continuous functions. Additionally, we discuss the bootstrap resampling... | github_jupyter |
<h1><center>Introductory Data Analysis Workflow</center></h1>

https://xkcd.com/2054
# An example machine learning notebook
* Original Notebook by [Randal S. Olson](http://www.randalolson.com/)
* Supported by [Jason H. Moore](http://www.epistasis.org/)
* ... | github_jupyter |
# Computer Vision Nanodegree
## Project: Image Captioning
---
In this notebook, you will train your CNN-RNN model.
You are welcome and encouraged to try out many different architectures and hyperparameters when searching for a good model.
This does have the potential to make the project quite messy! Before subm... | github_jupyter |
# Mount google drive to colab
```
from google.colab import drive
drive.mount("/content/drive")
```
# Import libraries
```
import os
import random
import numpy as np
import shutil
import time
from PIL import Image, ImageOps
import cv2
import pandas as pd
import math
import matplotlib.pyplot as plt
import seaborn a... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_02_4_pandas_functional.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 2: Python fo... | github_jupyter |
## Dependencies
```
import os
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
from sklea... | github_jupyter |
```
from gs_quant.data import Dataset
from gs_quant.markets.securities import Asset, AssetIdentifier, SecurityMaster
from gs_quant.timeseries import *
from gs_quant.target.instrument import FXOption, IRSwaption
from gs_quant.markets import PricingContext, HistoricalPricingContext, BackToTheFuturePricingContext
from gs_... | github_jupyter |
# 💡 Solutions
Before trying out these solutions, please start the [gqlalchemy-workshop notebook](../workshop/gqlalchemy-workshop.ipynb) to import all data. Also, this solutions manual is here to help you out, and it is recommended you try solving the exercises first by yourself.
## Exercise 1
**Find out how many ge... | github_jupyter |
```
# "PGA Tour Wins Classification"
```
Can We Predict If a PGA Tour Player Won a Tournament in a Given Year?
Golf is picking up popularity, so I thought it would be interesting to focus my project here. I set out to find what sets apart the best golfers from the rest.
I decided to explore their statistics and to s... | github_jupyter |
# Minimum spanning trees
*Selected Topics in Mathematical Optimization*
**Michiel Stock** ([email](michiel.stock@ugent.be))

```
import matplotlib.pyplot as plt
%matplotlib inline
from minimumspanningtrees import red, green, blue, orange, yellow
```
## Graphs in python
Consider the following ... | github_jupyter |
**INITIALIZATION:**
- I use these three lines of code on top of my each notebooks because it will help to prevent any problems while reloading the same project. And the third line of code helps to make visualization within the notebook.
```
#@ INITIALIZATION:
%reload_ext autoreload
%autoreload 2
%matplotlib inline
``... | github_jupyter |
# 내가 닮은 연예인은?
사진 모으기
얼굴 영역 자르기
얼굴 영역 Embedding 추출
연예인들의 얼굴과 거리 비교하기
시각화
회고
1. 사진 모으기
2. 얼굴 영역 자르기
이미지에서 얼굴 영역을 자름
image.fromarray를 이용하여 PIL image로 변환한 후, 추후에 시각화에 사용
```
# 필요한 모듈 불러오기
import os
import re
import glob
import glob
import pickle
import pandas as pd
import matplotlib.pyplot as plt
import matplotl... | github_jupyter |
<h1>Notebook Content</h1>
1. [Import Packages](#1)
1. [Helper Functions](#2)
1. [Input](#3)
1. [Model](#4)
1. [Prediction](#5)
1. [Complete Figure](#6)
<h1 id="1">1. Import Packages</h1>
Importing all necessary and useful packages in single cell.
```
import numpy as np
import keras
import tensorflow as tf
from numpy... | github_jupyter |
# **Libraries**
```
from google.colab import drive
drive.mount('/content/drive')
# ***********************
# *****| LIBRARIES |*****
# ***********************
%tensorflow_version 2.x
import pandas as pd
import numpy as np
import os
import json
from sklearn.model_selection import train_test_split
import tensorflow as ... | github_jupyter |
# 电影评论文本分类
此笔记本(notebook)使用评论文本将影评分为*积极(positive)*或*消极(nagetive)*两类。这是一个*二元(binary)*或者二分类问题,一种重要且应用广泛的机器学习问题。
我们将使用来源于[网络电影数据库(Internet Movie Database)](https://www.imdb.com/)的 [IMDB 数据集(IMDB dataset)](https://tensorflow.google.cn/api_docs/python/tf/keras/datasets/imdb),其包含 50,000 条影评文本。从该数据集切割出的25,000条评论用作训练,另外 25,... | github_jupyter |
## 8. Classification
[Data Science Playlist on YouTube](https://www.youtube.com/watch?v=VLKEj9EN2ew&list=PLLBUgWXdTBDg1Qgmwt4jKtVn9BWh5-zgy)
[](https://www.youtube.com/watch?v=VLKEj9EN2ew&list=PLLBUgWXdTBDg1Qgmwt4jKtVn9BWh5-zgy ... | github_jupyter |
## Installing & importing necsessary libs
```
!pip install -q transformers
import numpy as np
import pandas as pd
from sklearn import metrics
import transformers
import torch
from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler
from transformers import AlbertTokenizer, AlbertModel, Albert... | github_jupyter |
# 3D Map
While representing the configuration space in 3 dimensions isn't entirely practical it's fun (and useful) to visualize things in 3D.
In this exercise you'll finish the implementation of `create_grid` such that a 3D grid is returned where cells containing a voxel are set to `True`. We'll then plot the result!... | github_jupyter |
# FloPy
## Plotting SWR Process Results
This notebook demonstrates the use of the `SwrObs` and `SwrStage`, `SwrBudget`, `SwrFlow`, and `SwrExchange`, `SwrStructure`, classes to read binary SWR Process observation, stage, budget, reach to reach flows, reach-aquifer exchange, and structure files. It demonstrates these... | github_jupyter |
[제가 미리 만들어놓은 이 링크](https://colab.research.google.com/github/heartcored98/Standalone-DeepLearning/blob/master/Lec4/Lab6_result_report.ipynb)를 통해 Colab에서 바로 작업하실 수 있습니다!
런타임 유형은 python3, GPU 가속 확인하기!
```
!mkdir results
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
im... | github_jupyter |
## 1、可视化DataGeneratorHomographyNet模块都干了什么
```
import glob
import os
import cv2
import numpy as np
from dataGenerator import DataGeneratorHomographyNet
img_dir = os.path.join(os.path.expanduser("~"), "/home/nvidia/test2017")
img_ext = ".jpg"
img_paths = glob.glob(os.path.join(img_dir, '*' + img_ext))
dg = DataGenerator... | github_jupyter |
# Diamond Prices: Model Tuning and Improving Performance
#### Importing libraries
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
pd.options.mode.chained_assignment = None
%matplotlib inline
```
#### Loading the dataset
```
DATA_DIR = '../data'
FILE_NAME =... | github_jupyter |
# Loads pre-trained model and get prediction on validation samples
### 1. Info
Please provide path to the relevant config file
```
config_file_path = "../configs/pretrained/config_model1.json"
```
### 2. Importing required modules
```
import os
import cv2
import sys
import importlib
import torch
import torchvision
... | github_jupyter |
# Bar charts
This is 'abusing' the scatter object to create a 3d bar chart
```
import ipyvolume as ipv
import numpy as np
# set up data similar to animation notebook
u_scale = 10
Nx, Ny = 30, 15
u = np.linspace(-u_scale, u_scale, Nx)
v = np.linspace(-u_scale, u_scale, Ny)
x, y = np.meshgrid(u, v, indexing='ij')
r = n... | github_jupyter |
# Emukit tutorials
Emukit tutorials can be added and used through the links below. The goal of each of these tutorials is to explain a particular functionality of the Emukit project. These tutorials are stand-alone notebooks that don't require any extra files and fully sit on Emukit components (apart from the creation... | github_jupyter |
```
%run ../setup/nb_setup
%matplotlib inline
```
# Compute a Galactic orbit for a star using Gaia data
Author(s): Adrian Price-Whelan
## Learning goals
In this tutorial, we will retrieve the sky coordinates, astrometry, and radial velocity for a star — [Kepler-444](https://en.wikipedia.org/wiki/Kepler-444) — and ... | github_jupyter |
# Lab 04 : Train vanilla neural network -- solution
# Training a one-layer net on FASHION-MNIST
```
# For Google Colaboratory
import sys, os
if 'google.colab' in sys.modules:
from google.colab import drive
drive.mount('/content/gdrive')
file_name = 'train_vanilla_nn_solution.ipynb'
import subprocess... | github_jupyter |
```
from pandas import read_csv
import cv2
import glob
import os
import numpy as np
import logging
import coloredlogs
logger = logging.getLogger(__name__)
coloredlogs.install(level='DEBUG')
coloredlogs.install(level='DEBUG', logger=logger)
IM_EXTENSIONS = ['png', 'jpg', 'jpeg', 'bmp']
def read_img(img_path, img_shape=(... | github_jupyter |
<font color = "mediumblue">Note: Notebook was updated July 2, 2019 with bug fixes.</font>
#### If you were working on the older version:
* Please click on the "Coursera" icon in the top right to open up the folder directory.
* Navigate to the folder: Week 3/ Planar data classification with one hidden layer. You ca... | github_jupyter |
<a href="https://cognitiveclass.ai/">
<img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/PY0101EN/Ad/CCLog.png" width="200" align="center">
</a>
<h1>2D <code>Numpy</code> in Python</h1>
<p><strong>Welcome!</strong> This notebook will teach you about using <code>Numpy</code>... | github_jupyter |
# Segmentation
This notebook shows how to use Stardist (Object Detection with Star-convex Shapes) as a part of a segmentation-classification-tracking analysis pipeline.
The sections of this notebook are as follows:
1. Load images
2. Load model of choice and segment an initial image to test Stardist parameters
3. B... | github_jupyter |
# Introduction to Language Processing Concepts
### Original tutorial by Brain Lehman, with updates by Fiona Pigott
The goal of this tutorial is to introduce a few basical vocabularies, ideas, and Python libraries for thinking about topic modeling, in order to make sure that we have a good set of vocabulary to talk mor... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D3_ModelFitting/W1D3_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Neuromatch Academy: Week 1, Day 3, Tutorial 3
# Model Fittin... | github_jupyter |
# Load raw data
```
import numpy as np
data = np.loadtxt('SlowSteps1.csv', delimiter = ',') # load the raw data, change the filename as required!
```
# Find spikes
```
time_s = (data[:,8]-data[0,8])/1000000 # set the timing array to seconds and subtract 1st entry to zero it
n_spikes = 0
spike_times = [] # in seconds... | github_jupyter |
# DIMAML for Autoencoder models
Training is on Celeba. Evaluation is on Tiny ImageNet
```
%load_ext autoreload
%autoreload 2
%env CUDA_VISIBLE_DEVICES=0
import os, sys, time
sys.path.insert(0, '..')
import lib
import math
import numpy as np
from copy import deepcopy
import torch, torch.nn as nn
import torch.nn.funct... | github_jupyter |
# Autonomous Driving - Car Detection
Welcome to the Week 3 programming assignment! In this notebook, you'll implement object detection using the very powerful YOLO model. Many of the ideas in this notebook are described in the two YOLO papers: [Redmon et al., 2016](https://arxiv.org/abs/1506.02640) and [Redmon and Far... | 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 |
# Remote Sensing Hands-On Lesson, using TGO
EPSC Conference, Berlin, September 18, 2018
## Overview
In this lesson you will develop a series of simple programs that
demonstrate the usage of SpiceyPy to compute a variety of different
geometric quantities applicable to experiments carried out by a r... | github_jupyter |
```
import numpy
from context import vaeqst
import numpy
from context import base
base.RandomCliffordGate(0,1)
```
# Random Clifford Circuit
## RandomCliffordGate
`RandomClifordGate(*qubits)` represents a random Clifford gate acting on a set of qubits. There is no further parameter to specify, as it is not any parti... | github_jupyter |
<font size=6>
<b>Curso de Programación en Python</b>
</font>
<font size=4>
Curso de formación interna, CIEMAT. <br/>
Madrid, Octubre de 2021
Antonio Delgado Peris
</font>
https://github.com/andelpe/curso-intro-python/
<br/>
# Tema 9 - El ecosistema Python: librería estándar y otros paquetes populares
## Obj... | github_jupyter |
<a href="https://colab.research.google.com/github/google/evojax/blob/main/examples/notebooks/TutorialTaskImplementation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Tutorial: Creating Tasks
## Pre-requisite
Before we start, we need to install... | github_jupyter |
# Categorical encoders
Examples of how to use the different categorical encoders using the Titanic dataset.
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from feature_engine import categorical_encoders as ce
from feature_engine.missin... | github_jupyter |
```
__author__ = 'Mike Fitzpatrick <mike.fitzpatrick@noirlab.edu>, Robert Nikutta <robert.nikutta@noirlab.edu>'
__version__ = '20211130'
__datasets__ = []
__keywords__ = []
```
## How to use the Data Lab *Store Client* Service
This notebook documents how to use the Data Lab virtual storage system via the store client... | github_jupyter |
# *Bosonic statistics and the Bose-Einstein condensation*
`Doruk Efe Gökmen -- 30/08/2018 -- Ankara`
## Non-interacting ideal bosons
Non-interacting bosons is the only system in physics that can undergo a phase transition without mutual interactions between its components.
Let us enumerate the energy eigenstates of ... | github_jupyter |
# Working with 3D city models in Python
**Balázs Dukai** [*@BalazsDukai*](https://twitter.com/balazsdukai), **FOSS4G 2019**
Tweet <span style="color:blue">#CityJSON</span>
[3D geoinformation research group, TU Delft, Netherlands](https://3d.bk.tudelft.nl/)

Repo of this talk: [https://githu... | github_jupyter |
# 100 pandas puzzles
Inspired by [100 Numpy exerises](https://github.com/rougier/numpy-100), here are 100* short puzzles for testing your knowledge of [pandas'](http://pandas.pydata.org/) power.
Since pandas is a large library with many different specialist features and functions, these excercises focus mainly on the... | github_jupyter |
<a href="https://colab.research.google.com/github/rjrahul24/ai-with-python-series/blob/main/01.%20Getting%20Started%20with%20Python/Python_Revision_and_Statistical_Methods.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
**Inheritence in Python**
Ob... | github_jupyter |
# Continuous Control
---
In this notebook, you will learn how to use the Unity ML-Agents environment for the second project of the [Deep Reinforcement Learning Nanodegree](https://www.udacity.com/course/deep-reinforcement-learning-nanodegree--nd893) program.
### 1. Start the Environment
We begin by importing the ne... | github_jupyter |
```
def download(url, params={}, retries=3):
resp = None
header = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"}
try:
resp = requests.get(url, params=params, headers = header)
resp.raise_for_stat... | github_jupyter |
```
%matplotlib inline
```
# Species distribution modeling
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
variables. Since we have only positiv... | github_jupyter |
```
%pushd ../../
%env CUDA_VISIBLE_DEVICES=3
import json
import os
import sys
import tempfile
from tqdm.auto import tqdm
import torch
import torchvision
from torchvision import transforms
from PIL import Image
import numpy as np
torch.cuda.set_device(0)
from netdissect import setting
segopts = 'netpqc'
segmodel, se... | github_jupyter |
# ML Project 6033657523 - Feedforward neural network
## Importing the libraries
```
from sklearn.metrics import mean_absolute_error
from sklearn.svm import SVR
from sklearn.model_selection import KFold, train_test_split
from math import sqrt
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squa... | github_jupyter |
# PyFunc Model + Transformer Example
This notebook demonstrates how to deploy a Python function based model and a custom transformer. This type of model is useful as user would be able to define their own logic inside the model as long as it satisfy contract given in `merlin.PyFuncModel`. If the pre/post-processing st... | github_jupyter |
# PROYECTO CIFAR-10
## CARLOS CABAÑÓ
## 1. Librerias
Descargamos la librería para los arrays en preprocesamiento de Keras
```
from tensorflow import keras as ks
from matplotlib import pyplot as plt
import numpy as np
import time
import datetime
import random
from sklearn.preprocessing import LabelEncoder
from ten... | github_jupyter |
# NumPy arrays
Nikolay Koldunov
koldunovn@gmail.com
This is part of [**Python for Geosciences**](https://github.com/koldunovn/python_for_geosciences) notes.
================
<img height="100" src="files/numpy.png" >
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools... | github_jupyter |
<img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="35%" align="right" border="0"><br>
# Python for Finance (2nd ed.)
**Mastering Data-Driven Finance**
© Dr. Yves J. Hilpisch | The Python Quants GmbH
<img src="http://hilpisch.com/images/py4fi_2nd_shadow.png" width="300px" align="left">
... | github_jupyter |
Deep Learning
=============
Assignment 4
------------
Previously in `2_fullyconnected.ipynb` and `3_regularization.ipynb`, we trained fully connected networks to classify [notMNIST](http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html) characters.
The goal of this assignment is make the neural network convol... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
import ipdb
import dan_utils
warnings.filterwarnings("ignore")
from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.graphics.tsaplots import plot_pacf
from statsmodels.tsa.stattools import adfuller as ADF
from sta... | 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 |
# 转置卷积
:label:`sec_transposed_conv`
到目前为止,我们所见到的卷积神经网络层,例如卷积层( :numref:`sec_conv_layer`)和汇聚层( :numref:`sec_pooling`),通常会减少下采样输入图像的空间维度(高和宽)。
然而如果输入和输出图像的空间维度相同,在以像素级分类的语义分割中将会很方便。
例如,输出像素所处的通道维可以保有输入像素在同一位置上的分类结果。
为了实现这一点,尤其是在空间维度被卷积神经网络层缩小后,我们可以使用另一种类型的卷积神经网络层,它可以增加上采样中间层特征图的空间维度。
在本节中,我们将介绍
*转置卷积*(transposed convol... | github_jupyter |
# The YUSAG Football Model
by Matt Robinson, matthew.robinson@yale.edu, Yale Undergraduate Sports Analytics Group
This notebook introduces the model we at the Yale Undergraduate Sports Analytics Group (YUSAG) use for our college football rankings. This specific notebook details our FBS rankings at the beginnin... | github_jupyter |
### Using fmriprep
[fmriprep](https://fmriprep.readthedocs.io/en/stable/) is a package developed by the Poldrack lab to do the minimal preprocessing of fMRI data required. It covers brain extraction, motion correction, field unwarping, and registration. It uses a combination of well-known software packages (e.g., FSL,... | github_jupyter |
SVM
```
import pandas as pd
from sklearn import svm, metrics
from sklearn.model_selection import train_test_split
wesad_eda = pd.read_csv('D:\data\wesad-chest-combined-classification-eda.csv') # need to adjust a path of dataset
wesad_eda.columns
original_column_list = ['MEAN', 'MAX', 'MIN', 'RANGE', 'KURT', 'SKEW', 'M... | github_jupyter |
# Time series analysis on AWS
*Chapter 1 - Time series analysis overview*
## Initializations
---
```
!pip install --quiet tqdm kaggle tsia ruptures
```
### Imports
```
import matplotlib.colors as mpl_colors
import matplotlib.dates as mdates
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import n... | github_jupyter |
## ML Lab 3
### Neural Networks
In the following exercise class we explore how to design and train neural networks in various ways.
#### Prerequisites:
In order to follow the exercises you need to:
1. Activate your conda environment from last week via: `source activate <env-name>`
2. Install tensorflow (https://www... | github_jupyter |
# Initial Modelling notebook
```
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import warnings
import bay12_solution_eposts as solution
```
## Load data
```
post, thread = solution.prepare.load_dfs('train')
post.head(2)
thread.head(2)
```
I will set the thread... | github_jupyter |
```
# Import Dependencies
import os
import csv
# Establish filepath
budget_csv = os.path.join(".", "resources", "budget_data.csv")
output_file = os.path.join(".", "financial_analysis.txt")
# Index Reference for the Profit and Loss List
# Track Financial Parameters
# Open and read csv file
with open(budget_csv, newlin... | github_jupyter |
```
import numpy as np
import pandas as pd
```
# Pandas Metodları ve Özellikleri
### Veri Analizi için Önemli Konular
#### Eksik Veriler (Missing Value)
```
data = {'Istanbul':[30,29,np.nan],'Ankara':[20,np.nan,25],'Izmir':[40,39,38],'Antalya':[40,np.nan,np.nan]}
weather = pd.DataFrame(data,index=['pzt','sali','car... | github_jupyter |
<a href="https://colab.research.google.com/github/keivanipchihagh/Intro_To_MachineLearning/blob/master/Models/Newswires_Classification_with_Reuters.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Newswires Classification with Reuters
##### Import... | github_jupyter |
# autotimeseries
> Nixtla SDK. Time Series Forecasting pipeline at scale.
[](https://github.com/Nixtla/nixtla/actions/workflows/python-sdk.yml)
[](https://pypi.o... | github_jupyter |
```
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: 874681044@qq.com
@Software: PyCharm
@File: cam_2.py
@Time: 2021/4/12 21:47
@Overview:
Created on 2019/8/4 上午9:37
@author: mick.yi
"""
import os
import pdb
import numpy as np
import torch
from torch.nn.parallel.distributed import Di... | github_jupyter |
# The Structure and Geometry of the Human Brain
[Noah C. Benson](https://nben.net/) <[nben@uw.edu](mailto:nben@uw.edu)>
[eScience Institute](https://escience.washingtonn.edu/)
[University of Washington](https://www.washington.edu/)
[Seattle, WA 98195](https://seattle.gov/)
## Introduction
This notebook i... | github_jupyter |
# Baye's Theorem
### Introduction
Befor starting with *Bayes Theorem* we can have a look at some definitions.
**Conditional Probability :**
Conditional Probability is the Probability of one event occuring with some Relationship to one or more events.
Let A and B be the two interdependent event,where A has already oc... | github_jupyter |
[learning-python3.ipynb]: https://gist.githubusercontent.com/kenjyco/69eeb503125035f21a9d/raw/learning-python3.ipynb
Right-click -> "save link as" [https://gist.githubusercontent.com/kenjyco/69eeb503125035f21a9d/raw/learning-python3.ipynb][learning-python3.ipynb] to get most up-to-date version of this notebook file.
... | github_jupyter |
# Overview
### `clean_us_data.ipynb`: Fix data inconsistencies in the raw time series data from [`etl_us_data.ipynb`](./etl_us_data.ipynb).
Inputs:
* `outputs/us_counties.csv`: Raw county-level time series data for the United States, produced by running [etl_us_data.ipynb](./etl_us_data.ipynb)
* `outputs/us_counties_... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.