code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# Automate loan approvals with Business rules in Apache Spark and Scala ### Automating at scale your business decisions in Apache Spark with IBM ODM 8.9.2 This Scala notebook shows you how to execute locally business rules in DSX and Apache Spark. You'll learn how to call in Apache Spark a rule-based decision servic...
github_jupyter
``` ##World Map Plotly #Import Plotly Lib and Set up Credentials with personal account !pip install plotly import plotly plotly.tools.set_credentials_file(username='igleonaitis', api_key='If6Wh3xWNmdNioPzOZZo') plotly.tools.set_config_file(world_readable=True, sharing='public') import ...
github_jupyter
[this doc on github](https://github.com/dotnet/interactive/tree/master/samples/notebooks/fsharp/Samples) # Machine Learning over House Prices with ML.NET ### Reference the packages ``` #r "nuget:Microsoft.ML,1.4.0" #r "nuget:Microsoft.ML.AutoML,0.16.0" #r "nuget:Microsoft.Data.Analysis,0.2.0" #r "nuget: XPlot.Plo...
github_jupyter
ML Course, Bogotá, Colombia (&copy; Josh Bloom; June 2019) ``` %run ../talktools.py ``` # Featurization and Dirty Data (and NLP) <img src="imgs/workflow.png"> Source: [V. Singh](https://www.slideshare.net/hortonworks/data-science-workshop) ### Notes: Biased workflow :) * Labels → Answer * Feature extraction. Tak...
github_jupyter
# Calibration of non-isoplanatic low frequency data This uses an implementation of the SageCAL algorithm to calibrate a simulated SKA1LOW observation in which sources inside the primary beam have one set of calibration errors and sources outside have different errors. In this example, the peeler sources are held fixe...
github_jupyter
## Multiple linear regression **For Table 3 of the paper** Cell-based QUBICC R2B5 model ``` from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from tensorflow.keras import backend as K from tensorflow.keras.regularizers import l1_l2 import tensorflow as tf import tensorf...
github_jupyter
<a href="https://colab.research.google.com/github/jantic/DeOldify/blob/master/ImageColorizerColab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### **<font color='blue'> Artistic Colorizer </font>** #◢ DeOldify - Colorize your own photos! ####**...
github_jupyter
<div style="width: 100%; clear: both;"> <div style="float: left; width: 50%;"> <img src="http://www.uoc.edu/portal/_resources/common/imatges/marca_UOC/UOC_Masterbrand.jpg" align="left"> </div> <div style="float: right; width: 50%;"> <p style="margin: 0; padding-top: 22px; text-align:right;">M2.859 · Visualización de da...
github_jupyter
``` # This Python file uses the following encoding: utf-8 # Analise.ipynb # Github:@WeDias # MIT License # # Copyright (c) 2020 Wesley R. Dias # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softw...
github_jupyter
# Pyber Analysis ### 4.3 Loading and Reading CSV files ``` # Add Matplotlib inline magic command %matplotlib inline # Dependencies and Setup import matplotlib.pyplot as plt import pandas as pd import matplotlib.dates as mdates # File to Load (Remember to change these) city_data_to_load = "Resources/city_data.csv" ri...
github_jupyter
# Estatísticas descritivas e Visualização de Dados Este notebook é responsável por mostrar as estatíscas descritivas da base dados com visualizações. Será analisado o comportamento de algumas características que são cruciais na compra/venda de veículos usados. ``` from Utils import * from tqdm import tqdm from matplot...
github_jupyter
# Airbnb - Rio de Janeiro * Download [data](http://insideairbnb.com/get-the-data.html) * We downloaded `listings.csv` from all monthly dates available ## Questions 1. What was the price and supply behavior before and during the pandemic? 2. Does a title in English or Portuguese impact the price? 3. What features corre...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/real-itu/modern-ai-course/blob/master/lecture-04/lab.ipynb) # Lab 4 - Math ### Stats You're given the following dataset: ``` import random random.seed(0) x = [random.gauss(0, 1)**2 for _ in range(...
github_jupyter
``` %pylab inline from ipyparallel import Client, error cluster=Client(profile="mpi") view=cluster[:] view.block=True try: from openmdao.utils.notebook_utils import notebook_mode except ImportError: !python -m pip install openmdao[notebooks] ``` ```{note} This feature requires MPI, and may not be able to be r...
github_jupyter
Lambda School Data Science *Unit 2, Sprint 1, Module 4* --- # Logistic Regression - do train/validate/test split - begin with baselines for classification - express and explain the intuition and interpretation of Logistic Regression - use sklearn.linear_model.LogisticRegression to fit and interpret Logistic Regressi...
github_jupyter
<a href="https://colab.research.google.com/github/harvardnlp/pytorch-struct/blob/master/notebooks/Unsupervised_CFG.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install -qqq torchtext -qqq pytorch-transformers dgl !pip install -qqqU git+h...
github_jupyter
# Sklearn ## sklearn.linear_model ``` from matplotlib.colors import ListedColormap from sklearn import cross_validation, datasets, linear_model, metrics import numpy as np %pylab inline ``` ### Линейная регрессия #### Генерация данных ``` data, target, coef = datasets.make_regression(n_features = 2, n_informative...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import functools import time ``` # Questão 1 Resolva o sistema linear $Ax = b$ em que $ A = \begin{bmatrix} 9. & −4. & 1. & 0. & 0. & 0. & 0. \\ −4. & 6. & −4. & 1. & 0. & 0. & 0. \\ 1. & −4. & 6. & −4. & 1. & 0. & 0. \\ 0. & 1. & −4. & 6. & −4. & 1. & 0. \\ \v...
github_jupyter
# Assignment 9: Implement Dynamic Programming In this exercise, we will begin to explore the concept of dynamic programming and how it related to various object containers with respect to computational complexity. ## Deliverables: 1) Choose and implement a Dynamic Programming algorithm in Python, make sure yo...
github_jupyter
# Chapter 3 Questions #### 3.1 Form dollar bars for E-mini S&P 500 futures: 1. Apply a symmetric CUSUM filter (Chapter 2, Section 2.5.2.1) where the threshold is the standard deviation of daily returns (Snippet 3.1). 2. Use Snippet 3.4 on a pandas series t1, where numDays=1. 3. On those sampled features, apply the tri...
github_jupyter
![Python Logo](img/Python_logo.png) # If I have seen further it is by standing on the shoulders of Giants (Newton??) ![Python Logo](img/python-loc.png) (https://www.openhub.net/) ![Python Logo](img/numpy-loc.png) (https://www.openhub.net/) ![Python Logo](img/scipy-loc.png) (https://www.openhub.net/) ![Python Logo]...
github_jupyter
# T1566 - Phishing Adversaries may send phishing messages to elicit sensitive information and/or gain access to victim systems. All forms of phishing are electronically delivered social engineering. Phishing can be targeted, known as spearphishing. In spearphishing, a specific individual, company, or industry will be t...
github_jupyter
# Import Libraries ``` from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms ``` ## Data Transformations We first start with defining our data transformations. We need to think what our data is...
github_jupyter
# Document AI Specialized Parser with HITL This notebook shows you how to use Document AI's specialized parsers ex. Invoice, Receipt, W2, W9, etc. and also shows Human in the Loop (HITL) output for supported parsers. ``` # Install necessary Python libraries and restart your kernel after. !python -m pip install -r ../r...
github_jupyter
Notebook which focuses on the randomly generated data sets and the performance comparison of algorithms on it ``` from IPython.core.display import display, HTML display(HTML('<style>.container {width:100% !important;}</style>')) %matplotlib notebook import matplotlib.pyplot as plt import numpy as np import torch from...
github_jupyter
``` %matplotlib inline ``` 02: Fitting Power Spectrum Models ================================= Introduction to the module, beginning with the FOOOF object. ``` # Import the FOOOF object from fooof import FOOOF # Import utility to download and load example data from fooof.utils.download import load_fooof_data # Dow...
github_jupyter
## Discretisation Discretisation is the process of transforming continuous variables into discrete variables by creating a set of contiguous intervals that span the range of the variable's values. Discretisation is also called **binning**, where bin is an alternative name for interval. ### Discretisation helps handl...
github_jupyter
# MCIS6273 Data Mining (Prof. Maull) / Fall 2021 / HW0 **This assignment is worth up to 20 POINTS to your grade total if you complete it on time.** | Points <br/>Possible | Due Date | Time Commitment <br/>(estimated) | |:---------------:|:--------:|:---------------:| | 20 | Wednesday, Sep 1 @ Midnight | _up to_ 20 ho...
github_jupyter
## Obligatory imports ``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns import sklearn import matplotlib %matplotlib inline matplotlib.rcParams['figure.figsize'] = (12,8) matplotlib.rcParams['font.size']=20 matplotlib.rcParams['lines.linewidth']=4 matplotlib.rcParams['xtick.major.size'] = 10...
github_jupyter
<center> <h1>Numerical Methods -- Assignment 5</h1> </center> ## Problem1 -- Energy density The matter and radiation density of the universe at redshift $z$ is $$\Omega_m(z) = \Omega_{m,0}(1+z)^3$$ $$\Omega_r(z) = \Omega_{r,0}(1+z)^4$$ where $\Omega_{m,0}=0.315$ and $\Omega_r = 9.28656 \times 10^{-5}$ ### (a) Plot...
github_jupyter
``` import matplotlib matplotlib.use('nbagg') import matplotlib.animation as anm import matplotlib.pyplot as plt import math import matplotlib.patches as patches import numpy as np class World: ### fig:world_init_add_timespan (1-5行目) def __init__(self, time_span, time_interval, debug=False): self.obj...
github_jupyter
# Exploratory Data Analysis ``` from pyspark import SparkContext, SparkConf from pyspark.sql import SparkSession from pyspark.sql.types import * from pyspark.sql import functions as F spark = SparkSession.builder.master('local[1]').appName("Jupyter").getOrCreate() sc = spark.sparkContext #test if this works import pa...
github_jupyter
``` import pandas as pd import os import csv import numpy as np import seaborn as sns import matplotlib.pyplot as plt data_dir = '/home/steffi/dev/data/ExpW/ExpwCleaned' labels_csv = '/home/steffi/dev/data/ExpW/labels_clean.csv' expw = pd.read_csv(labels_csv, delimiter=',') expw.head() expressions = expw.iloc[:, 2:] ex...
github_jupyter
# T M V A_Tutorial_Classification_Tmva_App TMVA example, for classification with following objectives: * Apply a BDT with TMVA **Author:** Lailin XU <i><small>This notebook tutorial was automatically generated with <a href= "https://github.com/root-project/root/blob/master/documentation/doxygen/converttonotebo...
github_jupyter
# Data Processing ``` %pylab inline matplotlib.rcParams['figure.figsize'] = [20, 10] import pandas as pd import numpy as np import warnings warnings.filterwarnings("ignore") # All variables we concern about columnNames1 = ["releaseNum", "1968ID", "personNumber", "gender", "marriage", "familyNumber", "sequenceNum", ...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import retry import seaborn as sns %matplotlib inline current_work...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from matplotlib import rcParams import seaborn as sns %matplotlib inline rcParams['figure.figsize'] = 10, 8 sns.set_style('whitegrid') num = 50 xv = np.linspace(-500,400,num) yv = np.linspace(-500,400,num) X,Y = np.meshgrid(xv,yv) # frist X,Y a = 8.2 intervalo...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Tower-of-Hanoi" data-toc-modified-id="Tower-of-Hanoi-1">Tower of Hanoi</a></span></li><li><span><a href="#Learning-Outcomes" data-toc-modified-id="Learning-Outcomes-2">Learning Outcomes</a></span></li><li><...
github_jupyter
# Auto detection to main + 4 cropped images **Pipeline:** 1. Load cropped image csv file 2. Apply prediction 3. Save prediction result back to csv file * pred_value * pred_cat * pred_bbox ``` # Import libraries %matplotlib inline from pycocotools.coco import COCO from keras.models import load_model # from utils.utils...
github_jupyter
``` from egocom import audio from egocom.multi_array_alignment import gaussian_kernel from egocom.transcription import async_srt_format_timestamp from scipy.io import wavfile import os import numpy as np import pandas as pd from sklearn.metrics import accuracy_score from egocom.transcription import write_subtitles def ...
github_jupyter
``` from torchvision.models import * import wandb from sklearn.model_selection import train_test_split import os,cv2 import numpy as np import matplotlib.pyplot as plt from torch.nn import * import torch,torchvision from tqdm import tqdm device = 'cuda' PROJECT_NAME = 'Intel-Image-Classification-V2' def load_data(): ...
github_jupyter
Caníbales y misioneros mediante búsqueda primero en anchura. ``` from copy import deepcopy from collections import deque import sys # (m, c, b) hace referencia a el número de misioneros, canibales y el bote class Estado(object): def __init__(self, misioneros, canibales, bote): self.misioneros = misioneros s...
github_jupyter
# Running and Plotting Coeval Cubes The aim of this tutorial is to introduce you to how `21cmFAST` does the most basic operations: producing single coeval cubes, and visually verifying them. It is a great place to get started with `21cmFAST`. ``` %matplotlib inline import matplotlib.pyplot as plt import os # We chang...
github_jupyter
``` import numpy as np import xarray as xr import scipy.ndimage as ndimage import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import metpy.calc as mpcalc from metpy.units import units from datetime import datetime # Get dataset from NOMAD...
github_jupyter
``` # Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
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
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import statsmodels.api as sm import pylab df1 = pd.read_csv('data/power_act_.csv') ``` 'power_act_.csv' In total we have 18 columns and 64328 rows Coulmns names : ['dt_start_utc', 'power_act_21', 'power_act_24', 'p...
github_jupyter
# Determinant Quantum Monte Carlo ## 1 Hubbard model The Hubbard model is defined as \begin{align} \label{eq:ham} \tag{1} H &= -\sum_{ij\sigma} t_{ij} \left( \hat{c}_{i\sigma}^\dagger \hat{c}_{j\sigma} + hc \right) + \sum_{i\sigma} (\varepsilon_i - \mu) \hat{n}_{i\sigma} + U \sum_{i} \left( \hat{n}...
github_jupyter
``` import os.path from collections import Counter from glob import glob import inspect import os import pickle import sys from cltk.corpus.latin.phi5_index import PHI5_INDEX from cltk.corpus.readers import get_corpus_reader from cltk.stem.latin.j_v import JVReplacer from cltk.stem.lemma import LemmaReplacer from cltk...
github_jupyter
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_07_2_Keras_gan.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # T81-558: Applications of Deep Neural Networks **Module 7: Generative Advers...
github_jupyter
``` from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D from keras.utils i...
github_jupyter
# Compute forcing for 1%CO2 data ``` import os import numpy as np import pandas as pd import matplotlib.pyplot as plt filedir1 = '/Users/hege-beatefredriksen/OneDrive - UiT Office 365/Data/CMIP5_globalaverages/Forcingpaperdata' storedata = False # store anomalies in file? storeforcingdata = False createnewfile = Fals...
github_jupyter
# How to do video classification In this tutorial, we will show how to train a video classification model in Classy Vision. Given an input video, the video classification task is to predict the most probable class label. This is very similar to image classification, which was covered in other tutorials, but there are ...
github_jupyter
# Bayesian Parametric Regression Notebook version: 1.5 (Sep 24, 2019) Author: Jerónimo Arenas García (jarenas@tsc.uc3m.es) Jesús Cid-Sueiro (jesus.cid@uc3m.es) Changes: v.1.0 - First version v.1.1 - ML Model selection included v.1.2 - Some typos corrected ...
github_jupyter
# Goals ### 1. Learn to implement Resnet V2 Block (Type - 1) using monk - Monk's Keras - Monk's Pytorch - Monk's Mxnet ### 2. Use network Monk's debugger to create complex blocks ### 3. Understand how syntactically different it is to implement the same using - Traditional Keras - Traditiona...
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> # Equations of General Relativistic Hydrodynamics (GRHD) #...
github_jupyter
``` from misc import HP import argparse import random import time import pickle import copy import SYCLOP_env as syc from misc import * import sys import os import cv2 import argparse import tensorflow.keras as keras from keras_networks import rnn_model_102, rnn_model_multicore_201, rnn_model_multicore_202 from curric...
github_jupyter
### K-Means ``` class Kmeans: """K-Means Clustering Algorithm""" def __init__(self, k, centers=None, cost=None,iter=None, labels=None, max_iter = 1000): """Initialize Parameters""" self.max_iter = max_iter self.k = k self.centers = np.empty(1) self.cost = [...
github_jupyter
``` import os import pandas as pd import numpy as np import plotly.graph_objects as go from sklearn.preprocessing import MinMaxScaler from plotly.subplots import make_subplots df_dict = {} for path in os.listdir('Data/FINAL INDEX'): var = path.split('.')[0] vars()[var] = pd.read_csv('Data/FINAL INDEX/' + path,...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt ``` # 1. ## a) ``` def simetrica(A): "Verifică dacă matricea A este simetrică" return np.all(A == A.T) def pozitiv_definita(A): "Verifică dacă matricea A este pozitiv definită" for i in range(1, len(A) + 1): d_minor = np.linalg.det(A[:i...
github_jupyter
# Input data representation as 2D array of 3D blocks > An easy way to represent input data to neural networks or any other machine learning algorithm in the form of 2D array of 3D-blocks - toc: false - branch: master - badges: true - comments: true - categories: [machine learning, jupyter, graphviz] - image: images/ar...
github_jupyter
``` import jupman; jupman.init() ``` # Jupman Tests Tests and cornercases. The page Title has one sharp, the Sections always have two sharps. ## Sezione 1 bla bla ## Sezione 2 Subsections always have three sharps ### Subsection 1 bla bla ### Subsection 2 bla bla ## Quotes > I'm quoted with **greater than**...
github_jupyter
## Load Dataset ``` import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns # 노트북 안에 그래프를 그리기 위해 %matplotlib inline # 그래프에서 마이너스 폰트 깨지는 문제에 대한 대처 mpl.rcParams['axes.unicode_minus'] = False import warnings warnings.filterwarnings('ignore') train = pd.rea...
github_jupyter
# From Variables to Classes ## A short Introduction Python - as any programming language - has many extensions and libraries at its disposal. Basically, there exist libraries for everything. <center>But what are **libraries**? </center> Basically, **libraries** are a collection of methods (_small pieces of co...
github_jupyter
``` # Dependencies from bs4 import BeautifulSoup as bs import requests import pymongo from splinter import Browser from webdriver_manager.chrome import ChromeDriverManager import pandas as pd ``` ``` #setup splinter executable_path = {'executable_path': ChromeDriverManager().install()} browser = Browser('chrome', **ex...
github_jupyter
# Visualize Counts for the three classes The number of volume-wise predictions for each of the three classes can be visualized in a 2D-space (with two classes as the axes and the remained or class1-class2 as the value of the third class). Also, the percentage of volume-wise predictions can be shown in a modified pie...
github_jupyter
``` #default_exp torch_core #export from fastai2.imports import * from fastai2.torch_imports import * from nbdev.showdoc import * from PIL import Image #export _all_ = ['progress_bar','master_bar'] #export if torch.cuda.is_available(): if torch.cuda.current_device()==0: def_gpu = int(os.environ.get('DEFAULT...
github_jupyter
# Soft Computing ## Vežba 1 - Digitalna slika, computer vision, OpenCV ### OpenCV Open source biblioteka namenjena oblasti računarske vizije (eng. computer vision). Dokumentacija dostupna <a href="https://opencv.org/">ovde</a>. ### matplotlib Plotting biblioteka za programski jezik Python i njegov numerički paket ...
github_jupyter
## <center>Ensemble models from machine learning: an example of wave runup and coastal dune erosion</center> ### <center>Tomas Beuzen<sup>1</sup>, Evan B. Goldstein<sup>2</sup>, Kristen D. Splinter<sup>1</sup></center> <center><sup>1</sup>Water Research Laboratory, School of Civil and Environmental Engineering, UNSW Sy...
github_jupyter
``` import torch from torch import nn import torch.nn.functional as F from torchvision import datasets, transforms import matplotlib.pyplot as plt import numpy as np # Define a transform to normalize the data - change the range of values in the image [histogram stretch] transform = transforms.Compose([transforms.ToTen...
github_jupyter
``` !wget https://LoanStats_2019Q1.csv.zip !wget https://LoanStats_2019Q2.csv.zip !wget https://LoanStats_2019Q3.csv.zip !wget https://LoanStats_2019Q4.csv.zip //LoanStats_2020Q1.csv.zip import numpy as np import pandas as pd from pathlib import Path from collections import Counter from sklearn.model_selection import t...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '' # !git pull import tensorflow as tf import malaya_speech import malaya_speech.train from malaya_speech.train.model import fastspeech2 import numpy as np _pad = 'pad' _start = 'start' _eos = 'eos' _punctuation = "!'(),.:;? " _special = '-' _letters = 'ABCDEFGHIJKLMN...
github_jupyter
# Subplots ``` %matplotlib notebook import matplotlib.pyplot as plt import numpy as np plt.subplot? plt.figure() # subplot with 1 row, 2 columns, and current axis is 1st subplot axes plt.subplot(1, 2, 1) linear_data = np.array([1,2,3,4,5,6,7,8]) plt.plot(linear_data, '-o') exponential_data = linear_data**2 # sub...
github_jupyter
``` %pylab inline %config InlineBackend.figure_format = 'retina' from ipywidgets import interact import scipy import scipy.special ``` # Question #1 Assume that $f(\cdot)$ is an infinitely smooth and continuous scalar function. Suppose that $a\in \mathbb{R}$ is a given constant in the domain of the function $f$ and th...
github_jupyter
# Building and using data schemas for computer vision This tutorial illustrates how to use raymon profiling to guard image quality in your production system. The image data is taken from [Kaggle](https://www.kaggle.com/ravirajsinh45/real-life-industrial-dataset-of-casting-product) and is courtesy of PILOT TECHNOCAST, S...
github_jupyter
``` pip install pandas pip install numpy pip install sklearn pip install matplotlib from sklearn import cluster from sklearn.cluster import KMeans import pandas as pd import numpy as np from matplotlib import pyplot as plt df = pd.read_csv("sample_stocks.csv") df df.describe() df.head() df.info() # x = df['returns'] # ...
github_jupyter
This notebook demonstrates how to perform regression analysis using scikit-learn and the watson-machine-learning-client package. Some familiarity with Python is helpful. This notebook is compatible with Python 3.7. You will use the sample data set, **sklearn.datasets.load_boston** which is available in scikit-learn, ...
github_jupyter
# Copyright Netherlands eScience Center <br> ** Function : Computing AMET with Surface & TOA flux** <br> ** Author : Yang Liu ** <br> ** First Built : 2019.08.09 ** <br> ** Last Update : 2019.09.09 ** <br> Description : This notebook aims to compute AMET with TOA/surface flux fields from NorESM model. T...
github_jupyter
``` import numpy as np import sklearn import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline # Load the Boston Housing Dataset from sklearn from sklearn.datasets import load_boston boston_dataset = load_boston() print(boston_dataset.keys()) print(boston_dataset.DESCR) # Create t...
github_jupyter
``` from IPython.core.display import display, HTML import pandas as pd import numpy as np import copy import os %load_ext autoreload %autoreload 2 import sys sys.path.insert(0,"/local/rankability_toolbox") PATH_TO_RANKLIB='/local/ranklib' from numpy import ix_ import numpy as np D = np.loadtxt(PATH_TO_RANKLIB+"/prob...
github_jupyter
``` # Annulus_Simple_Matplotlib # mjm June 20, 2016 # # solve Poisson eqn with Vin = V0 and Vout = 0 for an annulus # with inner radius r1, outer radius r2 # Vin = 10, Vout =0 # from dolfin import * from mshr import * # need for Circle object to make annulus import numpy as np import matplotlib.pyplot as plt import m...
github_jupyter
# Handwritten Digits Recognition 02 - TensorFlow From the table below, we see that MNIST database is way larger than scikit-learn database, which we modelled in the previous notebook. Both number of samples and size of each sample are significantly higher. The good new is that, with TensorFlow and Keras, we can build ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from sklearn.metrics import mean_squared_error, accuracy_score, f1_score, r2_score, explained_variance_score, roc_auc_score from sklearn.preprocessing import MinMaxScale...
github_jupyter
``` import pandas as pd import numpy as np np.warnings.filterwarnings('ignore') import xarray as xr from metpy.units import units from metpy.plots import SkewT import metpy.calc as mpcalc import matplotlib.pyplot as plt import seaborn as sns import sys sys.path.append('/home/franzihe/Documents/Python/Thesis/') import ...
github_jupyter
# Lets play with a funny fake dataset. This dataset contains few features and it has an dependent variable which says if we are going ever to graduate or not Importing few libraries ``` from sklearn import datasets,model_selection import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import numpy...
github_jupyter
# Linear Regression Implementation from Scratch :label:`sec_linear_scratch` Now that you understand the key ideas behind linear regression, we can begin to work through a hands-on implementation in code. In this section, (**we will implement the entire method from scratch, including the data pipeline, the model, the l...
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
# Mask R-CNN - Train on Nuclei Dataset (updated from train_shape.ipynb) This notebook shows how to train Mask R-CNN on your own dataset. To keep things simple we use a synthetic dataset of shapes (squares, triangles, and circles) which enables fast training. You'd still need a GPU, though, because the network backbon...
github_jupyter
<h1>Índice<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Socioeconomic-data-validation" data-toc-modified-id="Socioeconomic-data-validation-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Socioeconomic data validation</a></span><ul class="toc-item"><li><ul class="toc-item...
github_jupyter
### Intro & Resources * [Sutton/Barto ebook](https://goo.gl/7utZaz); [Silver online course](https://goo.gl/AWcMFW) ### Learning to Optimize Rewards * Definitions: software *agents* make *observations* & take *actions* within an *environment*. In return they can receive *rewards* (positive or negative). ### Policy Sea...
github_jupyter
# SQLAlchemy Homework - Surfs Up! ### Before You Begin 1. Create a new repository for this project called `sqlalchemy-challenge`. **Do not add this homework to an existing repository**. 2. Clone the new repository to your computer. 3. Add your Jupyter notebook and `app.py` to this folder. These will be the main scr...
github_jupyter
###### Text provided under a Creative Commons Attribution license, CC-BY. Code under MIT license. (c)2014 Lorena A. Barba, Olivier Mesnard. Thanks: NSF for support via CAREER award #1149784. ##### Version 0.2 -- February 2014 # Doublet Welcome to the third lesson of *AeroPython*! We created some very interesting pot...
github_jupyter
``` import MySQLdb from sklearn.svm import LinearSVC from tensorflow import keras from keras.models import load_model import tensorflow as tf from random import seed import pandas as pd import numpy as np import re from re import sub import os import string import tempfile import pickle import tarfile from unidecode im...
github_jupyter
# Maximum Likelihood Estimation (Generic models) This tutorial explains how to quickly implement new maximum likelihood models in `statsmodels`. We give two examples: 1. Probit model for binary dependent variables 2. Negative binomial model for count data The `GenericLikelihoodModel` class eases the process by prov...
github_jupyter
# Connecting MLOS to a C++ application This notebook walks through connecting MLOS to a C++ application within a docker container. We will start a docker container, and run an MLOS Agent within it. The MLOS Agent will start the actual application, and communicate with it via a shared memory channel. In this example, t...
github_jupyter
``` #Download the dataset from opensig import urllib.request urllib.request.urlretrieve('http://opendata.deepsig.io/datasets/2016.10/RML2016.10a.tar.bz2', 'RML2016.10a.tar.bz2') #decompress the .bz2 file into .tar file import sys import os import bz2 zipfile = bz2.BZ2File('./RML2016.10a.tar.bz2') # open the file data ...
github_jupyter
### Fairness ### ##### This exercise we explore the concepts and techniques in fairness in machine learning ##### <b> Through this exercise one can * Increase awareness of different types of biases that can occur * Explore feature data to identify potential sources of biases before training the model. * E...
github_jupyter
<a href="https://colab.research.google.com/github/lvisdd/object_detection_tutorial/blob/master/object_detection_face_detector.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # restart (or reset) your virtual machine #!kill -9 -1 ``` # [Tensorfl...
github_jupyter
# Writing a Molecular Monte Carlo Simulation Starting today, make sure you have the functions 1. `calculate_LJ` - written in class 1. `read_xyz` - provided in class 1. `calculate_total_energy` - modified version provided in this notebook written for homework which has cutoff 1. `calculate_distance` - should be the ve...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import re from glob import glob import json import numpy as np import pandas as pd from difflib import SequenceMatcher import matplotlib.pyplot as plt import seaborn as sns ``` ## Data Acquisition ``` arxiv_files = sorted(glob('../data/arxiv/*')) scirate_files = sort...
github_jupyter