text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# RidgeClassifier with StandardScaler & Polynomial Features This Code template is for the Classification tasks using RidgeClassifier, feature rescaling using StandardScaler and feature transformation using Polynomial features in a pipeline. ### Required Packages ``` !pip install imblearn import warnings import num...
github_jupyter
# Neural Machine Translation Let's load all the packages we will need for this model. ``` from keras.layers import Bidirectional, Concatenate, Permute, Dot, Input, LSTM, Multiply from keras.layers import RepeatVector, Dense, Activation, Lambda from keras.optimizers import Adam from keras.utils import to_categorical f...
github_jupyter
``` # MIT License # # Copyright (c) 2019 Mohamed-Achref MAIZA # # 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 Software without restriction, including without limitation the # rights to use, copy, modi...
github_jupyter
<a href="https://cognitiveclass.ai"><img src = "https://ibm.box.com/shared/static/9gegpsmnsoo25ikkbl4qzlvlyjbgxs5x.png" width = 400> </a> <h1 align=center><font size = 5>Pie Charts, Box Plots, Scatter Plots, and Bubble Plots</font></h1> ## Introduction In this lab session, we continue exploring the Matplotlib librar...
github_jupyter
# Activity 7: Optimizing a deep learning model In this activity we optimize our deep learning model. We aim to achieve greater performance than our model `bitcoin_lstm_v0`, which is off at about 6.8% from the real Bitcoin prices. We explore the following topics in this notebook: * Experimenting with different layers a...
github_jupyter
JibanCat: If you are not sure about the regular expression is correct or not, you can use this https://regexr.com website to see the real-time response. Classical Chinese DH: Regular expressions ===== *By [Donald Sturgeon](https://dsturgeon.net/about)* \[[View this notebook online](https://digitalsinology.org/classi...
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
TSG060 - Persistent Volume disk space for all BDC PVCs ====================================================== Description ----------- Connect to each container and get the disk space used/available for each Persisted Volume (PV) mapped to each Persisted Volume Claim (PVC) of a Big Data Cluster (BDC) Steps ----- ###...
github_jupyter
``` import pandas as pd import numpy as np ``` ### Step 1: Importing Data ``` df= pd.read_csv('train.csv') df.head() ``` ### Step 2: Cleaning Data ``` df.info() df.isnull().values.any() df.isnull().sum() df[df['V4'].isnull()] df.dropna(inplace=True) df.isnull().values.any() ``` ### Step 3: Data Preprocessing ``` ...
github_jupyter
## Triage Demonstration Using Elasticsearch / Kibana Some helper functions below needed to insert office document prediction results into a local Elasticsearch instance. This was tested with ES / Kibana 5.1.2 ``` import mmbot as mmb from elasticsearch import Elasticsearch import time import requests import json def...
github_jupyter
# Using Tensorflow DALI plugin: DALI and tf.data ### Overview DALI offers integration with [tf.data API](https://www.tensorflow.org/guide/data). Using this approach you can easily connect DALI pipeline with various TensorFlow APIs and use it as a data source for your model. This tutorial shows how to do it using well...
github_jupyter
# Predictive maintenance ## Part 1: Data Preparation The original data can be [downloaded from this link.](https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository/#turbofan) Since the content in the train and test datasets is different, we are making it uniform before we start the data exploration an...
github_jupyter
``` import os import glob import math import numpy as np import pandas as pd import matplotlib as mpl import xml.etree.ElementTree as ET import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D %matplotlib inline data_path = os.path.join('data', 'motion_data', 'files_motions_589') all_files = glob.glob(...
github_jupyter
# Arbres On utilisera la structure suivante. ``` class Arbre(): def __init__(self, x, enfants = None): # constructeur if enfants is None: enfants = [] self.valeur = x self.enfants = enfants def __repr__(self): # affichage s = str(self.valeur) + str(sel...
github_jupyter
### The purpose of this notebook is to complete a data cleaning workflow from start to finish in order to validate the core functionality our package #### TO DO: - Add in complete PubChem data - Write PubChem function - Organize code modules & tests - Clean up/finish writing tests - Write main script wrapper function ...
github_jupyter
``` %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import json import seaborn as sb plt.rcParams['figure.figsize'] = 8, 4 df = pd.read_json(open('data/nobel_winners_cleaned.json')) df.info() # convert the date columns to a usable form df.date_of_birth = pd.to_datetime(df.date...
github_jupyter
``` from pathlib import Path import matplotlib.pyplot as plt import pandas as pd import imageio %matplotlib inline ``` ## Download youtube-dl --rm-cache-dir youtube-dl -f bestvideo https://youtu.be/Fkadv0VnZkI youtube-dl -f bestvideo https://www.youtube.com/playlist?list=PLAPUEAObdbMb747QUFsjQ2e9MPz1FkDnQ youtube-...
github_jupyter
# COVID19 Exposure Notification System Risk Simulator kpmurphy@google.com, serghiou@google.com (broken link) Last update: 22 August 2020 ## References We base our approach on these papers * [Quantifying SARS-CoV-2-infection risk withing the Apple/Google exposure notification framework to inform quarantine reco...
github_jupyter
``` import tensorflow as tf print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU'))) # !pip install --upgrade pip # !pip install -U --ignore-installed wrapt enum34 simplejson netaddr imageio setuptools # !pip install matplotlib==2.2.3 # !pip install pyyaml h5py # !pip install --upgrade s...
github_jupyter
<img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="35%" align="right" border="0"><br> # Derivatives Analytics with Python **_Chapters 2 & 3_** **Wiley Finance (2015)** <img src="http://hilpisch.com/images/derivatives_analytics_front.jpg" alt="Derivatives Analytics with Python" width="30%" al...
github_jupyter
# Advanced topic: Ice albedo feedback in the EBM This notebook is part of [The Climate Laboratory](https://brian-rose.github.io/ClimateLaboratoryBook) by [Brian E. J. Rose](http://www.atmos.albany.edu/facstaff/brose/index.html), University at Albany. *These notes and the companion [Advanced topic: Snowball Earth and ...
github_jupyter
# Greatness Rating for NBA players ### Observations: 1. Great players tend to lead the league annually in 'primary' categories. 2. Great players tend to lead the league annually in 'secondary' categories. However, these categories are subordinate to 'primary' categories for the reasons below, and should not carry the...
github_jupyter
# Housing Data Visual Analysis Although we previously got a pretty good R squared quality metric for predicting house values using a linear regression model (see here https://www.ibm.com/developerworks/community/blogs/JohnBoyer/entry/Measuring_the_Quality_of_a_TensorFlow_Regression_Model), there still may be a lot of ...
github_jupyter
``` # Binary Classification Example import numpy import pandas from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from sklearn.model_selection import cross_val_score from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import S...
github_jupyter
... ***CURRENTLY UNDER DEVELOPMENT*** ... ## RBFs reconstruction of historical and synthetic data inputs required: * Synthetic offshore waves - emulator output * Sea and swell **SWAN simulated cases** in this notebook: * RBF reconstruction simulated storms * Generation of hourly nearshore waves with Intrad...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Visualization/styled_layer_descriptors.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target...
github_jupyter
## Setup Notebook and Libraries ``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import ssl ssl._create_default_https_context = ssl._create_unverified_context plt.rcParams['figure.figsize'] = (8,6) plt.rcParams['font.size'] = 14 plt.style.use("fivethirtyeight") %matplot...
github_jupyter
# PhysioNet/Computing in Cardiology Challenge 2020 ## Classification of 12-lead ECGs ### Synthetic Noise Generation # Setup Notebook ``` # Import 3rd party libraries import os import sys import json import numpy as np import pandas as pd import matplotlib.pylab as plt from ipywidgets import interact, fixed # Import ...
github_jupyter
``` # import sys # !{sys.executable} -m pip install --upgrade c-lasso from classo import random_data, classo_problem import numpy as np import matplotlib.pyplot as plt # this is the path of the directory where one want to save its figures path = '../../figures/' ``` ## Basic example The c-lasso package includes the...
github_jupyter
``` # 1. Create shapes in external drawing apps. # 2. Write a code to identify your shapes. import cv2 as cv import matplotlib.pyplot as plt import numpy as np # Load the image and convert it to grayscale: img = cv.imread("assets/shapes2.png") imgGray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) plt.figure(figsize=(20,15))...
github_jupyter
``` import cv2 as cv import matplotlib.pyplot as plt net=cv.dnn.readNetFromTensorflow("graph_opt.pb") BODY_PARTS = { "Nose": 0, "Neck": 1, "RShoulder": 2, "RElbow": 3, "RWrist": 4, "LShoulder": 5, "LElbow": 6, "LWrist": 7, "RHip": 8, "RKnee": 9, "RAnkle": 10, "LHip": 11, "LKnee": 12, "LAnk...
github_jupyter
<img alt="QuantRocket logo" src="https://www.quantrocket.com/assets/img/notebook-header-logo.png"> <a href="https://www.quantrocket.com/disclaimer/">Disclaimer</a> # Dimensionality Reduction with PCA Given the poor result of our first walk-forward optimization, we want to explore whether reducing the number of featu...
github_jupyter
## Coronary Heart Disease Prediction ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns # Sklearn from sklearn.preprocessing import normalize from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.model_selection imp...
github_jupyter
``` import torch from torchvision import datasets,transforms from torch import nn,optim import torch.nn.functional as F transform=transforms.Compose([transforms.ToTensor(),transforms.Normalize((0.5,0.5,0.5),(0.5,0.5,0.5))]) dataset=datasets.FashionMNIST('./fashion_mnist',download=True,train=True,transform=transform) tr...
github_jupyter
``` import mlflow import matplotlib.pyplot as plt import matplotlib from matplotlib.ticker import NullFormatter, FormatStrFormatter, ScalarFormatter import tikzplotlib import pandas as pd from matplotlib import rc rc('font',**{'family':'libertine'}) rc('text', usetex=True) import seaborn as sns import sys sys.path....
github_jupyter
# Semantic Similarity with BERT **Author:** [Mohamad Merchant](https://twitter.com/mohmadmerchant1)<br> **Date created:** 2020/08/15<br> **Last modified:** 2020/08/29<br> **Description:** Natural Language Inference by fine-tuning BERT model on SNLI Corpus. ## Introduction Semantic Similarity is the task of determini...
github_jupyter
``` import itertools import xml.etree.cElementTree as et import networkx as nx import pandas as pd import numpy as np def trackmate_peak_import(trackmate_xml_path, get_tracks=False): """Import detected peaks with TrackMate Fiji plugin. Parameters ---------- trackmate_xml_path : str TrackMate...
github_jupyter
# Generate JayChou Text # 1. load dataset ``` with open('jaychou_lyrics.txt' ,'r', encoding='utf-8') as fr: corpus_chars = fr.read() corpus_chars[:40] ``` # 2. pre-process ``` corpus_chars = corpus_chars.replace('\n', ' ').replace('\r', ' ') corpus_chars = corpus_chars[:10000]#只取前10000个词 len(corpus_chars) ``` ...
github_jupyter
# Neural networks with PyTorch Next I'll show you how to build a neural network with PyTorch. ``` # Import things like usual %matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import torch import helper import matplotlib.pyplot as plt from torchvision import datasets, transforms ...
github_jupyter
# User's Guide, Chapter 29: Spanners 1 (Slurs) In `music21`, a ":class:`~music21.spanner.Spanner`" is a :class:`~music21.base.Music21Object` that denotes a relationship among other elements, such as Notes, Chords, or even Streams, which may or may not be separated in a hierarchy, such as `Note` objects in different me...
github_jupyter
##### Copyright 2019 The TensorFlow Hub Authors. Licensed under the Apache License, Version 2.0 (the "License"); Created by @[Adrish Dey](https://github.com/captain-pool) for [Google Summer of Code](https://summerofcode.withgoogle.com/) 2019 ``` # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Li...
github_jupyter
##### Copyright 2020 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
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/jupyter/transformers/HuggingFace%20in%20Spark%20NLP%20-%20XlmRoBertaForTokenClassification.ipynb) ## Import XlmRoBertaForTokenClassification models from Hugg...
github_jupyter
<img src="../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> Welcome Qiskitters to Quantum Information Science with Qiskit Terra! Here we have a collection of great tutorials from our fantastic Qi...
github_jupyter
# Example Gate Characterization ``` import os from qcodes import Station, load_or_create_experiment from qcodes.dataset.plotting import plot_dataset from qcodes.dataset.data_set import load_by_run_spec import nanotune as nt from nanotune.tuningstages.gatecharacterization1d import GateCharacterization1D from nanotun...
github_jupyter
``` import sys import os import numpy as np BIN = '../' sys.path.append(BIN) import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import pickle import my_matplotlib_style as ms from scipy import stats import utils import torch import torch.nn as nn import torch.utils.data from torch.utils.data...
github_jupyter
# `mle-logging`: A Lightweight Logger for ML Experiments ### Author: [@RobertTLange](https://twitter.com/RobertTLange) [Last Update: August 2021] [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/RobertTLange/mle-logging/blob/main/examples/getting_started.ipyn...
github_jupyter
<br> <center> <font size='7' style="color:#0D47A1"> <b>CHEMICAL GNNs</b> </font> </center> <hr style= "height:3px;"> <br> <hr style= "height:1px;"> <font size='6' style="color:#000000"> <b>Content</b> </font> <a name="content"></a> <br> <br> 1. [Abstract](#abstract) <br> 2. [Setup](#setup) <br> 3. [Loading Da...
github_jupyter
# Naive Bayes Simple Male or Female author: Nicholas Farn [<a href="sendto:nicholasfarn@gmail.com">nicholasfarn@gmail.com</a>] This example shows how to create a simple Gaussian Naive Bayes Classifier using pomegranate. In this example we will be given a set of data measuring a person's height (feet) and try to class...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd np.random.seed(1789) from IPython.core.display import HTML def css_styling(): styles = open("styles/custom.css", "r").read() return HTML(styles) css_styling() ``` # An Introduction to Bayesian Statistical Analysis ...
github_jupyter
# Introduction Data science is cool! It's not only because the technology it implements is fancy,but also because it stretches our vision to broader scope. In addition to explore new and advanced data science tools and algorithms, we expand our access to new data types as well,including image data, audio data and video...
github_jupyter
# Preface The locations requiring configuration for your experiment are commented in capital text. # Setup **Installations** ``` !pip install apricot-select !pip install sphinxcontrib-napoleon !pip install sphinxcontrib-bibtex !git clone https://github.com/decile-team/distil.git !git clone https://github.com/circu...
github_jupyter
<h1 style="color:red">IF YOU ARE DOING THE EXERCISE DO NOT READ THIS! TRY TO FIND A GOOD SOLUTION WITHOUT KNOWING THE PROBLEM PERFECTLY.</h1> After you have run out of ideas, you can see how I created the data and then adapt your Kalman-Filter to fit this perfectly. . . . . . . . . . . . . . . . . . ...
github_jupyter
# Understand the Normal Curve ## Mini-Lab: Characteristics of the Normal Curve Welcome to your next mini-lab! Go ahead an run the following cell to get started. You can do that by clicking on the cell and then clickcing `Run` on the top bar. You can also just press `Shift` + `Enter` to run the cell. ``` from datascie...
github_jupyter
# Automated Machine Learning #### Forecasting away from training data ## Contents 1. [Introduction](#Introduction) 2. [Setup](#Setup) 3. [Data](#Data) 4. [Prepare remote compute and data.](#prepare_remote) 4. [Create the configuration and train a forecaster](#train) 5. [Forecasting from the trained model](#forecasti...
github_jupyter
# 独立成分分析 Lab 在此 notebook 中,我们将使用独立成分分析方法从三个观察结果中提取信号,每个观察结果都包含不同的原始混音信号。这个问题与 ICA 视频中解释的问题一样。 ## 数据集 首先看看手头的数据集。我们有三个 WAVE 文件,正如我们之前提到的,每个文件都是混音形式。如果你之前没有在 python 中处理过音频文件,没关系,它们实际上就是浮点数列表。 首先加载第一个音频文件 **[ICA mix 1.wav](ICA mix 1.wav)** [点击即可聆听该文件]: ``` import numpy as np import wave # Read the wave file mix_1_wa...
github_jupyter
#### Copyright 2017 Google LLC. ``` # 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 writin...
github_jupyter
# Simulations for multi-resolution deblending In this notebook I test multi-resolution on simulated images using the galsim package. ``` import scarlet import galsim from astropy import wcs as WCS import time from mr_tools import galsim_compare_tools as gct from mr_tools.simulations import Simulation, load_surveys, c...
github_jupyter
``` import numpy as np import tensorflow as tf from tensorflow import keras def split_sequence(sequence, n_steps): X, y = list(), list() for i in range(len(sequence)): end_ix = i + n_steps if end_ix > len(sequence) - 1: break seq_x, seq_y = sequence[i:end_ix], sequence[end_ix...
github_jupyter
BiLSTM+CRF模型训练,使用100维随机初始化词嵌入 ``` # 显卡查看 ! nvidia-smi # 依赖安装 ! pip install fastNLP ``` 加载数据集 ``` import sys from fastNLP.core import Const from fastNLP.io import PeopleDailyNERLoader from fastNLP.io import PeopleDailyPipe sys.path.insert(0, '/content/drive/My Drive/my_framework/qyt_clue/') # 定义搜索路径的优先顺序,序号从0开始,表示...
github_jupyter
## Using Chicago Open Data Portal download data Car Crahses https://data.cityofchicago.org/Public-Safety/Crimes-2018/3i3m-jwuy * export button, save as a csv file. ## Objective where the worst place to park in Chicago. + to learning basic sci kit learn preprocessing + learn k means clustering + to install run from c...
github_jupyter
``` import dask import dask.dataframe as dd import warnings import datetime import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import category_encoders as ce import lightgbm as lgb from sklearn.model_selection import train_test_split, StratifiedKFold, GridSearchCV from sklearn....
github_jupyter
# Step 2 - Transcript Quant Into Gene Quant ## Introduction ## Things I do below 1. I used tximport to aggregate transcript-level quantification into gene-level quantification 2. I aggregated all gene-level quantification from all 16 samples into a single large table ## Use R and Python in the same notebook To ac...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import matplotlib.backends.backend_pdf as pdf import matplotlib.patches as pch import eleanor_constants as EL matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 %matplotlib inline savename = "./...
github_jupyter
# ML 101 Unsupervised learning is where you only have input data $(X)$ and no corresponding output variables. The goal for unsupervised learning is to model the underlying structure or distribution in the data in order to learn more about the data. These are called unsupervised learning because unlike supervised lea...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
# Categorical Naive Bayes Classifier with MinMaxScaler and Quantile Transformer ## Required Packages ``` !pip install imblearn import warnings import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as se from imblearn.over_sampling import RandomOverSampler from sklearn.naive_bayes ...
github_jupyter
# RMSProp :label:`sec_rmsprop` One of the key issues in :numref:`sec_adagrad` is that the learning rate decreases at a predefined schedule of effectively $\mathcal{O}(t^{-\frac{1}{2}})$. While this is generally appropriate for convex problems, it might not be ideal for nonconvex ones, such as those encountered in dee...
github_jupyter
# REINFORCE --- In this notebook, we will train REINFORCE with OpenAI Gym's Cartpole environment. ### 1. Import the Necessary Packages ``` import gym import gym.spaces gym.logger.set_level(40) # suppress warnings (please remove if gives error) import numpy as np from collections import deque import matplotlib.pyplo...
github_jupyter
``` import matplotlib.pyplot as plt %matplotlib inline from bayes_implicit_solvent.constants import beta def unreduce(value): """Input value is in units of kB T, turn it into units of kilocalorie_per_mole""" return value / (beta * unit.kilocalorie_per_mole) from bayes_implicit_solvent.continuous_parameter_expe...
github_jupyter
# Cement Strength Neural Network ## Goal - Develop a neural network that can predict cement strength based on various features. ## Approach - We will primarily be using Python and the deep learning library Keras to develop such solution. ## Performance Evaluation - For the evaluation of our model, we will be using...
github_jupyter
# Load Constrained Layout Optimization [Try this yourself](https://colab.research.google.com/github/DTUWindEnergy/TopFarm2/blob/master/docs/notebooks/layout_and_loads.ipynb) (requires google account) ## Install TopFarm and PyWake ``` %%capture try: import py_wake except: !pip install git+https://gitlab.winde...
github_jupyter
# Exploratory data analysis in Python with pandas and seaborn In this workshop we are going to explore a dataset using two powerful Python libraries: [pandas](http://pandas.pydata.org/) and [seaborn](http://seaborn.pydata.org/). We will see that pandas provides us with flexible data structures and powerful methods to m...
github_jupyter
## Impulse Control Algorithm for HFT Market Making For my homie Pontus <3 ### Algorithmic design The algorithm seeks to optimize the bid ask spread + hedging decisions for each time $t<T$ such that the net Profit and Loss of trading the spread is maximized at the end of the trading session time $T$. We also want to c...
github_jupyter
# Imports ``` import warnings warnings.filterwarnings(action='ignore') import tensorflow as tf from tensorflow import keras import sklearn from sklearn.metrics import roc_curve, auc, log_loss, precision_score, f1_score, recall_score, confusion_matrix from sklearn.model_selection import KFold, StratifiedKFold import ...
github_jupyter
# Image segmentation with a U-Net-like architecture **Author:** [fchollet](https://twitter.com/fchollet)<br> **Date created:** 2019/03/20<br> **Last modified:** 2020/04/20<br> **Description:** Image segmentation model trained from scratch on the Oxford Pets dataset. ## Download the data ``` !curl -O http://www.robot...
github_jupyter
``` model_folder='/home/mara/multitask_adversarial/results/F_CORRELATION/' ## Loading OS libraries to configure server preferences import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import warnings warnings.filterwarnings("ignore") import setproctitle SERVER_NAME = 'ultrafast' EXPERIMENT_TYPE='test_guidedCNN' import ti...
github_jupyter
``` import pandas as pd import numpy as np import os import re root_path = os.getcwd() data_path = os.path.join(root_path, 'IMDb 2017') os.listdir(data_path) F1_path = os.path.join(data_path, 'Combinded_raw_file_2017.csv') F2_path = os.path.join(data_path, 'movie_list_2017.csv') ``` # F1 ``` df1 = pd.read_csv(F1_path...
github_jupyter
Taking the datframes and putting .png in place of .tif ``` import os import pandas as pd import numpy as np import cv2 import matplotlib.pyplot as plt directory = '/content/drive/MyDrive/CovCT/images' filename = '137covid_patient15_SR_2_IM00016.tif' image = cv2.imread(os.path.join(directory, filename),-1) img_scaled =...
github_jupyter
##### Copyright 2018 The TF-Agents Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
github_jupyter
<a href="https://colab.research.google.com/github/BrunaMedeiroos/PYTHON-MYSQL-POWER-BI/blob/main/Analise_Completa.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Análise de Dados Empresa de telefonia e tem clientes de vários serviços diferentes...
github_jupyter
# The following notebook shows the implementation of LinearSVC a part of scikit learns SVM package on the csv file that we created on the Resume Text ## Background Details ### Working with resume data stored in .csv file job_desc <ul> <li>reading the given data from csv file</li> <li>lemmatization and transfo...
github_jupyter
## Dataset Tutorial Let's first load several packages from DeepPurpose ``` # if you are using source version, uncomment the next two lines: #import os #os.chdir('../') from DeepPurpose import utils, DTI, dataset ``` There are mainly three types of input data for DeepPurpose. 1. Target Sequence and its name to be re...
github_jupyter
# Logic ``` ## Based on logic code of Book: *Artificial Intelligence: A Modern Approach* # We also do an example on course selection ``` Chapter 6 Logical Agents, Chapter 7 First-Order Logic and Chapter 8 Inference in First-Order Logic of the book *Artificial Intelligence: A Modern Approach*. We make use of the imple...
github_jupyter
# Preprocessing of density data for Python Colormap Tutorial ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import fiona from shapely.geometry import Polygon, MultiPolygon, shape from descartes.patch import PolygonPatch from scipy.stats import gaussian_kde from scipy.ndimage.filters import ...
github_jupyter
<small><small><i> All of these python notebooks are available at [ https://github.com/milaan9/Python4DataScience ] </i></small></small> ## Scientific Python Scientific python refers to a large collection of libraries that can be used with python for a range of numerical and scientific computing tasks. Most of these a...
github_jupyter
# Convolutional Neural Networks ## Foundations of Convolutional Neural Networks ### Computer Vision Computer vision is one of the applications that are rapidly active thanks to deep learning. Some of the applications of computer vision that are using deep learning includes self driving cars and face recognition. Ra...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#An-example-of-a-small-Single-Player-simulation" data-toc-modified-id="An-example-of-a-small-Single-Player-simulation-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>An example of a small Single-Player simulation</a></div><div class="lev2 toc-item"><a href="...
github_jupyter
## Incorporating Neural Networks author: Jacob Schreiber <br> contact: jmschreiber91@gmail.com Neural networks have become exceedingly popular recently due, in part, to their ability to achieve state-of-the-art performance on a variety of tasks without requiring complicated feature extraction pipelines. These models ...
github_jupyter
# An Astronomical Application of Machine Learning: Separating Stars and Galaxies from SDSS ==== ##### Version 0.1 *** By AA Miller 2018 Nov 06 The problems in the following notebook develop an end-to-end machine learning model using actual astronomical data to separate stars and galaxies. There are 5 steps in this ...
github_jupyter
# Exploratory Data Analysis Preparing the BRFSS dataset Allen Downey [MIT License](https://en.wikipedia.org/wiki/MIT_License) ``` %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(style='white') import utils from utils import decorate from dis...
github_jupyter
# Manifold Learning: t-SNE and UMAP for Equity Return This notebook explores how [t-SNE](https://lvdmaaten.github.io/tsne/) and UMAP perform on equity returns. ## Imports & Settings ``` %matplotlib inline import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.decom...
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
##### 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
# Scikit-learn Pipeline Persistence and JSON Serialization Part II By Chris Emmery, 14-04-2016, 5 minute read --- *This is a follow-up to [this](./serialize) post.* In my last entry, I wrote about several hurdles on the way to replacing pickle with JSON for storing scikit-learn pipelines. While my previous solut...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import torch from scipy.special import factorial from IPython.display import display, Latex def get_D_Coeffs(s,d=2): ''' Solve arbitrary stencil points s of length N with order of derivatives d<N can be obtained from equation on MIT website http://w...
github_jupyter
``` f = 'text.txt' file = open(f,'r') text = '' for line in file.readlines(): text+=str(line) text+=" " file.close() print(text) import nltk from nltk import word_tokenize import string text1 = word_tokenize(text) #tokenize by word case_insensitive_text = word_tokenize(text.lower()) #lowercase #Segmentating...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import mpl_toolkits %matplotlib inline data = pd.read_csv("kc_house_data.csv") data.head() data.describe() data['bedrooms'].value_counts().plot(kind='bar') plt.title('number of Bedroom') plt.xlabel('Bedrooms') plt.ylabel('C...
github_jupyter
``` from graphblas import Matrix, Vector from graphblas import unary, binary, monoid, semiring, dtypes from graphblas import io as gio ``` ### Basic syntax Let's examine some basic graphblas syntax ``` A = Matrix.from_values( [0, 0, 1, 2, 2, 3, 4], [1, 2, 3, 3, 4, 4, 0], [1.1, 9.8, 4.2, 7.1, 0.2, 6.9, 2....
github_jupyter
``` import numpy as np import h5py # Helper function to help read the h5 files. def simple_read_data(fileName): print(fileName) hf = h5py.File('{}.h5'.format(fileName), 'r') # We'll return a dictionary object. results = {} results['rs_glob_acc'] = np.array(hf.get('rs_glob_acc')[:]) re...
github_jupyter