text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Human Activity Prediction ### Libraries ``` ## Modelling library(caret); library(rattle); library(randomForest); library(e1071); library(forecast) ## Data processing/visualization library(dplyr); library(ggplot2); library(rattle) ``` #### Getting the data Downloading ``` train_URL = "https://d396qusza40orc.cloud...
github_jupyter
# Gensim > Gensim is designed to automatically extract semantic topics from documents, as efficiently (computer-wise) and painlessly (human-wise) as possible. > Gensim is designed to process raw, unstructured digital texts (“plain text”). The algorithms in gensim, such as Latent Semantic Analysis, Latent Dirichlet Al...
github_jupyter
# Demo of Ch2. Linear Classifier ---- This is the sample code of TU-ETP-AD1062 Machine Learning Fundamentals. For more information, please refer to: https://sites.google.com/view/tu-ad1062-mlfundamentals/ ## Import packages ---- - `numpy`: Provide linear algebra related computation ability, with `norm` used to measur...
github_jupyter
### MEDC0106: Bioinformatics in Applied Biomedical Science <p align="center"> <img src="../../resources/static/Banner.png" alt="MEDC0106 Banner" width="90%"/> <br> </p> --------------------------------------------------------------- # 12 - Introduction to Biopython - Proteins Exercises *Written by:* Mateusz Kac...
github_jupyter
``` import json import logging from collections import OrderedDict from typing import Optional import coloredlogs from ph4_walkingpad.profile import Profile, calories_walk2_minute, calories_rmrcb_minute from ph4_walkingpad.analysis import StatsAnalysis import scipy import numpy as np import pandas as pd import seabor...
github_jupyter
# Logistic Regression (before Multinomial logistic regression) We want to predict the probability of an input belonging to one of two classes. --- ## Study case : Classify the zero and one digits from MNist dataset ### a) Dataset ! - Input: Images of size 28*28 where a one or two is present - Output: 0 if the i...
github_jupyter
``` # HIDDEN from datascience import * import matplotlib matplotlib.use('Agg', warn=False) %matplotlib inline import matplotlib.pyplot as plots plots.style.use('fivethirtyeight') import numpy as np # Interaction from IPython.display import display from functools import partial from ipywidgets import interact, interac...
github_jupyter
``` import numpy as np import pandas as pd import xarray as xr import geojson import geopandas as gpd from shapely.geometry import Polygon as shpPolygon from scipy.optimize import differential_evolution from numba import jit from hm import gr4j, gr4j_bounds from bokeh.plotting import figure, show, output_file from ...
github_jupyter
``` import numpy as np ``` **Module** is an abstract class which defines fundamental methods necessary for a training a neural network. You do not need to change anything here, just read the comments. ``` class Module(object): def __init__ (self): self.output = None self.gradInput = None s...
github_jupyter
``` import tensorflow as tf from tensorflow import keras print( 'Tensorflow : ',tf.__version__) print( ' |-> Keras : ',keras.__version__) ``` # Text generation with LSTM This notebook contains the code samples found in Chapter 8, Section 1 of [Deep Learning with Python](https://www.manning.com/books/deep-learning-wit...
github_jupyter
<a href="https://colab.research.google.com/github/amir1m/learning-ml/blob/master/FCML_CoinToss.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` from scipy.special import comb from scipy.stats import beta import matplotlib.pyplot as plt import n...
github_jupyter
# Time Series Forecasting with Linear Learner _**Using Linear Regression to Forecast Monthly Demand**_ --- --- ## Contents 1. [Background](#Background) 1. [Setup](#Setup) 1. [Data](#Data) 1. [Train](#Train) 1. [Host](#Host) 1. [Forecast](#Forecast) 1. [Extensions](#Extensions) --- ## Background Forecasting is ...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.model_selection import train_test_split import h5py import os from preprocessor import Preprocessor def save_data_set(x, y, data_type, path, s=''): if not os.path.exists(path): os.makedirs(path) fname=os.path.join(path, f'x_{data_type}{s}.h5') ...
github_jupyter
``` import torch import torch.nn as nn import torch.nn.functional as f import torch.optim as optim import time import random, argparse, logging, os from collections import namedtuple from minatar import Environment import matplotlib.pyplot as plt import numpy as np # remove for game display %matplotlib inline NUM_FRAME...
github_jupyter
<table width="100%"> <tr style="border-bottom:solid 2pt #009EE3"> <td style="text-align:left" width="10%"> <a href="open_h5.dwipynb" download><img src="../../images/icons/download.png"></a> </td> <td style="text-align:left" width="10%"> <a><img class="not_active_img" ...
github_jupyter
# 08. Pseudo-Random Numbers, Simulating from Some Discrete and Continuous Random Variables ## [Inference Theory 1](https://lamastex.github.io/scalable-data-science/infty/2018/01/) &copy;2018 Raazesh Sainudiin. [Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) - The $Uniform(0...
github_jupyter
## Functions for TAA Component Preparation Complementary notebook to executable on the same topic. Functions are presented in an order closely following the exe notebook steps: #### Libraries ``` import os import re import numpy as np # basic numeric calculation import pandas as ...
github_jupyter
# Empirical Approximation overview For most models we use sampling MCMC algorithms like Metropolis or NUTS. In PyMC3 we got used to store traces of MCMC samples and then do analysis using them. There is a similar concept for the variational inference submodule in PyMC3: *Empirical*. This type of approximation stores p...
github_jupyter
# Hill Climbing --- In this notebook, we will train hill climbing with adaptive noise scaling with OpenAI Gym's Cartpole environment. ### 1. Import the Necessary Packages ``` import gym import numpy as np from collections import deque import matplotlib.pyplot as plt %matplotlib inline ``` ### 2. Define the Policy ...
github_jupyter
# 프로젝트 1. 영화 리뷰 감정 분석 **RNN 을 이용해 IMDB 데이터를 가지고 텍스트 감정분석을 해 봅시다.** 이번 책에서 처음으로 접하는 텍스트 형태의 데이터셋인 IMDB 데이터셋은 50,000건의 영화 리뷰로 이루어져 있습니다. 각 리뷰는 다수의 영어 문장들로 이루어져 있으며, 평점이 7점 이상의 긍정적인 영화 리뷰는 2로, 평점이 4점 이하인 부정적인 영화 리뷰는 1로 레이블링 되어 있습니다. 영화 리뷰 텍스트를 RNN 에 입력시켜 영화평의 전체 내용을 압축하고, 이렇게 압축된 리뷰가 긍정적인지 부정적인지 판단해주는 간단한 분류 모델을 만드는 것이 이...
github_jupyter
# Decision Tree Algorithm 👨🏻‍💻 --- ## SKlearn implementation --- ### `Imports` ``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline ``` ### `Importing Dataset` Next, we import the dataset from the CSV file to the Pandas dataframes. ``` col = [ 'Cla...
github_jupyter
# PANDAS!!! IS made for working with data sets generally below or around 1 GB in size, but really this limit varies depending on the memory constraints of the device you run it on. A good rule of thumb is have at least five to ten times the amount of memory on the device as your data set. Once the data set starts to e...
github_jupyter
# Demonstration of the Metrics To-Date For a complete list of metrics and their documentation, please see the API Metrics [documentation](../API/simulation_api.md#metrics-computation). This demonstration will rely on the results produced in the "How To" notebook. ``` from pprint import pprint import pandas as pd f...
github_jupyter
# Tribolium embryo morphometry over time in Napari Authors: Robert Haase, Daniela Vorkel, 2020 This is the pyclesperanto version of a workflow earlier [published for clij2](https://clij.github.io/clij2-docs/md/tribolium_morphometry/). [ImageJ Macro original](https://github.com/clij/clij2-docs/tree/master/src/main/mac...
github_jupyter
# Practice Assignment: Understanding Distributions Through Sampling ** *This assignment is optional, and I encourage you to share your solutions with me and your peers in the discussion forums!* ** To complete this assignment, create a code cell that: * Creates a number of subplots using the `pyplot subplots` or `ma...
github_jupyter
##### Copyright 2019 DeepMind Technologies Limited. ``` #@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 ...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns #Fecha import locale locale.setlocale(locale.LC_ALL,'es_ES.UTF-8') import dateparser import datetime as datet from datetime import datetime sns.set() date_fmt = '%b %Y' #Graficación import plotly import plotly.express as px from plotly.subplots import ...
github_jupyter
# 5. Compressing h5 Training/Validation Dataset Attempting to compress the h5 dataset to allow for temporary storage of dataset on Compute Canada Cedar GPU node SSD. Compression was done using create_compressed_h5.py in the same directory. ``` import sys import os import random import h5py from collections import Coun...
github_jupyter
# Tutorial 07: Networks from Custom Templates In the previous tutorial, we discussed how OpenStreetMap files can be simulated in Flow. These networks, however, may at time be imperfect, as we can see in the toll section of the Bay Bridge (see the figure below). The simulators SUMO and Aimsun both possess methods for a...
github_jupyter
``` from __future__ import print_function import numpy as np import pandas as pd import pickle import matplotlib.pyplot as plt import seaborn as sns from sklearn.manifold import TSNE #from sklearn.datasets import fetch_mldata from sklearn.decomposition import PCA from sklearn.manifold import TSNE from sklearn.preproces...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set_style("whitegrid") ``` # Model: xgboost ``` from sklearn.metrics import classification_report, confusion_matrix, plot_confusion_matrix, roc_auc_score, roc_curve, precision_recall_curve from sklearn.pipeline impor...
github_jupyter
``` import pandas as pd import numpy as np import nltk from collections import Counter from sklearn.metrics import log_loss from scipy.optimize import minimize import multiprocessing import difflib import time import gc import xgboost as xgb from sklearn.cross_validation import train_test_split from sklearn.feature_ex...
github_jupyter
# Tutorial Part 21: Introduction to Bioinformatics So far in this tutorial, we've primarily worked on the problems of cheminformatics. We've been interested in seeing how we can use the techniques of machine learning to make predictions about the properties of molecules. In this tutorial, we're going to shift a bit an...
github_jupyter
# Задание 2.1 - Нейронные сети В этом задании вы реализуете и натренируете настоящую нейроную сеть своими руками! В некотором смысле это будет расширением прошлого задания - нам нужно просто составить несколько линейных классификаторов вместе! <img src="https://i.redd.it/n9fgba8b0qr01.png" alt="Stack_more_layers" wi...
github_jupyter
# Evaluate likelihood ratio ``` import sys, os sys.path.append('../') import logging import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.colors import colorConverter from scipy.stats import norm from sklearn.metrics import roc_curve from inference.utils import s_from_r, shuffle impor...
github_jupyter
*Copyright (c) Microsoft Corporation. All rights reserved.* *Licensed under the MIT License.* # Natural Language Inference on MultiNLI Dataset using Transformers # Before You Start It takes about 4 hours to fine-tune the `bert-large-cased` model on a Standard_NC24rs_v3 Azure Data Science Virtual Machine with 4 NV...
github_jupyter
# This notebook refines the model using only playable songs: ### While generating new songs to play we only want to generate songs with difficulty of 8. Therefore we will load the refined model and then finetune it only to operate on our desired songs ``` from pathlib import Path import pandas as pd import re #Get t...
github_jupyter
# Getting Data Ready Forecasting is used in a variety of applications and business use cases: For example, retailers need to forecast the sales of their products to decide how much stock they need by location, Manufacturers need to estimate the number of parts required at their factories to optimize their supply chain...
github_jupyter
# Solving the Taxi Problem Using SARSA ### Goal: Say our agent is the driving the taxi. There are totally four locations and the agent has to pick up a passenger at one location and drop at the another. The agent will receive +20 points as a reward for successful drop off and -1 point for every time step it takes. Th...
github_jupyter
``` # %pip install --upgrade pip --user # %pip install zarr --user # %pip install tables --user # %pip install git+https://github.com/simpeg/simpeg.git@simulation-tdem --user # %pip install dask dask_jobqueue --user # %pip install git+https://github.com/simpeg-research/casingSimulations.git@simulation --user import num...
github_jupyter
``` %%capture !apt-get install cmake !apt-get install zlib1g-dev !pip install gym[atari] !pip install JSAnimation import numpy as np # import cPickle as pickle import matplotlib.pyplot as plt from JSAnimation.IPython_display import display_animation from matplotlib import animation import gym from keras.models import ...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Water/usgs_watersheds.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank...
github_jupyter
# Deploying Tensorflow models on Verta Within Verta, a "Model" can be any arbitrary function: a traditional ML model (e.g., sklearn, PyTorch, TF, etc); a function (e.g., squaring a number, making a DB function etc.); or a mixture of the above (e.g., pre-processing code, a DB call, and then a model application.) See mo...
github_jupyter
``` from osgeo import gdal,ogr,osr raster = r'/usgs/data0/bathy/sandy/zip3/big.tif' ofile = r'/usgs/data2/notebook/data/big.ncml' def GetExtent(gt,cols,rows): ''' Return list of corner coordinates from a geotransform @type gt: C{tuple/list} @param gt: geotransform @type cols: C{int} ...
github_jupyter
# Simulated Sky Signal in time domain In this lesson we will use the TOAST Operator `OpSimPySM` to create timestreams for an instrument given a sky model. ``` # Load common tools for all lessons import sys sys.path.insert(0, "..") from lesson_tools import ( fake_focalplane ) # Capture C++ output in the jupyter c...
github_jupyter
# PyEcharts **注意** - 本文案例来源:https://github.com/pyecharts/pyecharts-gallery - 本文用来直接复制到使用地方进行使用...T_T ## 折线图 ``` import pyecharts.options as opts from pyecharts.charts import Line x_data = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] y_data = [820, 932, 901, 934, 1290, 1330, 1320] y_data2 = [i*1.5 for i in y_data]...
github_jupyter
# Image Classification using Pre-trained model ## Step 1- Download the model ``` !omz_downloader --name inception-resnet-v2-tf ``` ## Step 2 - Import the libraries ``` import cv2 import matplotlib.pyplot as plt import numpy as np from openvino.runtime import Core from pathlib import Path from IPython.display import...
github_jupyter
# Lesson 04. Python intro **Udacity Full Stack Web Developer Nanodegree program** Part 01. Programming fundamentals and the web [Programming foundations with Python](https://www.udacity.com/course/programming-foundations-with-python--ud036) Brendon Smith br3ndonland ## 01. What will we create? Kunal, Udacity...
github_jupyter
This is one of the Objectiv example notebooks. For more examples visit the [example notebooks](https://objectiv.io/docs/modeling/example-notebooks/) section of our docs. The notebooks can run with the demo data set that comes with the our [quickstart](https://objectiv.io/docs/home/quickstart-guide/), but can be used t...
github_jupyter
# 5 - Creating, getting and visualizing Mesh groups and Mesh Fields **This Notebook will introduce you to**: 1. what is a Mesh Group 2. the Mesh Group data model 3. how to create a mesh Group 4. the Mesh Field data model 5. how to add a field to a Mesh Group 6. how to get Mesh Groups and Mesh Fields ...
github_jupyter
<div style="text-align: right">Dino Konstantopoulos, 3 June 2021</div> # Introducing sentence transformers A python package called **sentence-transformers** that has specifically been optimized for doing semantic textual similarity searches. The model creates a 1024-dimensional embedding for each sentence, and the sim...
github_jupyter
# Basic CNN based digit recognizer In this tutorial we shall go through a bangla digit recognizer model in details. Our model is going to be based on a convolutional neural network (CNN). The focus is to get familiar with the components of a bangla digit recognizer framework. There are three steps in building this dig...
github_jupyter
``` # reload packages %load_ext autoreload %autoreload 2 ``` ### Choose GPU (this may not be needed on your computer) ``` %env CUDA_DEVICE_ORDER=PCI_BUS_ID %env CUDA_VISIBLE_DEVICES=1 import tensorflow as tf gpu_devices = tf.config.experimental.list_physical_devices('GPU') if len(gpu_devices)>0: tf.config.experim...
github_jupyter
``` %pylab inline import pandas as pd import os # Just use 1 GPU os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = "1" import pandas as pd from pyvirchow.io import WSIReader from pyvirchow.morphology import TissuePatch from matplotlib.patches import Polygon from s...
github_jupyter
<a href="https://colab.research.google.com/github/OUCTheoryGroup/colab_demo/blob/master/02_Unsupervised_Segmentation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Unsupervised Image Segmentation. *ICASSP* 2018 **图片无监督语义分割**,作者是东京大学的 Asako Kanezak...
github_jupyter
# Monte Carlo Simulations with the Efficient Frontier ### Summary of Efficient Frontier The Efficient fronter is a set of optimal portfolios that offer the highest expected return for a defined level of risk. It provides a great visualization on how to choose an optimal portfolio mathematically. _*Risk is defined as t...
github_jupyter
# Think Bayes solutions: Chapter 4 This notebook presents solutions to exercises in Think Bayes. Copyright 2016 Allen B. Downey MIT License: https://opensource.org/licenses/MIT ``` from __future__ import print_function, division import numpy as np import thinkbayes2 from thinkbayes2 import Pmf, Cdf, Suite import ...
github_jupyter
# Templating and Jinja2 --- ```html <div class="simplelist"> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </div> ``` <div class="simplelist"> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </div> ```html <table> <thead> ...
github_jupyter
# Accessing Physical Quantities In order to compute the synthetic spectrum, TARDIS must either be told or must calculate many physical properties of the model. To understand and test the code it can be important to look at these values. One easy way to do this is to run TARDIS in an interactive mode and then inspect t...
github_jupyter
# Optimization Methods Until now, you've always used Gradient Descent to update the parameters and minimize the cost. In this notebook, you will learn more advanced optimization methods that can speed up learning and perhaps even get you to a better final value for the cost function. Having a good optimization algorit...
github_jupyter
**Copyright 2018 Google LLC.** Licensed under the Apache License, Version 2.0 (the "License"); 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 r...
github_jupyter
# Amazon SageMaker と Amazon Redshift を利用した、高速、柔軟、セキュアな機械学習基盤の構築 必要な Python Package をインポートします。 ``` # Import packages import pandas as pd import matplotlib.pyplot as plt import psycopg2 import boto3 import json ``` ## Obtain parameters from AWS CloudFormation AWS CloudFormation で設定したパラメータを取得します。 ``` # Please edit st...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#Intro" data-toc-modified-id="Intro-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Intro</a></span></li><li><span><a href="#Save-and-Restore-Variables" data-toc-modified-id="Save-...
github_jupyter
## Coding Exercise #0707 ### 1. Convolutional Neural Network (color images): ``` import numpy as np import pandas as pd # import tensorflow as tf # from keras.datasets.cifar10 import load_data import tensorflow.compat.v1 as tf from tensorflow.keras.datasets.cifar10 import load_data import matplotlib.pyplot as plt tf...
github_jupyter
``` #Import python packages. Some may need to be installed using the Python Package Manager. import os import datetime import exifread from PIL import Image import wikipedia #This is the only variable that needs to be set. It is the path to the folder of images. path = "C:\\1_projects\\138_fedgis2021\\images\\" #This...
github_jupyter
# Example: Regenerating Data from # [R. Wu et al. / Elec Acta 54 25 (2010) 7394–7403](http://www.sciencedirect.com/science/article/pii/S0013468610009503) Import the modules ``` import scipy as sp import numpy as np import openpnm as op import matplotlib.pyplot as plt import openpnm.models.geometry as gm import openpn...
github_jupyter
``` import pandas as pd import numpy as np ``` # 自由现金流估值法 DCF 有以下四种模型: 1. 零增长模型 2. 不变增长模型 3. 两阶段模型 4. 三阶段模型 不同的是自由现金流的使用和贴现的方式不同。 **计算步骤**: 1. 计算自由现金流并依据相应的方法折现($\star\star\star\star\star$, the most important, this is what the code solves) 2. 计算股权价值= 1.+金融资产+长期股权投资-公司债务 3. 计算少数股东比例 4. 归属于上市公司股东的价值=股权价值$\times$(1-...
github_jupyter
< [Classes](PythonIntroCh7.ipynb) | [Contents](PythonIntro.ipynb) | [File I/O](PythonIntroCh9.ipynb) > # 8. Modules ## 8.1 Introduction Last lesson we covered the killer topic of Classes. As you can remember, classes are neat combinations of variables and functions in a nice, neat package. Programming lingo calls this...
github_jupyter
# Functions If you find yourself doing the same thing over and over again in your code, it might be time to write a function. Functions are blocks of reusable code -- little boxes that (usually) take inputs and return outputs. In Excel, `=SUM()` is a function. `print()` is one of Python's built-in function. You can ...
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
# Thematic Reports Thematic reports run historical analyses on the exposure of a portfolio to various Goldman Sachs Flagship Thematic baskets over a specified date range. ### Prerequisite To execute all the code in this tutorial, you will need the following application scopes: - **read_product_data** - **read_financ...
github_jupyter
# Pythonic APIs: the workshop notebook ## Tutorial overview * Introduction * A simple but full-featured Pythonic class * **Exercise:** custom formatting and alternate constructor * A Pythonic sequence * **Exercise:** implementing sequence behavior * *Coffee break* * A Pythonic sequence (continued) * **Exercise:...
github_jupyter
``` %load_ext autoreload %autoreload 2 %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.cluster import KMeans from sklearn.svm import SVC from sklearn.metrics import roc_auc_score, roc_curve from sklearn import preprocessing from sklearn.linear_model import Log...
github_jupyter
# [모듈 3.1] 모델 배포 및 추론 (VPC 및 No VPC 모두에서 사용 가능) 이 노트북은 아래와 같은 작업을 합니다. - 엔드포인트 생성 - SageMaker Estimator 생성 - Training Job 을 Estimator 에 연결 - 엔드포인트 생성은 위의 방법 말고도 다른 방법이 추가적으로 있습니다. 아래를 참고 하세요 - https://docs.aws.amazon.com/ko_kr/sagemaker/latest/dg/ex1-deploy-model.html - 엔드포인트 대상으로 추론 - 추론 예...
github_jupyter
This example notebook uses the averaging functions found ins the diff_classifier msd module to find average msd profiles over input msd datasets using precision-weighted averaging. Precision is the inverse of the standard squared error. This increases the contribution of videos that have many particles and more homogen...
github_jupyter
### DCGANs `MNIST` dataset. ``` import tensorflow as tf from tensorflow.keras import layers, Model from tensorflow.keras.layers import Input, Conv2D, Dense, Flatten, Reshape, Conv2DTranspose, MaxPooling2D, UpSampling2D, LeakyReLU from tensorflow.keras.activations import relu from tensorflow.keras.models import Sequent...
github_jupyter
# Random Forests - Redux From Fastai ML1 [Lesson 1 Intro to Random Forests](https://github.com/fastai/fastai/blob/master/courses/ml1/lesson1-rf.ipynb) This notebook turned into a redux of my [first RF Code Along](https://github.com/WNoxchi/Kaukasos/blob/master/FAML1/Lesson1-RandomForests.ipynb) with notes. --- ## ...
github_jupyter
<img src="http://upload.wikimedia.org/math/7/5/2/752fd6396a9c9d026f10eccb39ddca15.png"/> $$V(x) = w\left(\frac{L}{2} - x\right)$$ $$M(x) = \frac{w}{2}\left(L x - x^2\right)$$ $$\theta(x) = \frac{- w}{2 EI}\left(\frac{L x^2}{2} - \frac{x^3}{3} +C\right)$$ $$\Delta(x) = \frac{- w}{2 EI}\left(\frac{L x^3}{6} - \frac{x...
github_jupyter
``` #hide #skip ! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab #export from fastai.torch_basics import * from fastai.data.all import * #hide from nbdev.showdoc import * #default_exp text.core #default_cls_lvl 3 ``` # Text core > Basic function to preprocess text before assembling it in a `Dat...
github_jupyter
_Lambda School Data Science_ This sprint, your project is about water pumps in Tanzania. Can you predict which water pumps are faulty? # Decision Trees #### Objectives - clean data with outliers - impute missing values - use scikit-learn for decision trees - understand why decision trees are useful to model non-line...
github_jupyter
``` from openeye import oechem, oedepict import oenotebook as oenb import pandas as pd def depict_smiles(smiles): mol = oechem.OEMol() oechem.OESmilesToMol(mol,smiles) return oenb.draw_mol(mol) depict_smiles(smiles) ``` ## SM11 Initial mol is the same as the tautomer: SM11_micro018 and SM11_micro020 SM1...
github_jupyter
``` import numpy as np import pandas as pd pd.core.common.is_list_like = pd.api.types.is_list_like import pandas_datareader.data as web import datetime import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.backends.backend_pdf import PdfPages import random import pingouin def gen_pco...
github_jupyter
# Translate demand files format: from .dat to flow.csv ``` import sys import pandas as pd import xml.etree.ElementTree as ET import datetime import re import nltk import numpy import os from IPython.display import display, HTML low_memory=False PATH="data/OD_MADRID_v2" SCENARIO="madrid_barrio_salamanca_od" SCENARIO="...
github_jupyter
## **MODULE 3: Fundamental analysis using Regression** ###***3.1*** ``` # Import pandas library import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv('/content/GOLD.csv') #data of the last 2 years price action of Indian (MCX) gold standard. df.head(5) df.tail(5) #EXPLORATION OF DATA...
github_jupyter
``` # Copyright 2020 IITK EE604A Image Processing. All Rights Reserved. # # Licensed under the MIT License. Use and/or modification of this code outside of EE604 must reference: # # © IITK EE604A Image Processing # https://github.com/ee604/ee604_assignments # # Author: Shashi Kant Gupta and Prof K. S. Venkatesh, Depa...
github_jupyter
# Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier. Have you ever wanted to make your text messages more expressive? Your emojifier app will help you do that. So rather than writing: >"Congratulations on the promotion! Let's get coffee and ...
github_jupyter
# Bayesian Estimation of Orbital Scaling Parameters ## Introduction These notes briefly outline a Bayesian approach to estimating the statistical distribution of the orbital scaling (or $\lambda$) parameters from NIST data and their associated experimental error bars. The atomic structure calculation can be viewed ...
github_jupyter
##### Copyright 2021 The Cirq Developers ``` #@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 agre...
github_jupyter
``` import open3d as o3d import numpy as np import sys # monkey patches visualization and provides helpers to load geometries sys.path.append('..') import open3d_tutorial as o3dtut # change to True if you want to interact with the visualization windows o3dtut.interactive = False ``` # File IO This tutorial shows how ...
github_jupyter
``` %matplotlib inline ``` PyTorch是什么? ================ 基于Python的科学计算包,服务于以下两种场景: - 作为NumPy的替代品,可以使用GPU的强大计算能力 - 提供最大的灵活性和高速的深度学习研究平台 开始 --------------- Tensors(张量) ^^^^^^^ Tensors与Numpy中的 ndarrays类似,但是在PyTorch中 Tensors 可以使用GPU进行计算. ``` from __future__ import print_function import torch ``` 创建一个 5x3 矩阵...
github_jupyter
# Getting started with machine learning <br> using scikit-learn ## James Bourbeau ### Big Data Madison Meetup April 24, 2018 ### GitHub repo with materials: https://github.com/jrbourbeau/big-data-madison-ml-sklearn <br> ### Slides: https://jrbourbeau.github.io/big-data-madison-ml-sklearn ### Contact: E-mail: james...
github_jupyter
# Generating 3D People in Scenes without People Here we give a frontend demo of how to generate body meshes in a scene without people. + First, we use a pre-trained conditional VAE model to generate body meshes. Here we only show the one-stage model without scene loss. + Second, we perform scene geometry-aware fitti...
github_jupyter
# 02 - XOR Modell mit TensorFlow ``` # see https://aimatters.wordpress.com/2016/01/16/solving-xor-with-a-neural-network-in-tensorflow/ import tensorflow as tf import time ``` #### Trainings- und Testdaten ``` XOR_X = [[0,0],[0,1],[1,0],[1,1]] XOR_Y = [[0],[1],[1],[0]] ``` #### Weight und Bias definieren ``` x_ = ...
github_jupyter
``` import pandas as pd import numpy as np import os from datetime import datetime,timedelta,date,time import matplotlib.pyplot as plt %matplotlib inline from sklearn.cluster import KMeans from collections import Counter column_names = ['DateTime', 'y'] area = 'C:/Users/home/Desktop/Smart-Meter/ratiodata/' dir_path = o...
github_jupyter
``` import json import uuid from pymongo import MongoClient db_dict = { "id": "evmirna", "title": "EVmiRNA", "url": "http://bioinfo.life.hust.edu.cn/EVmiRNA/", "description": "EVmiRNA is a database of miRNA profiling in extracellular vesicles", "basicInfo": "Extracellular vesicles (EVs) released by ...
github_jupyter
# Checkpoints Sometimes, it might be useful to store some checkpoints while executing an algorithm. In particular, if a run is very time-consuming. **pymoo** offers to resume a run by serializing the algorithm object and loading it. Resuming runs from checkpoints is possible - the functional way by calling the `min...
github_jupyter
# Introduction This notebook demostrates the prediction pipeline for the trained classifiers. With the 3 pretrained classifiers, you can easily classify a new structure that is not included in the original training set. **Note**: - For easier readability, you can change the fontsize of this notebook by navigating to...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # 05. Train in Spark * Create Workspace * Create Experiment * Copy relevant files to the script folder * Configure and Run ## Prerequisites Make sure you go through the [00. Installation and Configuration](00.configuration.ipyn...
github_jupyter
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAADhCAYAAAC+/w30AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4wEeDgYF/Qy0kwAAIABJREFUeNrsnXl4G9W5/z8zWrxNHDt29j0kBEgQMYQdwtqW0CKgtHS5XShtb1vfbrSltOpduro/StfbW3VvaaG0QEtApQ1Q9n1JIlDCEkL23fES2+NFsjTz++MckUHYia0ZW5J9vs+jR7JkHc3MOXPe77uDgoKCgoKC...
github_jupyter
##### Copyright 2020 The TensorFlow IO 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 ...
github_jupyter