text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` from __future__ import print_function, division, absolute_import import GPy import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline import safeopt mpl.rcParams['figure.figsize'] = (20.0, 10.0) mpl.rcParams['font.size'] = 20 mpl.rcParams['lines.markersize'] = 20 ``` ## De...
github_jupyter
``` import numpy as np import torch import gpytorch import matplotlib.pyplot as plt import matplotlib as mpl import plotting_utilities from rllib.agent.bandit.gp_ucb_agent import GPUCBPolicy from rllib.environment.bandit_environment import BanditEnvironment from rllib.reward.gp_reward import GPBanditReward from rllib...
github_jupyter
``` #hide #skip ! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab #all_slow #export from fastai.basics import * from fastai.callback.progress import * from fastai.text.data import TensorText from fastai.tabular.all import TabularDataLoaders, Tabular from fastai.callback.hook import total_params #h...
github_jupyter
This notebook shows how to time and plot a simple function of one variable using C++ for the function, and Python for the plotting. To run the notebook locally or on Binder, the simplest thing to do is just click the "Cell" menu and select "Run all". Or you can click the "fast forward" icon on the toolbar. To run the...
github_jupyter
# AutoML Classification experiment using Local Compute and Pandas DataFrames ### Save trained model as Scikit-Learn model (.pkl) and as ONNX model (.onnx file) ### Data: IBM Employee Attrition dataset loaded from Azure ML Dataset ## Get Azure ML Workspace to use ``` # azureml-core of version 1.0.72 or higher is requ...
github_jupyter
``` %matplotlib inline import os import gzip import ujson as json from itertools import islice, takewhile from tqdm import tqdm_notebook as tqdm from collections import Counter, defaultdict import random import json import numpy import pandas as pd from mimo.evaluate import iter_instance_decodes, evaluate_decodes, get_...
github_jupyter
``` #@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 agreed to in writing, software # distributed u...
github_jupyter
# Convolutional Neural Networks: Application Welcome to Course 4's second assignment! In this notebook, you will: - Implement helper functions that you will use when implementing a TensorFlow model - Implement a fully functioning ConvNet using TensorFlow **After this assignment you will be able to:** - Build and t...
github_jupyter
# Allegro ClearML logging example [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/allegroai/clearml/blob/master/examples/reporting/Allegro_Trains_logging_example.ipynb) This example introduces ClearML [Logger](https://allegro.ai/docs/logger.html) f...
github_jupyter
``` %matplotlib inline ``` Online learning of a dictionary of parts of faces ================================================== This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use th...
github_jupyter
``` import seaborn as sns import pandas as pd import matplotlib.pyplot as plt from ipywidgets import interact %matplotlib inline %config InlineBackend.figure_format = 'svg' plt.style.use('seaborn-talk') ``` _Connect code and reports with_ <br> <img src="https://jupyter.readthedocs.io/en/latest/_static/_images/jupyter...
github_jupyter
<link rel="stylesheet" href="../../styles/theme_style.css"> <!--link rel="stylesheet" href="../../styles/header_style.css"--> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <table width="100%"> <tr> <td id="image_td" width="15%" class="head...
github_jupyter
# Construct school interaction networks for schools used for calibration from basic school statistics **Note**: teacher <-> student contacts in the contact networks created in this script are of strenght "far" (loose). ``` import networkx as nx import pandas as pd from os.path import join import numpy as np # networ...
github_jupyter
# Getting deeper with Keras * Tensorflow is a powerful and flexible tool, but coding large neural architectures with it is tedious. * There are plenty of deep learning toolkits that work on top of it like Slim, TFLearn, Sonnet, Keras. * Choice is matter of taste and particular task * We'll be using Keras ``` import sy...
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
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set_style('darkgrid') train = pd.read_csv("10-best features/10-best Training-Testing split/UNSW_2018_IoT_Botnet_Final_10_best_Training.csv") test = pd.read_csv("10-best features/10-best Training-Testi...
github_jupyter
## Facies classification using an SVM classifier with RBF kernel #### Contest entry by: <a href="https://github.com/mycarta">Matteo Niccoli</a> and <a href="https://github.com/dahlmb">Mark Dahl</a> #### [Original contest notebook](https://github.com/seg/2016-ml-contest/blob/master/Facies_classification.ipynb) by Br...
github_jupyter
# SLU06 - Flow Control: Iterations In this notebook we will be covering the following: - [1. Repeating executions with `while` and `for` loops](#Repeating-executions-with-loops) - [2. Interrupting loops with the `continue` and `break` statements](#Interrupting-loops-with-the-continue-and-break-statements) - [3. Build...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # Validating Runge Kutta Butcher tables using Truncated Tay...
github_jupyter
``` %%capture from typing import * from fastai2.basics import * from fastai2.text.all import * from fastai2.callback import * from transformers import AutoConfig, AutoTokenizer, AutoModelWithLMHead, GPT2LMHeadModel, GPT2Tokenizer from fastai_transformers_utils.all import TransformersTokenizer, TransformersNumericalize...
github_jupyter
``` import open3d as o3d import numpy as np import os 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 = not "CI" in os.environ ``` # Mesh ...
github_jupyter
# Advection-Diffusion In this example, we will learn how to perform an advection-diffusion simulation of a given chemical species through a `Cubic` network. The algorithm can be applied to more complex networks in the same manner as described in this example. For the sake of simplicity, a one layer 3D cubic network is...
github_jupyter
## AI Platform: Qwik Start This lab gives you an introductory, end-to-end experience of training and prediction on AI Platform. The lab will use a census dataset to: - Create a TensorFlow 2.x training application and validate it locally. - Run your training job on a single worker instance in the cloud. - Deploy a mod...
github_jupyter
# Effective Stiffness of Fiber Composite ## Introduction This example demonstrates the use of the homogenization model from pyMKS on a set of fiber-like structures. These structures are simulated to emulate fiber-reinforced polymer samples. For a summary of homogenization theory and its use with effective stiffness...
github_jupyter
# Profiling PyTorch Multi GPU Single Node Training Job with Amazon SageMaker Debugger This notebook will walk you through creating a PyTorch training job with the SageMaker Debugger profiling feature enabled. It will create a multi GPU single node training using Horovod. ### Install sagemaker and smdebug To use the n...
github_jupyter
``` !rm -rf data2 data RANDOM_SEED = 42 DATASET_DIR = "../dataset" TRAIN_PERCENTAGE = 0.75 AVOID_CLASS = "Black-grass" import cv2 from glob import glob import numpy as np from matplotlib import pyplot as plt import math import pandas as pd import os import random import shutil import tensorflow as tf np.random.seed(RA...
github_jupyter
# Excitation inhibition balance ``` import pprint import subprocess import sys sys.path.append('../') import numpy as np import matplotlib.pyplot as plt import matplotlib import matplotlib.gridspec as gridspec from mpl_toolkits.axes_grid1 import make_axes_locatable import seaborn as sns %matplotlib inline np.set_p...
github_jupyter
# Train an ML model and practice labeling on MNIST data ### To make your ml model intelligent, you need human generated labels. This tool will help you label unlabelled data and achive that goal. * This notebook demonstrates how to train a classfier using semi supervised learning, user interaction and unlabeled data ....
github_jupyter
# 2 B: Adding more dimensions, without loops We'll continue on with our heatwave example, this time expanding the analysis to the full 3d dataset We won't be using any explicit loops, instead we'll rely on Dask to automatically order array operations for us To start off with we'll load some libraries and the Dask di...
github_jupyter
<a href="https://colab.research.google.com/github/tancik/fourier-feature-networks/blob/master/Experiments/3d_shape_occupancy.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import jax from jax import random, grad, jit, vmap from jax.config impor...
github_jupyter
# Lists Data Structure: A data structure is a collection of data elements (such as numbers or characters—or even other data structures) that is structured in some way, for example, by numbering the elements. The most basic data structure in Python is the "sequence". -> List is one of the Sequence Data structure ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline import pandas as pd from sklearn import linear_model from pandas.tools.plotting import scatter_matrix from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from sklearn.linear_model import Ridge # UC...
github_jupyter
- https://github.com/matt-graham/bvh-tools/tree/master/bvh - https://github.com/20tab/bvh-python/pull/2/files - https://github.com/20tab/bvh-python - https://gist.github.com/johnfredcee/2007503 - https://github.com/ezgitek/bvh-parser/blob/master/bvhparser.py Papers - http://theorangeduck.com/media/uploads/other_stuff...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Challenge Notebook ## Problem: Determine whether you can win the Nim game given the remaining stones. See the [LeetCode](https://leetco...
github_jupyter
# Calculating Historical Free Cash Flows In this exercise we will load income statement and balance sheet data and use them to calculate free cash flows. ## Load Financial Statements into `DataFrame`s First we will use `pandas`' `read_excel` to get the data into `DataFrame`s. ``` import pandas as pd all_statements...
github_jupyter
``` import rtree import geopandas as gpd import numpy as np import os, glob comuni_trentini = gpd.read_file('data' + os.sep + 'comuni_trentini.gpkg') comuni_trentini = comuni_trentini.to_crs(epsg=4326) confini_pat = comuni_trentini.dissolve() confini_pat.to_file("confini_pat.geojson",driver="GeoJSON") confine_trento = ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` #Configurable parameters for pure pursuit + How fast do you want the robot to move? It is fixed at $v_{max}$ in this exercise + When can we declare the goal has been reached? + What is the lookahead distance? Determines the next position on ...
github_jupyter
<a href="https://colab.research.google.com/github/AmitHasanShuvo/Neural-Network-Implementations/blob/master/Fashion_MINST_with_tf.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> **Fashion MINST classification with tensorflow** I tried to implement ...
github_jupyter
# Day and Night Image Classifier --- The day/night image dataset consists of 200 RGB color images in two categories: day and night. There are equal numbers of each example: 100 day images and 100 night images. We'd like to build a classifier that can accurately label these images as day or night, and that relies on f...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns RESULT_FILE = '../files/results/experimental_results_electricity.csv' results = pd.read_csv(RESULT_FILE, delimiter=";") # Add column with architecture type (TCN or LSTM) results['ARCHITECTURE'] = results['MODEL'].map(lambd...
github_jupyter
# G2Engine Guide - Stats The `stats()` method creates a string with information about your Senzing workload. More information: * [G2Engine Reference](senzing-G2Engine-reference.ipynb) ## Prepare environment ``` import com.senzing.g2.engine.G2Engine; import com.senzing.g2.engine.G2JNI; ``` ### Helper class for Jso...
github_jupyter
# Batch Correction Tutorial Author: [Hui Ma](https://github.com/huimalinda), [Yiming Yang](https://github.com/yihming)<br /> Date: 2021-06-24<br /> Notebook Source: [batch_correction.ipynb](https://raw.githubusercontent.com/klarman-cell-observatory/pegasus/master/notebooks/batch_correction.ipynb) ``` import pegasus a...
github_jupyter
``` import jax.numpy as np import numpy as onp from jax import grad, jit, vmap from jax.ops import index_update from jax import random import matplotlib.pyplot as plt import morphine from morphine.matrixDFT import minimal_dft import poppy %matplotlib inline import matplotlib as mpl mpl.style.use('seaborn-colorblind'...
github_jupyter
__tests__ for `importnb` ``` from importnb import Notebook, reload from importnb.parameterize import parameterize, Parameterize from pytest import fixture, raises, mark import json, linecache, inspect, ast, sys, io from pathlib import Path import contextlib try: from IPython import get_ipyt...
github_jupyter
[Index](Index.ipynb) - [Back](Widget Basics.ipynb) - [Next](Output Widget.ipynb) # Widget List ``` import ipywidgets as widgets ``` ## Numeric widgets There are many widgets distributed with IPython that are designed to display numeric values. Widgets exist for displaying integers and floats, both bounded and unbo...
github_jupyter
!pip install statannot ``` import os from glob import glob import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from statannot import add_stat_annotation import json %matplotlib inline MIN_TILENO = 15 resultRoot = "/Volumes/wrangell-st-elias/research/planet/tuol-reruns/ASO_3M_SD_USCATE_2018052...
github_jupyter
# Item cold-start: recommending StackExchange questions In this example we'll use the StackExchange dataset to explore recommendations under item-cold start. Data dumps from the StackExchange network are available at https://archive.org/details/stackexchange, and we'll use one of them --- for stats.stackexchange.com --...
github_jupyter
``` from sklearn.decomposition import PCA import numpy as np import matplotlib.pyplot as plt import seaborn as sns import math import pandas as pd from sklearn.linear_model import LinearRegression from sklearn.linear_model import LogisticRegression from sklearn.pipeline import Pipeline from sklearn.model_selection imp...
github_jupyter
``` from google.colab import drive drive.mount('/content/gdrive/') cd /content/gdrive/MyDrive/Detection/simple-ssd-for-beginners/ from voc_dataset import CustomDetection from config import opt import numpy as np from lib.model import SSD import torch import torch.nn.functional as F import os from lib.utils import de...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $ \newcommand{\bra}[1]{\langle #1|} $ $ \newcommand{\ket}[1]{|#1\rangle} $ $ \newcommand{\braket}[2]{\langle #1|#2\rangle} $ $ \newcommand{\dot}[2]{ #1 \cdot #2} $ $ \newcommand{\biginner}[2]{\left\langle...
github_jupyter
# Example: CanvasXpress scatter2d Chart No. 7 This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at: https://www.canvasxpress.org/examples/scatter2d-7.html This example is generated using the reproducible JSON obtained from the above p...
github_jupyter
``` import math import pandas as pd import matplotlib.pyplot as plt import numpy as np import seaborn as sns import matplotlib.lines as mlines import matplotlib.patches as mpatches from numpy import median from scipy.stats import ranksums from matplotlib.ticker import PercentFormatter import matplotlib.ticker as mtic...
github_jupyter
``` import sys import os import math import importlib import matplotlib import matplotlib.pyplot as plt import numpy as np import random %matplotlib inline def simulate(initialRatio): rand = random.Random(1337) nprand = np.random.RandomState(1337) populationSize = 5000 # small town # model # of childre...
github_jupyter
<img src="images/strathsdr_banner.png" align="left"> # Getting Started with RFSoC Studio ---- You have just installed a significant amount of educational content and reference design projects for your RFSoC2x2 or ZCU111 development board. Before you get started, lets cover some introductory steps and helpful tips wh...
github_jupyter
<a href="https://colab.research.google.com/github/L-Quintana/Cromoforos/blob/main/cargar_qm9.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # Conda contiene una serie de herramientas de colab, incluidas Pandas , Scikit-Learn , PyTorch, etc. !c...
github_jupyter
``` # reload packages %load_ext autoreload %autoreload 2 ``` ### Choose GPU ``` %env CUDA_DEVICE_ORDER=PCI_BUS_ID %env CUDA_VISIBLE_DEVICES=3 import tensorflow as tf gpu_devices = tf.config.experimental.list_physical_devices('GPU') if len(gpu_devices)>0: tf.config.experimental.set_memory_growth(gpu_devices[0], Tr...
github_jupyter
``` import csv import numpy as np import seaborn as sns from scipy.misc import imread, imsave import cv2 from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten, Dropout, Lambda from keras.layers import concatenate, Input from keras.models import Model from keras.layers.convolutiona...
github_jupyter
# Language Translation In this project, you’re going to take a peek into the realm of neural network machine translation. You’ll be training a sequence to sequence model on a dataset of English and French sentences that can translate new sentences from English to French. ## Get the Data Since translating the whole lan...
github_jupyter
# GLM: Negative Binomial Regression ``` import arviz as az import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc3 as pm import re import seaborn as sns from scipy import stats print('Running on PyMC3 v{}'.format(pm.__version__)) %config InlineBackend.figure_format = 'retina' az.style.use...
github_jupyter
# Text Analysis In this lecture, we look at more recent methods of feature extraction and topic modeling. We will cover the following: - word2vec - latent semantic analysis - non-negative matrix factorization - latent Dirichlet allocation A technical guide to topic modeling can be found in these [lecture notes](ht...
github_jupyter
# Multi Digit Recognition This notebook shown the a simply model in keras to recognize a digit sequence in a real world image. This images data is taken from the Street View House Number Dataset. This model is divided into two part.**Preprocessing** notebook consist of converting the images in the dataset to 32x32 gre...
github_jupyter
<img src="../ancillarydata/logos/LundUniversity_C2line_RGB.png" width="150" align="left"/> <br> <img src="../ancillarydata/logos/Icos_Logo_CMYK_Regular_SMpng.png" width="327" align="right"/> <br> <a id='introduction'></a> <br> <br> # <font color=#B98F57>Notebook developed for the purposes of a PhD course titled</font...
github_jupyter
### This notebook walks you through how to use the pretrained model to generate your own transition state guesses. If using your own model and data, replace the model and data paths with your own Import the necessary packages ``` from rdkit import Chem, Geometry from rdkit.Chem.Draw import IPythonConsole import ten...
github_jupyter
# Derive Column By Example Copyright (c) Microsoft Corporation. All rights reserved.<br> Licensed under the MIT License. One of the more advanced tools in Data Prep is the ability to derive columns by providing examples of desired results and letting Data Prep generate code to achieve the intended derivation. ``` imp...
github_jupyter
# Latent Space Models for Neural Data Many scientific fields involve the study of network data, including social networks, networks in statistical physics, biological networks, and information networks (Goldenberg, Zheng, Fienberg, & Airoldi, 2010; Newman, 2010). What we can learn about nodes in a network from their ...
github_jupyter
< [Tutoriel](Python/tutoriel-python.ipynb) | [Contents](index.ipynb) | 5. [Données spatiales](05-donnees-spatiales.ipynb) > ``` # exemples de structures finies de données # chaîne de caractères s = "Hello" # booléen a = True b = False b == (not a) # True # entier x = 3 # réel y = 3.4 # classes class RoadUser: def ...
github_jupyter
# Using Custom Entropy Models With `constriction` - **Author:** Robert Bamler, University of Tuebingen - **Initial Publication Date:** Jan 4, 2022 This is an interactive jupyter notebook. You can read this notebook [online](https://github.com/bamler-lab/constriction/blob/main/examples/python/02-custom-entropy-models....
github_jupyter
<h1> 2d. Distributed training and monitoring </h1> In this notebook, we refactor to call ```train_and_evaluate``` instead of hand-coding our ML pipeline. This allows us to carry out evaluation as part of our training loop instead of as a separate step. It also adds in failure-handling that is necessary for distributed...
github_jupyter
# DC 2 layer foundation - [**Questions**](https://www.dropbox.com/s/uizpgz3eyt3urim/DC-2-layer-foundation.pdf?dl=0) In this notebook, we use widgets to explore the physical principals governing DC resistivity. For a half-space and a 2-layer resistivity model, we will learn about the behavior of the *currents*, *elec...
github_jupyter
# Going to Jupiter with Python using Jupyter and poliastro Let us recreate with real data the [Juno NASSA Mission](https://www.jpl.nasa.gov/news/press_kits/juno/overview/). The main objectives of Juno spacecraft is to study the Jupiter planet: how was its formation, its evolution along time, atmospheric characteristic...
github_jupyter
# Classificador de Carros usando Tensorflow Neste notebook iremos implementadar um modelo para classificação de imagens. Classificação é uma das "tarefas" em que podemos utilizar Machine Learning, nesta tarefa o ensino é **supervisionado**, em outras palavras nós vamos ensinar ao modelo através de exemplos com gabari...
github_jupyter
# Unsupervised anomaly detection After our initial EDA, we have decided to pursue some unsupervised anomaly detection with a feature for the number of usernames with a failed login attempt in a given minute. ## Setup ``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd import ...
github_jupyter
# Exploratory Data Analysis ## Data Collection ``` # Não consegui fazer funcionar o curl, arquivos estão salvos localmente ``` ## Data Processing ``` # Como deu problema no meu anaconda e não consegui importar direto com o plpred ativado, tive que puxar as bibliotecas manualmente para a tarefa. pip install pandas p...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker %matplotlib inline seed = 19 df = pd.read_csv('../dataset/train.csv') df.head() cols = ['toxic', 'severe_toxic', 'obscene', 'threat', 'insult', 'identity_hate'] print('total', df.shape[0]) print('-------------...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. [Licensed under the Apache License, Version 2.0](#scrollTo=bPJq2qP2KE3u). ``` // #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file ...
github_jupyter
# 2D Isostatic gravity inversion - Interpretation Model Este [IPython Notebook](http://ipython.org/videos.html#the-ipython-notebook) utiliza a biblioteca de código aberto [Fatiando a Terra](http://fatiando.org/) ``` #%matplotlib inline import numpy as np from scipy.misc import derivative import scipy as spy from scip...
github_jupyter
``` import numpy as np import pandas as pd import pandas_profiling import matplotlib.pyplot as plt from scipy import stats import seaborn as sns from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_absolute_error,mean_squared_error,r2_score from sklearn.model_selection import train_test_s...
github_jupyter
# Magic functions You can enable magic functions by loading ``pandas_td.ipython``: ``` %load_ext pandas_td.ipython ``` It can be loaded automatically by the following configuration in "~/.ipython/profile_default/ipython_config.py": ``` c = get_config() c.InteractiveShellApp.extensions = [ 'pandas_td.ipython', ...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Quickstart: Web Cam Action Recognition Action recognition is the increasingly popular computer vision task of determining specific actions in a given video. This notebook shows a simple example of loading a pre...
github_jupyter
> > # MaaS Sim tutorial > > ## Data structures, pandas DataFrames > ----- MaasSim uses: * `pandas` to store, read and load the data, * `.csv` format whenever we stor the * python native `list()` and `dict()` whenever speed is needed, sporadicaly `NamedTuple` ## 1. Main containers (data structures) * `inData` is a nest...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/ArunkumarRamanan/Exercises-Machine-Learning-Crash-Course-Google-Developers/blob/master/intro_to_pandas.ipynb) #### Copyright 2017 Google LLC. ``` # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in comp...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt # This import is needed to modify the way figure behaves from mpl_toolkits.mplot3d import Axes3D Axes3D %matplotlib inline from ipywidgets import * import pickle_functions as PK import plot_functions as PL import helpers as HL %load_ext autoreload %autoreloa...
github_jupyter
``` import pandas as pd import numpy as np import geopandas #: Our example dataset from seaborn, without loading the seaborn package. iris = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv') iris.head(5) ``` # Selecting Data `df[]` is overloaded and will do different things dependi...
github_jupyter
# ⚕️ Diabetes Prediction Model ⚕️ ## Problem: Given parameters like Glucose, Insulin levels, etc. of a patient, is it possible to predict whether or not the patient is prone to diabetes? ## Data: The dataset for this given problem is Pima Indians Diabetes Dataset obtained from kaggle. The datasets consists of sev...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import StandardScaler df_train = pd.read_excel('wdbc.train.xlsx') df_test = pd.read_excel('wdbc.test.xlsx') train = df_train test = df_test train.shape test.shape train.describe() import seaborn import m...
github_jupyter
# Zipline Algorithm Here's an example where we run an algorithm with zipline, then produce tear sheets for that algorithm. ## Imports & Settings Import pyfolio and zipline, and ingest the pricing data for backtesting. You may have to install [Zipline](https://zipline.ml4trading.io/) first; you can do so using either...
github_jupyter
# Schelling Segregation Model ## Background The Schelling (1971) segregation model is a classic of agent-based modeling, demonstrating how agents following simple rules lead to the emergence of qualitatively different macro-level outcomes. Agents are randomly placed on a grid. There are two types of agents, one const...
github_jupyter
``` data = '''### [Response Data](geocode-dataflow-response-description.md) ### [Walkthrough](geocode-dataflow-walkthrough.md) ### [Sample Code](geocode-dataflow-sample-code.md) ### [Data Schema v1.0](geocode-dataflow-data-schema-version-1-0.md) ### [Data Schema v2.0](geocode-dataflow-data-schema-version-2-0.md) ### [...
github_jupyter
``` from tensorflow import keras import pandas as pd import sklearn as sk import tensorflow as tf import matplotlib.pyplot as plt import cv2 import copy import numpy as np def removePlotterAxes(): plt.figure() plt.grid(False) plt.xticks([]) plt.yticks([]) pass def multiPlot(imgs, figsize, no_row...
github_jupyter
# Greedy Filter Pruning In this notebook we review a couple of experiments performed on Plain20 using Distiller's version of greedy filter pruning. This implementation is very similar to the greed algorithms defined in [1] and [2]. This is another means to explore the network sub-space around a pre-trained model: b...
github_jupyter
``` import tensorflow as tf tf.logging.set_verbosity(tf.logging.WARN) import pickle import numpy as np import os from sklearn.model_selection import train_test_split from sklearn.metrics import f1_score from sklearn.metrics import accuracy_score import os from tensorflow.python.client import device_lib from collections...
github_jupyter
##### Copyright 2021 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
# Redes neuronales convolucionales con TensorFlow *Esta notebook fue creada originalmente como un blog post por [Raúl E. López Briega](http://relopezbriega.com.ar/) en [Matemáticas, Analisis de datos y Python](http://relopezbriega.github.io). El contenido esta bajo la licencia BSD.* <img title="Redes neuronales convo...
github_jupyter
``` from pdf2image import convert_from_path import os import shutil import json functions = [ { "q": { "text": "¿Qué parte de la siguiente ecuación debes resolver primero?", "math": "(3-1)+6*2+1" }, "correct": "(3-1)", "incorrect": ["6*2", "2+1"] }, { "q": { "text": "¿Cuál es el siguiente pas...
github_jupyter
``` #uploding data to colab from google.colab import files uploaded = files.upload() for fn in uploaded.keys(): print('User uploaded file "{name}" with length {length} bytes'.format( name=fn, length=len(uploaded[fn]))) # Building the CNN #importing all keras packages from keras.models import Sequential f...
github_jupyter
``` # depedencies import getpass from topolib.subsetDat import subsetBBox; from topolib import IceSat2Data; import glob import rasterio from topolib import gda_lib; from topolib import dwnldArctic import numpy as np import geopandas as gpd from multiprocessing import Pool ``` Pflug example script showing data comparis...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import sys import numpy as np import matplotlib.pyplot as plt import hashlib import time import shutil MNM_nb_folder = os.path.join('..', '..', '..', 'side_project', 'network_builder') sys.path.append(MNM_nb_folder) python_lib_folder = os.path.join('..', '..', 'pylib') s...
github_jupyter
Example Usage for DataFrame ======================== ``` # remove comment to use latest development version import sys; sys.path.insert(0, '../') # import libraries import raccoon as rc ``` Initialize ---------- ``` # empty DataFrame df = rc.DataFrame() df # with columns and indexes but no data df = rc.DataFrame(col...
github_jupyter
# Global Configuration Options Woodwork contains global configuration options that you can use to control the behavior of certain aspects of Woodwork. This guide provides an overview of working with those options, including viewing the current settings and updating the config values. ## Viewing Config Settings To de...
github_jupyter
This notebook is adapted from a lesson from the 2019 [KIPAC/StatisticalMethods course](https://github.com/KIPAC/StatisticalMethods), (c) 2019 Adam Mantz and Phil Marshall, licensed under the GPLv2. Most of this material is culled from [this note](https://arxiv.org/abs/1901.10522), as well as the methods section of [th...
github_jupyter