text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
### Introduction
The `Lines` object provides the following features:
1. Ability to plot a single set or multiple sets of y-values as a function of a set or multiple sets of x-values
2. Ability to style the line object in different ways, by setting different attributes such as the `colors`, `line_style`, `stroke_width... | github_jupyter |
# Clean-Label Feature Collision Attacks on a Keras Classifier
In this notebook, we will learn how to use ART to run a clean-label feature collision poisoning attack on a neural network trained with Keras. We will be training our data on a subset of the CIFAR-10 dataset. The methods described are derived from [this pap... | github_jupyter |
# Lecture 12: Canonical Economic Models
[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/12/Canonical_economic_models.ipynb)
1. [OverLapping Generations (OLG) m... | github_jupyter |
```
##### Copyright 2020 Google LLC.
#@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 agreed to in ... | github_jupyter |
# Group Metrics
The `fairlearn` package contains algorithms which enable machine learning models to minimise disparity between groups. The `metrics` portion of the package provides the means required to verify that the mitigation algorithms are succeeding.
```
import numpy as np
import pandas as pd
import sklearn.met... | github_jupyter |
# The importance of space
Agent based models are useful when the aggregate system behavior emerges out of local interactions amongst the agents. In the model of the evolution of cooperation, we created a set of agents and let all agents play against all other agents. Basically, we pretended as if all our agents were p... | github_jupyter |
## Getting Data
```
#import os
#import requests
#DATASET = (
# "https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data",
# "https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.names"
#)
#def download_data(path='data', urls=DATASET):
# if not os.path.exists(pat... | github_jupyter |
# Draw an isochrone map with OSMnx
How far can you travel on foot in 15 minutes?
- [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)
- [GitHub repo](https://github.com/gboeing/osmnx)
- [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)
- [Documentation](htt... | github_jupyter |
# Raven annotations
Raven Sound Analysis Software enables users to inspect spectrograms, draw time and frequency boxes around sounds of interest, and label these boxes with species identities. OpenSoundscape contains functionality to prepare and use these annotations for machine learning.
## Download annotated data
We... | github_jupyter |
# CER043 - Install signed Master certificates
This notebook installs into the Big Data Cluster the certificates signed
using:
- [CER033 - Sign Master certificates with generated
CA](../cert-management/cer033-sign-master-generated-certs.ipynb)
## Steps
### Parameters
```
app_name = "master"
scaledset_name = "... | github_jupyter |
```
from ei_net import *
from ce_net import *
import matplotlib.pyplot as plt
import datetime as dt
%matplotlib inline
##########################################
############ PLOTTING SETUP ##############
EI_cmap = "Greys"
where_to_save_pngs = "../figs/pngs/"
where_to_save_pdfs = "../figs/pdfs/"
save = True
plt.rc('a... | github_jupyter |
```
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
from glob import glob
%matplotlib inline
```
# Instructions for Use
The "Main Functions" section contains functions which return the success rate to be plotted as well as lower and upper bounds for uncertai... | github_jupyter |
```
# import necessary packages
import json
import requests
import pandas as pd
import polyline
import geopandas as gpd
from shapely.geometry import LineString, Point
import numpy as np
from itertools import product
from haversine import haversine, Unit
from shapely.ops import nearest_points
import os
from matplotlib i... | github_jupyter |
## 1. Regression discontinuity: banking recovery
<p>After a debt has been legally declared "uncollectable" by a bank, the account is considered "charged-off." But that doesn't mean the bank <strong><em>walks away</em></strong> from the debt. They still want to collect some of the money they are owed. The bank will scor... | github_jupyter |
# Cruise collocation with gridded data
Authors
* [Dr Chelle Gentemann](mailto:gentemann@esr.org) - Earth and Space Research, USA
* [Dr Marisol Garcia-Reyes](mailto:marisolgr@faralloninstitute.org) - Farallon Institute, USA
-------------
# Structure of this tutorial
1. Opening data
1. Collocating satellite da... | github_jupyter |
```
from nltk.classify import NaiveBayesClassifier
from nltk.corpus import stopwords
stopset = list(set(stopwords.words('english')))
import re
import csv
import nltk.classify
def replaceTwoOrMore(s):
pattern = re.compile(r"(.)\1{1,}", re.DOTALL)
return pattern.sub(r"\1\1", s)
def processTweet(tweet):
t... | 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 |
# 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 |
# 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 |
# 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 |
# 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 |
```
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 |
# 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 |
# 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 |
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 |
```
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 |
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 |
```
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 |
## 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 |
# 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 |
# 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 |
<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 |
# 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 |
```
%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 |
# 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 |
<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 |
# 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 |
```
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 |
# 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 |
<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 |
```
%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 |
```
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 |
# 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 |
# 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 |
# 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 |
## 範例重點
* 學習如何在 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 |
# 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 |
```
%matplotlib inline
import os.path
import pprint
import pandas as pd
from gmprocess.io.asdf.stream_workspace import StreamWorkspace
from gmprocess.io.test_utils import read_data_dir
from gmprocess.io.read import read_data
from gmprocess.streamcollection import StreamCollection
from gmprocess.processing import proc... | github_jupyter |
# GMNS to AequilibraE example
## Inputs
1. Nodes as a .csv flat file in GMNS format
2. Links as a .csv flat file in GMNS format
3. Trips as a .csv flat file, with the following columns: orig_node, dest_node, trips
4. Sqlite database used by AequilibraE
## Steps
1. Read the GMNS nodes
- Place in SQLite database... | github_jupyter |
# Performance analysis of a uniform linear array
We compare the MSE of MUSIC with the CRB for a uniform linear array (ULA).
```
import numpy as np
import doatools.model as model
import doatools.estimation as estimation
import doatools.performance as perf
import matplotlib.pyplot as plt
%matplotlib inline
wavelength =... | 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 |
# Fast Bernoulli: Benchmark Python
In this notebooks we will measure performance of generating sequencies of Bernoulli-distributed random varibales in Python without and within LLVM JIT compiler. The baseline generator is based on top of expression `random.uniform() < p`.
```
import numpy as np
import matplotlib.pypl... | github_jupyter |
# Install dependencies
```
!pip install pretrainedmodels
!pip install albumentations==0.4.5
!pip install transformers
# install dependencies for TPU
#!curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py
#!python pytorch-xla-env-setup.py --apt-packages libo... | github_jupyter |
# CS229: Problem Set 3
## Problem 1: A Simple Neural Network
**C. Combier**
This iPython Notebook provides solutions to Stanford's CS229 (Machine Learning, Fall 2017) graduate course problem set 3, taught by Andrew Ng.
The problem set can be found here: [./ps3.pdf](ps3.pdf)
I chose to write the solutions to the co... | github_jupyter |
# Summarizing Data
> What we have is a data glut.
>
> \- Vernor Vinge, Professor Emeritus of Mathematics, San Diego State University
## Applied Review
### Dictionaries
* The `dict` structure is used to represent **key-value pairs**
* Like a real dictionary, you look up a word (**key**) and get its definition (**va... | github_jupyter |
This material has been adapted by @dcapurro from the Jupyter Notebook developed by:
Author: [Yury Kashnitsky](https://yorko.github.io). Translated and edited by [Christina Butsko](https://www.linkedin.com/in/christinabutsko/), [Yuanyuan Pao](https://www.linkedin.com/in/yuanyuanpao/), [Anastasia Manokhina](https://www.... | github_jupyter |
# Example of building a MLDataSet
## Building a Features MLDataSet from a Table
```
from PrimalCore.heterogeneous_table.table import Table
from ElementsKernel.Path import getPathFromEnvVariable
ph_catalog=getPathFromEnvVariable('PrimalCore/test_table.fits','ELEMENTS_AUX_PATH')
catalog=Table.from_fits_file(ph_catalog,... | github_jupyter |
<img src="images/usm.jpg" width="480" height="240" align="left"/>
# MAT281 - Laboratorio N°04
## Objetivos de la clase
* Reforzar los conceptos básicos de los módulos de pandas.
## Contenidos
* [Problema 01](#p1)
* [Problema 02](#p2)
## Problema 01
<img src="https://image.freepik.com/vector-gratis/varios-automo... | github_jupyter |
# Dependencies
```
import os, warnings, shutil
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from transformers import AutoTokenizer
from sklearn.utils import shuffle
from sklearn.model_selection import StratifiedKFold
SEED = 0
warnings.filterwarnings("ignore")
```
# Pa... | github_jupyter |
```
import numpy as np
import lqrpols
import matplotlib.pyplot as plt
```
Here is a link to [lqrpols.py](http://www.argmin.net/code/lqrpols.py)
```
np.random.seed(1337)
# state transition matrices for linear system:
# x(t+1) = A x (t) + B u(t)
A = np.array([[1,1],[0,1]])
B = np.array([[0],[1]])
d,p = B.shape
#... | github_jupyter |
# Encoding of categorical variables
In this notebook, we will present typical ways of dealing with
**categorical variables** by encoding them, namely **ordinal encoding** and
**one-hot encoding**.
Let's first load the entire adult dataset containing both numerical and
categorical data.
```
import pandas as pd
adult... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import torch
device = 'cuda' if torch.cuda.is_available() else 'cpu'
import os,sys
opj = os.path.join
from copy import deepcopy
import pickle as pkl
sys.path.append('../../src')
sys.path.append('../../src/dsets... | github_jupyter |
This notebook is part of the orix documentation https://orix.readthedocs.io. Links to the documentation won’t work from the notebook.
## Visualizing point groups
Point group symmetry operations are shown here in the stereographic projection.
Vectors located on the upper (`z >= 0`) hemisphere are displayed as points ... | github_jupyter |
## Loan EDA
```
import pandas as pd
import numpy as np
dtrain = pd.read_csv('data/train.csv')
test = pd.read_csv('data/test.csv')
```
## Data Cleaning
```
dtrain.head()
dtrain.shape
# Removing the commas form `Loan_Amount_Requested`
dtrain['Loan_Amount_Requested'] = dtrain.Loan_Amount_Requested.str.replace(',', '').... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
base_path = './data/ML-1M/'
ratings = pd.read_csv(base_path+'ratings.csv', sep='\t',
encoding='latin-1',
usecols=['user_id', 'movie_id', 'rating'])
users = pd.read_csv(base_path+'users.csv'... | github_jupyter |
```
# hide
from nbdev.showdoc import *
```
# Load model from Weights & Biases (wandb)
This tutorial is for people who are using [Weights & Biases (wandb)](https://wandb.ai/site) `WandbCallback` in their training pipeline and are looking for a convenient way to use saved models on W&B cloud to make predictions, evalua... | github_jupyter |
```
# Copyright 2019 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 |
# Notebook 5: Clean Up Resources
Specify "Python 3" Kernel and "Data Science" Image.
### Background
In this notebook, we will clean up the resources we provisioned during this workshop:
- SageMaker Feature Groups
- SageMaker Endpoints
- Amazon Kinesis Data Stream
- Amazon Kinesis Data Analytics application
### Im... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/tomwilde/100DaysOfMLCode/blob/master/2_numpy_linearRegression_with_CostFn.ipynb)
```
!pip install -U -q PyDrive
import numpy as np
import matplotlib.pyplot as plt
import pandas
import io
# Install the PyDrive wrapper & import libraries.
# This only nee... | github_jupyter |
# A demo of XYZ and RDKitMol
There is no easy way to convert xyz to RDKit Mol/RWMol. Here RDKitMol shows a possibility by using openbabel / method from Jensen et al. [1] as a molecule perception backend.
[1] https://github.com/jensengroup/xyz2mol.
```
import os
import sys
sys.path.append(os.path.dirname(os.path.abs... | github_jupyter |
# Dimensionality Reduction with the Shogun Machine Learning Toolbox
#### *By Sergey Lisitsyn ([lisitsyn](https://github.com/lisitsyn)) and Fernando J. Iglesias Garcia ([iglesias](https://github.com/iglesias)).*
This notebook illustrates <a href="http://en.wikipedia.org/wiki/Unsupervised_learning">unsupervised learnin... | github_jupyter |
# Feature List View
## Usage
```
import sys, json, math
from mlvis import FeatureListView
from random import uniform, gauss
from IPython.display import display
if sys.version_info[0] < 3:
import urllib2 as url
else:
import urllib.request as url
def generate_random_steps(k):
randoms = [uniform(0, 1) /... | github_jupyter |
```
# General purpose libraries
import boto3
import copy
import csv
import datetime
import json
import numpy as np
import pandas as pd
import s3fs
from collections import defaultdict
import time
import re
import random
from sentence_transformers import SentenceTransformer
import sentencepiece
from scipy.spatial import ... | github_jupyter |
# Investigating ocean models skill for sea surface height with IOOS catalog and Python
The IOOS [catalog](https://ioos.noaa.gov/data/catalog) offers access to hundreds of datasets and data access services provided by the 11 regional associations.
In the past we demonstrate how to tap into those datasets to obtain sea... | github_jupyter |
### Made by Kartikey Sharma (IIT Goa)
### GOAL
Predicting the costs of used cars given the data collected from various sources and distributed across various locations in India.
#### FEATURES:
<b>Name</b>: The brand and model of the car.<br>
<b>Location</b>: The location in which the car is being sold or is availabl... | github_jupyter |
```
library(dslabs)
library(HistData)
library(tidyverse)
data(heights)
data(Galton)
data(murders)
# HarvardX Data Science Course
# Module 2: Data Visualization
x <- Galton$child
x_with_error <- x
x_with_error[1] <- x_with_error[1] * 10
mean(x_with_error) - mean(x)
sd(x_with_error) - sd(x)
# Median and MAD (median abso... | github_jupyter |
```
import pandas as pd
df = pd.read_csv("../k2scoc/results/tables/full_table.csv")
hasflares = (df.real==1) & (df.todrop.isnull())
wassearched = (df.real==0) & (df.todrop.isnull())
df = df[hasflares & (df.cluster=="hyades") & (df.Teff_median > 3250.) & (df.Teff_median < 3500.)]
df[["EPIC"]].drop_duplicates()
```
3... | github_jupyter |
# `GiRaFFE_NRPy`: Solving the Induction Equation
## Author: Patrick Nelson
This notebook documents the function from the original `GiRaFFE` that calculates the flux for $A_i$ according to the method of Harten, Lax, von Leer, and Einfeldt (HLLE), assuming that we have calculated the values of the velocity and magnetic... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import math
from matplotlib import style
from collections import Counter
style.use('fivethirtyeight') #Shows Grid
import pandas as pd
import random
df = pd.read_csv('Breast-Cancer.csv',na_values = ['?'])
means = df.mean().to_dict()
df.drop(['id'],1,inplace=True)
he... | github_jupyter |
```
import os
from collections import defaultdict, namedtuple
from copy import deepcopy
from pprint import pprint
import lxml
import lxml.html
import lxml.etree
from graphviz import Digraph
from similarity.normalized_levenshtein import NormalizedLevenshtein
normalized_levenshtein = NormalizedLevenshtein()
TAG_NAME_A... | github_jupyter |
<a href="https://colab.research.google.com/github/yukinaga/minnano_kaggle/blob/main/section_2/02_titanic_random_forest.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# タイタニック号生存者の予測
「ランダムフォレスト」という機械学習のアルゴリズムにより、タイタニック号の生存者を予測します。
訓練済みのモデルによる予測結果は... | github_jupyter |
# Driven Modal Simulation and S-Parameters
## Prerequisite
You must have a working local installation of Ansys.
```
%load_ext autoreload
%autoreload 2
import qiskit_metal as metal
from qiskit_metal import designs, draw
from qiskit_metal import MetalGUI, Dict, Headings
import pyEPR as epr
```
## Create the design in... | 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 |
```
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file... | github_jupyter |
# Tarea 98 - Análisis del rendimiento de las aplicaciones de IA
## Ejercicio: Debes programar el problema que se plantea en la siguiente secuencia de videos en el lenguaje de programación que desees:
## Primera parte
[
rocznik = 1991
rocznik
teraz = 2020
teraz - rocznik
ile_lat ... | github_jupyter |
(docs-contribute)=
# Contributing to the Ray Documentation
There are many ways to contribute to the Ray documentation, and we're always looking for new contributors.
Even if you just want to fix a typo or expand on a section, please feel free to do so!
This document walks you through everything you need to do to get... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.