code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
<a href="https://colab.research.google.com/github/Imotep460/FastAIBlog/blob/master/_notebooks/2021-02-16-Kapitel-2%3A-hotdogs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
from... | github_jupyter |
A neural network consist of cnn layer (Kim,2014) and 4 fully connected layers.
Source: https://github.com/jojonki/cnn-for-sentence-classification
```
from google.colab import drive
drive.mount('/content/drive')
import os
os.chdir('/content/drive/MyDrive/sharif/DeepLearning/ipython(guide)')
import numpy as np
import... | 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 |
# Modeling and Simulation in Python
Chapter 14
Copyright 2017 Allen Downey
License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0)
```
# Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an a... | github_jupyter |
## Business Understanding
Now let's look at the 2nd question of interest. That is - What part of the StackOverflow affects the users satisfaction towards StackOverflow?
I use the data from the Stack Overflow survey answered by more than 64,000 reviewers, with the personal information, coding experience, attitude towar... | github_jupyter |
# LeetCode Algorithm Test Case 551
## (学生出勤记录 I)[https://leetcode-cn.com/problems/student-attendance-record-i/]
[TOC]
给你一个字符串 s 表示一个学生的出勤记录,其中的每个字符用来标记当天的出勤情况(缺勤、迟到、到场)。记录中只含下面三种字符:
1. 'A':Absent,缺勤
2. 'L':Late,迟到
3. 'P':Present,到场
如果学生能够 同时 满足下面两个条件,则可以获得出勤奖励:
1. 按 总出勤 计,学生缺勤('A')严格 少于两天。
2. 学生 不会 存在 连续 3 天或 3 天以... | github_jupyter |
# Supplemental Information
This notebook is intended to serve as a supplement to the manuscript "High-throughput workflows for determining adsorption energies on solid surfaces." It outlines basic use of the code and workflow software that has been developed for processing surface slabs and placing adsorbates accord... | github_jupyter |
# Decoding specified ISS tile(s)
This notebook provides an exampe how to decode an ISS tile from the mouse brain dataset used in the PoSTcode paper that is stored at local directory ``postcode/example-iss-tile-data/``.
```
import numpy as np
import pandas as pd
from pandas import read_csv
import matplotlib.pyplot as p... | github_jupyter |
<a href="https://colab.research.google.com/github/Gaurav7004/NEWS_ARTICLES_DEPLOYMENT/blob/main/ALL_NEWSPAPERS_ARTICLES_EXTRACTION_13th_Jan_2022.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from bs4 import BeautifulSoup
import requests
import... | github_jupyter |
# Self DCGAN
<table class="tfo-notebook-buttons" align="left" >
<td>
<a target="_blank" href="https://colab.research.google.com/github/HighCWu/SelfGAN/blob/master/implementations/dcgan/self_dcgan.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" />Run in Google Colab</a>
</td>
<td>
<... | github_jupyter |
```
import pandas as pd
import numpy as np
import gc
from time import time
import math
import random
import datetime
import pkg_resources
#import seaborn as sns
import scipy.stats as stats
import gc
import re
import operator
import sys
from sklearn import metrics
from sklearn import model_selection
import torch
impor... | github_jupyter |
# Standard Normal N(0,1)
Generate a total of 2000 i.i.d. standard normals N(0,1) using each method. Test the normality of the standard normals obtained from each method, using the Anderson-Darling test. Which data set is closer to the normal distribution? (Consult the paper by Stephens - filename 2008 Stephens.pdf on ... | github_jupyter |
##### Copyright 2020 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 |
# Diagramas de Cortante e Momento em Vigas
Exemplo disponível em https://youtu.be/MNW1-rB46Ig
<img src="viga1.jpg">
```
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
from matplotlib import rc
# Set the font dictionaries (for plot title and axis titles)
rc('font',... | github_jupyter |
<img src="../images/Boeing_full_logo.png" alt="Boeing" style="width: 400px;"/>
<br/>
<img src="../images/aeropython_logo.png" alt="AeroPython" style="width: 200px;"/>
# NumPy: Entrada/Salida
Con E/S (I/O en inglés) entendemos leer y escribir datos archivos. Es algo que necesitaremos hacer con relativa frecuencia, y... | github_jupyter |
# EventVestor: Shareholder Meetings
In this notebook, we'll take a look at EventVestor's *Shareholder Meetings* dataset, available on the [Quantopian Store](https://www.quantopian.com/store). This dataset spans January 01, 2007 through the current day, and documents companies' annual and special shareholder meetings c... | github_jupyter |
# Stack Overflow Survey 2019 Analysis
## Business Understanding
I am interested in finding the answers to the following questions related to career satisfaction.
- Are Developers satisfied with thier career?
- Who are the most satisfied developers?
- Is there is a significant relationship between compensation an... | github_jupyter |
```
import mxnet as mx
import numpy as np
import random
import bisect
# set up logging
import logging
reload(logging)
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s', level=logging.DEBUG, datefmt='%I:%M:%S')
```
# A Glance of LSTM structure and embedding layer
We will build a LSTM network to learn ... | github_jupyter |
# Further Pre-training MobileBERT MLM with Client-side Adam (Shakepeare)
```
# Copyright 2020, The TensorFlow Federated Authors.
# Copyright 2020, Ronald Seoh
#
# 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 o... | github_jupyter |
### Some helper functions
```
# define helper functions
def imShow(path):
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
image = cv2.imread(path)
height, width = image.shape[:2]
resized_image = cv2.resize(image,(3*width, 3*height), interpolation = cv2.INTER_CUBIC)
fig = plt.gcf()
fig.s... | github_jupyter |
## Depth Contours
### Generate depth-contours of all the Pareto-optimal data sets.
This notebook can be used to generate tradeoff values from all the Pareto-optimal data point files hard-coded in the dictionary `pfs`. Currently this notebook processes these Pareto-optimal fronts.
- DTLZ2 ($m$-Sphere) Problem
- DEBMD... | github_jupyter |
# p-Hacking and Multiple Comparisons Bias
By Delaney Mackenzie and Maxwell Margenot.
Part of the Quantopian Lecture Series:
* [www.quantopian.com/lectures](https://www.quantopian.com/lectures)
* [github.com/quantopian/research_public](https://github.com/quantopian/research_public)
Notebook released under the Creati... | github_jupyter |
# Roll decay test parameter sensitivity many
```
%matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
pd.set_option("display.max_rows", 200)
import matplotlib.pyplot as plt
from pylab import rcParams
rcParams['figure.figsize'] = 15, 7
import os
import copy
from scipy.optimize ... | github_jupyter |
# Artificial Intelligence Nanodegree
## Recurrent Neural Network Projects
Welcome to the Recurrent Neural Network Project in the Artificial Intelligence Nanodegree! In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete t... | github_jupyter |
# VacationPy
----
#### Note
* Keep an eye on your API usage. Use https://developers.google.com/maps/reporting/gmp-reporting as reference for how to monitor your usage and billing.
* Instructions have been included for each segment. You do not have to follow them exactly, but they are included to help you think throug... | github_jupyter |
# Simple Quantum Implementation using Qiskit Aqua for Boolean satisfiability problems
This Jupyter notebook demonstrates how easy it is to use quantum algorithms from [Qiskit Aqua](https://qiskit.org/aqua) to solve Boolean satisfiability problems [(SAT)](https://en.wikipedia.org/wiki/Boolean_satisfiability_problem).... | 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 writing, software
distri... | github_jupyter |
$
\DeclareMathOperator{\E}{\mathbb{E}}
\DeclareMathOperator{\R}{\mathcal{R}}
\DeclareMathOperator{\wv}{\mathbf{w}}
\newcommand{\bm}{\boldsymbol}
$
# ITCS 6010: Assignment #3 (V1)
<font color="red">(Due: 11 pm on Dec 3rd) </font>
### 1. The value of an action, $Q^\pi(s,a)$, depends on the expected next reward and the... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

# Deploy models to Azure Kubernetes Service (AKS... | github_jupyter |
# Examining Racial Discrimination in the US Job Market
### Background
Racial discrimination continues to be pervasive in cultures throughout the world. Researchers examined the level of racial discrimination in the United States labor market by randomly assigning identical résumés to black-sounding or white-sounding n... | github_jupyter |
<img src="images/JHI_STRAP_Web.png" style="width: 150px; float: right;">
# Supplementary Information: Holmes *et al.* 2020
# 2. Full model fitting
This notebook describes fitting of a Bayesian hierarchical model of the effects of control (growth) and treatment (passage) on individual genes from *E. coli* DH10B (carr... | github_jupyter |
```
import pandas as pd
import cv2
import numpy as np
import matplotlib.pyplot as plt
expression_df=pd.read_csv("C:/Users/user/Desktop/New folder/icml_face_data.csv")
expression_df.head()
expression_df[' Usage'].unique()
expression_df['emotion'].unique()
import collections
collections.Counter(np.array(expression_df['em... | github_jupyter |
```
import course;course.header()
```
# The csv module
There are several ways to interact with files that contain data in a "comma separated value" format.
We cover the [basic csv module](https://docs.python.org/3/library/csv.html), as it is sometimes really helpful to retain only a fraction of the information of a... | github_jupyter |
```
import time
import psutil
import os
%run BurrowsWheelerTransformImproved.ipynb
class FMIndexImproved():
@staticmethod
def SampleSuffixArray(suffixArray, step = 32):
sampledSA = {}
for index, suffix in enumerate(suffixArray):
if suffix % step == 0:
sampledSA[index]... | github_jupyter |
# Programming with Python
## Episode 3 - Storing Multiple Values in Lists
Teaching: 30 min,
Exercises: 30 min
## Objectives
- Explain what a list is.
- Create and index lists of simple values.
- Change the values of individual elements
- Append values to an existing list
- Reorder and slice list elements
- Create a... | github_jupyter |
# Tutorial 1 for R
## Solve Dantzig's Transport Problem using the *ix modeling platform* (ixmp)
<img style="float: right; height: 80px;" src="_static/R_logo.png">
### Aim and scope of the tutorial
This tutorial takes you through the steps to import the data for a very simple optimization model
and solve it using th... | github_jupyter |
# Unsupervised Graph Learning with GraphSage
GraphScope provides the capability to process learning tasks. In this tutorial, we demostrate how GraphScope trains a model with GraphSage.
The task is link prediction, which estimates the probability of links between nodes in a graph.
In this task, we use our implementa... | github_jupyter |
Lambda School Data Science
*Unit 4, Sprint 3, Module 2*
---
# Convolutional Neural Networks (Prepare)
> Convolutional networks are simply neural networks that use convolution in place of general matrix multiplication in at least one of their layers. *Goodfellow, et al.*
## Learning Objectives
- <a href="#p1">Part ... | github_jupyter |
This notebook is designed to run in a IBM Watson Studio default runtime (NOT the Watson Studio Apache Spark Runtime as the default runtime with 1 vCPU is free of charge). Therefore, we install Apache Spark in local mode for test purposes only. Please don't use it in production.
In case you are facing issues, please re... | github_jupyter |
```
from IPython.display import YouTubeVideo
YouTubeVideo('FPgo-hI7OiE')
```
# 如何使用和开发微信聊天机器人的系列教程
# A workshop to develop & use an intelligent and interactive chat-bot in WeChat
### WeChat is a popular social media app, which has more than 800 million monthly active users.
<img src='http://www.kudosdata.com/wp-cont... | github_jupyter |
# Monte-Carlo Method
## Install External Libraries
```
!pip install PyPortfolioOpt
!pip install yfinance
```
## Import Dependencies
```
import matplotlib
import pypfopt
import datetime
import math
import pandas as pd
import numpy as np
import yfinance as yf
import matplotlib.pyplot as plt
```
## Set Local Variabl... | github_jupyter |
```
import pandas as pd
import json
import numpy as np
megye={'Fehér':'ALBA', 'Arad':'ARAD', 'Bukarest':'B', 'Bákó':'BACAU', 'Bihar':'BIHOR', 'Beszterce-Naszód':'BISTRITA-NASAUD',
'Brassó':'BRASOV', 'Kolozs':'CLUJ', 'Kovászna':'COVASNA', 'Krassó-Szörény':'CARAS-SEVERIN', 'Hunyad':'HUNEDOARA',
'Hargita':'H... | github_jupyter |
# 1次元のデータの整理
## データの中心の指標
```
import numpy as np
import pandas as pd
# Jupyter Notebookの出力を小数点以下3桁に抑える
%precision 3
# Dataframeの出力を小数点以下3桁に抑える
pd.set_option('precision', 3)
df = pd.read_csv('../data/ch2_scores_em.csv',
index_col='生徒番号')
# dfの最初の5行を表示。df.head(3) にすれば3行。
df.head()
# df['英語'] は Pamdas ... | github_jupyter |
## RIHAD VARIAWA, Data Scientist - Who has fun LEARNING, EXPLORING & GROWING
<h1 align="center"><font size="5">COLLABORATIVE FILTERING</font></h1>
Recommendation systems are a collection of algorithms used to recommend items to users based on information taken from the user. These systems have become ubiquitous can be... | github_jupyter |
# Melanoma analysis with fractal neural networks
This notebook shows how good is [Fractal neural network](#Fractal-neural-network) for [melanoma](#Melanoma) analysis.
```
import os
import datetime
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_addons as tfa
import matplotlib... | github_jupyter |
# Let's apply the GP-based optimizer to our small Hubbard model.
Make sure your jupyter path is the same as your virtual environment that you used to install all your packages.
If nopt, do something like this in your terminal:
`$ ipython kernel install --user --name TUTORIAL --display-name "Python 3.9"`
```
# check... | github_jupyter |
# Performance analysis at system-level
## Reproduce line chart for CPU utiliztion
```
import py2neo
import pandas as pd
import matplotlib.pyplot as plt
graph = py2neo.Graph(bolt=True, host='localhost', user='neo4j', password = 'neo4j')
# query for CPU measurements
cpu_query = """
MATCH (r:Record)-[:CONTAINS]->(c:Cp... | github_jupyter |
# KNN, Decision Tree, SVM, and Logistic Regression Classifiers to Predict Loan Status
Today, we'll look into the question: will a new bank customer default on his or her loan? We'll optimize, train, make predictions with, and evaluate four classification models - K Nearest Neighbor (KNN), Decision Tree, Support Vector... | github_jupyter |
# Introduction to Data Science
# Lecture 25: Neural Networks II
*COMP 5360 / MATH 4100, University of Utah, http://datasciencecourse.net/*
In this lecture, we'll continue discussing Neural Networks.
Recommended Reading:
* A. Géron, [Hands-On Machine Learning with Scikit-Learn & TensorFlow](http://proquest.safariboo... | github_jupyter |
# Red Giant Mode fitting
Fitting $nstars$ RG stars chosen at random using Vrard model.
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import pystan
import random
#import output data
nstars = 5
IDs = []
stardat = pd.read_csv('RGdata/output_1000stars.csv', delim_whitesp... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Terrain/us_ned_physio_diversity.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a targ... | github_jupyter |
```
import sys
import pickle
import numpy as np
import matplotlib.pyplot as plt
sys.path.append("../..")
import gradient_analyze as ga
import hp_file
filename = './results.pickle'
with open(filename, "rb") as file:
results = pickle.load(file)
hess_exact = np.array([[ 0.794, 0.055, 0.109, -0.145, 0. ],
... | github_jupyter |
# ML Pipeline Preparation
Follow the instructions below to help you create your ML pipeline.
### 1. Import libraries and load data from database.
- Import Python libraries
- Load dataset from database with [`read_sql_table`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sql_table.html)
- Define fea... | github_jupyter |
# Dowloading data
We'll use a shell command to download the zipped data, unzip it into are working directory (folder).
```
!wget "https://docs.google.com/uc?export=download&id=1h3YjfecYS8vJ4yXKE3oBwg3Am64kN4-x" -O temp.zip && unzip -o temp.zip && rm temp.zip
```
# Importing and Cleaning the Data
```
import pandas a... | github_jupyter |
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
from sklearn.linear_model... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.svm import SVC
from sklearn.metrics import roc_auc_score, roc_curve
from mlxtend.plotting import plot_decision_regions
from sklearn impor... | github_jupyter |
# TensorFlow Tutorial
Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caffe, Ke... | github_jupyter |
# Лабораторная работа №3. Однофакторный дисперсионный анализ
> Вариант № ??
**Распределения**:
$X_1$ ~ ?? (объём выборки $n_1$ — ?)
$X_2$ ~ ?? (объём выборки $n_2$ — ?)
$X_3$ ~ ?? (объём выборки $n_3$ — ?)
```
%matplotlib inline
import numpy as np
from scipy import stats
import matplotlib.pyplot... | github_jupyter |
# Horse or Human? In-graph training loop Assignment
This assignment lets you practice how to train a Keras model on the [horses_or_humans](https://www.tensorflow.org/datasets/catalog/horses_or_humans) dataset with the entire training process performed in graph mode. These steps include:
- loading batches
- calculatin... | github_jupyter |
# Rejection Sampling
Rejection sampling, or "accept-reject Monte Carlo" is a Monte Carlo method used to generate obsrvations from distributions. As it is a Monte Carlo it can also be used for numerical integration.
## Monte Carlo Integration
### Example: Approximation of $\pi$
Enclose a quadrant of a circle of radi... | github_jupyter |
# Ways to visualize top count with atoti
Given different categories of items, we will explore how to achieve the following with atoti:
- Visualize top 10 apps with the highest rating in table
- Visualize top 10 categories with most number of apps rated 5 in Pie chart
- Visualize top 10 apps for each category in subplo... | github_jupyter |
```
from HSICLassoVI.models import api
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.metrics import *
```
## Data1: Additive model
```
N, P = 1000, 256
mean = np.zeros(P)
cov = np.eye(P)
np.random.seed(1)
```
$$
y\in\mathbb{R}^{1000}, X\... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D5_DeepLearning2/W3D5_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Neuromatch Academy: Week 3, Day 5, Tutorial 2
# Deep Learnin... | github_jupyter |
```
pip install cached_property
from PIL import Image
from cached_property import cached_property
from skimage import io
from torch.autograd import Variable
from torch.optim import lr_scheduler
from torch.utils.data import Dataset
from torchvision import transforms, datasets
import glob
import matplotlib.pyplot as plt
... | github_jupyter |
# Author : Vedanti Ekre
# Email: vedantiekre@gmail.com
## Task 1 : Prediction using Supervised Machine Learning
___
## GRIP @ The Sparks Foundation
____
# Role : Data Science and Business Analytics [Batch May-2021]
## TABLE OF CONTENTS:
1. [Introduction](#intro)
2. [Importing the dependencies](#libs)
3. [Loading th... | github_jupyter |
## Genere un conjunto de datos nuevos a partir de CSV con al menos 50mil registros y prediga cuáles serían las respuestas de una nueva encuestaenel 2018.(Adjunte el análisis y el algoritmo que le permitió generar los registros manteniendo la línea de tendencia con base en las encuestas anteriores)
```
import pandas as... | github_jupyter |
```
import run_info_utils
df = run_info_utils.get_df_run_info()
df.head()
# print(list(df.columns))
experiment_name = 'jordan_cp9_add_sub_maxstep'
df = df.loc[df['experiment_name'] == experiment_name]
cols = ['run_id', 'operator', 'rnn_type', 'confidence_prob', 'operand_bits', 'hidden_activation', 'max_steps',
'dev/la... | github_jupyter |
<p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"><br>
Pandas</p><br>
*pandas* is a Python library for data analysis. It offers a number of data exploration, cleaning and transformation operations that are critical in working with data in Python.
*pandas* build upon *numpy* and *scipy* pr... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import string
df = pd.read_csv('./Documents/listings.csv')
df.head()
Ht = pd.read_csv('./Documents/Hawaii_Tourisim_Data.csv')
Ht
Ht['Value']=pd.to_numeric(Ht['Value']) # convert the data type to numeric
visitor_month=Ht.gr... | github_jupyter |
# What you will learn
- What is a CSV file
- Reading and writting on a csv file
### CSV = Comma seperated values
Chances are you have worked with .csv files before. There are simply values sperated by commas ...
#### Note
- All files used or created will be stored under week 3 in a folder called "data"
Here is some... | github_jupyter |
# Simple training tutorial
The objective of this tutorial is to show you the basics of the library and how it can be used to simplify the audio processing pipeline.
This page is generated from the corresponding jupyter notebook, that can be found on [this folder](https://github.com/fastaudio/fastaudio/tree/master/doc... | github_jupyter |
# Table of Contents
<p><div class="lev1"><a href="#Dependent-Things"><span class="toc-item-num">1 </span>Dependent Things</a></div><div class="lev1"><a href="#Cancer-Example"><span class="toc-item-num">2 </span>Cancer Example</a></div><div class="lev2"><a href="#Question-1"><span class="toc-item-... | github_jupyter |
# 0.0. IMPORTS
```
import pandas as pd
import inflection
import math
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from IPython.display import Image
import datetime
from scipy import stats
```
## 0.1. Helper Functions
```
def cramer_v(x, y):
cm = pd.crosstab(x, y).as_matrix()
n ... | github_jupyter |
<h3 align=center> Combining Datasets: Merge and Join</h3>
One essential feature offered by Pandas is its high-performance, in-memory join and merge operations.
If you have ever worked with databases, you should be familiar with this type of data interaction.
The main interface for this is the ``pd.merge`` function, an... | github_jupyter |
<a href="https://colab.research.google.com/github/RugvedKatole/Learning-Single-Camera-Depth-Estimation-using-Dual-Pixels/blob/main/Dual_Pixel_Net.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Dual Pixel Net implementation
Link to Paper: [Learnin... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/Naren-Jegan/Deep-Learning-Keras/blob/master/One_Shot_Classification_V1.ipynb)
# One Shot Learning on Omniglot Dataset
The [Omniglot](https://github.com/brendenlake/omniglot) dataset contains 1623 different handwritten characters from 50 different alphabe... | github_jupyter |
```
%reload_ext autoreload
%autoreload 2
%matplotlib inline
import os
os.chdir('../../')
from musicautobot.numpy_encode import *
from musicautobot.utils.file_processing import process_all, process_file
from musicautobot.config import *
from musicautobot.music_transformer import *
from musicautobot.multitask_transformer... | github_jupyter |
```
library(tidyverse)
library(broom) #glance
library(knitr) #kable
library(MASS) #stepAIC
library(data.table) #fread
library(car) #vif
```
Recommend a model to predict the y variable -- “Opening Weekend Gross” with the possible predictors (no interactions) -- Runtime, Production Budget, Critic Rating, Audience Rating... | github_jupyter |
```
import matplotlib
from matplotlib.axes import Axes
from matplotlib.patches import Polygon
from matplotlib.path import Path
from matplotlib.ticker import NullLocator, Formatter, FixedLocator
from matplotlib.transforms import Affine2D, BboxTransformTo, IdentityTransform
from matplotlib.projections import register_pro... | github_jupyter |
## Arkouda example of cosine distance and euclidean distance
- Two random arkouda int64 pdarrays are created then the distance is measured between them...
- The cosine and euclidean distance functions are compared against the scipy variants for correctness
Arkouda functions used:
- `ak.connect`
- `ak.randint`
- `ak.su... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
filename = "https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DA0101EN/auto.csv"
headers = ["symboling","normalized-losses","make","fuel-type","aspiration", "num-of-doors","body-style",
"drive-wheels","eng... | github_jupyter |
# Set-up
```
# libraries
import re
import numpy as np
import pandas as pd
from pymongo import MongoClient
# let's connect to the localhost
client = MongoClient()
# let's create a database
db = client.moma
# collection
artworks = db.artworks
# print connection
print("""
Database
==========
{}
Collection
==========... | github_jupyter |
```
# this is for the data from the three runs where we try
# each of the conflict resolutions
# imports and reading csv
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import os
import sys
#get correct path for files
__file__ = 'conflict_res'
absolute... | github_jupyter |
# Gaussian Process (GP) smoothing
This example deals with the case when we want to **smooth** the observed data points $(x_i, y_i)$ of some 1-dimensional function $y=f(x)$, by finding the new values $(x_i, y'_i)$ such that the new data is more "smooth" (see more on the definition of smoothness through allocation of va... | github_jupyter |
```
# %load /Users/facai/Study/book_notes/preconfig.py
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import SVG
```
逻辑回归在scikit-learn中的实现简介
==============================
分析用的代码版本信息:
```bash
~/W/g/scikit-learn ❯❯❯ git log -n 1
commit d161bfaa1a42da75f4940464f7f1c524e... | 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 |
# Basic functionality tests.
If the notebook cells complete with no exception the tests have passed.
The tests must be run in the full `jupyter notebook` or `jupyter lab` environment.
*Note:* I couldn't figure out to make the validation tests run correctly
at top level cell evaluation using `Run all`
because the wi... | github_jupyter |
# MNLI Diagnostic Example
## Setup
#### Install dependencies
```
%%capture
!git clone https://github.com/jiant-dev/jiant.git
%%capture
# This Colab notebook already has its CUDA-runtime compatible versions of torch and torchvision installed
!sed -e /"torch==1.5.0"/d -i jiant/requirements.txt
!sed -e /"torchvision==0... | github_jupyter |
# MNIST Digit Classification Neural Network
---
A neural network is a system of interconnected nodes, or artificial neurons that perform some task by learning from a dataset and incrementally improving its own performance. These artificial neurons are organised into multiple layers including an input layer, where data... | github_jupyter |
```
import numpy as np
import pandas as pd
from sklearn import metrics
from sklearn import model_selection
from sklearn import preprocessing
import dask.dataframe as ddf
import dask
import tensorflow as tf
```
### Load NYC Taxi fare prepped data
```
train_df = (pd
.read_parquet("../../datasets/kaggle/new... | github_jupyter |
## 範例重點
* 學習如何在 keras 中加入 EarlyStop
* 知道如何設定監控目標
* 比較有無 earlystopping 對 validation 的影響
```
import os
from tensorflow import keras
# 本範例不需使用 GPU, 將 GPU 設定為 "無"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
train, test = keras.datasets.cifar10.load_data()
## 資料前處理
def preproc_x(x, flatten=True):
x = x / 255.
if flat... | github_jupyter |
# Automatic Differentiation
:label:`chapter_autograd`
In machine learning, we *train* models, updating them successively
so that they get better and better as they see more and more data.
Usually, *getting better* means minimizing a *loss function*,
a score that answers the question "how *bad* is our model?"
This... | github_jupyter |
## Rover Project Test Notebook
This notebook contains the functions from the lesson and provides the scaffolding you need to test out your mapping methods. The steps you need to complete in this notebook for the project are the following:
* First just run each of the cells in the notebook, examine the code and the re... | github_jupyter |
# Binary Classifier on Single records
### Most basic example.
This notebook will show how to set-up learning features (i.e. fields we want to use for modeling) and read them from a CSV file. Then create a very simple feed-forward Neural Net to classify fraud vs. non-fraud, train the model and test it.
Throughout thes... | github_jupyter |
### Before running:
Please set the file structure as follows:
* parent folder
* backgrounds - includes all background pictures
* dataset - generated images and masks will be placed here
* images
* masks
* strawberry autolabelling.ipynb
* strawberry.png
* strawberry2.png
``... | github_jupyter |
```
%matplotlib inline
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
from scipy import stats as st
import numpy as np
import pandas as pd
import datetime as dt
```
# Reflect Tables into SQLAlchemy ORM
```
# Python SQL toolkit and Object Relational Mapper
import sqlalchemy
f... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('classic')
%matplotlib inline
```
# Homework 5
**Instructions:** Complete the notebook below. Download the completed notebook in HTML format. Upload assignment using Canvas.
**Due:** Feb. 20 at **12:30pm.**
## Exercise: AR(1) P... | github_jupyter |
```
from pathlib import Path
from tqdm import tqdm
import pandas as pd
import numpy as np
import matplotlib as matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import os
import datetime as dt
from shapely import wkt
from shapely.geometry import Point, Polygon
import geopandas as gpd
# import rtree, pyge... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
import tensorflow.keras.layers as tfl
from tensorflow import keras
device_name = tf.test.gpu_device_name()
if device_name != '/device:GPU... | github_jupyter |
### Домашняя работа №3
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score, train_test_spli... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.