text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# Extra Trees Classifier with Normalize
### Required Packages
```
import numpy as np
import pandas as pd
import seaborn as se
import warnings
import matplotlib.pyplot as plt
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.preprocessing import LabelEncoder, Normalizer
from sklearn.model_selection import... | github_jupyter |
## Programming Assignment: Regularized Logistic Regression
Chào mừng các bạn đến với bài tập lập trình Regularized Logistic Regression (Bài toán phân loại nhị phân - 2 nhóm). Trước khi thực hiện bài tập này, các bạn nên học kỹ các kiến thức lý thuyết. Nếu có bất kỳ câu hỏi hay vấn đề nào xảy ra, các bạn hãy để lại com... | github_jupyter |
## Amazon SageMaker with XGBoost and Hyperparameter Tuning for Taxi Trip Fare Prediction
#### Supervised Learning with Gradient Boosted Trees
This notebook works well with the **Python 3 (Data Science)** kernel on SageMaker Studio, or conda_python3 on classic SageMaker Notebook Instances
---
## Objective
This worksh... | github_jupyter |
# Import Libs
```
import os
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import jupyternotify
ip = get_ipython()
ip.register_magics(jupyternotify.JupyterNotifyMagi... | github_jupyter |
## Sequential fitting
It is not always clear how to select good hyperparameters for calculations. In the second tutorial "Getting insights about the model" it was shown how to plot spectrums of PCA for all lambda channels and parities. This information along with the other one, such as regression accuracy might be use... | github_jupyter |
## Một phương trình vô cùng nguy hiểm
Trong bài báo khoa học nổi tiếng vào năm 2007, Howard Wainer đã viết về một số phương trình vô cùng nguy hiểm:
"Một số phương trình nguy hiểm nếu ta biết chúng, và một số khác nguy hiểm nếu ta không biết chúng. Loại thứ nhất nguy hiểm vì trong phạm vi của chúng ẩn chứa những bí m... | github_jupyter |
<a href="https://colab.research.google.com/github/lustraka/Data_Analysis_Workouts/blob/main/Analyse_Twitter_Data/wrangle_act.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Project: Wrangling and Analyze Data
This Jupyter notebook contains the co... | github_jupyter |
# Solutions to exercises
**EXERCISE:** Solve the constrained programming problem by any of the means above.
Minimize: f = -1*x[0] + 4*x[1]
Subject to: <br>
-3*x[0] + 1*x[1] <= 6 <br>
1*x[0] + 2*x[1] <= 4 <br>
x[1] >= -3 <br>
where: -inf <= x[0] <= inf
```
import cvxopt as cvx
from cvxopt import solvers as cvx_sol... | github_jupyter |
# Module 8: Histogram and CDF
A deep dive into Histogram and boxplot.
```
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import altair as alt
import pandas as pd
import matplotlib
matplotlib.__version__
```
## The tricky histogram with pre-counted data
Let's revisit the table from the clas... | github_jupyter |
... ***CURRENTLY UNDER DEVELOPMENT*** ...
## Obtain synthetic waves and water level timeseries under a climate change scenario (future TCs occurrence probability)
inputs required:
* Historical DWTs (for plotting)
* Historical wave families (for plotting)
* Synthetic DWTs
* Probability of TCs under climate ... | github_jupyter |
# Logging with Tensorboard
**DIVE into Deep Learning**
___
```
from util import *
```
## Logging the results
To call additional functions during training, we can add the functions to the `callbacks` parameter of the model `fit` method. For instance:
```
import tqdm.keras
if input('Train? [Y/n]').lower() != 'n':
... | github_jupyter |
<a href="https://colab.research.google.com/github/datacamp/Brand-Analysis-using-Social-Media-Data-in-R-Live-Training/blob/master/notebooks/brand_analysis_session_notebook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<p align="center">
<img src="h... | github_jupyter |
# Performance vs weight decay
```
import numpy as np
from collections import OrderedDict
import pandas as pd
import os, time, sys
import matplotlib.pyplot as plt
%matplotlib inline
from matplotlib import colors as mcolors
colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS)
# https://matplotlib.org/examples/color... | github_jupyter |
```
import os
import word2vec
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
```
## Download toy corpus for wordvector training and example text
```
corpus_path = './text8' # be sure your corpus is cleaned from punctuation and lowercased
if not os.path.exists(corpu... | github_jupyter |
```
# matplotlib notebook
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import os
import matplotlib
datadir = '/home/tamarnat/gem5-accuracy-evaluation/micro-experiments/results/X86/'
plotdir = '/home/tamarnat/gem5art-experiments/documents/sim-objects/images/'
controlBenchmarks = ['CCa','CC... | github_jupyter |
##### Copyright 2019 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
from matplotlib import pyplot
import json
from pathlib import Path
with open("files/results_squadv1.json") as f:
results = json.load(f)
for k,v in results["checkpoints"].items():
f1 = v["eval_metrics"]["f1"]
if f1 > 87:
model_path = Path(k)
print(k, f1)
break
import torch
from ma... | github_jupyter |
# Spatial Opponency
This notebook plots the distribution of spatially opponent, non-opponent and unresponsive cells in different layers of our model as a function of bottleneck size. It corresponds to Figures 2(a) and 2(b) in the paper.
**Note**: The easiest way to use this is as a colab notebook, which allows you to... | github_jupyter |
# Counterfactuals guided by prototypes on MNIST
This method is described in the [Interpretable Counterfactual Explanations Guided by Prototypes](https://arxiv.org/abs/1907.02584) paper and can generate counterfactual instances guided by class prototypes. It means that for a certain instance X, the method builds a prot... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Queries-from-Different-Languages" data-toc-modified-id="Queries-from-Different-Languages-1"><span class="toc-item-num">1 </span>Queries from Different Languages</a></span></li><li><span><a href="... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/21.Gender_Classifier.ipynb)
# 21. Gender C... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.colors import LogNorm
import seaborn as sns
from functools import partial
%matplotlib inline
x1 = np.random.randint(1,1e7,size=1000)
x2 = np.random.randint(1954,10008,size=1000)
plt.hist2d(x1,x2,bins=[10,(x2.max() - x2.min())/5],... | github_jupyter |

# Tsuki-colab by Gusbell
## Implement of my decensoring scripts on google colab
#### https://github.com/Gusb3ll/tsuki
#### Do not use any hardware accelerator as it will broke the HentAI
## Install pytho... | github_jupyter |
# [NTDS'18] tutorial 5: sparse matrices in scipy
[ntds'18]: https://github.com/mdeff/ntds_2018
[Eda Bayram](http://lts4.epfl.ch/bayram), [EPFL LTS4](http://lts4.epfl.ch)
## Ojective
This is a short tutorial on the `scipy.sparse` module. We will talk about:
1. What is sparsity?
2. Sparse matrix storage schemes
3. Li... | github_jupyter |
# Exporting data to NetCDF files <img align="right" src="../Supplementary_data/dea_logo.jpg">
* [**Sign up to the DEA Sandbox**](https://docs.dea.ga.gov.au/setup/sandbox.html) to run this notebook interactively from a browser
* **Compatibility:** Notebook currently compatible with both the `NCI` and `DEA Sandbox` envi... | github_jupyter |
# Loading tensor data to Tensorflow
Currently ZmqOp only accepts a list of tensors as valid input e.g. [np.array1, np.array2, np.array3 .....]
and the input parameter types has to be [dtype of np.array1, dtype of np.array2, dtype of np.array3]
it outputs [tensor1, tensor2, tensor3], data in tensor[i] == np.array[i]
`... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
%matplotlib inline
from src.anchor_generator import tile_anchors
WIDTH, HEIGHT = 512, 1024
GRID_WIDTH, GRID_HEIGHT = 16, 32 # stride 32 or scale 0 in the face detector
# GRID_WIDTH, GRID_HEIGHT = 8, 16 #... | github_jupyter |
# Exploring the Lorenz System of Differential Equations
*Downloaded 10/2017 from the [ipywidgets docs](https://github.com/jupyter-widgets/ipywidgets/tree/master/docs/source/examples)*
In this Notebook we explore the Lorenz system of differential equations:
$$
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \r... | github_jupyter |
```
%matplotlib notebook
import matplotlib
import numpy as np
import itertools
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from ipywidgets import interact, interactive, fixed, FloatSlider, widgets
```
Overview
======
This notebook introduces a number of concepts from molecular mechanics:... | github_jupyter |
# Bokeh Visualization Demo
## Recreating Han's Rosling's "The Health and Wealth of Nations"
This notebook is intended to illustrate the some of the utilities of the Python [Bokeh](http://bokeh.pydata.org/en/latest/) visualization library.
```
import numpy as np
import pandas as pd
from bokeh.embed import file_html
... | github_jupyter |
# Brainscript CNTK Distributed GPU
## Introduction
This example uses the MNIST dataset to demonstrate how to train a convolutional neural network (CNN) on a GPU cluster. You can run this recipe on a single or multiple nodes.
## Details
- For demonstration purposes, MNIST dataset and ConvNet_MNIST.cntk will be deplo... | github_jupyter |
# Expectation Values
Given a circuit generating a quantum state $\lvert \psi \rangle$, it is very common to have an operator $H$ and ask for the expectation value $\langle \psi \vert H \vert \psi \rangle$. A notable example is in quantum computational chemistry, where $\lvert \psi \rangle$ encodes the wavefunction for... | github_jupyter |
# ChainerRL Quickstart Guide
This is a quickstart guide for users who just want to try ChainerRL for the first time.
If you have not yet installed ChainerRL, run the command below to install it:
```
pip install chainerrl
```
If you have already installed ChainerRL, let's begin!
First, you need to import necessary m... | github_jupyter |
# PCA Script Mode
How to implement PCA with Python and scikit-learn: Theory & Code
https://medium.com/ai-in-plain-english/how-to-implement-pca-with-python-and-scikit-learn-22f3de4e5983
Iris Training and Prediction with Sagemaker Scikit-learn
- Scikit Learn 스크립트 모드
https://github.com/awslabs/amazon-sagemaker-example... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/canny_edge_detector.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" hr... | github_jupyter |
```
import pandas as pd
import os
import glob
inputPath = '../data/records_samples/'
```
# 1. Load dataframe with records
Create records_samples folder in data if not there
Place records.pkl and samples.pkl in folder from shared folder in google drive
```
df_record = pd.read_pickle(os.path.join(inputPath,'records.pk... | github_jupyter |
```
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
t = pd.read_csv("TreesData.csv", low_memory=False)
```
### For every tree in Pittsburgh, there is a corresponding neighborhood indicating where it is. Let's get the amount of neighborhoods and rank them to see which neighborh... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Deep Learning
## Traffic Light Recognition Classifier
---
## Step 0: Load The Data
```
import sys
import csv
import numpy as np
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import pickle
%matplotlib inline
training_file = "train.p"
#csv_files=['... | github_jupyter |
```
## importando bibiliotecas
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv('data/houses_train.csv')
def get_data_desc():
"""Essa função devolve a descrição completa do dataset"""
with open('data/data_description.txt','r') as file:
for line in file:
print(line)
... | github_jupyter |
# Example of omniscidb UDF/UDTF: Black-Scholes Model
```
%%html
<iframe src="https://docs.google.com/presentation/d/e/2PACX-1vQZGYxXWJODxVaBvThiBQvsWakQrBpHsdyNb8LGF1OTFzW2fTo0hHsJV223XHGhDhvmBIpS-nb-62YS/embed?start=false&loop=false&delayms=60000" frameborder="0" width="960" height="749" allowfullscreen="true" mozal... | github_jupyter |
# Key Things to Remember
- Data Structure
- heap: for efficient for sorting, adding and popping
- named tuple: provide name and keep efficiency
- counter: convenience for counting
- deque: `append()` and `pop()` at the both ends
- default dict
- ChainMap: combine multiple dictionary
- Al... | github_jupyter |
```
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
from sklearn.naive_bayes import MultinomialNB
import statsmodels.tools.tools as stattools
import jenkspy
from scipy import stats
from sklearn.model_selection import train_test_split
import pandas as pd
import numpy as np
... | github_jupyter |
# Image Classification using Perceptron
This Code Template is for Image Classification task using Perceptron based on Support Vector Machine Algorithm.
### Required Packages
```
!pip install opencv-python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import os
import random
... | github_jupyter |
<p><font size="6"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>
> *DS Data manipulation, analysis and visualization in Python*
> *May/June, 2021*
>
> *© 2021, Joris Van den Bossche and Stijn Van Hoey (<mailto:jorisvandenbossche@gmail.com>, <mailto:stijnvanhoey@gmail.com>). Lic... | github_jupyter |
```
import numpy as np
from sklearn.model_selection import KFold
import pickle as pk
import os
from os import listdir
import pandas as pd
from os.path import isfile, join
from keras.utils import to_categorical ,Sequence
from sklearn.utils import shuffle
from keras.models import load_model
import numpy as np
import sy... | github_jupyter |
```
from google.colab import drive
drive.mount('/proj')
!pip install -q -U umap-learn[plot] hdbscan tensorflow-addons #opencv-python==4.5.1.48
#Imports
import tensorflow as tf
import tensorflow_addons as tfa
import tensorflow_datasets as tfds
import io
import numpy as np
###UMAP seems to take a while to import due ... | github_jupyter |
```
import sys
sys.path.insert(0, "/export/servers/wenhao/database_reader/")
%load_ext autoreload
%autoreload 2
import database_reader as dr
import database_reader.utils as du
from database_reader import CPSC2018
hehe_cpsc = CPSC2018(db_path="/export/servers/data/CPSC2018/Training_WFDB/", verbose=5)
ro = 608
hehe_cpsc... | github_jupyter |
```
from io import StringIO
import pandas as pd
from sklearn.preprocessing import Imputer
```
# Identifying missing values in tabular data
Before we discuss several techniques for dealing with missing values, let's create a simple example data frame from a Comma-separated Values (CSV) file to get a better grasp of th... | github_jupyter |
## Sentiment Analysis for Twitter Dataset
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import re
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
from bs4 import BeautifulSoup
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_tes... | github_jupyter |
# Train VAE for task2...
This attemt uses reconstruction loss only, confirming model can be trained as usual Autoencoder.
Loss function is weighted as: $loss = L_{Reconstruction} + 0 L_{KLD} = L_{Reconstruction}$
```
# public modules
from dlcliche.notebook import *
from dlcliche.utils import (
sys, random, Path,... | github_jupyter |
**Chapter 5 – Support Vector Machines**
_This notebook contains all the sample code and solutions to the exercises in chapter 5._
# Setup
First, let's make sure this notebook works well in both python 2 and 3, import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save the figu... | github_jupyter |
# Training for MsPacman
```
%matplotlib inline
import os
import sys
sys.path.append(os.path.expanduser("~/libs"))
import random
import string
import numpy as np
import tensorflow as tf
import tensortools as tt
from model.frame_prediction import LSTMConv2DPredictionModel
```
### Hyperparams
```
# data
INPUT_SEQ_L... | github_jupyter |
# A Beginners Guide to Beating the Bookmakers with TensorFlow
This notebook tries to improve the original work.
This is done by
- scaling the input data
- using keras (to know what we are doing)
- using tensorboard
- write custom callback to collect performance
- using a commitee of network
- cross validate the resu... | github_jupyter |
# What is Object Oriented Programming (OOP)?
## The Need for OOP
- As you write more code, you'll notice that some code looks better than others
- Sometime I find myself feeling "weird" about some code that I just wrote
- Furthermore, when you start working with larger code bases, you'll notice it gets harder to ... | github_jupyter |
<a href="https://colab.research.google.com/github/jmontalvo94/02456_l2rpn/blob/main/DQN_playground_emil.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
# Use this code if pull commands does not work
%rm -rf /content/drive/My\ Drive/Colab\ Notebo... | github_jupyter |
# Maass form pieces
This is a log of pieces assembled together for the computation of Maass forms.
```
CC = ComplexField(200)
```
## Overview
We apply Hejhal's method for the computation of a weight $0$ Maass form on level $1$. This is the simplest possible case. We first implement this in a simple, slow manner.
F... | github_jupyter |
<a href="https://colab.research.google.com/github/aayushkumar20/ML-based-projects./blob/main/Google%20API%20based/Image_based_location_detection.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#Install this first for complete functioning
!pip in... | github_jupyter |
# <img src="https://img.icons8.com/bubbles/100/000000/3d-glasses.png" style="height:50px;display:inline"> EE 046746 - Technion - Computer Vision
---
#### Tal Daniel
## Tutorial 06 - Generative Adversarial Networks (GANs)
---
<img src="./assets/tut_gan_morphing.gif" style="height:200px">
* <a href="https://becominghu... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from deepracer.tracks import TrackIO, Track
from deepracer.logs import PlottingUtils as pu
tu = TrackIO()
# Ignore deprecation warnings we have no power over
import warnings
warnings.filterwarnings('ignore')
#copy waypoints from logfile where ... | github_jupyter |
# `jupyterlite 0.1.0a5+main` vs `pyodide dev`
> This is very much a work-in-progress. See the [Author's log below](#Author's-Log) or follow along on the [draft PR](https://github.com/jupyterlite/jupyterlite/pull/274).
```
import sys, os, asyncio, pyolite, IPython
from pathlib import Path
print(len(sys.modules), "are ... | github_jupyter |
```
%matplotlib inline
import gym
import matplotlib
import numpy as np
import sys
from collections import defaultdict
if "../" not in sys.path:
sys.path.append("../")
from lib.envs.blackjack import BlackjackEnv
from lib import plotting
matplotlib.style.use('ggplot')
env = BlackjackEnv()
def create_random_policy(n... | github_jupyter |
# Data Exploration #1
### In this file we will:
1. Explore the dataset we have compiled.
2. Visualise the different transformations.
3. Conclude on a course of action for our training.
#### First, we make sure relative imports work
```
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module... | github_jupyter |

## Classification BKHW
Classification - predicting the discrete class ($y$) of an object from a vector of input features ($\vec x$).
Models used in this notebook include: Logistic Regression, Support Vector Machines, KNN
**Author List**: Kevin Li, Ikhlaq Sidhu
**Original So... | github_jupyter |
# Distribution Test Tables
This example demonstrates how to create some conditional probability tables and a bayesian network.
```
from pomegranate import *
import math
```
First let's define some conditional probability tables.
```
c_table = [[0, 0, 0, 0.6],
[0, 0, 1, 0.4],
[0, 1, 0, 0.7],
... | github_jupyter |
# Get Intangible Asset
* 「企業結合等関係注記」から、無形資産の情報を取得する
```
import os
import pandas as pd
import xbrr
ROOT = os.path.join(os.getcwd(), "../data")
intangibles = pd.read_csv(os.path.join(ROOT, "raw/intangibles.csv"))
print(len(intangibles))
intangibles.head(5)
import re
import unicodedata
from bs4 import BeautifulSoup
... | github_jupyter |
# Colour - Colour Science for Python
```
from IPython.core.display import Image
Image(filename="resources/images/Colour_Logo_Medium_001.png")
```
## Introduction
[Colour](https://github.com/colour-science/colour/) is a **Python** colour science package implementing a comprehensive number of colour theory transforma... | github_jupyter |
```
import nltk
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
nltk.download('brown')
import re
import json
import pprint
import numpy as np
import pandas as pd
import seaborn as sns
from os import listdir
from os.path import isfile, join
import matplotlib.pyplot as plt
import plotly.graph_objects a... | github_jupyter |
## Word2Vec from [nlintz's tutoral](https://github.com/nlintz/TensorFlow-Tutorials)
```
import collections
import numpy as np
import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
# Configuration
batch_size = 20
# Dimension of the embedding vector. Two too small to get
# any m... | github_jupyter |
```
#Code for AMC Group Project
#With Drag
import matplotlib.pyplot as plt
import math
#coef of restitution e
e=0.8
#Variable list
#D,Density,C,A (NOTE :A is projection surface area of ball not actual surface area)
#Not very sure about value of drag coeffecient , Typical values of C for balls are in th... | github_jupyter |
컨볼루션 신경망은 다층 퍼셉트론 신경망과 매우 유사하나 이미지가 가지고 있는 특성이 고려되어 설계된 신경망이기에 영상 처리에 주로 사용됩니다. 컨볼루션 신경망 모델의 주요 레이어는 컨볼루션(Convolution) 레이어, 맥스풀링(Max Pooling) 레이어, 플래튼(Flatten) 레이어이며, 각 레이어별로 레이어 구성 및 역할에 대해서 알아보겠습니다.
---
### 필터로 특징을 뽑아주는 컨볼루션(Convolution) 레이어
케라스에서 제공되는 컨볼루션 레이어 종류에도 여러가지가 있으나 영상 처리에 주로 사용되는 Conv2D 레이어를 살펴보겠습니다. 레이... | github_jupyter |
```
import argparse
from models.model_resnet import *
from models.model_resnet18 import *
import myData.iDataset
import myData.iDataLoader
from utils import *
from sklearn.utils import shuffle
import trainer.trainer_warehouse
import trainer.evaluator
from myData.data_warehouse import *
import easydict
from models.W_res... | github_jupyter |
This example notebook shows how we can train a simple Regression classifier.
We employ TileDB as a storage engine for our training data and labels.
We will use the MovieLens 100K public data set, available [here](https://grouplens.org/datasets/movielens/100k/). We will first download the
MovieLens, which contains 100.0... | github_jupyter |
# The Python Programming Language: Functions
<br>
`add_numbers` is a function that takes two numbers and adds them together.
```
def add_numbers(x, y):
return x + y
add_numbers(1, 2)
```
<br>
`add_numbers` updated to take an optional 3rd parameter. Using `print` allows printing of multiple expressions within a ... | github_jupyter |
# CNTK 206 Part B: Deep Convolutional GAN with MNIST data
**Prerequisites**: We assume that you have successfully downloaded the MNIST data by completing the tutorial titled CNTK_103A_MNIST_DataLoader.ipynb.
## Introduction
[Generative models](https://en.wikipedia.org/wiki/Generative_model) have gained a [lot of at... | github_jupyter |
# Simulating capillary pressure curves using Porosimetry
Start by importing OpenPNM.
```
import numpy as np
import openpnm as op
np.random.seed(10)
ws = op.Workspace()
ws.settings["loglevel"] = 40
np.set_printoptions(precision=5)
```
Next, create a simple cubic network with 20 pores per side and a spacing of 50 um
... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/ImageCollection/mosaicking.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" h... | github_jupyter |
## Import Libraries
```
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# Set default matplot figure size
plt.rcParams['figure.figsize'] = (10.0, 8.0)
```
## Reading Data Set using Pandas
`... | github_jupyter |
# TensorFlow Data Validation (Advanced)
## Learning Objectives
1. Install TFDV
2. Compute and visualize statistics
3. Infer a schema
4. Check evaluation data for errors
5. Check for evaluation anomalies and fix it
6. Check for drift and skew
7. Freeze the schema
## Introduction
This notebook illustrates how Tens... | github_jupyter |
```
%pylab inline
from sklearn.dummy import DummyRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
import pandas as pd
from soln.dataset import AllCategoricalsFeaturizer
from soln.dataset import generate_xv_splits
from soln.dataset import get_augmented_train_a... | github_jupyter |
# Using Snorkel with biomedical literature and PubAnnotation
In this tutorial we will try to show how to use snorkel for extraction of related Diseases and Genes from PubMed abstracts using PubAnnotation.
The overall flow of this tutorial is the following:
1. Use stanford CoreNLP to parse an inital set of 5 documents... | github_jupyter |
# The Fourier Transform
*This Jupyter notebook is part of a [collection of notebooks](../index.ipynb) in the bachelors module Signals and Systems, Communications Engineering, Universität Rostock. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).*
## Summary ... | github_jupyter |
```
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR, MultiStepLR
import numpy as np
# import matplotlib.pyplot as plt
from math import *
import time
torch.cuda.set_device(2)
torch.set_default_t... | github_jupyter |
**Chapter 9 – Up and running with TensorFlow**
_This notebook contains all the sample code and solutions to the exercices in chapter 9._
# Setup
First, let's make sure this notebook works well in both python 2 and 3, import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save t... | github_jupyter |
# This notebook will help you install the SAS NBExtensions
The process includes a mix of command line and python code and can be done either systemwide or for the current user depending on the permission level the user has.
This code will import the notebook module and display the paths that Juypter will search for NB... | github_jupyter |
# Regresyon Modelleri
Daha önceki derslerimizde sınıflandırma yöntemlerinden karar ağaçlarını ve destek vektör makinelerini görmüştük. Bu algoritmaların nasıl çalıştığına bakmıştık. Her iki algoritmada da verilerimiz hedef değerleri ile birlikte verilmişti. Biz var olan bilgilerden yola çıkarak bir makine öğrenmesi ge... | github_jupyter |
# User Defined Functions with cuDF
Sometimes, the built-in methods of cudf.DataFrame don't do exactly what we want. We need to write a custom function (also known as a user defined function) to apply over the DataFrame.
cuDF’s DataFrame class has two primary methods that let users run custom Python functions on GPUs:... | github_jupyter |
## Problem
- Because Python variable type is dynamically determined at runtime there is no need to specify them during function declaration.
- However, not knowing which type a function's parameter should have when calling that function could lead into bugs.
- Can we force function parameters to be of specific type dur... | github_jupyter |
```
##----------------------------------------------------------------------------------------##
# Projeto de Analise de Dados com Python e Pandas #
# Este projeto faz parte da conclusão do Bootcamp da Digital Innovation One (Data Engineer)#
# Foi utilizado para esse projeto um... | github_jupyter |
# <center>RIP ibmq_armonk</center>

## <center>Long live Qiskit Pulse!</center>
```
from qiskit import IBMQ, pulse, assemble
from qiskit.pulse import DriveChannel, Play, Schedule
from qiskit.pulse.library import Gaussian
import numpy as np
# make the styles nice for dark ba... | github_jupyter |
<pre>
We will be build a observation scorer to measure the probsbility of a sequence of observation
We will then build a predictor for optimul path (sequence of states) for a given observation to happen
We will then cross check the predictions against hmmlearn standard library.
</pre>
```
import numpy as np
from hmmle... | github_jupyter |
# Projet pluridisciplinaire TP2 : python
Le logiciel Sage est basé sur le langage de programmation `python`. Dans ce TP, nous allons réviser les bases de la syntaxe python et des structures de données telles qu'elles sont utilisées dans Sage.
## Les Listes
Les **listes** sont une des structures fondamentales du pyth... | github_jupyter |
```
# Data Source: https://www.kaggle.com/worldbank/world-development-indicators
# Folder: 'world-development-indicators'
```
<br><p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold">
World Development Indicators</p><br><br>
# Exploring Data Visualization Using Matplotlib
```
import pandas as... | github_jupyter |
# Random Coefficients Logit Tutorial with the Automobile Data
```
import pyblp
import numpy as np
import pandas as pd
pyblp.options.digits = 2
pyblp.options.verbose = False
pyblp.__version__
```
In this tutorial, we'll use data from [Berry, Levinsohn, and Pakes (1995)](https://pyblp.readthedocs.io/en/stable/referen... | 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 |
# A Guided Tour of Ray Core: JobLib
[*Distributed scikit-learn*](https://docs.ray.io/en/latest/joblib.html) provides a drop-in replacement to parallelize the [`JobLib`](https://joblib.readthedocs.io/en/latest/) backend for [`scikit-learn`](https://scikit-learn.org/stable/)
---
First, let's start Ray…
```
import lo... | github_jupyter |
<a href="https://colab.research.google.com/github/JSJeong-me/KOSA-Big-Data_Vision/blob/main/Model/09-29-lgbm-pca-mutate.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
### Microsoft https://github.com/microsoft/LightGBM
.
# Try to minimize size of the force in training. No significant improvements.
# Some test on ergodicity
# (calculate the probablity of generating the configs obtained via conventional HMC).
# TODO
# Plot the force size distribution... | github_jupyter |
# Interpolating Network Sets
Frequently a set of `Networks` is recorded while changing some other parameters; like temperature, voltage, current, etc. Once this set of data acquired, it is sometime usefull to estimate the behaviour of the network for parameter values that lie in between those that have been mesured. F... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.