code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Classification metrics
Author: Geraldine Klarenberg
Based on the Google Machine Learning Crash Course
## Tresholds
In previous lessons, we have talked about using regression models to predict values. But sometimes we are interested in **classifying** things: "spam" vs "not spam", "bark" vs "not barking", etc.
Log... | github_jupyter |
# Multi-panel detector
The AGIPD detector, which is already in use at the SPB experiment, consists of 16 modules of 512×128 pixels each. Each module is further divided into 8 ASICs (application-specific integrated circuit).
<img src="AGIPD.png" width="300" align="left"/> <img src="agipd_geometry_14_1.png" width="420"... | github_jupyter |
tgb - 6/12/2021 - The goal is to see whether it would be possible to train a NN/MLR outputting results in quantile space while still penalizing them following the mean squared error in physical space.
tgb - 4/15/2021 - Recycling this notebook but fitting in percentile space (no scale_dict, use output in percentile uni... | github_jupyter |
# Association Analysis
```
dataset = [['Milk', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'],
['Dill', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'],
['Milk', 'Apple', 'Kidney Beans', 'Eggs'],
['Milk', 'Unicorn', 'Corn', 'Kidney Beans', 'Yogurt'],
['Corn', 'Oni... | github_jupyter |
```
import json
import glob
import re
import malaya
tokenizer = malaya.preprocessing._SocialTokenizer().tokenize
def is_number_regex(s):
if re.match("^\d+?\.\d+?$", s) is None:
return s.isdigit()
return True
def detect_money(word):
if word[:2] == 'rm' and is_number_regex(word[2:]):
return ... | github_jupyter |
```
import pandas as pd
import numpy as np
import seaborn as sns
from sklearn.model_selection import KFold
from sklearn.pipeline import make_union, make_pipeline
from sklearn.preprocessing import OneHotEncoder
from sklearn.base import TransformerMixin
from sklearn.model_selection import cross_val_score
from lightgbm i... | github_jupyter |
# Script for uploading our rProtein sequences
Uses a pregenerated csv file with the columns:
*Txid*, *Accession*, *Origin database*, *Description*, and *Full sequence*
Updates tables: **Polymer_Data**, **Polymer_metadata**, and **Residues**
```
#!/usr/bin/env python3
import csv, sys, getopt, getpass, mysql.connecto... | github_jupyter |
```
%matplotlib inline
import numpy as np
import pylab as pl
from psi.application import get_default_io, get_default_calibration, get_calibration_file
from psi.controller import util
from psi.controller.calibration.api import FlatCalibration, PointCalibration
from psi.controller.calibration.util import load_calibratio... | github_jupyter |
## 라이브러리(패키지) import
데이터프레임, 행렬, 그래프 그리기 위한 라이브러리
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
```
## 데이터 불러오기
현재폴더 데이터 불러오기
```
ExampleData = pd.read_csv('./ExampleData', sep=',', header=None)
ExampleData
```
하위폴더 데이터 불러오기
```
path = './Subfolder/ExampleData2' # 파일 경로
ExampleData2 ... | github_jupyter |
```
image_shape = (56,64,1)
train_path = "D:\\Projects\\EYE_GAME\\eye_img\\datav2\\train\\"
test_path = "D:\\Projects\\EYE_GAME\\eye_img\\datav2\\test\\"
import os
import pandas as pd
from glob import glob
import numpy as np
import matplotlib as plt
from matplotlib.image import imread
import seaborn as sns
from te... | github_jupyter |
## Modeling the Impact of Root Distributions Parameterizations on Total Evapotranspiration in the Reynolds Mountain East catchment using pySUMMA
## 1. Introduction
One part of the Clark et al. (2015) study explored the impact of root distribution on total evapotranspiration (ET) using a SUMMA model for the Reynolds ... | github_jupyter |
### Trade Demo
#### Goal:
- Load the trade data for the country `Canada`
- Launch a domain node for canada
- Login into the domain node
- Format the `Canada` trade dataset and convert to Numpy array
- Convert the dataset to a private tensor
- Upload `Canada's` trade on the domain node
- Create a Data Scientist User
... | github_jupyter |
```
import boto3
import sagemaker
import pandas as pd
from sagemaker import get_execution_role
from sagemaker.amazon.amazon_estimator import get_image_uri
from sagemaker import RandomCutForest
bucket = 'anomaly-detection-team-vypin' # <--- specify a bucket you have access to
prefix = 'vishal/sagemaker/rcf-benchmarks... | github_jupyter |
```
import math
import random
from array import *
from math import gcd as bltin_gcd
from fractions import Fraction
import matplotlib.pyplot as plt
import numpy as np
#import RationalMatrices as Qmtx
##########################################
###### Methods for Qmatrix #####
# --------------------------------------... | github_jupyter |
# LSTM Stock Predictor Using Fear and Greed Index
In this notebook, you will build and train a custom LSTM RNN that uses a 10 day window of Bitcoin fear and greed index values to predict the 11th day closing price.
You will need to:
1. Prepare the data for training and testing
2. Build and train a custom LSTM RNN
3... | github_jupyter |
# Coding Recommendation Engines Ground Up
***
## Overview
Recommendation Engines are the programs which basically compute the similarities between two entities and on that basis, they give us the targeted output. If we look at the root level of the recommendation engines, they all are trying to find out the level of si... | github_jupyter |
# ism Import and Plotting
This example shows how to measure an impedance spectrum and then plot it in Bode and Nyquist using the Python library [matplotlib](https://matplotlib.org/).
```
import sys
from thales_remote.connection import ThalesRemoteConnection
from thales_remote.script_wrapper import PotentiostatMode,Th... | github_jupyter |
#### Omega and Xi
To implement Graph SLAM, a matrix and a vector (omega and xi, respectively) are introduced. The matrix is square and labelled with all the robot poses (xi) and all the landmarks (Li). Every time you make an observation, for example, as you move between two poses by some distance `dx` and can relate t... | github_jupyter |
<a href="https://colab.research.google.com/github/bitprj/Bitcamp-DataSci/blob/master/Week1-Introduction-to-Python-_-NumPy/Intro_to_Python_plus_NumPy.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<img src="https://github.com/bitprj/Bitcamp-DataSci/... | github_jupyter |
Move current working directory, in case for developing the machine learning program by remote machine or it is fine not to use below single line.
```
%cd /tmp/pycharm_project_881
import numpy as np
import pandas as pd
def sigmoid(x):
return 1/(1+np.exp(-x))
def softmax(x):
x = x - x.max(axis=1, keepdims=True... | github_jupyter |
# 3D Nuclear Segmentation with RetinaNet
```
import os
import errno
import numpy as np
import deepcell
import deepcell_retinamask
# Download the data (saves to ~/.keras/datasets)
filename = 'HEK293.trks'
test_size = 0.1 # % of data saved as test
seed = 0 # seed for random train-test split
(X_train, y_train), (X_tes... | github_jupyter |
## Fashion Item Recognition with CNN
> Antonopoulos Ilias (p3352004) <br />
> Ndoja Silva (p3352017) <br />
> MSc Data Science AUEB
## Table of Contents
- [Data Loading](#Data-Loading)
- [Hyperparameter Tuning](#Hyperparameter-Tuning)
- [Model Selection](#Model-Selection)
- [Evaluation](#Evaluation)
```
import gc
i... | github_jupyter |
```
%matplotlib inline
# Packages
import os, glob, scipy, sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Project directory
base_dir = os.path.realpath('..')
print(base_dir)
# Project-specific functions
funDir = os.path.join(base_dir,'Code/Functions')
print(funDir)
... | github_jupyter |
```
#!/usr/bin/env python
# coding: utf-8
'''
This module helps to predict new data sets using a trained model
Author: Tadele Belay Tuli, Valay Mukesh Patel,
University of Siegen, Germany (2022)
License: MIT
'''
import glob
import os
import subprocess
import pandas as pd
from scipy import stats
import numpy as np
i... | github_jupyter |
# Writing custom steps
<!-- Add overview -->
The Graph executes built-in task classes, or task classes and functions that you implement.
The task parameters include the following:
* `class_name` (str): the relative or absolute class name.
* `handler` (str): the function handler (if class_name is not specified it is ... | github_jupyter |
```
import sys
sys.path.append('../src')
from mcmc_norm_learning.algorithm_1_v4 import to_tuple
from mcmc_norm_learning.rules_4 import get_log_prob
from pickle_wrapper import unpickle
import pandas as pd
import yaml
import tqdm
from numpy import log
with open("../params_nc.yaml", 'r') as fd:
params = yaml.safe_loa... | github_jupyter |
# AbuseCH Data Scraper
## SSLBL
> The SSL Blacklist (SSLBL) is a project of abuse.ch with the goal of detecting malicious SSL connections, by identifying and blacklisting SSL certificates used by botnet C&C servers. In addition, SSLBL identifies JA3 fingerprints that helps you to detect & block malware botnet C&C com... | github_jupyter |
# Data Management with OpenACC
This version of the lab is intended for C/C++ programmers. The Fortran version of this lab is available [here](../../Fortran/jupyter_notebook/openacc_fortran_lab2.ipynb).
You will receive a warning five minutes before the lab instance shuts down. Remember to save your work! If you are a... | github_jupyter |
```
%matplotlib inline
import cv2
import numpy as np
import scipy
from tqdm.notebook import tqdm
import seaborn as sns
import matplotlib.pyplot as plt
import utils
import disparity_functions
data_ix = 1
if data_ix == 0:
img_list = [cv2.imread("dataset/data_disparity_estimation/Plastic/view1.png"),
... | github_jupyter |
```
import sys
sys.path.insert(1, '../functions')
import importlib
import numpy as np
import nbformat
import plotly.express
import plotly.express as px
import pandas as pd
import scipy.optimize as optimization
import food_bank_functions
import food_bank_bayesian
import matplotlib.pyplot as plt
import seaborn as sns
fro... | github_jupyter |
```
import sys
import keras
import tensorflow as tf
print('python version:', sys.version)
print('keras version:', keras.__version__)
print('tensorflow version:', tf.__version__)
```
# 6.3 Advanced use of recurrent neural networks
---
## A temperature-forecasting problem
### Inspecting the data of the Jena weather da... | github_jupyter |
# Discover, Customize and Access NSIDC DAAC Data
This notebook is based off of the [NSIDC-Data-Access-Notebook](https://github.com/nsidc/NSIDC-Data-Access-Notebook) provided through NSIDC's Github organization.
Now that we've visualized our study areas, we will first explore data coverage, size, and customization (s... | github_jupyter |
# Improving Data Quality
**Learning Objectives**
1. Resolve missing values
2. Convert the Date feature column to a datetime format
3. Rename a feature column, remove a value from a feature column
4. Create one-hot encoding features
5. Understand temporal feature conversions
## Introduction
Recall that machine l... | github_jupyter |
# Books Recommender System

This is the second part of my project on Book Data Analysis and Recommendation Systems.
In my first notebook ([The Story of Book](https://www.kaggle.com/omarzaghlol/goodreads-1-the-story-of-book/)), I attempted... | github_jupyter |
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.stats import gaussian_kde, chi2, pearsonr
SMALL_SIZE = 16
MEDIUM_SIZE = 18
BIGGER_SIZE = 20
plt.rc('font', size=SMALL_SIZE) # controls default text sizes
plt.rc('axes', titlesize=SMALL_SIZE) # fontsiz... | github_jupyter |
## 人脸与人脸关键点检测
在训练用于检测面部关键点的神经网络之后,你可以将此网络应用于包含人脸的*任何一个*图像。该神经网络需要一定大小的Tensor作为输入,因此,要检测任何一个人脸,你都首先必须进行一些预处理。
1. 使用人脸检测器检测图像中的所有人脸。在这个notebook中,我们将使用Haar级联检测器。
2. 对这些人脸图像进行预处理,使其成为灰度图像,并转换为你期望的输入尺寸的张量。这个步骤与你在Notebook 2中创建和应用的`data_transform` 类似,其作用是重新缩放、归一化,并将所有图像转换为Tensor,作为CNN的输入。
3. 使用已被训练的模型检测图像上的人脸关键点。
---
在下一个... | github_jupyter |
# WGAN
元論文 : Wasserstein GAN https://arxiv.org/abs/1701.07875 (2017)
WGANはGANのLossを変えることで、数学的に画像生成の学習を良くしよう!っていうもの。
通常のGANはKLDivergenceを使って、Generatorによる確率分布を、生成したい画像の生起分布に近づけていく。だが、KLDでは連続性が保証されないので、代わりにWasserstain距離を用いて、近似していこうというのがWGAN。
Wasserstain距離によるLossを実現するために、WGANのDiscriminatorでは最後にSigmoid関数を適用しない。つまり、Lossも... | github_jupyter |
```
#hide
# default_exp script
```
# Script - command line interfaces
> A fast way to turn your python function into a script.
Part of [fast.ai](https://www.fast.ai)'s toolkit for delightful developer experiences.
## Overview
Sometimes, you want to create a quick script, either for yourself, or for others. But in ... | github_jupyter |
```
'''
这个code的目的是用neurosketch 的数据来检测现在在realtime data里面发现的issue:也就是ceiling有时候竟然比floor更小
这个code的运行逻辑是
用neurosketch前五个run训练2 way classifiers,然后用最后一个run来计算ceiling和floor的值,看是否合理
'''
'''
purpose:
find the best performed mask from the result of aggregate_greedy.py and save as chosenMask
train all possible pairs of ... | github_jupyter |
# Transfer Learning
A Convolutional Neural Network (CNN) for image classification is made up of multiple layers that extract features, such as edges, corners, etc; and then use a final fully-connected layer to classify objects based on these features. You can visualize this like this:
<table>
<tr><td rowspan=2 st... | github_jupyter |
# Check Lipid differences in WT, KO and DKO
- Show if some Lipids are particularly high in one of the three categories
### Included libraries
```
from matplotlib import cm
from matplotlib.lines import Line2D
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from matplotlib import pylab as plt
import ... | github_jupyter |
# Image Processing Dense Array, JPEG, PNG
> In this post, we will cover the basics of working with images in Matplotlib, OpenCV and Keras.
- toc: true
- badges: true
- comments: true
- categories: [Image Processing, Computer Vision]
- image: images/freedom.png
Images are dense matrixes, and have a certain numbers of... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

# Unfairness Mitigation with Fairlearn and Azure Machine Learning
*... | github_jupyter |
```
import cv2
import numpy as np
import matplotlib.pyplot as plt
```
# Data Base Generation
### Basic Frame Capture
```
## This is just an example to ilustrate how to display video from webcam##
vid = cv2.VideoCapture(0) # define a video capture object
status = True # Initalize status
while(... | github_jupyter |
```
%matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
import time
import os
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
from tests import test_prediction, test_generation
# load all that we need
dataset = np.load('../... | github_jupyter |
# Degradation Module
```
## Importing Packages
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
## Pre-processing cycle dataframe for the battery pack in question
def deg_preprocessing(df):
df['avg_ch_C'] = (df["avg_ch_MW"]*1000)/design_dict['tot_cap'] # Charge C rate
df['avg_disch_C'] = ... | github_jupyter |
```
import numpy as np
import pandas as pd
from pandas.plotting import scatter_matrix
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white")
%matplotlib inline
```
<h3>Carrega os arquivos e padroniza os sem informação</h3>
```
missing_values = ["n/a", "na", "--", " "] # mais comuns
df = pd.rea... | github_jupyter |
# CTW dataset tutorial (Part 1: basics)
Hello, welcome to the tutorial of _Chinese Text in the Wild_ (CTW) dataset. In this tutorial, we will show you:
1. [Basics](#CTW-dataset-tutorial-(Part-1:-Basics)
- [The structure of this repository](#The-structure-of-this-repository)
- [Dataset split](#Dataset-Split)
- ... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import os
import datetime
import numpy as np
import scipy
import pandas as pd
import torch
from torch import nn
import criscas
from criscas.utilities import create_directory, get_device, report_available_cuda_devices
from criscas.predict_model import *
base_dir = os.path.abspath('... | github_jupyter |
# Day 3
batch size 256 lr 1e-3, normed weighted, rotated, cartesian, split ny jet mult (1)
### Import modules
```
%matplotlib inline
from __future__ import division
import sys
import os
os.environ['MKL_THREADING_LAYER']='GNU'
sys.path.append('../')
from Modules.Basics import *
from Modules.Class_Basics import *
```
... | github_jupyter |
# Procedure for Word Correction Strategy as mentioned in Page 43 in the dissertation report
```
import numpy as np
import pandas as pd
import os
import nltk
import re
import string
from bs4 import BeautifulSoup
from spellchecker import SpellChecker
def read_file(df_new):
print("Started extracting data from file",d... | github_jupyter |
```
from extra import *
import keras
from keras.datasets import mnist
from keras.models import Sequential, Model
from keras import regularizers
from keras.layers import Dense, Dropout, Conv2D, Input, GlobalAveragePooling2D, GlobalMaxPooling2D
from keras.layers import Add, Concatenate, BatchNormalization
import keras.b... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# a)
import sse
Lx, Ly = 8, 8
n_updates_measure = 10000
# b)
spins, op_string, bonds = sse.init_SSE_square(Lx, Ly)
for beta in [0.1, 1., 64.]:
op_string = sse.thermalize(spins, op_string, bonds, beta, n_updates_measure//10)
ns = sse.mea... | github_jupyter |
# Register Client and Create Access Token Notebook
- Find detailed information about client registration and access tokens in this blog post: [Authentication to SAS Viya: a couple of approaches](https://blogs.sas.com/content/sgf/2021/09/24/authentication-to-sas-viya/)
- Use the client_id to create an access token you c... | github_jupyter |
# 문자 단위 RNN으로 이름 분류하기
- 문자 하나(ex. a, b,....,z)를 하나의 one-hot벡터로 표현하여 예측 실시
- 한 문자의 벡터 길이는 alphabet의 길이(26)이다.
- 18개 언어로 된 수천 개의 성을 훈련시킨 후, 철자에 따라 이름이 어떤 언어인지 예측
# DataLoad
- data/name 디렉토리에 18개 텍스트 파일이 포함되어 있다.
- 각 파일에는 한 줄에 하나의 이름이 포함되어 있다.(로마자)
- ASCII로 변환해야 한다.
```
# data 보기
from io import open
import glob
import ... | github_jupyter |
# Sklearn
# Визуализация данных
```
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.stats as sts
import seaborn as sns
from contextlib import contextmanager
sns.set()
sns.set_style("whitegrid")
color_palette = sns.color_palette('deep') + sns.color_palette... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
from IPython.core.debugger import Pdb; pdb = Pdb()
def get_down_centre_last_low(p_list):
zn_num = len(p_list) - 1
available_num = min(9, (zn_num - 6))
index = len(p_list) - 4
for i in range(0, available_num // 2):
if p_list[index - 2... | github_jupyter |
#Create the environment
```
from google.colab import drive
drive.mount('/content/drive')
%cd /content/drive/My Drive/ESoWC
import pandas as pd
import xarray as xr
import numpy as np
import pandas as pd
from sklearn import preprocessing
import seaborn as sns
#Our class
from create_dataset.make_dataset import CustomDa... | github_jupyter |
## Amazon SageMaker Feature Store: Client-side Encryption using AWS Encryption SDK
This notebook demonstrates how client-side encryption with SageMaker Feature Store is done using the [AWS Encryption SDK library](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html) to encrypt your data ... | github_jupyter |
# Strings
### **Splitting strings**
```
'a,b,c'.split(',')
latitude = '37.24N'
longitude = '-115.81W'
'Coordinates {0},{1}'.format(latitude,longitude)
f'Coordinates {latitude},{longitude}'
'{0},{1},{2}'.format(*('abc'))
coord = {"latitude":latitude,"longitude":longitude}
'Coordinates {latitude},{longitude}'.format(**... | github_jupyter |
# 9. Incorporating OD Veto Data
```
import sys
import os
import h5py
from collections import Counter
from progressbar import *
import re
import numpy as np
import h5py
from scipy import signal
import matplotlib
from repeating_classifier_training_utils import *
from functools import reduce
# Add the path to the parent... | github_jupyter |
###### Name: Deepak Vadithala
###### Course: MSc Data Science
###### Project Name: MOOC Recommender System
##### Notes:
This notebook contains the analysis of the **Google's Word2Vec** model. This model is trained on the news articles.
two variable **(Role and Skill Scores)** is used to predict the course category.
... | github_jupyter |
<a href="https://colab.research.google.com/github/sreyaschaithanya/football_analysis/blob/main/Football_1_Plotting_pass_and_shot.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#! git clone https://github.com/statsbomb/open-data.git
from google.... | github_jupyter |
# Vectors in Python
In the following exercises, you will work on coding vectors in Python.
Assume that you have a state vector
$$\mathbf{x_0}$$
representing the x position, y position, velocity in the x direction, and velocity in the y direction of a car that is driving in front of your vehicle. You are tracking th... | github_jupyter |
# Workflows for reproducibile and trustworthy data science wrap-up
This topic serves as a wrap-up of the course, summarizing the course learning objectives, redefining what is meant by reproducible and trustworthy data science, as well as contains data analysis project critique exercises to reinforce what has been lea... | github_jupyter |
```
%matplotlib inline
```
DCGAN Tutorial
==============
**Author**: `Nathan Inkawhich <https://github.com/inkawhich>`__
Introduction
------------
This tutorial will give an introduction to DCGANs through an example. We
will train a generative adversarial network (GAN) to generate new
celebrities after showing it ... | github_jupyter |
# Kernel-based Time-varying Regression - Part II
The previous tutorial covered the basic syntax and structure of **KTR** (or so called **BTVC**); time-series data was fitted with a KTR model accounting for trend and seasonality. In this tutorial a KTR model is fit with trend, seasonality, and additional regressors. T... | github_jupyter |
# Extension Input Data Validation
When using extensions in Fugue, you may add input data validation logic inside your code. However, there is standard way to add your validation logic. Here is a simple example:
```
from typing import List, Dict, Any
# partitionby_has: a
# schema: a:int,ct:int
def get_count(df:List[D... | github_jupyter |
##### Copyright 2020 The TF-Agents Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | github_jupyter |
# Week 4
Yay! It's week 4. Today's we'll keep things light.
I've noticed that many of you are struggling a bit to keep up and still working on exercises from the previous weeks. Thus, this week we only have two components with no lectures and very little reading.
## Overview
* An exercise on visualizing geodata ... | github_jupyter |
# DSCI 525 - Web and Cloud Computing
***Milestone 4:*** In this milestone, you will deploy the machine learning model you trained in milestone 3.
You might want to go over [this sample project](https://github.ubc.ca/mds-2021-22/DSCI_525_web-cloud-comp_students/blob/master/release/milestone4/sampleproject.ipynb) and g... | github_jupyter |
# Inference with your model
This is the third and final tutorial of our [beginner tutorial series](https://github.com/awslabs/djl/tree/master/jupyter/tutorial) that will take you through creating, training, and running inference on a neural network. In this tutorial, you will learn how to execute your image classifica... | github_jupyter |
# Autonomous driving - Car detection
Welcome to your week 3 programming assignment. You will learn about object detection using the very powerful YOLO model. Many of the ideas in this notebook are described in the two YOLO papers: [Redmon et al., 2016](https://arxiv.org/abs/1506.02640) and [Redmon and Farhadi, 2016](h... | github_jupyter |
```
addressProviderAddr = '0xcF64698AFF7E5f27A11dff868AF228653ba53be0' #mainnet
#addressProviderAddr = '0xA526311C39523F60b184709227875b5f34793bD4' #kovan
import os
from dotenv import load_dotenv
load_dotenv() # add this line
providerRPC = os.getenv('RPC_NODE')
from web3 import Web3
import json
w3 = Web3(Web3.HTT... | github_jupyter |
```
# Copyright (c) 2020-2021 Adrian Georg Herrmann
import os
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy import interpolate
from sklearn.linear_model import LinearRegression
from datetime import datetime
data_root = "../../data"
locations = {
"berlin": ["52.4652025", "13.34... | github_jupyter |
# GAMA-09 Selection Functions
## Depth maps and selection functions
The simplest selection function available is the field MOC which specifies the area for which there is Herschel data. Each pristine catalogue also has a MOC defining the area for which that data is available.
The next stage is to provide mean flux st... | github_jupyter |
<a href="https://colab.research.google.com/github/jereyel/LinearAlgebra/blob/main/Assignment2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Welcome to Python Fundamentals
In this module, we are going to establish our skills in Python Programming... | github_jupyter |
# 2A.eco - Exercice API SNCF corrigé
Manipulation d'une [API REST](https://fr.wikipedia.org/wiki/Representational_state_transfer), celle de la SNCF est prise comme exemple. Correction d'exercices.
```
from jyquickhelper import add_notebook_menu
add_notebook_menu()
```
## Partie 0 - modules recommandés et connexion à... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Pre_data = pd.read_csv("C:\\Users\\2019A00303\\Desktop\\Code\\Airbnb Project\\Data\\PreProcessingAustralia.csv")
Pre_data
Pre_data['Price'].plot(kind='hist', bins=100)
Pre_data['group'] = pd.cut(x=Pre_data['Price'],
bins=[0, 50, 100, 150, 200, ... | github_jupyter |
# KNN(K Nearest Neighbours) for classification of glass types
We will make use of KNN algorithms to classify the type of glass.
### What is covered?
- About KNN algorithm
- Exploring dataset using visualization - scatterplot,pairplot, heatmap (correlation matrix).
- Feature scaling
- using KNN to predict
- Optimizati... | github_jupyter |
<a href="https://colab.research.google.com/github/krakowiakpawel9/machine-learning-bootcamp/blob/master/unsupervised/04_anomaly_detection/01_local_outlier_factor.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
### scikit-learn
Strona biblioteki: [ht... | github_jupyter |
```
import numpy as np
import pandas as pd
import glob
import emcee
import corner
import scipy.stats
from scipy.ndimage import gaussian_filter1d
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from sklearn.model_selection import GridSearchCV
from sklearn.neighbors import KernelDensity
f... | github_jupyter |
This notebook demonstrates how to use this code to calculate various quantities for both Ngen=1 and Ngen=3.
```
import numpy as np
import time
#-- Change working directory to the main one with omegaH2.py and omegaH2_ulysses.py--#
import os
#print(os.getcwd())
os.chdir('../')
#print(os.getcwd())
```
# Define input va... | github_jupyter |
```
import gradio as gr
import torch
from torchvision import transforms
import requests
from PIL import Image
from net import Net, Vgg16
import numpy as np
model = torch.hub.load('pytorch/vision:v0.6.0', 'resnet18', pretrained=True).eval()
# Download human-readable labels for ImageNet.
response = requests.get("https... | github_jupyter |
# Initial data and problem exploration
```
import xarray as xr
import pandas as pd
import urllib.request
import numpy as np
from glob import glob
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import os
import cartopy.feature as cfeature
states_provinces = cfeature.NaturalEarthFeature(
category='cu... | github_jupyter |
```
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib.pyplot as plt
import numpy as np
import random
%matplotlib inline
mnist = input_data.read_data_sets('data/MNIST/', one_hot=True) #onhot=true -> y=5 ise => on tane eleman olan vektore cevirdi -> y=[0,0,0,0,1,0,0,0,0... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
from numpy import *
from IPython.html.widgets import *
import matplotlib.pyplot as plt
from IPython.core.display import clear_output
```
# Principal Component Analysis and EigenFaces
In this notebook, I will go through the basic concepts behind the principal ... | github_jupyter |
## Data Mining and Machine Learning
### k-nn Classification
#### Edgar Acuna
#### November 2018
```
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import ... | github_jupyter |
# Module 4 Required Coding Activity
Introduction to Python Unit 1
The activity is based on modules 1 - 4 and is similar to the Jupyter Notebooks **`Practice_MOD04_1-6_IntroPy.ipynb`** and **`Practice_MOD04_1-7_IntroPy.ipynb`** which you may have completed as practice. This activity is a new version of the str_ana... | github_jupyter |
# Descriptive analysis for the manuscript
Summarize geotagged tweets of the multiple regions used for the experiment and the application.
```
%load_ext autoreload
%autoreload 2
import os
import numpy as np
import pandas as pd
import yaml
import scipy.stats as stats
from tqdm import tqdm
def load_region_tweets(regio... | 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 |
# U-Net: nuclei segmentation 2
This is an implementation of a [Kaggle kernel](https://www.kaggle.com/c0conuts/unet-imagedatagenerator-lb-0-336/notebook) of a [U-net](https://arxiv.org/abs/1505.04597).
Changes:
* added model time elapsed with timeit
* modelling:
* batch_size=100
* epochs=3
* data augmentation:... | github_jupyter |
# Manual Jupyter Notebook:
https://athena.brynmawr.edu/jupyter/hub/dblank/public/Jupyter%20Notebook%20Users%20Manual.ipynb
#Jupyter Notebook Users Manual
This page describes the functionality of the [Jupyter](http://jupyter.org) electronic document system. Jupyter documents are called "notebooks" and can be seen as ... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.plotting.register_matplotlib_converters.html
# Register converters for handling time... | github_jupyter |
#### Naive bayes
```
#import library
import pandas as pd
#read data
df = pd.read_csv("spam.csv")
#display all data
df
#print full summary
df.info()
#display data first five rows
df.head()
#display data last five rows
df.tail()
#groupby category and describe
df.groupby('Category').describe()
#describe non-spam emails ... | github_jupyter |
```
import matplotlib.cbook
import warnings
import plotnine
warnings.filterwarnings(module='plotnine*', action='ignore')
warnings.filterwarnings(module='matplotlib*', action='ignore')
%matplotlib inline
```
# Querying SQL (intro)
## Reading in data
In this tutorial, we'll use the mtcars data ([source](https://stat... | github_jupyter |
## Expressões Regulares
Uma expressão regular é um método formal de se especificar um padrão de texto.
Mais detalhadamente, é uma composição de símbolos, caracteres com funções especiais, que agrupados entre si e com caracteres literais, formam uma sequência, uma expressão,Essa expressão é interpretada como uma regra q... | github_jupyter |
<a href="https://colab.research.google.com/github/MoRebaie/Sequences-Time-Series-Prediction-in-Tensorflow/blob/master/Course_4_Week_4_Lesson_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install tf-nightly-2.0-preview
import tensorflow ... | github_jupyter |
# Protein-ligand complex MD Setup tutorial using BioExcel Building Blocks (biobb)
### --***AmberTools package version***--
**Based on the [MDWeb](http://mmb.irbbarcelona.org/MDWeb2/) [Amber FULL MD Setup tutorial](https://mmb.irbbarcelona.org/MDWeb2/help.php?id=workflows#AmberWorkflowFULL)**
***
This tutorial aims to... | github_jupyter |
# Object Recognition using CNN model
```
import numpy as np
import cv2
import matplotlib.pyplot as plt
#detecting license plate on the vehicle
plateCascade = cv2.CascadeClassifier('indian_license_plate.xml')
#detect the plate and return car + plate image
def plate_detect(img):
plateImg = img.copy()
roi = img.c... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.