text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
## 1.5 Upscaling EOBS then Masking
This notebook builds onto [1.4 Masking](1.4Mask.ipynb), by upscaling EOBS to the SEAS5 grid. We regrid EOBS to the SEAS5 grid so we can select the same grid cells in calculating the UK average for both datasets. The country outline would not be perfect, but the masks would be the sa... | github_jupyter |
# Agentpy Workshop
<p>
<a href="https://mybinder.org/v2/gh/JoelForamitti/agentpy_workshop/HEAD" rel="noopener" target="_blank", style="float: left; padding-right:4px"><img src="https://mybinder.org/badge_logo.svg" alt="Binder"></a>
<a href="https://agentpy.readthedocs.io/en/latest/" rel="noopener" target="_blank"><img... | github_jupyter |
## Rules
---
<img style="float:left" src="Maze.png" alt="drawing" width="300"/>
> Consider the simple maze shown inset in the Figure. In each of the 47 states there are four actions, `up`, `down`, `right`, and `left`, which take the agent deterministically to the corresponding neighboring states, except when movement ... | github_jupyter |
# Diffractometer "Parameters"
Some of the diffractometer _modes_ use additional parameters. The [E4CV](https://people.debian.org/~picca/hkl/hkl.html#org7ef08ba) geometry, for example, has a `double_diffraction` mode which requires a reference $hkl_2$ vector. The vector is set and accessed by a Python command that ca... | github_jupyter |
```
## Idea for this code is taken from the kernel https://www.kaggle.com/lopuhin/mercari-golf-0-3875-cv-in-75-loc-1900-s
## Thanks to the authors for their elegant idea of using MLPs for this problem.
import warnings
warnings.filterwarnings('ignore')
import os
import gc
import time
from datetime import datetime
from... | 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 |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

# Distributed Chainer
In th... | github_jupyter |
```
#Define libraries
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Conv1D, MaxPooling1D, BatchNormalization, Flatten
from sklearn.model_selection import KFold
from keras.utils import multi_gpu_model
#from sklearn.cross_validation import StratifiedKFol... | github_jupyter |
# Monte Carlo Localizationのリサンプリング
千葉工業大学 上田 隆一
(c) 2017 Ryuichi Ueda
This software is released under the MIT License, see LICENSE.
## はじめに
このコードは、移動ロボットの自己位置推定に使われるMonte Carlo Localization(MCL)のサンプルの観測機能を切って、デッドレコニングだけでパーティクルフィルタを実行したものです。リサンプリングしているものとしていないものを比較しています。
```
%matplotlib inline
import numpy as np
f... | github_jupyter |
# TO-DO LIST
- Label Smoothing
- https://www.kaggle.com/chocozzz/train-cassava-starter-using-label-smoothing
- https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/173733
- Class Imbalance
- SWA / SWAG
- Augmentation
- https://www.kaggle.com/sachinprabhu/pytorch-resnet50-snapmix... | github_jupyter |
```
%matplotlib notebook
import common_libs.utilities as ut
import pandas as pd
import data.data_cost as dt
import numpy as np
from scipy.stats import linregress
import models.graph_models as md
import models.train as tr
import models.losses as ls
import tqdm
import seaborn as sns
import sklearn
import scipy
from matp... | github_jupyter |
```
import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import math
from scipy import stats
```
## Prepare data
```
data_3 = pd.read_csv("result_0.3_full.csv", index_c... | github_jupyter |
# Multi-Frame Motion Deblur Analysis
This notebook opens simulated blurred data, the recovered objects, and provides exploration
```
%matplotlib notebook
%load_ext autoreload
%autoreload 2
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import scipy.misc as misc
import time
import sys
import ite... | github_jupyter |
# Create a Learner for inference
```
from fastai import *
from fastai.gen_doc.nbdoc import *
```
In this tutorial, we'll see how the same API allows you to create an empty [`DataBunch`](/basic_data.html#DataBunch) for a [`Learner`](/basic_train.html#Learner) at inference time (once you have trained your model) and ho... | github_jupyter |
# Day 8, Part 1 - intro to ipyvolume
We'll start our journey into the 3RD DIMENSION with the package ```ipyvolume```
```
# if you don't get it:
#!pip install ipyvolume
# note: you may need:
#!jupyter nbextension enable --py --sys-prefix ipyvolume
#!jupyter nbextension enable --py --sys-prefix widgetsnbextension
# or ... | github_jupyter |
```
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.stats as stats
import warnings
warnings.filterwarnings("ignore")
df = pd.read_csv("./data/kc_house_data.csv")
df.head()
print("Size of the data : ", df.shape)
```
### Data Preparation
#### 1. Dropping the ir... | github_jupyter |
# Logistic Regression with a Neural Network mindset
Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone your intuitions about deep learning.... | github_jupyter |
```
import numpy as np
import torch
import torch.nn as nn
from nets import GraphNN_KNN_v1, EdgeClassifier_v1
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score, roc_curve, precision_recall_curve, accuracy_score, average_precision_score
from torch_geometric.data import DataLo... | github_jupyter |
```
import keras
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda
from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, CuDNNLSTM, CuDNNGRU, BatchNormalization, LocallyConnected2D, ... | github_jupyter |
# Prototyping the egun mode for the Sirepo interface and demoing the Impact Density Report
**10/18/2017**
Updated the notebook to demonstrat a new function computing the expected crossing fraction of electrons (not accounting for grid geometry and losses).
**8/15/2017**
Updated the notebook for properly following p... | 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 |
# Simple Test between NumPy, Numexpr, Numba, and Cython
## for complex square root of big matrices
The calculation is
$$\sqrt{A\ L^2 + B}\ ,$$
where
- $A$ and $B$ are complex matrices (complex128) with dimension (#frequencies, #layers), and
- L is a real matrix (floats64) with dimension (#offsets, #wavenumbers).
The... | github_jupyter |
# Labeled Stream Creator
```
import nuclio
%nuclio cmd -c python -m pip install v3io --upgrade
%%nuclio env
METRICS_TABLE = /User/demo-network-operations/streaming/metrics
PREDICTIONS_TABLE = /User/demo-network-operations/streaming/predictions
OUTPUT_STREAM = /users/admin/demo-network-operations/streaming/labels_strea... | github_jupyter |
# Salmon
*Modeling and Simulation in Python*
Copyright 2021 Allen Downey
License: [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
# install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download m... | github_jupyter |
#### Buffalo's word2vec only supports skip-gram word2vec algorithm (No HS)
```
from buffalo.algo.w2v import W2V
from buffalo.algo.options import W2VOption
from buffalo.data.stream import StreamOptions
from buffalo.misc import aux, log
from buffalo.misc.log import set_log_level
log.set_log_level(1) # set log level 3 ... | github_jupyter |
This notebook was prepared by Marco Guajardo. Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Solution Notebook
## Problem: Implement a binary search tree with insert, delete, different traversals & max/min node values
* [Constraints](#Constraints)
* [Test Cases... | 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 |
阅读下面文章前,请保证[**zvt**](https://github.com/zvtvz/zvt)的环境已经准备好。
>源码:
>https://github.com/zvtvz/zvt
>https://gitee.com/null_071_4607/zvt
>文档:
>https://zvtvz.github.io/zvt/
>http://zvt.foolcage.com
## 1. 什么是技术分析
所谓技术分析,是以历史成交数据(量价)为基础的一种分析方法。
数据在时间上的排列,就有了图形(形态)。波浪,趋势,震荡,头肩顶,头肩底,压力线,支撑线等皆属此列。
而对数据进行各种维度的计算,便有了... | github_jupyter |
```
import pandas as pd
#my import
import text_data_utils as tdu
warning_df = pd.read_csv('./train_warning_utf8.csv', header=0 ,sep=',',index_col=None ) #用0行作为标题
warning_df.rename(columns = {'告警开始时间':'time',
'告警标题':'warning',
'基站eNBID或小区ECGI':'cell_id'
... | github_jupyter |
```
#Setup
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
from audl_elo import generate
#g = pd.read_csv("audl_elo.csv") # is short for games table
g = generate(K=20)
g['year_id'] = g['year_id'].astype(int)
nba_g = pd.read_csv("nbaallelo.csv") #dataset from fivethirtyeight
g.tail()
```
... | github_jupyter |
```
import numpy as np
import tensorflow as tf
from tensorflow.contrib import rnn
from sklearn.preprocessing import MinMaxScaler
import time
from google.colab import files
uploaded = files.upload()
def window_slice(data, time_steps):
data = np.transpose(data, (1, 0, 2)).reshape(-1, 310)
xs = []
for i in ra... | github_jupyter |
# DenoiSeg Example: DSB 2018
This is an example notebook which illustrates how DenoiSeg should be trained. In this notebook we use a refined version of the Kaggle 2018 Data Science Bowl (DSB 2018) dataset. We already split the data into train and test images. From the train images we then extracted 3800 training and 67... | github_jupyter |
<a href="https://colab.research.google.com/github/mashnoor3/data-science-portfolio/blob/main/Google_Play_Store_Apps_Exploratory_Data_Analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Google Play Store Apps - Explortatory Data Analysis
In t... | github_jupyter |
# OUTDATED, the examples moved to the manual
## See https://empymod.readthedocs.io/en/stable/examples
----
# Time-domain examples: step and impulse responses
These examples compare the analytical solution with `empymod` for time-domain step and impulse responses for inline, x-directed source and receivers, for the f... | github_jupyter |
```
#Create test documents
first = 'this is a test test test document'
second = 'this this is is is another test test document'
third = 'this this this is is third test document'
#Get all documents in a list
documents = [first, second, third]
# Scikit Learn
from sklearn.feature_extraction.text import CountVectorizer
im... | github_jupyter |
<a id='python-oop'></a>
<div id="qe-notebook-header" align="right" style="text-align:right;">
<a href="https://quantecon.org/" title="quantecon.org">
<img style="width:250px;display:inline;" width="250px" src="https://assets.quantecon.org/img/qe-menubar-logo.svg" alt="QuantEcon">
</a>
<... | github_jupyter |
# Get and Hash all VASP data in the MDF
```
import globus_sdk
from mdf_forge.forge import Forge
import dfttopif
from ase.io import vasp
from ase import Atoms
import codecs
from joblib import Parallel, delayed
from pypif import pif
import gzip
import os
import json
import io
import requests
from tempfile import Te... | github_jupyter |
## Building Logistic Regression models
The simple model built in the proof of concept showed acceptable performances, however an attempt to improve its ability
to generalize should be made involving techniques to scale the data and reduce its dimensionality.
### Data scaling
A step that could help improving the perf... | 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 |
# Function h2stats
## Synopse
The *h2stats* function computes several statistics given an image histogram.
- **g = h2stats(h)**
- **Output**
- **g**: unidimensional array. Array containing the statistics from
the histogram
- **Input**
- **h**: 1-D ndarray: histogram
## ... | github_jupyter |
<img align="right" width="250" src="http://www.sobigdata.eu/sites/default/files/logo-SoBigData-DEFINITIVO.png">
**Author:** [Riccardo Guidotti](http://kdd.isti.cnr.it/people/riccardo-guidotti)
**Python version:** 3.x
<img align="right" width="300" src="https://upload.wikimedia.org/wikipedia/it/5/53/TitanicFilm.jpg"... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D1_RealNeurons/W3D1_Tutorial4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Neuromatch Academy: Week 2, Day 3, Tutorial 4 (Bonus)
# Real N... | github_jupyter |
**[SQL Home Page](https://www.kaggle.com/learn/intro-to-sql)**
---
# Introduction
Try writing some **SELECT** statements of your own to explore a large dataset of air pollution measurements.
Run the cell below to set up the feedback system.
```
# Set up feedback system
from learntools.core import binder
binder.bin... | github_jupyter |
[Zebra Puzzle](http://en.wikipedia.org/wiki/Zebra_Puzzle)
1. 有五間房子
2. 英國人住紅色的房子
3. 西班牙人養狗
4. 住綠色房子的人喝咖啡
5. 烏克蘭人喝茶
6. 綠色房子緊鄰的左邊(你的右邊)是白色房子
7. 抽「Old Gold」牌香菸的人養蝸牛
8. 黃色房子的人抽「Kools」牌香菸
9. 正中間房子的人喝牛奶
10. 挪威人住左邊(你的右邊)第一間房子
11. 抽「Chesterfields」牌香菸的人,住在養狐狸的人的隔壁
12. 抽「Kools」牌香菸的人,住在養馬的人隔壁
13. 抽「Lucky Strike」牌香菸的人,喝橘子汁
14. 日本人... | github_jupyter |
```
from matplotlib.colors import ListedColormap
def plot_decision_regions(X, y, classifier, resolution=0.02):
# marker generator and color map
markers = ('s', 'x', 'o', '^', 'v')
colors = ('red', 'blue', 'lightgreen', 'gray', 'cyan')
cmap = ListedColormap(colors[:len(np.unique(y))])
# plot th... | github_jupyter |
# RadiusNeighborsRegressor with Polynomial Features
This Code template is for the regression analysis using a simple Radius Neighbor Regressor and feature transformation technique Polynomial Features in a pipeline. It implements learning based on the number of neighbors within a fixed radius r of each training point, ... | github_jupyter |
```
import pandas as pd
import xarray as xr
import pathlib
import json
```
## Ingested Data
```
# ingested dataset where cell id is int
cell_tidy_data = pd.read_hdf(
'/home/hanliu/pkg/omb/omb/Data/Dataset/Variables.h5')
def read_msgpack(path):
with open(path, 'rb') as f:
data = msgpack.unpackb(f.rea... | 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 |
# Crime vs Cancer: A Look at Death through the Ages from 1999-2012
**A Data Bootcamp Project by Arman Nasim**
**A special Thanks to Honoary Group Member Sean Rosario**
# Background
Death is part of our life. Life after death. Death during life. Living and never being alive.
These are the topics that consume the hu... | github_jupyter |
## Data Modeling in Python
As discussed in week one of this course, we will be investigating how to develop various statistical models around data.
Modeling plays a significant role in data analysis and builds upon fundamental concepts of statistics. By fitting models to data we are able to accomplish the following... | github_jupyter |
## Migrating from Spark to BigQuery via Dataproc -- Part 2
* [Part 1](01_spark.ipynb): The original Spark code, now running on Dataproc (lift-and-shift).
* [Part 2](02_gcs.ipynb): Replace HDFS by Google Cloud Storage. This enables job-specific-clusters. (cloud-native)
* [Part 3](03_automate.ipynb): Automate everything... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pymc3 as pm
import numpy.random as npr
%load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
```
# Introduction
Let's say there are three bacteria species that characterize the gut, and we... | github_jupyter |
```
# Uncomment this cell if running in Google Colab
# !pip install clinicadl==0.2.1
```
# Train your own models
This section explains how to train a CNN on OASIS data that were processed in the previous sections.
```{warning}
If you do not have access to a GPU, training the CNN may require too much time. However, ... | github_jupyter |
# Adversarial Audio Examples
This notebook demonstrates how to use the ART library to create adversarial audio examples.
---
## Preliminaries
Before diving into the different steps necessary, we walk through some initial work steps ensuring that the notebook will work smoothly. We will
1. set up a small configura... | github_jupyter |
<h1>0. Introduction</h1>
This notebook implements and runs a fraud detection model for credit-cards transactions using the Google Cloud platform. In this notebooks we will execute code to process data, train a tensorflow model, run predictions on new data and assess model performances.
**Before you start, you will ... | github_jupyter |
```
import cv2
from pathlib import Path
from random import *
import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from skimage.feature import hog
from imutils import face_utils
import dlib
import os
import pickle
np.random.seed(1000)
physical_device... | github_jupyter |
```
from loica import *
from flapjack import *
import matplotlib.pyplot as plt
import numpy as np
import getpass
import datetime
import random as rd
import pandas as pd
from numpy.fft import fft, ifft, fftfreq
from scipy.interpolate import interp1d, UnivariateSpline
from sklearn.metrics import mean_squared_error
fro... | github_jupyter |
# Compare TNS Transients to DESI Targets
Access a list of transients reported to the [Transient Name Server](https://wis-tns.weizmann.ac.il/) (TNS) between Jan. 1 2020 and Mar. 25, 2020. See if any of our fibers happened to be pointing at publicly reported transients.
Note: TNS is the primary IAU database for reporti... | github_jupyter |
# Download the Unsplash dataset
This notebook can be used to download all images from the Unsplash dataset: https://github.com/unsplash/datasets. There are two versions Lite (25000 images) and Full (2M images). For the Full one you will need to apply for access (see [here](https://unsplash.com/data)). This will allow... | github_jupyter |
```
from statsmodels.stats.outliers_influence import variance_inflation_factor
from sklearn.model_selection import KFold
from sklearn.datasets import make_regression
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score
from sklearn.model_selection import cross_val_score
%matplotlib i... | github_jupyter |

# Remove Before Flight
## Analyzing Flight Safety Data with Python
###### Jesús Martos Carrizo
###### Alejandro Sáez Mollejo
#### Who are these guys?
* Aerospace engineers
* Passion for programming
* Members of AeroPython

##... | github_jupyter |
```
# Install the dependencies
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q https://archive.apache.org/dist/spark/spark-3.0.2/spark-3.0.2-bin-hadoop3.2.tgz
!tar xf spark-3.0.2-bin-hadoop3.2.tgz
!pip install -q findspark
# Set the environment variables for running PySpark in the collaboration environ... | github_jupyter |
# Getting python for science up and running
Before we can use python we have to install python and get everything ready to go. This means:
1. download and install anaconda
2. create a virtual environment with the correct requirements
3. test this virtual environment
# **This step tests the environment.**
```
# if yo... | github_jupyter |
# WorkFlow
## Classes
## Load the data
## Test Modelling
## Modelling
**<hr>**
## Classes
```
import os
import cv2
import torch
import numpy as np
def load_data(img_size=112):
data = []
index = -1
labels = {}
for directory in os.listdir('./data/'):
index += 1
labels[f'./data/{dire... | github_jupyter |
# SIT742: Modern Data Science
**(Module 05: Data Visualization)**
---
- Materials in this module include resources collected from various open-source online repositories.
- You are free to use, change and distribute this package.
- If you found any issue/bug for this document, please submit an issue at [tulip-lab/si... | github_jupyter |
<h1 style="font-size:35px;
color:black;
">Lab 2 Quantum Measurements</h1>
Prerequisite
- [Ch.1.4 Single Qubit Gates](https://qiskit.org/textbook/ch-states/single-qubit-gates.html)
- [Ch.2.2 Multiple Qubits and Entangled States](https://qiskit.org/textbook/ch-gates/multiple-qubits-entangled-states.html)... | github_jupyter |
# Aim of this notebook
* To construct the singular curve of universal type to finalize the solution of the optimal control problem
# Preamble
```
from sympy import *
init_printing(use_latex='mathjax')
# Plotting
%matplotlib inline
## Make inline plots raster graphics
from IPython.display import set_matplotlib_forma... | github_jupyter |
# B, E, J
author: Louis Richard\
Plots of B, J, E, JxB electric field, and J.E. Calculates J using Curlometer method.
```
import numpy as np
import matplotlib.pyplot as plt
from pyrfu.mms import get_data
from pyrfu.plot import plot_line
from pyrfu.pyrf import (resample, avg_4sc, edb, c_4_j, norm, convert_fac, dot)
``... | github_jupyter |
```
%matplotlib inline
import os
import random
import pandas as pd
import numpy as np
import itertools
import scipy.stats
import matplotlib.pyplot as plt
import statsmodels.api as sm
from collections import Counter
from pprint import pprint
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import ... | github_jupyter |
```
def s(x): return " "*(10+x)
print(s(5)+".\n"+s(4)+"..:\n"+s(2)+"Hultnér\n"+s(0)+"Technologies\n\n@ahultner | https://hultner.se/")
```
# ⠠⠵ Schema-based-API-Testing
**Automatically generate test-cases based on your API-schemas.**
Shorter intro text.
## Index
- Short introduction to API-schemas
- OpenAPI
... | github_jupyter |
```
# lets start by loading the UFO dataset
import pandas as pd
buildings = pd.read_csv("/Users/jillnaiman1/Downloads/building_inventory.csv",
na_values = {'Year Acquired': 0,
'Year Constructed': 0,
'Square Footage': 0})... | github_jupyter |
# 文本情感分析
文本情感分析是NLP(自然语言处理)领域的重要研究领域。在NLP领域,文本情感分析(Text Sentiment Analysis)是指识别一段文本中流露出的说话者的情感态度,情感态度一般使用“积极”或者“消极”表示。文本情感分析可以广泛应用于社交媒体挖掘、电商平台订单评价挖掘、电影评论分析等领域。
为了定量表示情感偏向,一般使用[0,1]之间的一个浮点数给文本打上情感标签,越接近1表示文本的情感越正向,越接近0表示情感越负向。
本实践为基于BERT的中文短句文本情感分析。
## 数据集
数据集使用的是谭松波老师从某酒店预定网站上整理的酒店评论数据,共7000多条评论数据,5000多条正向评论,200... | github_jupyter |
### Preparation steps
Install iotfunctions with
`pip install git+https://github.com/ibm-watson-iot/functions@development`
This projects contains the code for the Analytics Service pipeline as well as the anomaly functions and should pull in most of this notebook's dependencies.
The plotting library matplotlib is th... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
```
# Linear Model Selection and Regularization
## Recall the linear model
$$ Y = \beta_0 + \beta_1 X_1 + \cdots + \beta_p X_p + \epsilon$$
- Despite its simplicity, the linea... | github_jupyter |
# 앙상블들의 앙상블 (모델 Stacking : Stacked generalization)
- 서로 다른 분류기 형태 간의 앙상블들의 앙상블
- 동일 형식 분류기를 사용한 부트스트랩 표본을 통한 앙상블들의 앙상블
```
import pandas as pd
pd.options.display.max_columns=None
```
---
### 데이터 로딩
IBM에서 제공했던 HR 데이터를 활용하겠습니다.
IBM kaggle 데이터 : https://www.kaggle.com/pavansubhasht/ibm-hr-analytics-attrition-datase... | github_jupyter |
```
# importing necessary libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import beta
# data from experiment
df = pd.DataFrame()
df['clicks_success'] = [192, 225]
df['impressions'] = [980, 1020]
df.index= ['version_a', 'version_b']
df['ctr'] = df[... | github_jupyter |
[periodo-reconciler/API.md at master · periodo/periodo-reconciler](https://github.com/periodo/periodo-reconciler/blob/master/API.md)
```
import requests
import json
from periodo_reconciler import (
RProperty,
RQuery,
PeriodoReconciler
)
```
Instantiate `PeriodoReconciler` for the reconciler run on the def... | github_jupyter |
# Using NumPy and SciPy modules
In addition to using Cantera and Pint to help solve thermodynamics problems, we will need to use some additional packages in the scientific Python ecosystem to make plots, solve systems of equations, integrate ordinary differential equations, and more.
```{margin}
The [*SciPy Lecture N... | github_jupyter |
This notebook shows a few features of the NodePy package.
## Instantiating a method and inspecting its properties
We can load a pre-defined RK method:
```
from nodepy import rk
import numpy as np
rk4 = rk.loadRKM('RK44')
```
Or create a custom method by entering the coefficients:
```
A=np.array([[0,0],[0.5,0]])
b... | github_jupyter |
<a href="https://colab.research.google.com/github/csy99/dna-nn-theory/blob/master/histone_ae_adam1024.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install -q biopython
from google.colab import drive
drive.mount('/content/drive')
# mo... | github_jupyter |
# Featuretools Solution
<p style="margin:30px">
<center>
<img style="display:inline; margin-right:50px" width=50% src="https://www.featuretools.com/wp-content/uploads/2017/12/FeatureLabs-Logo-Tangerine-800.png" alt="Featuretools" />
</center>
</p>
In this notebook, we'll use Featuretools to engineer our f... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import h5py
import pickle
import json
import torch
from tqdm import tqdm, tqdm_notebook
import os
from bullseye import BullseyeData
from mapping import *
# matplotlib and seaborn settings
from matplotlib import rc
rc('text', usetex=True)
plt... | github_jupyter |
# Chapter 7. 텍스트 문서의 범주화 - (3) 리뷰 감성 분류기 구현
- 이제 앞에서 구현한 CNN 문서 모델을 훈련해서 감성 분류기를 구축해 보자
- 캐글에서 아마존 감성 분석 리뷰 데이터 세트를 다운로드 받아 압축해제하여 저장한다. (train.ft.txt와 test.ft.txt 두 파일 모두 다운)
- 다운로드 url
- https://www.kaggle.com/bittlingmayer/amazonreviews
- 저장경로
- train.ft.txt -> data/amazonreviews/train.ft/t... | github_jupyter |
# Fitting the distribution of heights data
## Instructions
In this assessment you will write code to perform a steepest descent to fit a Gaussian model to the distribution of heights data that was first introduced in *Mathematics for Machine Learning: Linear Algebra*.
The algorithm is the same as you encountered in *... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# 03. Training MNIST dataset with hyperparameter tuning & deploy to ACI
## Introduction
This tutorial shows how to train a simple deep neural network using the MNIST dataset and TensorFlow on Azure Machine Learning. MNIST is a ... | github_jupyter |
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Challenge Notebook
## Problem: Return all subsets of a set.
* [Constraints](#Constraints)
* [Test Cases](#Test-Cases)
* [Algorithm](#Al... | github_jupyter |
```
# Python ≥3.5 is required
import sys
assert sys.version_info >= (3, 5)
# Scikit-Learn ≥0.20 is required
import sklearn
assert sklearn.__version__ >= "0.20"
try:
# %tensorflow_version only exists in Colab.
%tensorflow_version 2.x
!pip install -q -U tensorflow-addons
IS_COLAB = True
except Exception... | github_jupyter |
# MLToolKit Example
Create Date: July 20, 2019; Last Update: December 31, 2019.
Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
<hr>
### Current release: PyMLToolKit [v0.1.10]
MLToolKit (mltk) is a Python package providing a set of user-friendly functions to help building machine learning mo... | github_jupyter |
<h1> 2c. Loading large datasets progressively with the tf.data.Dataset </h1>
In this notebook, we continue reading the same small dataset, but refactor our ML pipeline in two small, but significant, ways:
1. Refactor the input to read data from disk progressively.
2. Refactor the feature creation so that it is not on... | github_jupyter |
```
#Fill the paths below
PATH_FRC = "" #git repo directory path
PATH_ZENODO = "" #Data and models are available here: https://zenodo.org/record/5831014#.YdnW_VjMLeo
import sys
import numpy as np
import pandas as pd
import glob
from tqdm import tqdm
import skimage
import matplotlib.pyplot as plt
from skimage.io import... | github_jupyter |
# OBP calculation for well
OBP calculation include the following step:
1. Extrapolate density log to the surface
2. Calculate Overburden Pressure
- Calculate Hydrostatic Pressrue (*)
```
import warnings
warnings.filterwarnings(action='ignore')
# for python 2 and 3 compatibility
# from builtins import str
# try:
# ... | github_jupyter |
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
print(tf.__version__)
def plot_series(time, series, format="-", start=0, end=None):
plt.plot(time[start:end], series[start:end], format)
plt.xlabel("Time")
plt.ylabel("Value")
plt.grid(False)... | github_jupyter |
```
# Author: Naveen Lalwani
# Script to convert model from .h5 to .tflite; post train quantize models and evaluate performance for
# LeNet-5 on MNIST
import tensorflow as tf
import keras
import numpy as np
import time
from tensorflow.contrib import lite
from keras.utils import np_utils
from tensorflow.examples.tutori... | github_jupyter |
<!--NOTEBOOK_HEADER-->
*This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta.notebooks);
content is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).*
<!--NAVIGATION-->
< [RNA in PyRosetta](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosett... | github_jupyter |
<a href="https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/00_geemap_key_features.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/></a>
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li>... | github_jupyter |
You now know the following
1. Generate open-loop control from a given route
2. Simulate vehicular robot motion using bicycle/ unicycle model
Imagine you want to make an utility for your co-workers to try and understand vehicle models.
Dashboards are common way to do this.
There are several options out there : Stre... | github_jupyter |
# Face Recognition for the Happy House
Welcome to the second assignment of week 4! Here you will build a face recognition system. Many of the ideas presented here are from [FaceNet](https://arxiv.org/pdf/1503.03832.pdf). In lecture, we also talked about [DeepFace](https://research.fb.com/wp-content/uploads/2016/11/dee... | github_jupyter |
# Add model: translation attention ecoder-decocer over the b4 dataset
```
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchtext import data
import pandas as pd
import unicodedata
import string
import re
import random
import copy
from contra_qa.plots.functions import simp... | github_jupyter |
<table style="border: none" align="left">
<tr style="border: none">
<th style="border: none"><font face="verdana" size="5" color="black"><b>Build a Loan default scoring model in Watson ML </b></th>
<th style="border: none"><img src="https://github.com/pmservice/customer-satisfaction-prediction/blob/maste... | github_jupyter |
# Forecasting using spatio-temporal data with combined Graph Convolution + LSTM model
The dynamics of many real-world phenomena are spatio-temporal in nature. Traffic forecasting is a quintessential example of spatio-temporal problems for which we present here a deep learning framework that models speed prediction usi... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.