text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` !pip install biom-format !pip install -U kaleido from biom import load_table input_biom = "../Human_Subramanian/INPUT_FILES/Subramanian_et_al_otu_table/Subramanian_et_al_otu_table.biom" table = load_table(input_biom) df_abundances = table.to_dataframe().T.rename_axis('sampleID').astype(np.int32).reset_index() print...
github_jupyter
In this notebook, we will implement forward and backward propogation functions for a multi layered neural from scratch in Pytorch. ``` import torch ``` ### Forward propagation Forward Propagation, for arbitrary layer $l \in \left\lbrace 0, L \right\rbrace$: $$\vec{z}^{\left(l\right)} = W^{\left(l\right)} \vec{a}^{\...
github_jupyter
Custom dataset preparation and Training using YOLOv3 darknet --- Labelling from scratch - Create **custom_data** folder on local with images to train and test. Can use Imageye as chrome extension to download images in bulk for each class - Download **LabelImg** from https://github.com/tzutalin/labelImg. This is a vi...
github_jupyter
This notebook contains code that evaluates the model by supplying images through a batch tranform. You will need three things for this notebook to run.<br> 1. **trainining Job Name (name of the job with which you have trained the model).** 2. **url of the location in s3 where images are uploaded.** 3. **url in the s3 ...
github_jupyter
``` inputfile="../../tmp/all.results.tsv" import pandas as pd import numpy as np import matplotlib import matplotlib.pylab as plt import seaborn as sns from scipy.cluster.hierarchy import fcluster import scipy.cluster.hierarchy as sch import scipy.spatial as scs from scipy import stats from collections import defaultdi...
github_jupyter
# Keras Secuencial y Funcional ### Conjunto de datos ``` import numpy as np dataset = np.loadtxt("pima-indians-diabetes.csv", delimiter=",") # X caracterítsticas, Y labels X = dataset[:,0:8] Y = dataset[:,8] print("Forma de X", X.shape) print("Forma de Y", Y.shape) print(X[0,:]) print(Y[0]) ``` # Secuencial ### U...
github_jupyter
# 第6章 モデルの評価とハイパーパラメータのチューニングのベストプラクティス * https://github.com/rasbt/python-machine-learning-book/blob/master/code/ch06/ch06.ipynb * モデルの性能の偏りのない推定量の算出 * 機械学習のアルゴリズムに共通する問題の診断 * 機械学習のモデルのチューニング * さまざまな性能指標に基づく予測モデルの評価 ## 6.1 パイプラインによるワークフローの効率化 ### 6.1.1 Breast Cancer Wisconsin データセットを読み込む * 悪性腫瘍細胞と良性腫瘍細胞の569のサンプル * ...
github_jupyter
# 1.0 Frequency Distributions ## 1.1 Simplifying Data Previously, we focused on the details around collecting data, on understanding its structure and how it's measured. **Collecting data is just the starting point in a data analysis workflow.** We rarely collect data just for the sake of collecting it. We collect d...
github_jupyter
# Download and process the Bay Area's street network ### for BPR coefficients calculation ``` import time import os, zipfile, requests, pandas as pd, geopandas as gpd, osmnx as ox, networkx as nx ox.config(use_cache=True, log_console=True) print('ox {}\nnx {}'.format(ox.__version__, nx.__version__)) start_time = time...
github_jupyter
``` from pyspark import SparkConf, SparkContext from pyspark.sql import SparkSession from pyspark.sql import * from pyspark.sql.types import * from pyspark.sql.functions import udf from pyspark.sql.functions import * from pyspark.sql.window import Window NoneType = type(None) import os import socket import hashlib impo...
github_jupyter
# Data reading example 2 - PRIMAP-hist v2.2 # To run this example the file `PRIMAPHIST22__19-Jan-2021.csv` must be placed in the same folder as this notebook. The PRIMAP-hist data (doi:10.5281/zenodo.4479172) is available from Zenodo: https://zenodo.org/record/4479172 ``` # imports import primap2 as pm2 ``` ## Datase...
github_jupyter
``` from collections import defaultdict, OrderedDict import warnings import logging import gffutils import pybedtools import pandas as pd import copy import re from gffutils.pybedtools_integration import tsses logging.basicConfig(level=logging.INFO) gtf = '/home/cmb-panasas2/skchoudh/genomes/WBcel235/annotation/Caenor...
github_jupyter
# **সাইকিট-লার্ন দিয়ে একটা সহজ লিনিয়ার ক্লাসিফিকেশন ** চারটার জায়গায় দুটো ফিচার, তিনটার জায়গায় দুটো টার্গেট ভ্যারিয়েবল চারটার জায়গায় দুটো। প্রস্তাব - এটাকে দুটো দিয়ে দেখান না কেন? বুঝলাম - জিনিসটাকে আরো পানির মতো করতে হবে। আমাকে অনেকে বলেন, আইরিস ডেটাসেটে চারটা অ্যাট্রিবিউট। ফলে ডেটা ভিজ্যুয়ালাইজেশনে একটার ভেতরে আরেক...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#How-to-use" data-toc-modified-id="How-to-use-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>How to use</a></span><ul class="toc-item"><li><span><a href="#President's-race-stats" data-toc-modified-id="Pre...
github_jupyter
In the [Introduction](Introduction.ipynb), we showed how to use parambokeh, using the Jupyter notebook to host our example. However, parambokeh widgets can also be used in other contexts. Here we show how parambokeh can be used in a bokeh server app. We'll create a simple bokeh app that displays a log of every time a ...
github_jupyter
# What is flow ranking? TODO: explain the goal of finding a latent ordering, comparing between graphs TODO: explain some of the math behind spring rank/signal flow ``` import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from scipy.stats import pearsonr from tqdm import tqdm...
github_jupyter
``` import numpy as np import healpy as hp import glob import matplotlib.pyplot as plt from enterprise.pulsar import Pulsar import skyplot_tools as spt %matplotlib inline golden_ratio = (np.sqrt(5.0)-1.0)/2.0 def get_figsize(scale): fig_width_pt = 513.17 #469.755 # Get this from LaTeX using \the\textwidth ...
github_jupyter
``` import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import numpy as np import traceback import contextlib @contextlib.contextmanager def options(options): old_opts = tf.config.optimizer.get_experimental_options() tf.config.optimizer.set_experimental_options(options) try: ...
github_jupyter
# Software Development Environments ## tl;dr * Integrated Development Environments (IDEs): we recommend you use one for software development ✔ * Jupyter notebooks: great for tutorials and as a playground for getting familiar with code, but not great for software engineering 🚸 * plain text editors: try to avoid, a...
github_jupyter
## Calculating historical and future projections of global warming in climate model simulations Solution to Part 2 of Exercise in `00_calculate_simulated_global_warming.ipynb` #### Python packages ``` from matplotlib import pyplot as plt import numpy as np import pandas as pd import xarray as xr import xesmf as xe i...
github_jupyter
# 2. Monolithic AD & ML Approaches and Why They are Unsatisfactory Given the abundance of normal driving data, the problem naturally leads to an anomaly detection (AD) formulation. Let’s try some off-the-shell well-known methods for example Isolation Forest! In theory, AD approach isn't affected by the Cold Start pro...
github_jupyter
## Funding Metric Model As a project maintainer, core contributors who aren’t compensated are less likely to keep up code quality Funding (are contributors and projects funded appropriately, based on project size, maintainer number etc). More organizational diversity, the community is more robust by the strength of ec...
github_jupyter
# Python Data Structures ## Data structure in computing Data structures are how computer programs store information. Theses information can be processed, analyzed and visualized easily from the programme. Scientific data can be large and complex and may require data structures appropriate for scientific programming....
github_jupyter
``` #importing the libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns #Data Preprocessing #importing the dataset dataset=pd.read_csv('Adult_Dataset.csv') #Converting the target value of the dataset from string to binary class i.e 0 and 1 dataset.loc[dataset['Target'...
github_jupyter
# Clustering ``` from IPython.display import Image Image('https://github.com/unpingco/Python-for-Probability-Statistics-and-Machine-Learning/raw/master/python_for_probability_statistics_and_machine_learning.jpg') %matplotlib inline from matplotlib.pylab import subplots import numpy as np from sklearn.datasets import...
github_jupyter
![data-x](https://raw.githubusercontent.com/afo/data-x-plaksha/master/imgsource/dx_logo.png) --- # Cookbook 5: SQL Example **Author list:** SINDHUJA JEYABAL, ALEXANDER FRED OJALA **References / Sources:** **License Agreement:** Feel free to do whatever you want with this code ___ *This notebook is an introducti...
github_jupyter
# September 26 - EresNet 34 results ``` # Imports import sys import os import time import math # Add the path to the parent directory to augment search for module par_dir = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) if par_dir not in sys.path: sys.path.append(par_dir) # Plotting import import matp...
github_jupyter
# A Walk Through Linear Models *Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. Please check the pdf file for more details.* In this exercise you will: - implement a whole bunch of **linear classifiers** - comp...
github_jupyter
``` import os import sys import cProfile import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats import n2j.inference.infer_utils as iutils from n2j.inference.inference_manager import InferenceManager from n2j.config_utils import get_config_modular %matplotlib inline %load_ext autoreload %autore...
github_jupyter
#Fire up graphlab create ``` import graphlab ``` #Load some house sales data Dataset is from house sales in King County, the region where the city of Seattle, WA is located. ``` sales = graphlab.SFrame('home_data.gl/') sales ``` #Exploring the data for housing sales The house price is correlated with the number o...
github_jupyter
# Computational Astrophysics ## 01. Pyplot Visualization. Example 1 --- ## Eduard Larrañaga Observatorio Astronómico Nacional\ Facultad de Ciencias\ Universidad Nacional de Colombia --- ### About this notebook In this worksheet, we use a synthetic dataset to illustrate the use of `matplotlib` in visualization. ---...
github_jupyter
# Principal Component Regression (PCR) This notebook implements **Principal Component Regression (PCR)** from scratch and helps to visualise the difference from the **Ordinary Least Square(OLS) Linear Regression**. # Defining Principal Component Regression (PCR) Going by the definition, **Principal Component Regress...
github_jupyter
# Generic scikit-learn classifier run any scikit-learn compatible classifier or list of classifiers ### **Function steps** : > **Generate a scikit-learn model configuration** using the `model_pkg_class` parameter > * input a package and class name, for example, `sklearn.linear_model.LogisticRegression` > * mlrun...
github_jupyter
# A simple DNN model built in Keras. Let's start off with the Python imports that we need. ``` import os, json, math import numpy as np import shutil import tensorflow as tf print(tf.__version__) ``` ## Locating the CSV files We will start with the CSV files that we wrote out in the [first notebook](../01_explore/t...
github_jupyter
#### 1) load numpy arrays #### 2) pass it to the model for training #### 3) plot and evaluate model ``` import numpy train_d = numpy.load('train_data.npy') train_l = numpy.load('train_label.npy') test_d = numpy.load('test_data.npy') test_l = numpy.load('test_label.npy') import matplotlib.pyplot as plt def plot_histor...
github_jupyter
``` test_index = 0 ``` #### testing ``` from load_data import * # load_data() ``` ## Loading the data ``` from load_data import * X_train,X_test,y_train,y_test = load_data() len(X_train),len(y_train) len(X_test),len(y_test) ``` ## Test Modelling ``` import torch import torch.nn as nn import torch.optim as optim i...
github_jupyter
#### Copyright 2019 The TensorFlow Hub Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
github_jupyter
# Experiment 2-1: Binary Logistic Regression on Iris Dataset ``` import numpy as np import pandas as pd from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt %matplotlib inline import tensorflow as tf from data import Datafile, load_data from influence.emp_risk_optimizer import Empirica...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import scipy.optimize as sopt from pysimu import ode2numba, ssa from ipywidgets import * %matplotlib notebook ``` ## System definition ``` sys = { 't_end':20.0,'Dt':0.01,'solver':'forward-euler', 'decimation':10, 'name':'freq2', 'models':[{'params': ...
github_jupyter
# Finding the Best Neighborhood in Pittsburgh: ## Factoring in Property Values ## Introduction The perception of a neighborhood often stems from the quality of its buildings and home. This dataset seeks to capture that perception quantitatively, rather than empirically by driving through each neighborhood and noting...
github_jupyter
<div align="center"> <img src= "/assets/content/datax_logos/DataX_blue_wide_logo.png" align="center" width="100%"> </div> ### **HOMEWORK** 01 - **FLASK** MINIMAL **APPLICATION +** <br> <div align="center" style="font-size:12px; font-family:FreeMono; font-weight: 100; font-stretch:ultra-condensed; line-height: 1....
github_jupyter
# Stage 1: Preprocess VNG's data In this stage, we will read raw data from a given dataset. The dataset consists of variable-resolution images, while our system requires a constant input dimensionality. Therefore, we need to down-sampled the images to a fixed resolution (270 x 270) ``` %matplotlib inline %load_ext aut...
github_jupyter
``` # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
github_jupyter
# Wikipedia-based vocabulary Part of the text cleaning is to recover misspelled tokens in documents. The base toolkit to implement the spell checking component is the [pyenchant](https://github.com/pyenchant/pyenchant) library. While the existing solution works, there are some issues that this implementation face. Th...
github_jupyter
<a href="https://colab.research.google.com/github/vitorsr/ccd/blob/master/main.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Importando dados ``` import pandas as pd import os !wget https://www.dropbox.com/s/7rriacb7c6vzf3m/ccd_2019.zip -O ccd_...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy.io import wavfile as wav from scipy.fftpack import fft %matplotlib inline #inputs required for (#a) samplingRate, (#b) tau, (#c) numEchoes, and (#d) fullfilename samplingRate = #a #number of samples per second tau = #b...
github_jupyter
# Random Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Superposition of Random Signals The superposition of two ran...
github_jupyter
``` # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
github_jupyter
# AdaHessian with Imagenette and ImageWoof ``` from fastai.vision.all import * from fastai.callback.all import * path = untar_data(URLs.IMAGENETTE_160) def get_dls(size=128): dls = ImageDataLoaders.from_folder(path, valid='val', item_tfms=[RandomResizedCrop(size, min_scale=0.35),FlipItem(p=0.5)], # Resiz...
github_jupyter
# Two-Qubit Simulator with Coupler Architecture *Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved.* ## Outline This tutorial introduces how to use Quanlse to create the two-qubit simulator with coupler architecture, analyze the $ZZ$ coupling characteristics (a common parasitic coupli...
github_jupyter
``` from django.contrib.gis.gdal import DataSource from helper_functions.LayerMapping2 import LayerMapping import os import shapefile import re from django.db import transaction mapping = {'name': 'name', 'geom': 'POLYGON', 'start_date': 'start_date', 'end_date': 'end_date', 'date_accuracy': 'date_acc', ...
github_jupyter
# Permuted and Split MNIST: a Deep Continual Learning Example in PyTorch In this brief demo we will showcase two common *Continual Learning* benchmark often used to introduce the problem and start prototyping possible computational strategies to solve it. We will use bare Python, Numpy and *PyTorch*. In order to const...
github_jupyter
<a href="https://colab.research.google.com/github/BatoolMM/DeepSulfation/blob/master/Pre_process_and_train1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install -Uqq fastbook !pip install fastcore==1.0.9 !pip install utils import pandas ...
github_jupyter
# Activation Functions Activation functions define how a processing unit will treat its input, usually passing this input through it and generating an output through its result, so the choice of function ends up playing an important role. ``` import tensorflow as tf import matplotlib.pyplot as plt import numpy as np ...
github_jupyter
<img src="../../assets/maxsqn.png" width=800 /> 着实可以理解为soft actor-critic的离散动作版本,但动作sample使用的是Q_network进行softmax操作 ``` import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import matplotlib.pyplot as plt from IPython.display import clear_output import gym import numpy as np fr...
github_jupyter
# Import Libraries ``` pip install xgboost import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt import seaborn as sns import random from sklearn.preprocessing import StandardScaler # Importing xgboost from xgboost import XGBClassifi...
github_jupyter
# Testing High-Dimensional Benchmarks - WGAN-QC Solver DenseICNN-based benchmark training. **GPU-only implementation.** ``` import os, sys sys.path.append("..") import matplotlib import numpy as np import matplotlib.pyplot as plt %matplotlib inline import numpy as np import torch import gc from sklearn.decompositi...
github_jupyter
<a href="https://colab.research.google.com/github/unicamp-dl/IA025_2022S1/blob/main/ex06/patrick_ferreira/ex06_patrick_ferreira.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Treinamento de uma CNN no CIFAR 10 ``` nome = "Patrick de Carvalho Tav...
github_jupyter
# KDD Cup 1999 Data http://kdd.ics.uci.edu/databases/kddcup99/kddcup99.html ``` import sklearn import pandas as pd from sklearn import preprocessing from sklearn.utils import resample from sklearn.model_selection import GridSearchCV from sklearn.svm import SVC import numpy as np from sklearn.decomposition import PCA ...
github_jupyter
# 凯利公式与扔骰子 ## 本文以扔硬币为例,在给定概率和盈亏比情况下,通过模拟验证了根据凯利公式确定的下注比率为最优。 ``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.mlab as mlab import datetime from collections import defaultdict import scipy.stats as stats import matplotlib.pyplot as plt sns.set_style('darkgrid') %matplotlib inline ``` ...
github_jupyter
# Using a "black box" likelihood function ``` %load_ext Cython import os import platform import arviz as az import corner import cython import emcee import IPython import matplotlib import matplotlib.pyplot as plt import numpy as np import pymc3 as pm import theano import theano.tensor as tt print('Running on PyMC3...
github_jupyter
# WordNet Today we will learn about WordNet and its Synsets. Let’s look at a real example by using nltk ’s WordNet interface to explore synsets associated with the term, 'fruit' . We can do this using the following code snippet: ``` from nltk.corpus import wordnet as wn import pandas as pd term = 'fruit' synsets = wn...
github_jupyter
# Quadratic Equations Consider the following equation: \begin{equation}y = 2(x - 1)(x + 2)\end{equation} If you multiply out the factored ***x*** expressions, this equates to: \begin{equation}y = 2x^{2} + 2x - 4\end{equation} Note that the highest ordered term includes a squared variable (x<sup>2</sup>). Let's gr...
github_jupyter
``` import os import sys # Append utils as a module module_path = os.path.abspath(os.path.join('utils/')) if module_path not in sys.path: sys.path.append(module_path) import numpy as np import pandas as pd from collections import OrderedDict import matplotlib.pyplot as plt %matplotlib inline # Load functio...
github_jupyter
``` # ATTENTION: Please do not alter any of the provided code in the exercise. Only add your own code where indicated # ATTENTION: Please do not add or remove any cells in the exercise. The grader will check specific cells based on the cell position. # ATTENTION: Please use the provided epoch values when training. # I...
github_jupyter
``` %matplotlib inline import pandas as pd import numpy as np import pymc3 as pm import theano.tensor as tt import scipy.stats as st from scipy import optimize import matplotlib.pylab as plt import theano.tensor as tt import theano plt.style.use('seaborn-darkgrid') ``` # Laplace approximation in PyMC3 Here first tr...
github_jupyter
# Image Classification using KNeighborsClassifier Simple Image Classification using KNeighborsClassifier based on K-Nearest Neighbors algorithm. ### Required Packages ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import cv2 import os import random from sklearn.model_selection impor...
github_jupyter
``` from __future__ import division, print_function %matplotlib inline import numpy as np import pandas as pd import re import six from IPython.display import display ``` ## Figure out county/PUMA regions Electoral data is by county, census data is by PUMA. Define regions that are connected components of PUMAs and c...
github_jupyter
# Collecting Text Data from Websites Very often there is data on the internet that we would just love to use for our purposes as digital humanists. But, perhaps because it is humanities data, the people publishing it online might not have made it available in a format that is very easily used by you. In a perfect worl...
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
# Image Segmentation U-Net + [https://ithelp.ithome.com.tw/articles/10240314](https://ithelp.ithome.com.tw/articles/10240314) + [https://www.kaggle.com/tikutiku/hubmap-tilespadded-inference-v2](https://www.kaggle.com/tikutiku/hubmap-tilespadded-inference-v2) Decoder 上採樣過程改以反卷積來實作 # Load data ``` from google.colab i...
github_jupyter
# JavaScript API to BeakerX Plot Widgets In addition to being available in Jupyter with BeakerX as demonstrated below, you can also access with widgets as a [JS library on npm](https://www.npmjs.com/package/beakerx) which you can [embed on any page](http://ipywidgets.readthedocs.io/en/latest/embedding.html), like [nbv...
github_jupyter
``` import numpy as np import tensorflow as tf import tensorflow.keras import tensorflow.keras.backend as K # import os from tensorflow.keras.datasets import fashion_mnist,mnist,cifar100, imdb # import keras.backend as K from tensorflow.keras.layers import Conv2D,Activation,BatchNormalization,UpSampling2D,Conv2DTranspo...
github_jupyter
``` # this mounts your Google Drive to the Colab VM. from google.colab import drive drive.mount('/content/drive', force_remount=True) # enter the foldername in your Drive where you have saved the unzipped # assignment folder, e.g. 'cs231n/assignments/assignment3/' FOLDERNAME = 'cs231n/assignment2' assert FOLDERNAME is...
github_jupyter
``` # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
github_jupyter
## 飞浆常规赛:遥感影像地块分割 - 12月第9名方案 ## 比赛链接: [常规赛:遥感影像地块分割](https://aistudio.baidu.com/aistudio/competition/detail/63) # 赛题说明 ### 赛题介绍 本赛题由 2020 CCF BDCI 遥感影像地块分割 初赛赛题改编而来。遥感影像地块分割, 旨在对遥感影像进行像素级内容解析,对遥感影像中感兴趣的类别进行提取和分类,在城乡规划、防汛救灾等领域具有很高的实用价值,在工业界也受到了广泛关注。现有的遥感影像地块分割数据处理方法局限于特定的场景和特定的数据来源,且精度无法满足需求。因此在实际应用中,仍然大量依赖于人工处理,需要消耗大...
github_jupyter
# Multi-Layer Perceptron, MNIST --- In this notebook, we will train an MLP to classify images from the [MNIST database](http://yann.lecun.com/exdb/mnist/) hand-written digit database. The process will be broken down into the following steps: >1. Load and visualize the data 2. Define a neural network 3. Train the model...
github_jupyter
# Supervised methods Since we now have labeled data, we can try some supervised methods. Our stakeholders are looking for a model with recall of at least 70% and precision of at least 85%. ## Setup ``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns impo...
github_jupyter
# Module 5: Batch ingestion via SageMaker Processing job (PySpark) --- **Note:** Please set kernel to `Python 3 (Data Science)` and select instance to `ml.t3.medium` ## Contents 1. [Setup](#Setup) 1. [Create PySpark SageMaker Processing script](#Create-PySpark-SageMaker-Processing-script) 1. [Run batch ingestion jo...
github_jupyter
### Enter State Farm ``` import theano import os, sys sys.path.insert(1, os.path.join(os.getcwd(), 'utils')) %matplotlib inline from __future__ import print_function, division # path = "data/sample/" path = "data/statefarm/sample/" import utils; reload(utils) from utils import * from IPython.display import FileLink # ...
github_jupyter
# ART1 demo Adaptive Resonance Theory Neural Networks by Aman Ahuja | github.com/amanahuja | twitter: @amanqa ## Overview Reminders: * ART1 accepts binary inputs only. In this example: * We'll use small PNG images for character recognition # [Load data] * Data is a series of png images * pixelated drawing...
github_jupyter
``` import numpy as np from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix import torch.nn import torch class ConvRF(object): def __init__(self, kernel_size=5, stride=2): self.kernel_size = kernel_...
github_jupyter
# Exploratory data analysis in python using car data set from Kaggle ## Introduction ## 1. Importing the required libraries for EDA Below are the libraries that are used in order to perform EDA (Exploratory data analysis) in this tutorial. ``` import pandas as pd import numpy as np import seaborn as sns ...
github_jupyter
``` #import modules %matplotlib inline import time import random import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.metrics import roc_curve, auc from sklearn.metrics import confusion_matrix from sklearn.metrics import classification_report from sklearn.model_sele...
github_jupyter
# Logic This Jupyter notebook acts as supporting material for topics covered in __Chapter 6 Logical Agents__, __Chapter 7 First-Order Logic__ and __Chapter 8 Inference in First-Order Logic__ of the book *[Artificial Intelligence: A Modern Approach](http://aima.cs.berkeley.edu)*. We make use of the implementations in t...
github_jupyter
# Grid Search This dataset is originally from the National Institute of Diabetes and Digestive and Kidney Diseases. *The objective is to predict based on diagnostic measurements whether a patient has diabetes.* ### Dataset information [Pima Indians Diabetes](https://www.kaggle.com/uciml/pima-indians-diabetes-databas...
github_jupyter
``` from IPython.core.display import HTML HTML('''<style> .container { width:100% !important; } </style> ''') ``` # <a href="https://www.spiegel.de/karriere/drei-ritter-drei-knappen-und-ein-boot-raetsel-der-woche-a-1295596.html">Knights and Squires</a> The red knight, the green knight, and the bl...
github_jupyter
<div align="center"> <img src="images/logo_fmkn.png" alt="logo_fmkn" /> </div> # Машинное обучение ### Лекция 13. Введение в байесовские методы <br /> <br /> 3 декабря 2021 ### Пятиминутка 1. Является ли задача кластеризации корректной? Почему? 2. Опишите постановку задачи semi-supervised learning 3. В чем иде...
github_jupyter
## SSD: Single-Shot MultiBox Detector implementation in Keras --- ### Contents 1. [Overview](#overview) 2. [Performance](#performance) 3. [Examples](#examples) 4. [Dependencies](#dependencies) 5. [How to use it](#how-to-use-it) 6. [Download the convolutionalized VGG-16 weights](#download-the-convolutionalized-vgg-16-w...
github_jupyter
# Measure runtime of stats algorithms November 14, 2018 **Overview:** We are planning on adding algorithms to NDMG. @GaneshArvapalli compiled all of the algorithms into a single [python script](https://github.com/NeuroDataDesign/the-ents/blob/master/src/features/stats_explained.md). In this notebook, we measure the ru...
github_jupyter
``` %matplotlib inline import sys # locate your spectralCV so we have scv_funcs to use sys.path.append('/Users/ldliao/Research/Projects/spectralCA/') # imports import os import numpy as np import scipy as sp import scipy.io as io import matplotlib.pyplot as plt import pandas as pd import mne from sca import sca ``` ...
github_jupyter
## Practice 02: Dealing with texts using CNN Today we're gonna apply the newly learned tools for the task of predicting job salary. <img src="https://storage.googleapis.com/kaggle-competitions/kaggle/3342/logos/front_page.png" width=400px> Based on YSDA [materials](https://github.com/yandexdataschool/nlp_course/blob...
github_jupyter
# Combinatorics **CS1302 Introduction to Computer Programming** ___ ## Permutation using Recursion A [$k$-permutation of $n$](https://en.wikipedia.org/wiki/Permutation#k-permutations_of_n) items $a_0,\dots,a_{n-1}$ is an ordered tuple $$ (a_{i_0},\dots,a_{i_{k-1}}) $$ of $k$ out of the $n$ objects, where $0\leq i...
github_jupyter
# IO, `CREATE`/`INSERT`, and External Data ## Setup ``` import ibis import os hdfs_port = int(os.environ.get('IBIS_TEST_WEBHDFS_PORT', 50070)) user = os.environ.get('IBIS_TEST_WEBHDFS_USER', 'ubuntu') hdfs = ibis.hdfs_connect(host='impala', user=user, port=hdfs_port) con = ibis.impala.connect(host='impala', database=...
github_jupyter
# Python Flow Control 1: `if`, `elif`, `else` ## Student Notes *** ## Learning Objectives In this lesson you will learn: 1. Understand elements of flow control 2. Apply the: if, else , and elif statements in Python code ## Modules covered in this lesson: >- none ## Links to topics and...
github_jupyter
<a href="https://colab.research.google.com/github/yukinaga/ai_programming/blob/main/lecture_12/04_exercise.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # 演習: 深層強化学習のテクニック 学習を安定化させるためのテクニックを実装しましょう。 ## 深層強化学習のテクニック 深層強化学習では、一般的に以下のようなテクニックが利用されます...
github_jupyter
# Updating Microstate Lists Based on Resonance Detection with OpenEye This jupyter notebook incorporates corrections based on resonance detection with OpenEye tools done in these notebooks: detecting_resonance_structures.ipynb checking_detected_resonance_structures.ipynb Files to be created for 24 molecules (v1...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.decomposition import PCA from sklearn.cluster import DBSCAN from sklearn.preprocessing import StandardScaler df = pd.read_csv('../data/final_per_90_and_pAdj.csv') df.info() def_stats = df.loc[(df['Nineties']>5)&(df['Position']==...
github_jupyter
``` import torch import torch.nn as nn import numpy as np ``` # Binary dice loss ``` class BinaryDiceWithLogitsLoss(nn.Module): """Computes the Sørensen–Dice loss with logits for binary data. Dice_coefficient = 2 * intersection(X, Y) / (|X| + |Y|) where, X and Y are sets of binary data, in this case, pre...
github_jupyter
**[Data Visualization Home Page](https://www.kaggle.com/learn/data-visualization)** --- In this exercise, you will use your new knowledge to propose a solution to a real-world scenario. To succeed, you will need to import data into Python, answer questions using the data, and generate **scatter plots** to understand...
github_jupyter