text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# भाग 9 - एन्क्रिप्ट किए गए कार्यक्रमों में प्रवेश करें मानो या न मानो, एन्क्रिप्टेड डेटा के साथ गणना करना संभव है। दूसरे शब्दों में, ऐसा प्रोग्राम चलाना संभव है जहां **प्रोग्राम में सभी चर** हैं **एन्क्रिप्टेड**! इस ट्यूटोरियल में, हम एन्क्रिप्टेड कम्प्यूटेशन के बहुत ही बुनियादी टूल्स से गुजरने वाले हैं। विशेष रूप स...
github_jupyter
<a href="https://colab.research.google.com/github/bs3537/dengueAI/blob/master/V5_San_Juan_XGB_all_environmental_features.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd #http...
github_jupyter
# Introduction This notebook demonstrates basic usage of BioThings Explorer, an engine for autonomously querying a distributed knowledge graph. BioThings Explorer can answer two classes of queries -- "PREDICT" and "EXPLAIN". PREDICT queries are described in [PREDICT_demo.ipynb](PREDICT_demo.ipynb). Here, we describe ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt scores = pd.read_csv('numerical_data.csv') scores scores.drop('Unnamed: 0', axis=1, inplace=True) scores a_scores = scores[['num_features', 'a_fitness', 'a_accuracy', 'a_sensitivity', 'a_specificity']] a_scores kin_df = pd.read_csv('reported_kin...
github_jupyter
``` import __init__ from __init__ import DATA_PATH from __init__ import PACKAGE_PATH from dce import DCE from cluster import Cluster import utilities import numpy as np import pandas as pd import os import matplotlib.pyplot as plt import seaborn as sns from keras import Model %matplotlib inline from rdkit.Chem import M...
github_jupyter
<a href="https://colab.research.google.com/github/Leonas2000/lil-Beethoven/blob/main/Lil'_Beethoven.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` from google.colab import drive drive.mount('/content/drive') #@title Imports import numpy as np ...
github_jupyter
# Neural networks with PyTorch Deep learning networks tend to be massive with dozens or hundreds of layers, that's where the term "deep" comes from. You can build one of these deep networks using only weight matrices as we did in the previous notebook, but in general it's very cumbersome and difficult to implement. Py...
github_jupyter
# Learning MNIST & Fashion In this exercise you will design a classifier for the very simple but very popular [MNIST dataset](http://yann.lecun.com/exdb/mnist/), a classic of dataset in computer vision and one of the first real world problems solved by neural networks. ``` %matplotlib inline import matplotlib.pyplot...
github_jupyter
# Code Style In this chapter, we'll discuss a number of important considerations to make when styling your code. If you think of writing code like writing an essay, considering code style improves your code the same way editing an essay improves your essay. Often, considering code style is referred to as making our co...
github_jupyter
# NNCP Splitter [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/byronknoll/tensorflow-compress/blob/master/nncp-splitter.ipynb) Made by Byron Knoll. GitHub repository: https://github.com/byronknoll/tensorflow-compress ### Description This noteboo...
github_jupyter
# Point-based and Parallel Processing Water Observations from Space (WOfS) Product in Africa <img align="right" src="../Supplementary_data/DE_Africa_Logo_Stacked_RGB_small.jpg"> * **Products used:** [ga_ls8c_wofs_2](https://explorer.digitalearth.africa/ga_ls8c_wofs_2) ## Description The [Water Observations from Spa...
github_jupyter
<a href="https://colab.research.google.com/github/Adminixtrator/gpt-2/blob/master/GPT_2_With_SQuAD.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Calling file from Repository ``` !git clone https://github.com/adminixtrator/gpt-2.git %cd gpt-2 %...
github_jupyter
##### Copyright 2021 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
## Churn Prediction using Logisitic Regression ## Data Dictionary There are multiple variables in the dataset which can be cleanly divided in 3 categories: ### Demographic information about customers <b>customer_id</b> - Customer id <b>vintage</b> - Vintage of the customer with the bank in number of days <b>age</...
github_jupyter
# Sample notebook showcasing R on Jupyter An overview of some plotting controls available in R for visualizing networks and visualizing tree models. To execute a cell, select it and then use **[Shift] + [Enter]**. ``` # Default plot size is 7 inches x 7 inches; change to 7 x 3 options(repr.plot.height=3) library(rpa...
github_jupyter
``` # Install RAPIDS (takes ~10 min). !git clone https://github.com/rapidsai/rapidsai-csp-utils.git !bash rapidsai-csp-utils/colab/rapids-colab.sh 0.18 import sys, os dist_package_index = sys.path.index('/usr/local/lib/python3.7/dist-packages') sys.path = sys.path[:dist_package_index] + ['/usr/local/lib/python3.7/sit...
github_jupyter
# Network Visualization This notebook demonstrates how to view **MASSpy** models on network maps using the [Escher](https://escher.github.io/#/) visualization tool <cite data-cite="KDragerE+15">(King et al., 2015)</cite>. The **Escher** package must already be installed into the environment. To install **Escher**: `...
github_jupyter
======================================== __Contents__ * Search usage 1. Import module & Load data 2. Defining parameter search space 3. Defining feature search space (optional) 4. Run search * Log usage 1. Extract pramater & feature setting 2. Make meta feature for stacking * Sample:run al...
github_jupyter
``` import torch import torch.utils.data from torch import nn from torch.nn import functional as F from ignite.engine import Events, Engine from ignite.metrics import Accuracy, Loss import numpy as np import sklearn.datasets import matplotlib.pyplot as plt import seaborn as sns sns.set() class Model_bilinear(nn.Mod...
github_jupyter
``` ## By Saina Srivastava ## Based on # - # Link: https://towardsdatascience.com/machine-learning-part-19-time-series-and-autoregressive-integrated-moving-average-model-arima-c1005347b0d7 # - https://machinelearningmastery.com/arima-for-time-series-forecasting-with-python/ # - https://www.statsmodels.org/stable/ge...
github_jupyter
# Exporting and Archiving Most of the other user guides show you how to use HoloViews for interactive, exploratory visualization of your data, while the [Applying Customizations](03-Applying_Customizations.ipynb) user guide shows how to use HoloViews completely non-interactively, generating and rendering images direct...
github_jupyter
Homework 2 ===== Daphne Ippolito ``` import xor_network ``` What issues did you have? ----- The first issue that I has was that I was trying to output a single scalar whose value could be thresholded to determine whether the network should return TRUE or FALSE. It turns out loss functions for this are much more comp...
github_jupyter
``` %matplotlib inline ``` # Classifier comparison A comparison of a several classifiers in scikit-learn on synthetic datasets. The point of this example is to illustrate the nature of decision boundaries of different classifiers. This should be taken with a grain of salt, as the intuition conveyed by these example...
github_jupyter
# Using Fuzzingbook Code in your own Programs This notebook has instructions on how to use the `fuzzingbook` code in your own programs. In short, there are three ways: 1. Simply run the notebooks in your browser, using the "mybinder" environment. Choose "Resources→Edit as Notebook" in any of the `fuzzingbook.org` pa...
github_jupyter
# Introduction to obspy The obspy package is very useful to download seismic data and to do some signal processing on them. Most signal processing methods are based on the signal processing method in the Python package scipy. First we import useful packages. ``` import obspy import obspy.clients.earthworm.client as ...
github_jupyter
# train.py: What it does step by step This tutorial will break down what train.py does when it is run, and illustrate the functionality of some of the custom 'utils' functions that are called during a training run, in a way that is easy to understand and follow. Note that parts of the functionality of train.py depend...
github_jupyter
``` ! nvidia-smi ``` # Install ติดตั้ง Library Transformers จาก HuggingFace ``` ! pip install transformers -q ! pip install fastai2 -q ``` # Import เราจะ Import ``` from transformers import GPT2LMHeadModel, GPT2TokenizerFast ``` # Download Pre-trained Model ดาวน์โหลด Weight ของโมเดล ที่เทรนไว้เรียบร้อยแล้ว ชื...
github_jupyter
# An Introduction to SageMaker Random Cut Forests ***Unsupervised anomaly detection on timeseries data a Random Cut Forest algorithm.*** --- 1. [Introduction](#Introduction) 1. [Setup](#Setup) 1. [Training](#Training) 1. [Inference](#Inference) 1. [Epilogue](#Epilogue) # Introduction *** Amazon SageMaker Random Cu...
github_jupyter
# This is the Saildrone and GOES collocation code. trying to get mfopendataset to work with opendap data...... ``` import os import numpy as np import matplotlib.pyplot as plt import datetime as dt import xarray as xr import requests def get_sat_filename(date): dir_sat='https://opendap.jpl.nasa.gov/opendap/Ocean...
github_jupyter
**Course Announcements** Due Friday (11:59 PM): - D8 - Q8 - A4 - weekly project survey (*optional*) # Geospatial Analysis - Analysis: - Exploratory Spatial Data Analysis - K-Nearest Neighbors - Tools: - `shapely` - create and manipulate shape objects - `geopandas` - shapely + dataframe + visualizati...
github_jupyter
``` ''' first lets import the neccesary labraries we import re which stand for regular expressions because we what to use it to remove the currency symbol on the price ''' from bs4 import BeautifulSoup as bs4 import requests import pandas as pd import re ''' next we initiale the list of columns we wh...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Evaluation Evaluation with offline metrics is pivotal to assess the quality of a recommender before it goes into production. Usually, evaluation metrics are carefully chosen based on the actual application scena...
github_jupyter
# Advanced Seq2Seq Modeling # Problem Build a model to help pronounce english words. We'll convert english words in to [Arpabet](https://en.wikipedia.org/wiki/Arpabet) phoneme @sunilmallya: refer for more live instructions https://www.twitch.tv/videos/171226133 ## Dataset http://svn.code.sf.net/p/cmusphinx/code/t...
github_jupyter
``` # mahalanobis_discriminative model from collections import OrderedDict import numpy as np import torch as th from torch import nn import seaborn as sns from pathlib import Path import matplotlib.pyplot as plt import cv2 import pandas as pd import math from scipy.spatial import distance as mahal_distance from ski...
github_jupyter
## Coding Exercise #0703 ### 1. Softmax regression (multi-class logistic regression): ``` # import tensorflow as tf import tensorflow.compat.v1 as tf import numpy as np import pandas as pd from sklearn.preprocessing import scale from sklearn.model_selection import train_test_split from sklearn.datasets import load_ir...
github_jupyter
# TensorFlow Tutorial Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caffe, Ke...
github_jupyter
<img src="qiskit-heading.gif" width="500 px" align="center"> # _*Qiskit Aqua: Experimenting with Traveling Salesman problem with variational quantum eigensolver*_ This notebook is based on an official notebook by Qiskit team, available at https://github.com/qiskit/qiskit-tutorial under the [Apache License 2.0](http...
github_jupyter
### solve the global sequence alignment problem using needleman-wunsch algorithm ``` import numpy as np equal_score = 1 unequal_score = -1 space_score = -2 # needleman-wunsch 算法可能出现负分的情况 def createScoreMatrix(list1, list2, debug=False): lenList1, lenList2 = len(list1), len(list2) #initialize matrix scoreMa...
github_jupyter
``` import numpy as np import tensorflow as tf from sklearn.utils import shuffle import re import time import collections import os def build_dataset(words, n_words, atleast=1): count = [['GO', 0], ['PAD', 1], ['EOS', 2], ['UNK', 3]] counter = collections.Counter(words).most_common(n_words) counter = [i for...
github_jupyter
## Regression Analysis : First Machine Learning Algorithm !! ### Machine learning - is an application of artificial intelligence (AI) that provides systems the __ability to automatically learn and improve from experience without being explicitly programmed__. <img style="float: left;" src = "./img/ml_definition.png"...
github_jupyter
``` #hide #skip ! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab #export from fastai.basics import * from fastai.text.core import * from fastai.text.data import * from fastai.text.models.core import * from fastai.text.models.awdlstm import * from fastai.callback.rnn import * from fastai.callback....
github_jupyter
``` import numpy as np import tensorflow as tf from tensorflow import keras from IPython.display import Image import matplotlib.pyplot as plt import matplotlib.cm as cm from tensorflow.compat.v1 import ConfigProto from tensorflow.compat.v1 import InteractiveSession config = ConfigProto() config.gpu_options.allow_growt...
github_jupyter
**This notebook is an exercise in the [Python](https://www.kaggle.com/learn/python) course. You can reference the tutorial at [this link](https://www.kaggle.com/colinmorris/booleans-and-conditionals).** --- In this exercise, you'll put to work what you have learned about booleans and conditionals. To get started, *...
github_jupyter
<img align="right" src="images/tf.png" width="128"/> <img align="right" src="images/etcbc.png" width="128"/> <img align="right" src="images/syrnt.png" width="128"/> <img align="right" src="images/peshitta.png" width="128"/> # Use lectionaries in the Peshitta (OT and NT) This notebook shows just one way to use the Syr...
github_jupyter
# Setup ``` import sys import os import re import collections import itertools import bcolz import pickle sys.path.append('../../lib') sys.path.append('../') import numpy as np import pandas as pd import gc import random import smart_open import h5py import csv import json import functools import time import string ...
github_jupyter
# Diagram Widget The same _renderer_ that powers the [Diagram Document](./Diagram%20Document.ipynb) can be used as a computable _Jupyter Widget_, which offers even more power than the [Diagram Rich Display](./Diagram%20Rich%20Display.ipynb). ``` from ipywidgets import HBox, VBox, Textarea, jslink, jsdlink, FloatSlide...
github_jupyter
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title"><b>A Magic Square Solver</b></span> by <a xmlns:cc="http://cr...
github_jupyter
``` import sys sys.path.append('..') sys.path.append('../..') from stats import * from sentiment_stats import * from peewee import SQL from database.models import RawFacebookComments, RawTwitterComments, RawInstagramComments, RawYouTubeComments, RawHashtagComments rede_social = 'Hashtags' modelo = RawHashtagComments...
github_jupyter
# Process metadata This notebook checks each experiment id is associated with gene expression data, via its run id, and returns a clean list of experiment ids that have gene expression data. ``` %load_ext autoreload %autoreload 2 import os import sys import glob import pandas as pd import numpy as np import random ...
github_jupyter
``` #alpha3版本内容:增加传输矩阵随机起伏 通过total函数控制训练时间控制 通过total函数控制内容存储文件夹 通过total函数控制结果预测数量 # 先说恢复误删单元格的操作 # 场景:不小心把某个cell给cut了,或者删除了单元格(前提不要关闭notebook窗口)。 # 解决方法: 先按Esc键进入命令模式,在按z键就会恢复。记住不要按Ctrl+z(这个只限没删除单元格的常规操作) # 命令模式和编辑模式识别: # 命令模式:左侧为蓝色。 #我们现在应该在master上弃用torch.nn.functional.tanh,因为现在已经合并了张量和变量。 #If you deprecate nn.funct...
github_jupyter
# Batch Normalization – Solutions Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a convolutional neural network with 20 convolutional layers, followed by a fully connected layer. We'll use it to classify handwritten digits in the MNIST dataset, which should be ...
github_jupyter
``` %matplotlib inline from fastai.vision.all import * from fastai.vision.gan import * ``` ## LSun bedroom data For this lesson, we'll be using the bedrooms from the [LSUN dataset](http://lsun.cs.princeton.edu/2017/). The full dataset is a bit too large so we'll use a sample from [kaggle](https://www.kaggle.com/jhowa...
github_jupyter
## The Basic Idea of Machine-learning Imagine a monkey drawing on a canvas (say, of `128 * 128` pixels). What's the probability that it draw a human-face? Almost none, isn't it. This implies that * the manifold of human-face involved in $\mathbb{R}^{128 \times 128}$ has relatively much smaller dimensions. * Even, th...
github_jupyter
# Monodepth Estimation with OpenVINO This tutorial demonstrates Monocular Depth Estimation with MidasNet in OpenVINO. Model information: https://docs.openvinotoolkit.org/latest/omz_models_model_midasnet.html ![monodepth](https://user-images.githubusercontent.com/36741649/127173017-a0bbcf75-db24-4d2c-81b9-616e04ab7cd9...
github_jupyter
# Lambda School Data Science - Logistic Regression Logistic regression is the baseline for classification models, as well as a handy way to predict probabilities (since those too live in the unit interval). While relatively simple, it is also the foundation for more sophisticated classification techniques such as neur...
github_jupyter
<h2> Import Libraries</h2> ``` %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression ``` ## Load the Data The boston house-price datas...
github_jupyter
# Assignment 5: Exploring Hashing In this exercise, we will begin to explore the concept of hashing and how it related to various object containers with respect to computational complexity. We will begin with the base code for as described in Chapter 5 of Grokking Algorithms (Bhargava 2016). ## Deliverables: We wi...
github_jupyter
# Building your Deep Neural Network: Step by Step Welcome to your week 4 assignment (part 1 of 2)! You have previously trained a 2-layer Neural Network (with a single hidden layer). This week, you will build a deep neural network, with as many layers as you want! - In this notebook, you will implement all the functio...
github_jupyter
# Demo: RAIL Evaluation The purpose of this notebook is to demonstrate the application of the metrics scripts to be used on the photo-z PDF catalogs produced by the PZ working group. The first implementation of the _evaluation_ module is based on the refactoring of the code used in [Schmidt et al. 2020](https://arxiv...
github_jupyter
# Model Selection/Evaluation with Yellowbrick Oftentimes with a new dataset, the choice of the best machine learning algorithm is not always obvious at the outset. Thanks to the scikit-learn API, we can easily approach the problem of model selection using model *evaluation*. As we'll see in these examples, Yellowbrick...
github_jupyter
``` from functools import partial from collections import defaultdict import os import pickle import numpy as np import scipy.sparse as sp import scipy.io as spio import matplotlib.pyplot as plt from torchray_extremal_perturbation_sequence import extremal_perturbation, contrastive_reward, simple_reward from torchr...
github_jupyter
Your name here. Your section number here. # Homework 5: Fitting ##### ** Submit this notebook to bourses to receive a credit for this assignment. ** Please complete this homework assignment in code cells in the iPython notebook. Please submit both a PDF of the jupyter notebook to bcourses and the notebook itself (...
github_jupyter
``` %matplotlib inline import gym import itertools import matplotlib import numpy as np import sys import tensorflow as tf import collections if "../" not in sys.path: sys.path.append("../") from lib.envs.cliff_walking import CliffWalkingEnv from lib import plotting matplotlib.style.use('ggplot') env = CliffWalki...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Goal" data-toc-modified-id="Goal-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Goal</a></span></li><li><span><a href="#Var" data-toc-modified-id="Var-2"><span class="toc-item-num">2&nbsp;&nbsp;</span>Va...
github_jupyter
``` import sys sys.path.append('../code') from utils import plot_utils %load_ext autoreload %autoreload 2 %matplotlib inline import os import glob import torch import numpy as np import pickle import stg_node from model.dyn_stg import SpatioTemporalGraphCVAEModel from model.model_registrar import ModelRegistrar from...
github_jupyter
``` dataset=0 # [Fashion MNIST, CIFAR10] import torch from torchvision import transforms, datasets import numpy as np import matplotlib.pyplot as plt print('Done') # get x and y axis to quantify HP/LP structure def get_axes(size_im): f_axis_0=np.arange(size_im) f_axis_0[f_axis_0>np.floor(size_im/2)]=np.flip(n...
github_jupyter
# <center> Pandas, part 2 </center> ### By the end of this talk, you will be able to - modify/clean columns - evaluate the runtime of your scripts - merge and append data frames ### <font color='LIGHTGRAY'>By the end of this talk, you will be able to</font> - **modify/clean columns** - **evaluate the r...
github_jupyter
# Results: mutagenesis2 Original <b> MIL </b> <i>stratified k fold Validation</i> is performed. Metrics: <br> - AUC - Accuracie ### Import Libraries ``` import sys,os import warnings os.chdir('/Users/josemiguelarrieta/Documents/MILpy') sys.path.append(os.path.realpath('..')) from sklearn.utils import shuf...
github_jupyter
# Course 2 week 1 lecture notebook Exercise 03 <a name="combine-features"></a> ## Combine features In this exercise, you will practice how to combine features in a pandas dataframe. This will help you in the graded assignment at the end of the week. In addition, you will explore why it makes more sense to multipl...
github_jupyter
Doc : https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/graphql et https://demarches-simplifiees-graphql.netlify.app/query.doc.html ``` import requests import json import pandas as pd pd.options.display.max_columns = 500 pd.options.display.max_rows = 500 import configparser config = configparser.ConfigParser()...
github_jupyter
# Import Modules ``` import os print(os.getcwd()) import sys import json import pickle import pandas as pd # ######################################################### from methods import get_df_dft ``` # Read Data ## Read bulk_ids of octahedral and unique polymorphs ``` # ########################################...
github_jupyter
``` # A new notebook to test the waters of the Spotify API # TODO: Find a way to make my model more complex. import spotipy from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOAuth import pandas as pd SPOTIPY_CLIENT_ID = '305996eeec9c42cb807aebcd48a82b29' SPOTIPY_SECRET_ID = '3699864be2834ad695827d8092e91812'...
github_jupyter
``` from cmp import * import pdir %matplotlib qt # Control variables plot_lattice_unfinished_1 = True plot_lattice_unfinished_2 = True plot_lattice_demo = True plot_lattice_planes = True plot_scattering_none = True plot_scattering_systemic = True plot_band_structure_none = True plot_band_structure_strong = True plot_n...
github_jupyter
<a href="https://colab.research.google.com/github/Jofdiazdi/TalleresSimpy/blob/master/Talleres/2.%20Simulacion%20de%20eventos%20discretos.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Simulación en Python usando Simpy: cola simple --- Ahora ver...
github_jupyter
# Sentiment Analysis ## Updating a Model in SageMaker _Deep Learning Nanodegree Program | Deployment_ --- In this notebook we will consider a situation in which a model that we constructed is no longer working as we intended. In particular, we will look at the XGBoost sentiment analysis model that we constructed ea...
github_jupyter
# DCASE-2021 Audio-Video Author: Maximo Cobos ``` # Import necessary standard packages import tensorflow as tf import numpy as np import pandas as pd from pathlib import Path import matplotlib.pyplot as plt #import tensorflow_addons as tfa tf.version.VERSION ``` ## Input Data Specify path to folder containing the ...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) # Callysto’s Weekly Data Visualization ## Weekly Title ### Recommended grade level: 5-12 ### Instructions #### “Run” the cells to see the graphs Click “Cell” and select “Run All”.<br> This w...
github_jupyter
# Udacity - Machine Learning Engineer Nanodegree ## Capstone Project ### Title: Development of a LSTM Network to Predict Students’ Answers on Exam Questions ### Implementation of DKT: #### Part 1: Define constants ``` dataset = "data/ASSISTments_skill_builder_data.csv" # Dataset path best_model_file = "saved_models/A...
github_jupyter
# Prepare data ``` from __future__ import print_function, division import os import torch import pandas as pd from skimage import io, transform import numpy as np import matplotlib.pyplot as plt from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils # Ignore warnings import warning...
github_jupyter
# Convolutional Neural Networks with TensorFlow "Deep Learning" is a general term that usually refers to the use of neural networks with multiple layers that synthesize the way the human brain learns and makes decisions. A convolutional neural network is a kind of neural network that extracts *features* from matrices ...
github_jupyter
# PyTorch 基础 : 张量 在第一章中我们已经通过官方的入门教程对PyTorch有了一定的了解,这一章会详细介绍PyTorch 里面的基础知识。 全部掌握了这些基础知识,在后面的应用中才能更加快速进阶,如果你已经对PyTorch有一定的了解,可以跳过此章 ``` # 首先要引入相关的包 import torch import numpy as np #打印一下版本 torch.__version__ ``` ## 张量(Tensor) 张量的英文是Tensor,它是PyTorch里面基础的运算单位,与Numpy的ndarray相同都表示的是一个多维的矩阵。 与ndarray的最大区别就是,PyTorch的Tensor可以...
github_jupyter
# Modul Python Bahasa Indonesia ## Seri Keempat ___ Coded by psychohaxer | Version 1.8 (2020.12.13) ___ Notebook ini berisi contoh kode dalam Python sekaligus outputnya sebagai referensi dalam coding. Notebook ini boleh disebarluaskan dan diedit tanpa mengubah atau menghilangkan nama pembuatnya. Selamat belajar dan sem...
github_jupyter
``` import random random.seed(a=613) import numpy as np import scProject import scanpy as sc patterns = sc.read_h5ad('patterns_anndata.h5ad') dataset = sc.read_h5ad('/Users/asherbaraban/PycharmProjects/scProject/scProject/test/targetALS_elim_annotated_20200510/p6counts.h5ad') dataset_filtered, patterns_filtered = scPro...
github_jupyter
# Regex In this lesson, we'll learn about a useful tool in the NLP toolkit: regex. Let's consider two motivating examples: #### 1. The phone number problem Suppose we are given some data that includes phone numbers: 123-456-7890 123 456 7890 101 Howard Some of the phone numbers have different formats (hyphens, ...
github_jupyter
``` import numpy as np import pprint import sys if "../" not in sys.path: sys.path.append("../") from lib.envs.gridworld import GridworldEnv pp = pprint.PrettyPrinter(indent=2) env = GridworldEnv() # Taken from Policy Evaluation Exercise! def policy_eval(policy, env, discount_factor=1.0, theta=0.00001): """ ...
github_jupyter
### DCGAN by keras References 1. https://blog.csdn.net/u010159842/article/details/79042195 2. https://github.com/myinxd/keras-dcgan ``` import matplotlib %matplotlib inline import matplotlib.pyplot as plt from keras import Input from keras import applications from keras.models import Sequential from keras.laye...
github_jupyter
### Clean Network In this process developed by Charles Fox, we move from a GOSTnets raw graph object (see Extract from osm.pbf) to a routable network. This process is fairly bespoke, with several parameters and opportunities for significant simplification. ``` import geopandas as gpd import os, sys, time import pandas...
github_jupyter
# Naive Bayes Models In this lab you will work with **naive Bayes models**. Naive Bayes models are a surprisingly useful and effective simplification of the general Bayesian models. Naive Bayes models make the naive assumption of statistical independence of the features. In many cases, naive Bayes module are surprisin...
github_jupyter
# My toolbox for data exploration using Pandas This is a basic set of data analysis tools and techniques that I use for prelimenary dataset analysis. ``` # Pandas is a common package for Python data exploration import pandas as pd import numpy as np ``` Load tabular data from a CSV file I will use the Titanic datase...
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
# Reccurent Neural Network with MNIST ## Introduction Reccurent Neural Network 簡稱 RNN.跟之前提到的 CNN (找出特徵),Autoencoder (降維 重建) 不同.它關注的是 **時間序列** 有關的問題,舉個例子,一篇文章中的文字會是跟前後文有前因後果的,而如果想要製作一個文章產生器,就會需要用到 RNN. 那 RNN 是如何解決這個問題呢?.觀察下面這個 RNN 基本的結構圖.其中 `Xt` 以及 `Ht` 分別是 `t` 時刻的輸入以及輸出,可以看到 `Ht` 會跟 `Ht-1` 以及 `Xt` 有關,可以簡單地把它想像成多一個輸入...
github_jupyter
``` import msiwarp as mx from msiwarp.util.read_sbd import read_sbd_meta, read_spectrum_fs from msiwarp.util.warp import to_mz, peak_density_mz, plot_range, get_mx_spectrum, generate_mean_spectrum import matplotlib.pyplot as plt import numpy as np i_r = 200 # scaling to test impact of sigma on alignment performance ...
github_jupyter
# **一、与时间序列分析相关的部分基础知识/概念** ### 1.1 什么是时间序列 简而言之: 对某一个或者一组变量$x\left ( t \right )$进行观察测量,将在一系列时刻$t_{1},t_{2},⋯,t_{n}$所得到的离散数字组成的序列集合,称之为时间序列。 例如: 某股票A从2015年6月1日到2016年6月1日之间各个交易日的收盘价,可以构成一个时间序列;某地每天的最高气温可以构成一个时间序列。 一些特征: **趋势**:是时间序列在长时期内呈现出来的持续向上或持续向下的变动。 **季节变动**:是时间序列在一年内重复出现的周期性波动。它是诸如气候条件、生产条件、节假日或人们的风俗习惯等各种...
github_jupyter
# Comparison between the magnetic field produced by a oblate ellipsoid and a sphere ### Import the required modules and functions ``` %matplotlib inline import numpy as np from matplotlib import pyplot as plt from matplotlib.colors import BoundaryNorm from matplotlib.ticker import MaxNLocator from fatiando import gri...
github_jupyter
# Recommendation Engine ## Building a Movie Recommendation Engine using MovieLens dataset We will be using a MovieLens dataset. This dataset contains 100004 ratings across 9125 movies for 671 users. All selected users had at least rated 20 movies. We are going to build a recommendation engine which will suggest movie...
github_jupyter
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_03_3_save_load.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # T81-558: Applications of Deep Neural Networks **Module 3: Introduction to T...
github_jupyter
# Mushroom Classification Using Different Classifiers #### In this project, we will examine the data and create a machine learning algorithm that will detect if the mushroom is edible or poisonous by its specifications like cap shape, cap color, gill color, etc. using different classifiers. #### The dataset used in th...
github_jupyter
**Chapter 1 – The Machine Learning landscape** _This is the code used to generate some of the figures in chapter 1._ # Setup First, let's make sure this notebook works well in both python 2 and 3, import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save the figures: ``` # T...
github_jupyter
``` from __future__ import print_function, division %matplotlib inline %config InlineBackend.print_figure_kwargs = {'dpi' : 150} import ipyparallel as ipp client = ipp.Client() client[:].use_dill() lbview = client.load_balanced_view() import numpy as np with client[:].sync_imports(): import scipy import scipy.s...
github_jupyter
# Academic Integrity Statement As a matter of Departmental policy, **we are required to give you a 0** unless you **type your name** after the following statement: > *I certify on my honor that I have neither given nor received any help, or used any non-permitted resources, while completing this evaluation.* \[TYPE...
github_jupyter