code
stringlengths
2.5k
150k
kind
stringclasses
1 value
``` import time import pandas as pd import requests import json5 import matplotlib.pyplot as plt ``` # Loading national data ``` df_nat = pd.read_csv("../Data/Employment_Projections.csv").sort_values('Employment 2030',ascending=False) ``` # Loading CA data ``` df_CA = pd.read_csv("../Data/CA_Long_Term_Occupational_...
github_jupyter
# Training a multi-linear classifier *In this assignment I had to train and test a one layer network with multiple outputs to classify images from the CIFAR-10 dataset. I trained the network using mini-batch gradient descent applied to a cost function that computes cross-entropy loss of the classifier applied to the ...
github_jupyter
``` """ Overriding descriptor (a.k.a. data descriptor or enforced descriptor): # BEGIN DESCR_KINDS_DEMO1 >>> obj = Managed() # <1> >>> obj.over # <2> -> Overriding.__get__(<Overriding object>, <Managed object>, <class Managed>) >>> Managed.over # <3> -> Overriding.__get__(<Overriding object>, N...
github_jupyter
<div class="alert alert-block alert-info" style="margin-top: 20px"> <a href="https://cocl.us/PY0101EN_edx_add_top"> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/PY0101EN/Ad/TopAd.png" width="750" align="center"> </a> </div> <a href="https://cognitiveclass....
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Natural-Language-Pre-Processing" data-toc-modified-id="Natural-Language-Pre-Processing-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Natural Language Pre-Processing</a></span></li><li><span><a href="#Ob...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# Named Entity Recognition on PILOT files using classic SpaCy pipeline MiMoText pilot files are: * Senac_Emigre * Maistre_Voyage * Sade_Aline * Sade_Justine * Bernadin_Paul * Laclos_Liaisons * Retif_Paysanne * Retif_Paysan * Mercier_An * Retif_AntiJustine * Rousseau_Julie * Voltaire_Candide For full list of metadat...
github_jupyter
# Make spectral libraries ``` import sys, os sys.path.append('/Users/simon/git/vimms') sys.path.insert(0,'/Users/simon/git/mass-spec-utils/') from vimms.Common import save_obj from tqdm import tqdm %load_ext autoreload %autoreload 2 library_cache = '/Users/simon/clms_er/library_cache' ``` ## Massbank ``` from mass_s...
github_jupyter
# How to handle WelDX files In this notebook we will demonstrate how to create, read, and update ASDF files created by WelDX. All the needed funcationality is contained in a single class named `WeldxFile`. We are going to show different modes of operation, like working with physical files on your harddrive, and in-memo...
github_jupyter
``` import os import json,cv2 import pandas as pd import numpy as np import torch,torchvision import wandb from torch.nn import * from torch.optim import * import matplotlib.pyplot as plt from tqdm import tqdm from sklearn.model_selection import train_test_split from torchvision.models import * import wandb device = 'c...
github_jupyter
[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) # Particle Filters ``` #format the book %matplotlib notebook from __future__ import division, print_function from book_format import load_style load_style() ``` ## Motivation Here...
github_jupyter
``` from microfaune.detection import RNNDetector import csv import os import glob import pandas as pd from microfaune import audio import scipy.signal as scipy_signal from IPython.display import clear_output from shutil import copyfile weightsPath = "" XCDataPath = "" column_names = ["Folder","Clip","Bird_Label","Globa...
github_jupyter
## Desafio Final 1 Bootcamp Analista de Machine Learning @ IGTI **Objetivos**: * Pré-processamento dos dados. * Detecção de anomalias * Processamento dos dados. * Correlações. * Redução da dimensionalidade. * Algoritmos supervisionados e não supervisionados **Análise com:** * Redução de dimensionalida...
github_jupyter
``` import pandas as pd import numpy as np import os, glob import pandas as pd import numpy as np %matplotlib inline #%matplotlib notebook import seaborn as sns sns.reset_orig() import matplotlib.pyplot as plt from datetime import datetime, timedelta import pdb import requests import sys from importlib import reload...
github_jupyter
I quote myself from the last post: > The number of tests and the probability to obtain at least one significant result increases with the number of variables (plus interactions) included in the Anova. According to Maxwell (2004) this may be a reason for prevalence of underpowered Anova studies. Researchers target some...
github_jupyter
``` def get_Earth_temp(c20,T,cloud_re): totall_cloudAndparticle_reflectfactor=cloud_re ocean_t=T totall_h20=0.0025 #co2单位ppm totall_co2=c20 totall_co2=totall_co2*ma.pow(10,-6) totall_radiation=1.7*10**17 #云及颗粒物对大气的吸收及反射影响比例系数均为0.2,短波反射,长波吸收 ...
github_jupyter
# Fine-tuning and deploying ProtBert Model for Protein Classification using Amazon SageMaker ## Contents 1. [Motivation](#Motivation) 2. [What is ProtBert?](#What-is-ProtBert?) 3. [Notebook Overview](#Notebook-Overview) - [Setup](#Setup) 4. [Dataset](#Dataset) - [Download Data](#Download-Data) 5. [Data Explora...
github_jupyter
# The Autodiff Cookbook [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/jax/blob/master/docs/notebooks/autodiff_cookbook.ipynb) *alexbw@, mattjj@* JAX has a pretty general automatic differentiation system. In this notebook, we'll go throug...
github_jupyter
``` # For Google Colaboratory import sys, os if 'google.colab' in sys.modules: # mount google drive from google.colab import drive drive.mount('/content/gdrive') file_name = 'Task_4.ipynb' import subprocess path_to_file = subprocess.check_output('find . -type f -name ' + str(file_name), shell=T...
github_jupyter
# Introduction to Deep Learning with PyTorch In this notebook, you'll get introduced to [PyTorch](http://pytorch.org/), a framework for building and training neural networks. PyTorch in a lot of ways behaves like the arrays you love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tenso...
github_jupyter
**This notebook is an exercise in the [Pandas](https://www.kaggle.com/learn/pandas) course. You can reference the tutorial at [this link](https://www.kaggle.com/residentmario/grouping-and-sorting).** --- # Introduction In these exercises we'll apply groupwise analysis to our dataset. Run the code cell below to loa...
github_jupyter
1. [`Language`](#language) 1. [`Doc`](#doc) 1. [`Process`](#process) 1. [`Pipeline`](#pipeline) 1. [`MorphosyntacticFeature`](#morpho) 1. [`MorphosyntacticFeatureBundle`](#morpho-bundle) 1. [`Form`](#form) 1. [`DecisionTree`](#dt) # `Language` <a name="language"></a> `Language` are used to identify each language and ...
github_jupyter
# Bulk RNA-seq eQTL analysis This notebook provide a master control on the XQTL workflow so it can works on multiple data collection as proposed. Input: A recipe file,each row is a data collection and with the following column: Theme name of dataset, must be different, each uni_study analysis will...
github_jupyter
<a href="https://colab.research.google.com/github/airctic/icevision-gradio/blob/master/IceApp_pets.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # IceVision Deployment App Example: PETS Dataset This example uses Faster RCNN trained weights using t...
github_jupyter
My beloved [SF Tsunami Master Team](http://sftsunami.org/) had planned a great picnic for this week end. For the second year in a row the plan had to be canceled due to inclement weather. I admit I sneered at the idea of having the picnic the same month as last year, considering that it got canceled once. However, fo...
github_jupyter
# Probability Think Bayes, Second Edition Copyright 2020 Allen B. Downey License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) The foundation of Bayesian statistics is Bayes's Theorem, and the foundation of Bayes's Theorem is conditio...
github_jupyter
<a href="https://colab.research.google.com/github/mowgli28/DS-Unit-1-Sprint-4-Statistical-Tests-and-Experiments/blob/master/Copy_of_LS_DS_144_Real_world_Experiment_Design.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Lambda School Data Science M...
github_jupyter
# 目標:利用openpose和神經網路辨識T-POSE和DAB姿勢。 # 組員: # 應數一 108701011 游能澤 # 應數一 108701034 柯里橫 # 應數一 108701018 池欣霓 # 應數一 108701019 許辰宇 # 分工: # 構想與建設環境:游能澤、柯里橫 # 程式建構:柯里橫 # 由於一直無法使用pyopenpose函式,無法透過 # openpose取得樣本,只好找別人做好的。 # 到https://github.com/burningion/dab-and-tpose-controlled-lights/tree/master/data # 載下作者生成好的數據,開個data資料夾放進...
github_jupyter
# High Molecular Weight Petroleum Pseudocomponents Thermo is a general phase equilibrium engine, and if the user provides enough properties for the components, there is no issue adding your own components. In this basic example below, a made-up extended gas analysis is used to specify a gas consisting of the standard ...
github_jupyter
To participate, you'll need to git clone (or download the .zip from GitHub): https://github.com/mbeyeler/2018-neurohack-skimage You can do that in git using: git clone https://github.com/mbeyeler/2018-neurohack-skimage If you have already cloned the material, please issue `git pull` now and reload the notebook ...
github_jupyter
Grade 5/7 No implementation of Cash-Karp coefficients Implementation of adaptive step is not set by Cash Karp algorithm ## Create a notebook to perform Runge-Kutta integration for multiple coupled variables. ``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np ``` This cell and the one followi...
github_jupyter
# Amazon SageMaker Multi-Model Endpoints using XGBoost With [Amazon SageMaker multi-model endpoints](https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html), customers can create an endpoint that seamlessly hosts up to thousands of models. These endpoints are well suited to use cases where any one o...
github_jupyter
# Continuous Control --- In this notebook, you will learn how to use the Unity ML-Agents environment for the second project of the [Deep Reinforcement Learning Nanodegree](https://www.udacity.com/course/deep-reinforcement-learning-nanodegree--nd893) program. ### 1. Start the Environment We begin by importing the ne...
github_jupyter
If not explicitly mentioned otherwise we assume: - RCP2.6 scenario or the lowest ppm concentration reported (stabilized around 400-420) - Linear phase-out of fossil fuels from model start time (2000-2015) by 2100 - BAU scenario would lead to RCP6 or higher - as it is widely accepcted that in order to obtain RCP2.6, emi...
github_jupyter
``` import xarray as xr import xroms import pandas as pd import numpy as np import matplotlib.pyplot as plt import cmocean.cm as cmo import cartopy ``` # How to select data The [load_data](load_data.ipynb) notebook demonstrates how to load in data, but now how to select out parts of it? ### Load in data More inform...
github_jupyter
## Viscous Inverse Design This notebook demonstrates the use of gradients from viiflow for fully viscous inverse design. It defines a target pressure distribution from one airfoil and, coming from another airfoil, tries to find the shape necessary to arrive at this target pressure. It uses virtual displacements, which ...
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). # Solution Notebook ## Problem: Given two 16 bit numbers, n and m, and two indices i, j, insert m into n such that m starts at bit j and e...
github_jupyter
``` ! pip install annoy nmslib %matplotlib inline ``` # Approximate nearest neighbors in TSNE This example presents how to chain KNeighborsTransformer and TSNE in a pipeline. It also shows how to wrap the packages `annoy` and `nmslib` to replace KNeighborsTransformer and perform approximate nearest neighbors. These ...
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
## Importación de librerías ``` import numpy as np import pandas as pd import re import matplotlib.pyplot as plt import seaborn as sns ``` ## Cargo el dataset ``` data = pd.read_csv('../Data/properatti.csv',index_col=0) #data.head() ``` ## Valores Faltantes del dataset ``` data.isnull().sum() data.loc[data['descri...
github_jupyter
# MAT281 - Laboratorio N°11 <a id='p1'></a> ## I.- Problema 01 Lista de actos delictivos registrados por el Service de police de la Ville de Montréal (SPVM). <img src="http://henriquecapriles.com/wp-content/uploads/2017/02/femina_detenida-1080x675.jpg" width="480" height="360" align="center"/> El conjunto de datos...
github_jupyter
**About this challenge** To assess the impact of climate change on Earth's flora and fauna, it is vital to quantify how human activities such as logging, mining, and agriculture are impacting our protected natural areas. Researchers in Mexico have created the VIGIA project, which aims to build a system for autonomous ...
github_jupyter
ERROR: type should be string, got "https://www.ax.dev/tutorials/\n\n__Tune a CNN on MNIST__\n\n1. [Import](#Import)\n1. [Load MNIST data](#Load-MNIST-data)\n1. [Define a function to optimize](#Define-a-function-to-optimize)\n1. [Run the optimization loop](#Run-the-optimization-loop)\n1. [Plot response surface](#Plot-response-surface)\n1. [Plot best objective as function of the iteration](#Plot-best-objective-as-function-of-the-iteration)\n1. [Train CNN with best hyperparameters and evaluate on test set](#Train-CNN-with-best-hyperparameters-and-evaluate-on-test-set)\n\n# Import\n\n<a id = 'Import'></a>\n\n```\nimport torch\nimport numpy as np\n\nfrom ax.plot.contour import plot_contour\nfrom ax.plot.trace import optimization_trace_single_method\nfrom ax.service.managed_loop import optimize\nfrom ax.utils.notebook.plotting import render, init_notebook_plotting\nfrom ax.utils.tutorials.cnn_utils import load_mnist, train, evaluate\n\ninit_notebook_plotting()\n```\n\n# Load MNIST data\n\n<a id = 'Load-MNIST-data'></a>\n\n```\n#\ntrain_loader, valid_loader, test_loader = load_mnist()\n```\n\n# Define a function to optimize\n\n<a id = 'Define-a-function-to-optimize'></a>\n\n```\n#\ndtype = torch.float\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\ndef train_evaluate(parameterization):\n net = train(\n train_loader=train_loader,\n parameters=parameterization,\n dtype=dtype,\n device=device,\n )\n return evaluate(net=net, data_loader=valid_loader, dtype=dtype, device=device)\n```\n\n# Run the optimization loop\n\n<a id = 'Run-the-optimization-loop'></a>\n\n```\n#\nbest_parameters, values, experiment, model = optimize(\n parameters=[\n {\"name\": \"lr\", \"type\": \"range\", \"bounds\": [1e-6, 0.4], \"log_scale\": True},\n {\"name\": \"momentum\", \"type\": \"range\", \"bounds\": [0.0, 1.0]},\n ],\n evaluation_function=train_evaluate,\n objective_name=\"accuracy\",\n)\n#\nbest_parameters\n#\nmeans, covariances = values\nprint(means)\nprint(covariances)\n```\n\n# Plot response surface\n\n<a id = 'Plot-response-surface'></a>\n\n```\n#\nrender(\n plot_contour(model=model, param_x=\"lr\", param_y=\"momentum\", metric_name=\"accuracy\")\n)\n```\n\n# Plot best objective as function of the iteration\n\n<a id = 'Plot-best-objective-as-function-of-the-iteration'></a>\n\n```\n#\nbest_objectives = np.array(\n [[trial.objective_mean * 100 for trial in experiment.trials.values()]]\n)\nbest_objective_plot = optimization_trace_single_method(\n y=np.maximum.accumulate(best_objectives, axis=1),\n title=\"Model performance vs. # of iters\",\n ylabel=\"Classification accuracy %\",\n)\nrender(best_objective_plot)\n```\n\n# Train CNN with best hyperparameters and evaluate on test set\n\n<a id = 'Train-CNN-with-best-hyperparameters-and-evaluate-on-test-set'></a>\n\n```\n#\ndata = experiment.fetch_data()\ndf = data.df\nbest_arm_name = df.arm_name[df[\"mean\"] == df[\"mean\"].max()].values[0]\nbest_arm = experiment.arms_by_name[best_arm_name]\nbest_arm\n#\nnet = train(\n train_loader=train_loader,\n parameters=best_arm.parameters,\n dtype=dtype,\n device=device,\n)\ntest_accuracy = evaluate(net=net, data_loader=test_loader, dtype=dtype, device=device)\ntest_accuracy\n#\nprint(\"Classification\")\n```\n\n"
github_jupyter
#### SageMaker Pipelines Tuning Step This notebook illustrates how a Hyperparameter Tuning Job can be run as a step in a SageMaker Pipeline. The steps in this pipeline include - * Preprocessing the abalone dataset * Running a Hyperparameter Tuning job * Creating the 2 best models * Evaluating the performance of the ...
github_jupyter
# Ensembles ``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import mean_absolute_error, mean_squared_error from sklearn.linear_model import LinearRegression from sklearn.tree import DecisionTreeRegressor sns.set_theme() rng = np.random.default_rng(42) x = rng.uniform...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter
``` %matplotlib inline import lsqfit from model_avg_paper import * from model_avg_paper.test_tmin import test_vary_tmin_SE p0_test_ME = { 'A0': 2.0, 'E0': 0.8, 'A1': 10.4, 'E1': 1.16, } Nt = 32 noise_params = { 'noise_amp': 0.3, 'noise_samples': 500, 'frac_noise': True, 'cross_val': Fal...
github_jupyter
### Classes Finally we get to classes. I assume you already have some knowledge of classes and OOP in general, so I'll focus on the semantics of creating classes and some of the differences with Java classes. First, the question of visibility. There is no such thing as private or public in Python. Everything is publ...
github_jupyter
# Массивы ``` import numpy import numpy as np a = numpy.zeros((2, 3), dtype=numpy.float32) # ничего не вывело a # выведет а, по оси Y левая координата (внешняя), по оси X правая (внутренняя) a; # не выведет а type(a) a.__class__ a = numpy.zeros((2, 3, 4), dtype=numpy.float32); a # выведет новый а, по оси X правая ...
github_jupyter
# DoWhy: Different estimation methods for causal inference This is quick introduction to DoWhy causal inference library. We will load in a sample dataset and use different methods for estimating causal effect from a (pre-specified)treatment variable to a (pre-specified) outcome variable. First, let us add required pat...
github_jupyter
# **01_PREPROCESSING** Summary: 1. Import and Normalization 2. Split Opinions into Subjects of Interest 3. Text Cleaning 4. Split into Sentences --- ``` from google.colab import drive drive.mount('/content/drive') import sys sys.path.append('/content/drive/My Drive/Università/inforet_prj/') !pip install -U...
github_jupyter
# Plagiarism Detection Model Now that you've created training and test data, you are ready to define and train a model. Your goal in this notebook, will be to train a binary classification model that learns to label an answer file as either plagiarized or not, based on the features you provide the model. This task wi...
github_jupyter
``` import argparse from collections import namedtuple, OrderedDict import itertools import os import numpy as np from typing import Tuple from typing import List from typing import Dict import random from itertools import product import copy import re import random import hashlib import pathlib import json import matp...
github_jupyter
# Data Analysis Here we need a `.csv` file in order to do the desired analysis. ``` import json import numpy as np import matplotlib.pyplot as plt from datetime import datetime import pandas as pd import seaborn as sns df = pd.read_csv('mergedDatalogger_formatted_data_nov1722.csv') df.head() df = pd.read_csv('merged...
github_jupyter
# Forecasting with sktime - appendix: forecasting, supervised regression, and pitfalls in confusing the two This notebook provides some supplementary explanation about the relation between forecasting as implemented in `sktime`, and the very common supervised prediction tasks as supported by `scikit-learn` and similar...
github_jupyter
``` import gym import numpy as np import math ``` Description: There are four designated locations in the grid world indicated by R(ed), G(reen), Y(ellow), and B(lue). When the episode starts, the taxi starts off at a random square and the passenger is at a random location. The taxi drives to the passenger's locat...
github_jupyter
<h1><center>DBSCAN: A macroscopic investigation in Python</center></h1><br> Cluster analysis is an important problem in data analysis. Data scientists use clustering to identify malfunctioning servers, group genes with similar expression patterns, or various other applications. Briefly, clustering is the task of group...
github_jupyter
``` import os, sys sys.path.append(os.path.abspath('../..')) import matplotlib.pyplot as plt import floris.tools as wfct # Initialize the FLORIS interface fi # For basic usage, the florice interface provides a simplified interface to # the underlying classes fi = wfct.floris_interface.FlorisInterface("../../exa...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from PIL import Image from IPython.display import Image as im %matplotlib inline data = pd.read_csv("../data/StockX-Data-Consolidated.csv") data['week_since_release'] = (data['Days Since Release']/7).round(1) data.columns[2...
github_jupyter
### <font color = "darkblue">Updates to Assignment</font> #### If you were working on the older version: * Please click on the "Coursera" icon in the top right to open up the folder directory. * Navigate to the folder: Week 3/ Planar data classification with one hidden layer. You can see your prior work in version...
github_jupyter
# EDA classification aim: When will a project succeed? Which features influence the success of a project? #### assumptions * the higher the goal, the lower the probability for success * the longer the duration the higher the probability for success * the longer the preparation time the higher the probability for ...
github_jupyter
``` %load_ext autoreload %autoreload 2 %matplotlib inline import os import numpy as np import matplotlib.pyplot as plt import wkw import torch from torch.utils import data from torch.utils.tensorboard import SummaryWriter # imports from genem package from genem.util import viewData,gpu # Get the empty gpu gpu.get_empt...
github_jupyter
--- _You are currently looking at **version 1.2** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-data-analysis/resources/0dhYG) course resource._ --- # Assignment 2 - Pand...
github_jupyter
# Neural Networks: Back-propagation Backprop is how the network evaluates its performance during feed forward. Combined with gradient descent, back-propagation helps train the network. # Further reading * [Peter's Notes](http://peterroelants.github.io/posts/neural_network_implementation_part01/) are a bit mathy and...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # AutoML 06: Custom CV Splits and Handling Sparse Data In this example we use the scikit-learn's [20newsgroup](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_20newsgroups.html) to showcase how you can u...
github_jupyter
<table> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="25%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by <a href="http://abu.lu...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Mathematics/TellingTime/telling-time.ip...
github_jupyter
``` import os import sys import math import json import torch import numpy as np import scipy.io from scipy import ndimage import matplotlib # from skimage import io # matplotlib.use("pgf") matplotlib.rcParams.update({ # 'font.family': 'serif', 'font.size':10, }) from matplotlib import pyplot as plt import py...
github_jupyter
``` import numpy as np import pandas as pd pd.set_option('display.max_columns', None) pd.set_option('display.max_rows', 10) import warnings import logging import os import onnxruntime from azureml.automl.runtime.onnx_convert import OnnxInferenceHelper # from azureml.automl.core.onnx_convert import OnnxInferenceHelper...
github_jupyter
``` from random import randint from timeit import default_timer size = 100 mat_1 = [[randint(0, size) for _ in range(size)] for _ in range(size)] mat_2 = [[randint(0, size) for _ in range(size)] for _ in range(size)] result = [[0 for _ in range(size)] for _ in range(size)] ``` ### 1. Serial Implementation ``` startti...
github_jupyter
``` #%%appyter init from appyter import magic magic.init(lambda _=globals: _()) ``` ### Load all necessary packages ``` import rpy2 import rpy2.robjects as robjects import rpy2.robjects.packages as rpackages from rpy2.robjects import numpy2ri, pandas2ri import rpy2.ipython.html rpy2.ipython.html.init_printing() im...
github_jupyter
<img src='../../../../img/EU-Copernicus-EUM_3Logos.png' alt='Logo EU Copernicus EUMETSAT' align='right' width='50%'></img> <br> # 04 - Assignment - Solution ### About > So far, we analysed Aerosol Optical Depth from different types of data (satellite, model-based and observations) for a single dust event. Let us now...
github_jupyter
``` import zarr from pyprojroot import here import pandas as pd import numpy as np import allel import yaml import matplotlib.pyplot as plt import functools import seaborn as sns sns.set_context('paper') sns.set_style('darkgrid') import dask.array as da import scipy.interpolate import scipy.stats import petl as etl imp...
github_jupyter
# 2. Modelling SVR Linear --- ``` ## load modules and run mlflow_logging.ipynb to get function to track model information on MLFLow import sys sys.path.append("..") import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error, r2_score from...
github_jupyter
<h1> <b>Homework 1</b></h1> <i>Alejandro J. Rojas<br> ale@ischool.berkeley.edu<br> W261: Machine Learning at Scale<br> Week: 01<br> Jan 21, 2016</i></li> <h2>HW1.0.0.</h2> Define big data. Provide an example of a big data problem in your domain of expertise. The term big data is asoociated to datasets that cannot be ...
github_jupyter
# Section 1: Preprocessing ## Behavior Analysis ### Generate trial regressors ``` import os import numpy as np from pandas import concat, read_csv from scipy.stats import gamma def normalize(arr): return (arr - arr.min()) / (arr.max() - arr.min()) root_dir = '/space/sophia/2/users/EMOTE-DBS/afMSIT/behavior' subjects ...
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
##### 1 ![1](http://7xqhfk.com1.z0.glb.clouddn.com/dlfornlp/lec09/0001.jpg) ##### 2 ![2](http://7xqhfk.com1.z0.glb.clouddn.com/dlfornlp/lec09/0002.jpg) ##### 3 ![3](http://7xqhfk.com1.z0.glb.clouddn.com/dlfornlp/lec09/0003.jpg) ##### 4 ![4](http://7xqhfk.com1.z0.glb.clouddn.com/dlfornlp/lec09/0004.jpg) ##### 5 ...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split dtypes = {'nt_fp': str, 'event_date': str, 'day_of_week': int, 'a_month': int, 'hour_o...
github_jupyter
# Azure Kubernetes Service (AKS) Deep MNIST In this example we will deploy a tensorflow MNIST model in the Azure Kubernetes Service (AKS). This tutorial will break down in the following sections: 1) Train a tensorflow model to predict mnist locally 2) Containerise the tensorflow model with our docker utility 3) Sen...
github_jupyter
# Lab 1: Markov Decision Processes - Problem 1 ## Lab Instructions All your answers should be written in this notebook. You shouldn't need to write or modify any other files. **You should execute every block of code to not miss any dependency.** *This project was developed by Peter Chen, Rocky Duan, Pieter Abbeel...
github_jupyter
# Image Classification with Logistic Regression from Scratch with NumPy Welcome to another jupyter notebook of implementing machine learning algorithms from scratch using only NumPy. This time we will be implementing a different version of logistic regression for a simple image classification task. I've already done a...
github_jupyter
## Script S5 Convert from jekyll title formato into origin url. **Target**: http://127.0.0.1:4000/2021/03/20/Fluid-Typography-with-CSS-Clamp()-is-My-New-Favorite-Thing-DEV-Community.html **File Path**: 2021-03-20-Fluid-Typography-with-CSS-Clamp()-is-My-New-Favorite Thing---DEV-Community.md **Title**: Fluid Typogra...
github_jupyter
# Инициализация ``` #@markdown - **Монтирование GoogleDrive** from google.colab import drive drive.mount('GoogleDrive') # #@markdown - **Размонтирование** # !fusermount -u GoogleDrive ``` # Область кодов ``` #@title Приближение с помощью кривых { display-mode: "both" } # Curve fitting # В программе реализовано приб...
github_jupyter
Lecture 8<br> Day: wednesday<br> Date: Oct 06th 2021 ### Problem Solve: ``` import numpy as np import os import random Quiz = np.random.randint(0,16,size =40) print(Quiz) Assignment = np.random.randint(0,51, size = 50) print(Assignment) Mid= np.random.randint(0,81, size= 80) print(Mid) Final = np.random.randint(0, 15...
github_jupyter
``` # import project Libraries import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Load the data and create pandas DataFrame. df = pd.read_csv('./My_data/Food_enforcement_data.csv',encoding= 'unic...
github_jupyter
# Machine Learning application: Forecasting wind power. Using alternative energy for social & enviromental Good <table> <tr><td> <img src="https://github.com/dmatrix/mlflow-workshop-part-3/raw/master/images/wind_farm.jpg" alt="Keras NN Model as Logistic regression" width="800"> </td></tr> </table> I...
github_jupyter
# Clone the repo ``` # # Clone the entire repo. # !git clone -b master --single-branch https://github.com/NewLuminous/Zalo-Vietnamese-Wiki-QA.git zaloqa # %cd zaloqa ``` # Install & load libraries ``` import modeling import evaluation %matplotlib inline import warnings warnings.filterwarnings('ignore') # To reload ...
github_jupyter
<!--NAVIGATION--> <!--NAVIGATION--> <!-- markdownlint-disable --> <h2 align="center" style="font-family:verdana;font-size:150%"> <b>S</b>equencing <b>A</b>nalysis and <b>D</b>ata Library for <b>I</b>mmunoinformatics <b>E</b>xploration <br><br>Demonstration for AIRR-C 2022</h2> <div align="center"> <img src="https://s...
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
# TOC 1. [Settings](#Settings) 2. [Get the task list](#Get-the-task-list) 3. [Upload annotations](#Upload-annotations) 4. [Get annotation results](#Get-annotation-results) 5. [Get annotation detail log](#Get-annotation-detail-log) # Settings ``` import init import pandas as pd import json import requests host = 'http...
github_jupyter
# Real-world use-cases at scale! # Imports Let's start with imports. ``` import sys sys.path.append("gpu_bdb_runner.egg") import gpu_bdb_runner as gpubdb import os import inspect from highlight_code import print_code config_options = {} config_options['JOIN_PARTITION_SIZE_THRESHOLD'] = os.environ.get("JOIN_PARTITION...
github_jupyter
``` import time notebookstart= time.time() import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import os import gc # Models Packages from sklearn import metrics from sklearn.metrics import mean_squared_error from sklearn import feature_selection from sklearn.model_...
github_jupyter
``` %pylab inline import sys import numpy as np import tensorflow as tf import tensorflow_probability as tfp import arviz as az import matplotlib.pyplot as plt from matplotlib import rcParams import matplotlib.font_manager as fm rcParams['font.family'] = 'sans-serif' sys.path.append('../') from mederrata_spmf impor...
github_jupyter
Final models with hyperparameters tuned for Logistics Regression and XGBoost with all features. ``` #Import the libraries import pandas as pd import numpy as np from tqdm import tqdm from sklearn import linear_model, metrics, preprocessing, model_selection from sklearn.preprocessing import StandardScaler import xgboo...
github_jupyter
Imaging you are a metal toy producer and wan't to package your product automaticaly. In this case it would be nice to categorise your products without much effort. In this example we use a pretrained model ('Xception' with 'imagenet' dataset). ## Import dependencies ``` import warnings warnings.filterwarnings('ignor...
github_jupyter
``` %matplotlib inline ``` # Linear classifier on sensor data with plot patterns and filters Decoding, a.k.a MVPA or supervised machine learning applied to MEG and EEG data in sensor space. Fit a linear classifier with the LinearModel object providing topographical patterns which are more neurophysiologically inter...
github_jupyter
``` # CHALLENGE PROBLEM: # # Use your check_sudoku function as the basis for solve_sudoku(): a # function that takes a partially-completed Sudoku grid and replaces # each 0 cell with an integer in the range 1..9 in such a way that the # final grid is valid. # # There are many ways to cleverly solve a partially-complet...
github_jupyter
``` import librosa SAMPLE_1_FILE = 'data/sample1.wav' SAMPLE_2_FILE = 'data/sample2.wav' filename = librosa.example('nutcracker') print(filename) # y, sr = librosa.load(filename) y, sr = librosa.load(SAMPLE_1_FILE) print('waveform (y): ', type(y), len(y)) print(f'sampling rate {sr}') # beat tracker tempo, beat_frame...
github_jupyter
``` import torch import sim_data_gen import numpy as np import dr_crn import matplotlib.pyplot as plt n_feat = 5 def get_mmd(x_train): feat = x_train[:, :n_feat] causes = x_train[:, n_feat:] cause_ind = sim_data_gen.cause_to_num(causes) uniques, counts = np.unique(cause_ind, return_counts=True) uniq...
github_jupyter