code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
```
!git clone https://github.com/ninomiyalab/Memory_Less_Momentum_Quasi_Newton
import tensorflow as tf
import tensorflow.keras
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.layers import Input, Dense, Activation, Conv2D, Flatten
from tensorflow.keras import optimizers
from Memory_Less_Mom... | github_jupyter |
<a href="https://colab.research.google.com/github/zevan07/DS-Unit-1-Sprint-3-Statistical-Tests-and-Experiments/blob/master/Copy_of_LS_DS_142_Sampling_Confidence_Intervals_and_Hypothesis_Testing.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Lambd... | github_jupyter |
# Fitting distribution with R
```
x.norm <- rnorm(n=200,m=10,sd=2)
hist(x.norm,main="Histogram of observed data")
plot(density(x.norm),main="Density estimate of data")
plot(ecdf(x.norm),main="Empirical cumulative distribution function")
z.norm <- (x.norm-mean(x.norm))/sd(x.norm) # standardize data
qqnorm(z.norm) ## dr... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
data = pd.read_csv('dataset-of-10s.csv')
data.head()
```
# checking basic integrity
```
data.shape
data.info()
```
# no. of rows = non null values for each column -> no null value
```
data.head()
```
# checking unique ... | github_jupyter |
# Python Language Basics, IPython, and Jupyter Notebooks
```
import numpy as np
np.random.seed(12345)
np.set_printoptions(precision=4, suppress=True)
```
## The Python Interpreter
```python
$ python
Python 3.6.0 | packaged by conda-forge | (default, Jan 13 2017, 23:17:12)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on l... | github_jupyter |
```
# last edited Apr 4, 2021, by GO.
# to do:
################################################################################
# script uses 'seagrid' E grid (500 m) and a bathymetric data file to generate
# new bathymetric .nc file at coarser resolutions (multiples of 500 m).
# Based on original code provide... | github_jupyter |
# PART 3 - Metadata Knowledge Graph creation in Amazon Neptune.
Amazon Neptune is a fast, reliable, fully managed graph database service that makes it easy to build and run applications that work with highly connected datasets. The core of Neptune is a purpose-built, high-performance graph database engine. This engine... | github_jupyter |
```
import os
import pickle
import sys
import numpy as np
import torch
import torch.utils.data
from skimage.color import lab2rgb, rgb2lab, rgb2gray
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
%matplotlib inline
class CIFAR10ImageDataSet(torch.utils.data.Dataset):
def __init__(self... | github_jupyter |
```
import pandas as pd
import numpy as np
df = pd.DataFrame({'Map': [0,0,0,1,1,2,2], 'Values': [1,2,3,5,4,2,5]})
df['S'] = df.groupby('Map')['Values'].transform(np.sum)
df['M'] = df.groupby('Map')['Values'].transform(np.mean)
df['V'] = df.groupby('Map')['Values'].transform(np.var)
print (df)
import numpy as np
import... | github_jupyter |
<a href="https://colab.research.google.com/github/allanstar-byte/ESTRELLA/blob/master/SQL_WORLD_SUICIDE_ANALYTICS.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# **SQL DATA CLEANING, OUTLIERS AND ANALYTICS**
# **1. Connecting to our Database**
`... | github_jupyter |
# Introduction to Python
##***Welcome to your first iPython Notebook.***

## **About iPython Notebooks**
iPython Notebooks are interactive coding environments embedded in a webpage. You will be using iPython notebooks i... | github_jupyter |
<a href="https://colab.research.google.com/github/AngieCat26/MujeresDigitales/blob/main/Taller_semana_7.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Introducción
**Contexto comercial.** Usted es un analista en una entidad bancaria, y se le pr... | github_jupyter |
# Hands On: Seleksi Fitur
Seleksi fitur (feature selection) adalah proses memilih feature yang tepat untuk melatih model ML.
Untuk melakukan feature selection, kita perlu memahami hubungan antara variables.
Hubungan antar dua random variables disebut correlation dan dapat dihitung dengan menggunakan correlation coef... | github_jupyter |
# Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free to explore the data and... | github_jupyter |
<a href="https://colab.research.google.com/github/dyjdlopez/linearAlgebra2021/blob/main/Week%202%20-%20Intro%20to%20Vectors%20and%20Numpy/LinAlg_Lab_2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Lab 2 - Plotting Vector using NumPy and MatPlotL... | github_jupyter |
```
import json
import joblib
import pickle
import pandas as pd
from lightgbm import LGBMClassifier
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline, Pipeline
from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import ColumnTransformer
from sklearn.impute ... | github_jupyter |
# Parsing Inputs
In the chapter on [Grammars](Grammars.ipynb), we discussed how grammars can be
used to represent various languages. We also saw how grammars can be used to
generate strings of the corresponding language. Grammars can also perform the
reverse. That is, given a string, one can decompose the string into ... | github_jupyter |
# 100 numpy exercises
This is a collection of exercises that have been collected in the numpy mailing list, on stack overflow
and in the numpy documentation. The goal of this collection is to offer a quick reference for both old
and new users but also to provide a set of exercises for those who teach.
If you find an... | github_jupyter |
# Predicting Boston Housing Prices
## Using XGBoost in SageMaker (Batch Transform)
_Deep Learning Nanodegree Program | Deployment_
---
As an introduction to using SageMaker's Low Level Python API we will look at a relatively simple problem. Namely, we will use the [Boston Housing Dataset](https://www.cs.toronto.edu... | github_jupyter |
# Problema do negócio
A empresa deseja uma análise dos preços dos produtos das lojas concorrentes para precificar melhor o próprio produto no mercado, neste caso, calças.
### Saída (Produto final)
1. Descobrir a reposta para a pergunta calculando a mediana dos preços dos concorrentes
2. Formato da entrega: tabela ou... | github_jupyter |
# Project: Investigate Children Out of School
## Table of Contents
<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#wrangling">Data Wrangling</a></li>
<li><a href="#eda">Exploratory Data Analysis</a></li>
<li><a href="#conclusions">Conclusions</a></li>
</ul>
<a id='intro'></a>
## Introduction
> **Key ... | github_jupyter |
# Apache Kafka Integration + Preprocessing / Interactive Analysis with KSQL
This notebook uses the combination of Python, Apache Kafka, KSQL for Machine Learning infrastructures.
It includes code examples using ksql-python and other widespread components from Python’s machine learning ecosystem, like Numpy, pandas, ... | github_jupyter |
# Multi-Layer Perceptron, MNIST
---
In this notebook, we will train an MLP to classify images from the [MNIST database](http://yann.lecun.com/exdb/mnist/) hand-written digit database.
The process will be broken down into the following steps:
>1. Load and visualize the data
2. Define a neural network
3. Train the model... | github_jupyter |
These notebook is used for initial training. Only necessary preprocessing is done, mainly categorical features encoding and Nans replacement.
It should show the main problems with observations, show main model difficulties, and feaures importances. It should also guide the way of validation Therefore we have:
- data ... | github_jupyter |
1. Crie uma classe Bola cujos atributos são cor e raio. Crie um método que imprime a cor da bola. Crie um método para calcular a área dessa bola. Crie um método para calcular o volume da bola. Crie um objeto dessa classe e calcule a área e o volume, imprimindo ambos em seguida.
Obs.:
Área da esfera = 4 * 3.14... | github_jupyter |
# US Production Data for RBC Modeling
```
import pandas as pd
import numpy as np
import fredpy as fp
import matplotlib.pyplot as plt
plt.style.use('classic')
%matplotlib inline
pd.plotting.register_matplotlib_converters()
# Load API key
fp.api_key = fp.load_api_key('fred_api_key.txt')
# Download nominal GDP, nominal ... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
```
# Reading QoS analysis raw info
Temporarily, this info is saved in a CSV file but it will be in the database
**qos_analysis_13112018.csv**
- columns = ['url','protocol','code','start','end','duration','runid']
- First try of qos analysi... | github_jupyter |
```
import pandas as pd
df = pd.read_csv('data/Consumer_Complaints.csv')
df.info()
feature_col = ['Consumer complaint narrative']
res_col = ['Product', 'Issue']
df.dropna(subset= feature_col + res_col, inplace=True)
df.drop_duplicates(subset=feature_col, inplace=True)
df.info()
#print(df['Product'].unique())
df_cat = N... | github_jupyter |
# Distributed Training of Mask-RCNN in Amazon SageMaker using EFS
This notebook is a step-by-step tutorial on distributed training of [Mask R-CNN](https://arxiv.org/abs/1703.06870) implemented in [TensorFlow](https://www.tensorflow.org/) framework. Mask R-CNN is also referred to as heavy weight object detection model ... | github_jupyter |
# Exercise 03 - Booleans and Conditionals
## 1. Simple Function with Conditionals
Many programming languages have [sign](https://en.wikipedia.org/wiki/Sign_function) available as a built-in function. Python does not, but we can define our own!
In the cell below, define a function called `sign` which takes a numerica... | github_jupyter |
<a href="https://colab.research.google.com/github/neurorishika/PSST/blob/master/Tutorial/Day%205%20Optimal%20Mind%20Control/Day%205.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <a href="https://kaggle.com/kernels/welcome?src=https://raw.git... | github_jupyter |
# II - Wavefronts and optical systems
First let's import HCIPy, and a few supporting libraries:
```
from hcipy import *
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```
Wavefronts in HCIPy are monochromatic. They consist of an electric field (as an HCIP `Field`), and a wavelength. If broadb... | github_jupyter |
# 📝 Exercise M6.03
This exercise aims at verifying if AdaBoost can over-fit.
We will make a grid-search and check the scores by varying the
number of estimators.
We will first load the California housing dataset and split it into a
training and a testing set.
```
from sklearn.datasets import fetch_california_housin... | github_jupyter |
# SmallPebble
[](https://github.com/sradc/smallpebble/commits/)
**Project status: unstable.**
<br><p align="center"><img src="https://raw.githubusercontent.com/sradc/SmallPebble/master/pebbles.jpg"/></p><br>
SmallPebble is a minimal auto... | github_jupyter |
```
import rioxarray as rio
import xarray as xr
import glob
import os
import numpy as np
import requests
import geopandas as gpd
from pathlib import Path
from datetime import datetime
from rasterio.enums import Resampling
import matplotlib.pyplot as plt
%matplotlib inline
site = "BRC"
# Change site name
chirps_seas_o... | github_jupyter |
# ChainerRL Quickstart Guide
This is a quickstart guide for users who just want to try ChainerRL for the first time.
If you have not yet installed ChainerRL, run the command below to install it:
```
%%bash
pip install chainerrl
```
If you have already installed ChainerRL, let's begin!
First, you need to import nec... | github_jupyter |
# Introduction to Kubernetes
**Learning Objectives**
* Create GKE cluster from command line
* Deploy an application to your cluster
* Cleanup, delete the cluster
## Overview
Kubernetes is an open source project (available on [kubernetes.io](kubernetes.io)) which can run on many different environments, from laptops... | github_jupyter |
# Advanced Usage Exampes for Seldon Client
## Istio Gateway Request with token over HTTPS - no SSL verification
Test against a current kubeflow cluster with Dex token authentication.
1. Install kubeflow with Dex authentication
```
INGRESS_HOST=!kubectl -n istio-system get service istio-ingressgateway -o jsonpath='... | github_jupyter |
<table width="100%">
<tr style="border-bottom:solid 2pt #009EE3">
<td style="text-align:left" width="10%">
<a href="prepare_anaconda.dwipynb" download><img src="../../images/icons/download.png"></a>
</td>
<td style="text-align:left" width="10%">
<a href="https://mybin... | github_jupyter |
# Testing cosmogan
April 19, 2021
Borrowing pieces of code from :
- https://github.com/pytorch/tutorials/blob/11569e0db3599ac214b03e01956c2971b02c64ce/beginner_source/dcgan_faces_tutorial.py
- https://github.com/exalearn/epiCorvid/tree/master/cGAN
```
import os
import random
import logging
import sys
import torch
... | github_jupyter |
# Exploring Clustering Results
The file containing the clustering results is stored in the processed data folder with the suffix clean. The index is set to the first __Product group key__.
As a reminder the file is organized in three columns: _Product Group Key_, _Cluster Number_ and the corresponding _Centroid_ of th... | github_jupyter |
```
%matplotlib inline
```
# Decoding in time-frequency space using Common Spatial Patterns (CSP)
The time-frequency decomposition is estimated by iterating over raw data that
has been band-passed at different frequencies. This is used to compute a
covariance matrix over each epoch or a rolling time-window and extra... | github_jupyter |
## week03: Логистическая регрессия и анализ изображений
В этом ноутбуке предлагается построить классификатор изображений на основе логистической регрессии.
*Забегая вперед, мы попробуем решить задачу классификации изображений используя лишь простые методы. В третьей части нашего курса мы вернемся к этой задаче.*
`... | github_jupyter |
# Using results
Since json is a dictionary, you can pull out a single datapoint using the key.
```
{
"source": "ensembl_havana",
"object_type": "Gene",
"logic_name": "ensembl_havana_gene",
"version": 12,
"species": "homo_sapiens",
"description": "B-Raf proto-oncogene, serine/threonine kinase [Source:HGNC ... | github_jupyter |
```
%%html
<style>div.run_this_cell{display:block;}</style>
<style>table {float:left;width:100%;}</style>
```
<img style="float:right;margin-left:50px;margin-right:50px;" width="300" src="images/discovercoding.png">
# 1. Welcome to the Hour of Callysto!
Lesson created and taught by [Discover Coding](https://discoverc... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from scipy.interpolate import RectBivariateSpline as rbs
from scipy.integrate import romb
import scipy.sparse as sp
import os
import pywt
wvt = 'db12'
%matplotlib inline
import matplotlib as mpl
norm = mpl.colors.Normalize(vmin=0.0,vmax... | github_jupyter |
$\newcommand{\xv}{\mathbf{x}}
\newcommand{\wv}{\mathbf{w}}
\newcommand{\yv}{\mathbf{y}}
\newcommand{\zv}{\mathbf{z}}
\newcommand{\Chi}{\mathcal{X}}
\newcommand{\R}{\rm I\!R}
\newcommand{\sign}{\text{sign}}
\newcommand{\Tm}{\mathbf{T}}
\newcommand{\Xm}{\mathbf{X}}
\newcommand{\Xlm}{\mathbf{X1}}
\newcommand{\Wm... | github_jupyter |
## Reinforcement Learning for seq2seq
This time we'll solve a problem of transribing hebrew words in english, also known as g2p (grapheme2phoneme)
* word (sequence of letters in source language) -> translation (sequence of letters in target language)
Unlike what most deep learning practicioners do, we won't only tr... | github_jupyter |
# DEAP
DEAP is a novel evolutionary computation framework for rapid prototyping and testing of ideas. It seeks to make algorithms explicit and data structures transparent. It works in perfect harmony with parallelisation mechanism such as multiprocessing and SCOOP. The following documentation presents the key concepts... | github_jupyter |
```
# !wget https://malaya-dataset.s3-ap-southeast-1.amazonaws.com/crawler/academia/academia-pdf.json
import json
import cleaning
from tqdm import tqdm
with open('../academia/academia-pdf.json') as fopen:
pdf = json.load(fopen)
len(pdf)
import os
os.path.split(pdf[0]['file'])
import malaya
fast_text = malaya... | github_jupyter |
<a href="https://colab.research.google.com/github/CarlosNeto2804/imersao-dados-2/blob/main/imersao_dados_aula_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Introdução
```
import pandas as pd;
dados_enem = pd.read_csv('https://github.com/alur... | github_jupyter |
```
import numpy as np
import pandas as pd
import xarray as xr
import geopandas as gpd
from shapely.geometry import Point
import sys
import os
sys.path.insert(0, os.path.dirname(os.getcwd()))
from time_space_reductions.match_ups_over_polygons import get_zonal_match_up
def make_fake_data(N=200):
# creating example... | github_jupyter |
<a href="https://colab.research.google.com/github/csy99/dna-nn-theory/blob/master/supervised_UCI_adam256_save_embedding.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.py... | github_jupyter |
```
import os
import plaid
import requests
import datetime
import json
import pandas as pd
%matplotlib inline
def pretty_print_response(response):
print(json.dumps(response, indent=4, sort_keys=True))
PLAID_CLIENT_ID = ('PLAID_CLIENT_ID')
PLAID_SBX_SECRET_KEY = ('PLAID_SBX_SECRET_KEY')
PLAID_PUBLIC_KEY = ('PLAID_PUBL... | github_jupyter |
```
import numpy as np
import Cluster_Ensembles as CE
from functools import reduce
# require(data.table)
# require(bit64)
# require(dbscan)
# require(doParallel)
# require(rBayesianOptimization)
# path='../input/train_1/'
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import o... | github_jupyter |
```
import pandas as pd
import numpy as np
import os
import math
import graphlab
import graphlab as gl
import graphlab.aggregate as agg
from graphlab import SArray
'''钢炮'''
path = '/home/zongyi/bimbo_data/'
train = gl.SFrame.read_csv(path + 'train_lag5.csv', verbose=False)
town = gl.SFrame.read_csv(path + 'towns.csv', ... | github_jupyter |
## Multi-label classification
```
%reload_ext autoreload
%autoreload 2
%matplotlib inline
from fastai.conv_learner import *
PATH = 'data/planet/'
# Data preparation steps if you are using Crestle:
os.makedirs('data/planet/models', exist_ok=True)
os.makedirs('/cache/planet/tmp', exist_ok=True)
!ln -s /datasets/kaggle... | github_jupyter |
```
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.layers import Embedding, LSTM, Dense, Dropout, Bidirectional
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam
from tensorflow.k... | github_jupyter |
# sentinelRequest
sentinelRequest can be used to colocate a geodataframe (ie areas, trajectories, buoys, etc ...) with sentinel (1, but also 2 , 3 : all known by scihub)
## Install
```
conda install -c conda-forge lxml numpy geopandas shapely requests fiona matplotlib jupyter descartes
pip install --upgrade git+ht... | github_jupyter |
# Reproduct Autopilot Architecture
The Autopilot has the following Architecture:
~ ResNet50-like backbone
~ FPN - DeepLabV3- UNet - like heads
~ 15 tasks
~ subtasks i.e. if task is car detection, then the sub task is what kind of car, is it stationary? Parked, broken down?
For later exploration:
Stitching up of i... | github_jupyter |
<a href="https://colab.research.google.com/github/Amberineee/ecommerce_covid_analysis/blob/main/BA_775_Team_Assignment_Team_4b.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import auth
auth.authenticate_user()
from google.col... | github_jupyter |
```
import sys
import importlib
import blockworld_helpers as utils
from Box2D import *
import copy
import numpy as np
world = b2World(gravity=(0,-10), doSleep=True)
groundBody = world.CreateStaticBody(
position=(0,-10),
shapes=b2PolygonShape(box=(50,10)),
)
body = world.CreateDynamicBody(position=(0,1))
bo... | github_jupyter |
```
library(data.table)
library(dplyr)
library(Matrix)
library(BuenColors)
library(stringr)
library(cowplot)
library(SummarizedExperiment)
library(chromVAR)
library(BSgenome.Hsapiens.UCSC.hg19)
library(JASPAR2016)
library(motifmatchr)
library(GenomicRanges)
library(irlba)
library(cicero)
library(umap)
library(cisTopic)... | github_jupyter |
```
# default_exp learner
```
# Learner
> This contains fastai Learner extensions.
```
#export
from tsai.imports import *
from tsai.data.core import *
from tsai.data.validation import *
from tsai.models.all import *
from tsai.models.InceptionTimePlus import *
from fastai.learner import *
from fastai.vision.models.a... | github_jupyter |
# "Price Charts with Technical Indicators"
> "Calculating Stock Price Indicators using FINTA python library, and visualizing using plotly python library."
- toc: false
- branch: master
- badges: true
- comments: true
- author: Ijeoma Odoko
- categories: [stocks, python, finta, pandas, plotly, ipywidgets]
 in the manuscript was designed to be a simple toy for illustrating the novel type of inference SuSiE offers. Here are some slightly ... | github_jupyter |
## Analyzing Hamlet
```
%load_ext autoreload
%autoreload 2
import src.data
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
from collections import OrderedDict
from IPython.display import display
pd.options.display.max_rows = 999
pd.options.display.max_columns = ... | github_jupyter |
# Train mnist with Tensorflow
**Requirements** - In order to benefit from this tutorial, you will need:
- A basic understanding of Machine Learning
- An Azure account with an active subscription - [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
- An Azure ML workspace with computer c... | github_jupyter |
```
import sys
sys.path.append(r'C:\Users\moallemie\EMAworkbench-master')
sys.path.append(r'C:\Users\moallemie\EM_analysis')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from ema_workbench import load_results, ema_logging
from ema_workbench.em_framework.salib_samplers imp... | github_jupyter |
##### Imports
```
import numpy as np
import pandas as pd
import os
import time
from itertools import permutations, combinations
from IPython.display import display
```
##### Prompts to choose which store you want
```
print("Welcome to Apriori 2.0!")
store_num = input("Please select your store \n 1. Amazon \n 2. Nike... | github_jupyter |
# Neural Transfer
## Input images
```
%matplotlib inline
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from PIL import Image
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
import torchvision.models as models
import co... | github_jupyter |
# Lab: Working with a real world data-set using SQL and Python
## Introduction
This notebook shows how to work with a real world dataset using SQL and Python. In this lab you will:
1. Understand the dataset for Chicago Public School level performance
1. Store the dataset in an Db2 database on IBM Cloud instance
1. R... | github_jupyter |
# 검색
wihle loop 를 이용한 선형 검색
```
from typing import Any,List
def linear_search_while(lst:List, value:Any) -> int:
i = 0
while i != len(lst) and lst[i] != value:
i += 1
if i == len(lst):
return -1
else:
return 1
l = [1,2,3,4,5,6,7,8,9]
linear_search_while(l,9)
def linear_search_... | github_jupyter |
<center>
<img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/Logos/organization_logo/organization_logo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# Access DB2 on Cloud using Python
Estimated time needed: **15** minutes
## Objectives
After completing this l... | github_jupyter |
# Building a Machine Translation System with Forte
## Overview
This tutorial will walk you through the steps to build a machine translation system with Forte. Forte allows users to breaks down complex problems into composable pipelines and enables inter-operations across tasks through a unified data format. With Fort... | github_jupyter |
```
import folium
import branca
import geopandas
from folium.plugins import Search
print(folium.__version__)
```
Let's get some JSON data from the web - both a point layer and a polygon GeoJson dataset with some population data.
```
states = geopandas.read_file(
'https://rawcdn.githack.com/PublicaMundi/MappingA... | github_jupyter |
# NumPy Tutorial: Data analysis with Python
[Source](https://www.dataquest.io/blog/numpy-tutorial-python/)
NumPy is a commonly used Python data analysis package. By using NumPy, you can speed up your workflow, and interface with other packages in the Python ecosystem, like scikit-learn, that use NumPy under the hood. ... | github_jupyter |
```
%matplotlib inline
import numpy as np
import yt
```
This notebook shows how to use yt to make plots and examine FITS X-ray images and events files.
## Sloshing, Shocks, and Bubbles in Abell 2052
This example uses data provided by [Scott Randall](http://hea-www.cfa.harvard.edu/~srandall/), presented originally i... | github_jupyter |
tobac example: Tracking deep convection based on OLR from geostationary satellite retrievals
==
This example notebook demonstrates the use of tobac to track isolated deep convective clouds based on outgoing longwave radiation (OLR) calculated based on a combination of two different channels of the GOES-13 imaging inst... | github_jupyter |
# Transfer Learning Template
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import os, json, sys, time, random
import numpy as np
import torch
from torch.optim import Adam
from easydict import EasyDict
import matplotlib.pyplot as plt
from steves_models.steves_ptn import Steves_Prototypical_Network
... | github_jupyter |
# Building a Fraud Prediction Model with EvalML
In this demo, we will build an optimized fraud prediction model using EvalML. To optimize the pipeline, we will set up an objective function to minimize the percentage of total transaction value lost to fraud. At the end of this demo, we also show you how introducing the... | github_jupyter |
```
#Always Pyspark first!
ErhvervsPath = "/home/svanhmic/workspace/Python/Erhvervs"
from pyspark.sql import functions as F, Window, WindowSpec
from pyspark.sql import Row
from pyspark.sql.types import StringType,ArrayType,IntegerType,DoubleType,StructField,StructType
sc.addPyFile(ErhvervsPath+"/src/RegnSkabData/Impor... | 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 |
# Imports
```
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Dropout, Flatten, Input, Concatenate
from tensorflow.keras.optimizers import Adam, RMSprop
import numpy as np
import matplotlib.pyplot as plt
import copy
```
# Global Variables
```
epochs = 500
batch_size = 16
number_o... | github_jupyter |
# Field operations
There are several convenience methods that can be used to analyse the field. Let us first define the mesh we are going to work with.
```
import discretisedfield as df
p1 = (-50, -50, -50)
p2 = (50, 50, 50)
n = (2, 2, 2)
mesh = df.Mesh(p1=p1, p2=p2, n=n)
```
We are going to initialise the vector f... | github_jupyter |
## Search with Options
- Piece or Corpus
- Actual or Incremental Durations
- Chromatic or Diatonic
- Exact or Close
- Classify
***
```
from crim_intervals import *
import pandas as pd
import ast
import matplotlib
from itertools import tee, combinations
```
### The Complete Corpus
```
work_list = ['CRIM_Mass_0001_1... | github_jupyter |
# Use the Shirt Class
You've seen what a class looks like and how to instantiate an object. Now it's your turn to write code that insantiates a shirt object.
# Explanation of the Code
This Jupyter notebook is inside of a folder called 1.OOP_syntax_shirt_practice. You can see the folder if you click on the "Jupyter" l... | github_jupyter |
# [NTDS'19] tutorial 5: machine learning with scikit-learn
[ntds'19]: https://github.com/mdeff/ntds_2019
[Nicolas Aspert](https://people.epfl.ch/nicolas.aspert), [EPFL LTS2](https://lts2.epfl.ch).
* Dataset: [digits](https://archive.ics.uci.edu/ml/datasets/Pen-Based+Recognition+of+Handwritten+Digits)
* Tools: [scikit... | github_jupyter |
```
%matplotlib inline
```
Introduction to artifacts and artifact detection
================================================
Since MNE supports the data of many different acquisition systems, the
particular artifacts in your data might behave very differently from the
artifacts you can observe in our tutorials and ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from scipy.stats import kurtosis
from sklearn.decomposition import PCA
import seaborn as sns
from scipy.stats import pearsonr
%matplotlib
gov_pop_area_data = pd.read_excel('/Users/Rohil/Documents/... | github_jupyter |
# Implement image blending
We will start by importing libraries and defining a couple of functions for displaying images using matplotlib.
```
import cv2
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
plt.rcParams['figure.figsize'] = [20, 10]
def showResult(title, img):
# Colour images in... | github_jupyter |
<center>
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# 2D Numpy in Python
Estimated time needed: **20** minutes
## Objectives
After completing this lab you will ... | github_jupyter |
```
import torch
from torch import optim
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
from torch.autograd import Variable
from sklearn.preprocessing import OneHotEncoder
import os, math, glob, argparse
from utils.torch_utils import *
from utils.utils import *
from mpradragonn... | github_jupyter |
# Plotting and Functions
This notebook will work trough how to plot data and how to define functions. Throughout the lecture we will take a few moments to plot different functions and see how they depend on their parameters
## Plotting in Python: Matplot
```
import matplotlib.pyplot as plt
import numpy as np
import ... | github_jupyter |
```
import os
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pprint import pprint
from scipy.optimize import curve_fit
import src.io as sio
import src.preprocessing as spp
import src.fitting as sft
AFM_FOLDER = sio.get_folderpath("20200818_Akiyama_AFM")
A... | github_jupyter |
<a href="https://colab.research.google.com/github/yarusx/cat-vs-dogo/blob/main/cat_vs_dog_0_0_2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import matplotlib.pyplot as plt
import numpy as np
import os
import tensorflow as tf
from tensorflow... | github_jupyter |
```
# some_file.py
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, "/Users/dhruvbalwada/work_root/sogos/")
import os
from numpy import *
import pandas as pd
import xarray as xr
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from xgcm import Grid
from xgcm.... | github_jupyter |
```
#Add needed imports
import numpy as np
import pandas as pd
from imblearn.over_sampling import SMOTE
import seaborn as sns
from sklearn.preprocessing import OrdinalEncoder
from sklearn.dummy import DummyClassifier
from imblearn.over_sampling import SMOTENC
from sklearn.model_selection import train_test_split
from sk... | github_jupyter |
```
# import dependencies
import pandas as pd
import requests
import json
# read csv on covid-19 covid vulnerability index data and convert to dataframe
ccvi = pd.read_csv('../resources/ccvi.csv')
# drop rows that contain any null values (there are 655 of them)
ccvi = ccvi.dropna(how='any')
# display dataframe
ccvi
#... | github_jupyter |
# User testing for for Scikit-Yellowbrick
### Using data that was recorded from sensors during Data Science Certificate Program at GW
https://github.com/georgetown-analytics/classroom-occupancy
Data consist of temperature, humidity, CO2 levels, light, # of bluetooth devices, noise levels and count of people in the r... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.