text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# ExtraTrees Regression with Normalize
### Required Packages
```
import warnings
import numpy as np
import pandas as pd
import seaborn as se
import matplotlib.pyplot as plt
from sklearn.preprocessing import Normalizer
from sklearn.model_selection import train_test_split
from sklearn.ensemble import ExtraTreesRegre... | github_jupyter |
# Recommender Systems (RS):
- We can use deep learning to predict rating for users based on the items
- We use the Movielens-100k dataset for illustration. There are 943 users and 1682 movies. In total there are a 100k ratings in the dataset.
```
import pandas as pd
import numpy as np
u_cols = ['user_id', 'sex', 'a... | github_jupyter |
## Exponential Smoothing Real Data
```
# install and load necessary packages
!pip install seaborn
!pip install --upgrade --no-deps statsmodels
import pyspark
from datetime import datetime
import seaborn as sns
import sys
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import os
print('Python ve... | github_jupyter |
# Pix2Pix
### Goals
In this notebook, you will write a generative model based on the paper [*Image-to-Image Translation with Conditional Adversarial Networks*](https://arxiv.org/abs/1611.07004) by Isola et al. 2017, also known as Pix2Pix.
You will be training a model that can convert aerial satellite imagery ("input"... | github_jupyter |
```
import numpy as np
import os
import cv2
import matplotlib.pyplot as plt
from keras.models import load_model
import numpy as np
import pandas as pd
import os
import glob
import cv2
import random
import matplotlib.pyplot as plt
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from... | github_jupyter |
# Equivalent layer technique for estimating total magnetization direction : Iteration process and L-curve application
Notebook to perform the inversion process. The L-curve
## Importing libraries
```
% matplotlib inline
import sys
import numpy as np
import matplotlib.pyplot as plt
import cPickle as pickle
import dat... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive/')
%cd '/content/drive/My Drive/thesis'
import config_16x15_seq
%cd '/content/drive/My Drive/thesis/config_16x15_seq'
import os
import pprint
import tensorflow as tf
if 'COLAB_TPU_ADDR' not in os.environ:
device_name = tf.test.gpu_device_name()
if ... | github_jupyter |
# Dunder Data Challenge 004 - Finding the Date of the Largest Percentage Stock Price Drop
In this challenge, you are given a table of closing stock prices for 10 different stocks with data going back as far as 1999. For each stock, find the date where it had its largest one-day percentage loss. The data is found in t... | github_jupyter |
- load logs
- normalisation
- feture engineering
- UMAP
```
from welly import Project
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data_df = pd.read_csv("./LASDF_ss.csv").drop(['UWI'], axis=1)
# data_df = pd.read_csv("./big_df.csv")
data_df['W'] = data_df['W'].apply(lambda n: n[:-4])
data_df... | github_jupyter |
# Metadata
## Overview
At its core, metadata is data about data. In day-to-day GIS data management workflows, data is created, updated,
archived and used for various decision support systems. Part of the information management lifecycle of data includes maintenance, protection and preservation, as well as facilitati... | github_jupyter |
# A Line-up of Tips for Better SQL Writing
**SQL** stands for **`structured query language (SQL)`**
The three most common SQL RDBMS are:
* SQLite
* MySQL (from Oracle)
* PostgreSQL
**SELECT** indicates which column(s) you want from the table.
**FROM** specifies from which table(s) you want to select the columns. N... | github_jupyter |
### k Nearest Neighbors (kNN)
As the name suggest the algorithm works based on majority vote of its k nearest neighbors class. In figure 14, 5 (k) nearest neighbors for the unknown data point are identified based on the chosen distance measure, and the unknown point will be classified based on majority class among id... | github_jupyter |
```
import geopandas as gpd
import pandas as pd
import numpy as np
import numpy
import matplotlib.pyplot as plt
import pandas
import math
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM, Flatten
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import m... | github_jupyter |
# Lecture 02: Primitives
[Download on GitHub](https://github.com/NumEconCopenhagen/lectures-2022)
[<img src="https://mybinder.org/badge_logo.svg">](https://mybinder.org/v2/gh/NumEconCopenhagen/lectures-2022/master?urlpath=lab/tree/02/Primitives.ipynb)
1. [Your first notebook session](#Your-first-notebook-session)
2.... | github_jupyter |
# Using Python, requests and Pandas
[Python](https://www.python.org) is a popular programming language which is heavily used in the data science domains. Python provides high level functionality supporting rapid application development with a large ecosystem of packages to work with weather/climate/water data.
Let's... | github_jupyter |
To open this notebook in Google Colab and start coding, click on the Colab icon below.
<table style="border:2px solid orange" align="left">
<td style="border:2px solid orange ">
<a target="_blank" href="https://colab.research.google.com/github/neuefische/ds-meetups/blob/main/01_Python_Workshop_Revisiting_Some_Fu... | github_jupyter |
<img src="../../images/banners/python-oop.png" width="600"/>
# <img src="../../images/logos/python.png" width="23"/> OOP (Part 4: Composition)
## <img src="../../images/logos/toc.png" width="20"/> Table of Contents
* [Implementation Inheritance vs Interface Inheritance](#implementation_inheritance_vs_interface_inhe... | github_jupyter |
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a>
$ \newcommand{\bra}[1]{\langle #1|} $
$ \newcommand{\ket}[1]{|#1\rangle} $
$ \newcommand{\braket}[2]{\langle #1|#2\rangle} $
$ \newcommand{\dot}[2]{ #1 \cdot #2} $
$ \newcommand{\biginner}[2]{\left\langle... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.stats import kurtosis,skew
from sklearn.linear_model import LinearRegression,Ridge
from sklearn.preprocessing import LabelEncoder,StandardScaler
from sklearn.tree import DecisionTreeRegressor,ExtraTreeRegressor
from... | github_jupyter |
1. #### Matlab SPM pipeline for making brain regions and tumor regions in uncorrected, corrected and ground truth DSC space
```
# Run once to store stdout
import sys
nb_stdout = sys.stdout
# Redirect stdout to console, to not get too much text output in the notebook
# This means that the notebook will not output any t... | github_jupyter |
# Distilling a Neural Network into Soft Decision Tree
* Implementation based on [[Frosst & Hinton, 2017](http://arxiv.org/abs/1711.09784)]
## Imports
```
import os
import keras
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.layers import Input, Dense, Conv1D, ... | github_jupyter |
# ProjectQ First Program
This exercise is based on the ProjectQ compiler tutorial. See https://github.com/ProjectQ-Framework/ProjectQ/blob/develop/examples/compiler_tutorial.ipynb for the original version.
Please check out [ProjectQ paper](http://arxiv.org/abs/1612.08091) for an introduction to the basic concepts beh... | github_jupyter |
# Core Pressures and Mass Flux
We can additionally find higher level pressure drops across the system. We will start with a specific steam generator with inputs given below.
```
import NuclearTools.MassFlux as mf
import pint
U = pint.UnitRegistry()
obj = mf.steam_generator(
m = 36*10**6 * U.lb/U.hr,
T_hl = ... | github_jupyter |
# Generate trajectories
```
import os
from datetime import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from numpy.polynomial import legendre
from scipy.linalg import block_diag
from pyrotor.constraints import is_in_constraints
from pyrotor.projection import trajectory_to_coef, co... | github_jupyter |
This notebook is part of the `deepcell-tf` documentation: https://deepcell.readthedocs.io/.
# Training a segmentation model
`deepcell-tf` leverages [Jupyter Notebooks](https://jupyter.org) in order to train models. Example notebooks are available for most model architectures in the [notebooks folder](https://github.c... | github_jupyter |
# 1. `LightningModule`
A LightningModule organizes your PyTorch code into 6 sections:
- Computations (init).
- Train Loop (training_step)
- Validation Loop (validation_step)
- Test Loop (test_step)
- Prediction Loop (predict_step)
- Optimizers and LR Schedulers (configure_optimizers)
The LightningModule has many conv... | github_jupyter |
```
import warnings
warnings.filterwarnings("ignore")
import os
import jieba
import torch
import pickle
import torch.nn as nn
import torch.optim as optim
import pandas as pd
from ark_nlp.model.tm.bert import Bert
from ark_nlp.model.tm.bert import BertConfig
from ark_nlp.model.tm.bert import Dataset
from ark_nlp.model... | github_jupyter |
```
%matplotlib inline
# import statements
import numpy as np
import matplotlib.pyplot as plt #for figures
from mpl_toolkits.basemap import Basemap #to render maps
import math
import json #to write dict with parameters
#import GrowYourIC
from GrowYourIC import positions, geodyn, geodyn_trg, geodyn_static, plot_data, ... | github_jupyter |
# Series Methods More
In this chapter, we cover several more less common, but still useful and important Series methods that you need to know in order to be fully capable at analyzing data with pandas.
* `agg` - Compute multiple aggregations at once
* `idxmax` and `idxmin` - Return the index of the max/min
* `diff` ... | github_jupyter |
```
# Load Data
import glob
import pandas as pd
def Carga_All_Files( ):
regexp='../data/covi*'
df = pd.DataFrame()
# Iterate trough LIST DIR and
for my_file in glob.glob(regexp):
this_df = pd.read_csv(my_file)
for columna in [ 'PCR' , 'Antic.' ] :
if columna in this_df.col... | github_jupyter |
# Data Science with Python : Markov's Chain #377
## What is Markov's Chain ?
Markov chains, named after <a href = "https://en.wikipedia.org/wiki/Andrey_Markov">Andrey Markov</a>, a stochastic model that depicts a sequence of possible events where predictions or probabilities for the next state based solely on its pre... | github_jupyter |
```
import pandas as pd
import requests
import json
MUC_compare_df = pd.read_csv('MUC_compare_df.csv')
PA_compare_df = pd.read_csv('PA_compare_df.csv')
MUC_df = pd.read_csv('MUC_poi_df.csv')
PA_df = pd.read_csv('PA_poi_df.csv')
charging_df = pd.read_csv('../PA_charging/PA_charging_data.csv')
MUC_compare_df.
MUC_compare... | github_jupyter |
```
import numpy as np
import tensorflow as tf
from sklearn.utils import shuffle
import re
import time
import collections
import os
def build_dataset(words, n_words, atleast=1):
count = [['PAD', 0], ['GO', 1], ['EOS', 2], ['UNK', 3]]
counter = collections.Counter(words).most_common(n_words)
counter = [i for... | github_jupyter |
# 1. 어제 오른 내 주식, 과연 내일은?
**ARIMA 시계열 분석법을 배우고, 직접 주식 시세를 예측해 본다.**
## 11-1. 들어가며
## 11-2. 시계열 예측이란(1) 미래를 예측한다는 것은 가능할까?
## 11-3. 시계열 예측이란(2) Stationary한 시계열 데이터
## 11-4. 시계열 예측이란(3) 시계열 데이터 사례분석
```bash
$ mkdir -p ~/aiffel/stock_prediction/data
$ ln -s ~/data/* ~/aiffel/stock_prediction/data
```
```
import nump... | github_jupyter |
<a href="https://colab.research.google.com/github/john-s-butler-dit/Numerical-Analysis-Python/blob/master/Chapter%2004%20-%20Multistep%20Methods/4_Problem_Sheet/406b_Problem_Sheet.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Problem Sheet Ques... | github_jupyter |
# Author : Kritika Srivastava
## Task 1 : Prediction using Supervised Machine Learning
## GRIP @ The Sparks Foundation
In this regression task I tried to predict the percentage of marks that a student is expected to score based upon the number of hours they studied.
This is a simple linear regression task as it invo... | github_jupyter |
# Thermal equilibrium
An ensemble of trajectories obtained from simulating Langevin dynamics will tend to a stable distribution: the Boltzmann distribution.
#### Problem setup
Two identical magnetic nanoparticles, aligned along their anisotropy axes. The system has 6 degrees of freedom (x,y,z components of magnetisa... | github_jupyter |
# chat bot api
```
from chatbot import Chat,reflections,multiFunctionCall
import wikipedia
import os
```
# Wikipedia API connection
```
def whoIs(query,sessionID="general"):
print(query)
try:
return wikipedia.summary(query)
except:
for newquery in wikipedia.search(query):
try:... | github_jupyter |
# GatedGCNs with DGL
From [Bresson & Laurent (2018) Residual Gated Graph ConvNets](https://arxiv.org/abs/1711.07553), adapted from [Xavier's notebook](https://drive.google.com/file/d/1WG5t6X12Z70JPtvA2-2PzdK3TMTQMsvm).
```
# Import libs
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
impor... | github_jupyter |
<a href="https://colab.research.google.com/github/smlra-kjsce/DL-in-NLP-101/blob/master/RNNs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#RNN Implementation
##Data Preprocessing
```
!wget http://cmshare.eea.europa.eu/s/6WZZ8dBECmER2EF/download... | github_jupyter |
# Deep Learning 101
This notebook presents the basics concepts that involve the concept of Deep Learning.
1. Linear Regression
* Logistic Regression
* Artificial Neural Networks
* Deep Neural Networks
* **Convolutional Neural Networks**
## 4. Convolutional Neural Networks
Convolutional networks are simply neural ne... | github_jupyter |
# Implementing the Gradient Descent Algorithm
In this lab, we'll implement the basic functions of the Gradient Descent algorithm to find the boundary in a small dataset. First, we'll start with some functions that will help us plot and visualize the data.
```
import matplotlib.pyplot as plt
import numpy as np
import ... | github_jupyter |
# Advanced Feature Engineering in Keras
**Learning Objectives**
1. Process temporal feature columns in Keras
2. Use Lambda layers to perform feature engineering on geolocation features
3. Create bucketized and crossed feature columns
## Introduction
In this notebook, we use Keras to build a taxifare price pred... | github_jupyter |
## Outlier Engineering
An outlier is a data point which is significantly different from the remaining data. “An outlier is an observation which deviates so much from the other observations as to arouse suspicions that it was generated by a different mechanism.” [D. Hawkins. Identification of Outliers, Chapman and Hal... | github_jupyter |
# Challenge 3 - Employment and Skills
This notebook demonstrates the use of the Python recipe wrapper to create a basic data pack that you can use to get you started with the GLA challenge of Employment and Skills. If you want to know more on the Challenge you can visit our [Tombolo website](http://www.tombolo.org.uk/... | github_jupyter |
# Get Passer Rating data by Play from DB
```
import mysql.connector
import pandas as pd
import numpy as np
from pandas import DataFrame
import matplotlib.mlab as mlab
from mysql.connector import errorcode
import matplotlib.pyplot as plt
%matplotlib inline
config = {
'user': 'db_gtown_2018',
'password': '****',
'port... | github_jupyter |
```
!pip install scikit-learn==1.0
!pip install xgboost==1.4.2
!pip install catboost==0.26.1
!pip install pandas==1.3.3
!pip install radiant-mlhub==0.3.0
!pip install rasterio==1.2.8
!pip install numpy==1.21.2
!pip install pathlib==1.0.1
!pip install tqdm==4.62.3
!pip install joblib==1.0.1
!pip install matplotlib==3.4.... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W0D5_Statistics/W0D5_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Tutorial 2: Statistical Inference
**Week 0, Day 5: Probability ... | github_jupyter |
**Outline**
Here's the general outline:
Given a square matrix M, we want to calculate its inverse, this is to say:
Given M we seek M_inverse in the following equation:
(i) M @ M_inverse = I
where
* @ is the matrix multiplication operator
* I is the identity matrix
* the dimensions of M, M_inverse and I are all ... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms, models
import cv2
from google.colab import drive
drive.mount('/content/drive')
import os
os.... | github_jupyter |
```
import numpy as np
import pandas as pd
import torch
import torchvision
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from matplotlib import pyplot as plt
%matplotlib inline
torch.backends... | github_jupyter |
# Backwards Compatability Examples with Different Protocols
## Prerequisites
* A kubernetes cluster with kubectl configured
* curl
* grpcurl
* pygmentize
## Setup Seldon Core
Use the setup notebook to [Setup Cluster](https://docs.seldon.io/projects/seldon-core/en/latest/examples/seldon_core_setup.html) to set... | github_jupyter |
## Organizing the system by scoring coupling and cohesion
### Intuition
Ordering by group / modules gives us a visual indication of how well the system accomplishes the design goal of loosely coupled and highly cohesive modules. We can quantify this idea.
Clustering is a type of assignment problem seeking the optima... | github_jupyter |
```
import tensorflow as tf
tf.config.experimental.list_physical_devices()
tf.test.is_built_with_cuda()
```
# Importing Libraries
```
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import os.path as op
import pickle
import tensorflow as tf
from tensorflow import keras
from keras.models im... | github_jupyter |
<a href="https://colab.research.google.com/github/SoumyadeepDebnath/DataEngineering_with_Python_by_SAM/blob/main/QualityCodes.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#### **Multiple Assignment**
```
# Instead of this
x = 10
y = 10
z = 10
a... | github_jupyter |
# Principal component analysis of ensemble forecast fields (GRIB)
In this example we will perform a principal component (PCA) analysis on ensemble forecast fields stored in GRIB format. We will use a combination of Metview, numpy and scipy to achieve this.
```
import metview as mv
import numpy as np
from scipy import... | github_jupyter |
```
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import NearestCentroid
from sklearn.neighbors import RadiusNeighborsClassifier
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
import seaborn as sns... | github_jupyter |
# Titanic Prediction using Python
### A huge thank you to Jose Portilla and his Udemy course for teaching me https://www.udemy.com/python-for-data-science-and-machine-learning-bootcamp/learn/v4
## Imports and reading in files
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as... | github_jupyter |
# Zero Pressure Gradient Flat Plate

#### References
http://turbmodels.larc.nasa.gov/flatplate.html
```
DATA_DIR='.'
REF_DATA_DIR='.'
from zutil import analysis
data_dir = DATA_DIR
ref_data_dir = REF_DATA_DIR
analysis.data_init(default_... | github_jupyter |
*This notebook is part of course materials for CS 345: Machine Learning Foundations and Practice at Colorado State University.
Original versions were created by Asa Ben-Hur.
The content is availabe [on GitHub](https://github.com/asabenhur/CS345).*
*The text is released under the [CC BY-SA license](https://creativecom... | github_jupyter |
# SPAM CLASSIFIER
Before you start download spam.csv dataset from: https://www.kaggle.com/uciml/sms-spam-collection-dataset
```
# default_exp train
```
## Input parameters for mlflow project
```
#export
import argparse
parser= argparse.ArgumentParser()
parser.add_argument('--max_features', type=int)
args = parse... | github_jupyter |
---
**Universidad de Costa Rica** | Escuela de Ingeniería Eléctrica
*IE0405 - Modelos Probabilísticos de Señales y Sistemas*
### `PyX` - Serie de tutoriales de Python para el análisis de datos
# `Py7` - *Graficación estadística*
> La visualización de resultados es fundamental en el análisis de datos. Python tiene... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.plotly as py
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
import plotly.graph_objs as go
import os
# print(os.listdir("../Software_Defect"))
data = pd.read_csv('cm... | github_jupyter |
# ML with TensorFlow Extended (TFX) -- Part 1
The puprpose of this tutorial is to show how to do end-to-end ML with TFX libraries on Google Cloud Platform. This tutorial covers:
1. Data analysis and schema generation with **TF Data Validation**.
2. Data preprocessing with **TF Transform**.
3. Model training with **TF E... | github_jupyter |
Value investing means to invest in the 50 cheapest stocks that are relative to the
common measure of business asset (earning or return)
```
import pandas as pd
import numpy as np
import xlsxwriter
import requests
from scipy import stats
stocks = pd.read_csv('sp_500_stocks.csv')
from secrets import IEX_CLOUD_API_TOK... | github_jupyter |
```
# Copyright 2021 Google LLC
#
# 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 agreed to in writi... | github_jupyter |
# Factor Model of Portfolio Return
```
import sys
!{sys.executable} -m pip install -r requirements.txt
import numpy as np
import pandas as pd
import time
import os
import quiz_helper
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = (14, 8)
```
### data bundle... | github_jupyter |
<a href="https://colab.research.google.com/github/dlmacedo/starter-academic/blob/master/content/courses/deeplearning/notebooks/tensorflow/saving_and_serializing.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
##### Copyright 2019 The TensorFlow Auth... | github_jupyter |
### Preparation steps
Install iotfunctions with
`pip install git+https://github.com/ibm-watson-iot/functions@development`
This projects contains the code for the Analytics Service pipeline as well as the anomaly functions and should pull in most of this notebook's dependencies.
The plotting library matplotlib is th... | github_jupyter |
# TensorFlow2.0教程-过拟合和欠拟合
```
from __future__ import absolute_import, division, print_function
import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
NUM_WORDS = 10000
(train_data, train_labels), (test_data, test_labels) = keras.datasets.imdb.lo... | github_jupyter |
```
!nvidia-smi
!pip --quiet install transformers
!pip --quiet install tokenizers
from google.colab import drive
drive.mount('/content/drive')
!cp -r '/content/drive/My Drive/Colab Notebooks/Tweet Sentiment Extraction/Scripts/.' .
COLAB_BASE_PATH = '/content/drive/My Drive/Colab Notebooks/Tweet Sentiment Extraction/'
M... | github_jupyter |
```
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import tensorflow as tf
from keras import backend as K
K.set_image_dim_ordering('th')
import numpy as np
import pandas as pd
import cv2
import zarr
import glob
import matplotlib.pyplot as plt
%matplotlib inline
from ke... | github_jupyter |
# Plotting and Visualization
---
Created on 2019-05-22
Update on 2019-05-22
Author: Jiacheng
Github: https://github.com/Jiachengciel/Data_Analysis
---
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib notebook
```
---
## 1. A Brief matplotlib API Primer
## matplotlib API入门... | github_jupyter |
```
# Copyright 2020 Google LLC
#
# 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 agreed to in writi... | github_jupyter |
```
# Copyright 2021 Google LLC
#
# 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 agreed to in writi... | github_jupyter |
# SLU12: Feature Engineering (aka Real World Data): Examples notebook
---
In this notebook we will cover the following:
* Types of statistical data
* Dealing with numerical features
* Dealing with categorical features
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
impor... | github_jupyter |
# Exercise 15 - More plotting
In this exercise, we will meet some more advanced features of Python's plotting capabilities.
In `matplotlib`, a `figure` represents the entire 'page' you can draw on, and can contain multiple `axes`, each of which contains a single plot. This allows you to build up complex, multi-panel... | github_jupyter |
# HLCM Diagnostic
Arezoo Besharati, Paul Waddell, UrbanSim, July 2018
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Preliminaries" data-toc-modified-id="Preliminaries-1"><span class="toc-item-num">1 </span>Preliminaries</a></span><ul class... | github_jupyter |
# Exposure Time Calculator tutorial
```
# Allows interactive plot within this notebook
%matplotlib notebook
# Allows to take into account modifications made in the source code without having to restart the notebook
%reload_ext autoreload
%autoreload 2
```
# Telescope configuration Files
First you need to define the... | github_jupyter |
# Time Domain and Gating
## Intro
This notebooks demonstrates how to use [scikit-rf](www.scikit-rf.org) for time-domain analysis and gating. A quick example is given first, followed by a more detailed explanation.
S-parameters are measured in the frequency domain, but can be analyzed in time domain if you like. ... | github_jupyter |
# 5. Combining arrays
We have already seen how to create arrays and how to modify their dimensions. One last operation we can do is to combine multiple arrays. There are two ways to do that: by assembling arrays of same dimensions (concatenation, stacking etc.) or by combining arrays of different dimensions using *bro... | github_jupyter |
# Data Processing and Versioning
```
%matplotlib inline
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.pyplot import figure
import seaborn as sn
from azureml.core import Workspace, Dataset
# import dataset
df = pd.read_csv('Dataset/weather_dataset_raw.csv')
```
# 1. Data ... | 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 a... | github_jupyter |
# Keypoint Detectors
```
import os
import csv
import matplotlib.pyplot as plt
data_dir = "data/keypoints"
names = ["SHITOMASI", "HARRIS", "FAST", "BRISK", "ORB", "AKAZE", "SIFT"]
images = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
data = dict()
# read data
class KeypointLineWrapper:
def __init__(self, lst):
self._l... | github_jupyter |
# Generate a Vecsigrafo using Swivel
In this notebook we show how to generate a Vecsigrafo based on a subset of the [UMBC corpus](https://ebiquity.umbc.edu/resource/html/id/351/UMBC-webbase-corpus).
We follow the procedure described in [Towards a Vecsigrafo: Portable Semantics in Knowledge-based Text Analytics](http... | github_jupyter |
```
import numpy as np
import pandas as pd
from tqdm import tqdm
trainData = np.load('../../../dataFinal/npy_files/fin_t2_train.npy')
trainLabels = open('../../../dataFinal/finalTrainLabels.labels', 'r').readlines()
testData = np.load('../../../dataFinal/npy_files/fin_t2_test.npy')
testLabels = open('../../../dataFinal... | github_jupyter |
2D image (width, height) ==> (width * features * resolution, height)
```
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
import pdb
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import random
from scipy.ndimage.filters import gaussia... | github_jupyter |
```
import keras
keras.__version__
```
# 5.2 - Using convnets with small datasets
This notebook contains the code sample found in Chapter 5, Section 2 of [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python?a_aid=keras&a_bid=76564dff). Note that the original text features far more conte... | github_jupyter |
# Convolutional Sentiment Classifier
In this notebook, we build a *convolutional* neural net to classify IMDB movie reviews by their sentiment.
```
#load watermark
%load_ext watermark
%watermark -a 'Gopala KR' -u -d -v -p watermark,numpy,pandas,matplotlib,nltk,sklearn,tensorflow,theano,mxnet,chainer,seaborn,keras,tfl... | github_jupyter |
```
import sys
from pathlib import Path
from addict import Dict
from copy import deepcopy
sys.path.append('../../')
import numpy as np
import pandas as pd
import pylab as plt
import seaborn as sns
from sklearn.metrics import accuracy_score, roc_auc_score
from sklearn.model_selection import GroupShuffleSplit
from skl... | github_jupyter |
STAT 453: Deep Learning (Spring 2020)
Instructor: Sebastian Raschka (sraschka@wisc.edu)
Course website: http://pages.stat.wisc.edu/~sraschka/teaching/stat453-ss2020/
GitHub repository: https://github.com/rasbt/stat453-deep-learning-ss20
```
%load_ext watermark
%watermark -a 'Sebastian Raschka' -v -p torch
```
... | github_jupyter |
#### Example 1. Access individual elements of 1-D array
```
import numpy as np
# We create a rank 1 ndarray that contains integers from 1 to 5
x = np.array([1, 2, 3, 4, 5])
# We print x
print()
print('x = ', x)
print()
# Let's access some elements with positive indices
print('This is First Element in x:', x[0])
pr... | github_jupyter |
Lambda School Data Science
*Unit 2, Sprint 1, Module 3*
---
# Ridge Regression
## Assignment
We're going back to our other **New York City** real estate dataset. Instead of predicting apartment rents, you'll predict property sales prices.
But not just for condos in Tribeca...
- [ ] Use a subset of the data where... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import torch
from UnarySim.sw.kernel.div import UnaryDiv
from UnarySim.sw.stream.gen import RNG, SourceGen, BSGen
from UnarySim.sw.metric.metric import ProgressiveError
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib... | github_jupyter |
**[SQL Home Page](https://www.kaggle.com/learn/intro-to-sql)**
---
# Introduction
Queries with **GROUP BY** can be powerful. There are many small things that can trip you up (like the order of the clauses), but it will start to feel natural once you've done it a few times. Here, you'll write queries using **GROUP BY... | github_jupyter |
## Logistic Regression in Plaintext : Training and Evaluation
The file Plaintext_train_eval.ipynb shows the implementation and evaluation of Logistic Regression using Nesterov's Accelereated Gradient method.
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
import sklearn
from skl... | github_jupyter |
RMinimum : Full - Test - Case: $k(n) = \log(n)/\log(\log(n))$
```
import math
import random
import queue
```
Testfälle : k(n) = n^(1/2)
```
# User input
n = 2**22
# Automatic generation: k = log(n)/loglog(n), X = [0, ..., n-1]
lgn = math.log(n) / math.log(2)
k = int(lgn / (math.log(lgn)/math.log(2)))
X = [i for i i... | github_jupyter |
# Introduction to pysptk
This notebook shows a few typical usages of pysptk, with a focus on a spectral parameter estimation. The steps are composed of:
- windowing
- mel-generalized cepstrum analysis
- visualize spectral envelope estimates
- F0 estimation
## Requirements
- pysptk: https://github.com/r9y9/pysptk
- ... | github_jupyter |
```
#IMPORT SEMUA LIBARARY
#IMPORT LIBRARY PANDAS
import pandas as pd
#IMPORT LIBRARY UNTUK POSTGRE
from sqlalchemy import create_engine
import psycopg2
#IMPORT LIBRARY CHART
from matplotlib import pyplot as plt
from matplotlib import style
#IMPORT LIBRARY BASE PATH
import os
import io
#IMPORT LIBARARY PDF
from fpdf im... | github_jupyter |
TSG050 - Cluster create hangs with “timeout expired waiting for volumes to attach or mount for pod”
===================================================================================================
Description
-----------
The controller gets stuck during the `bdc create` create process.
> Events: Type Reason Age F... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.