code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Node classification with Node2Vec using Stellargraph components
<table><tr><td>Run the latest release of this notebook:</td><td><a href="https://mybinder.org/v2/gh/stellargraph/stellargraph/master?urlpath=lab/tree/demos/node-classification/keras-node2vec-node-classification.ipynb" alt="Open In Binder" target="_paren... | github_jupyter |
```
cd /content/drive/My Drive/Dava with ML
!unzip chronic-kidney-disease.zip
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClas... | github_jupyter |
## 线性回归
```
import numpy as np
import pandas as pd
### 初始化模型参数
def initialize_params(dims):
'''
输入:
dims:训练数据变量维度
输出:
w:初始化权重参数值
b:初始化偏差参数值
'''
# 初始化权重参数为零矩阵
w = np.zeros((dims, 1))
# 初始化偏差参数为零
b = 0
return w, b
### 定义模型主体部分
### 包括线性回归公式、均方损失和参数偏导三部分
def linear_loss(X, y... | github_jupyter |
# Introduction
- ElasticNetを使ってみる
- permutation importance を追加
# Import everything I need :)
```
import warnings
warnings.filterwarnings('ignore')
import time
import multiprocessing
import glob
import gc
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from plotly.offline i... | github_jupyter |
```
import pandas as pd
import numpy as np
from datetime import datetime
import os
```
# Define Which Input Files to Use
The default settings will use the input files recently produced in Step 1) using the notebook `get_eia_demand_data.ipynb`. For those interested in reproducing the exact results included in the repos... | github_jupyter |
# Dataset
```
import sys
sys.path.append('../../datasets/')
from prepare_individuals import prepare, germanBats
import matplotlib.pyplot as plt
import torch
import numpy as np
import tqdm
import pickle
classes = germanBats
patch_len = 44 # 88 bei 44100, 44 bei 22050 = 250ms ~ 25ms
X_tra... | github_jupyter |
```
import pandas as pd
import numpy as np
from scipy.stats import ks_2samp, chi2
import scipy
from astropy.table import Table
import astropy
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from matplotlib.colors import colorConverter
import matplotlib
%matplotlib notebook
print('numpy ... | github_jupyter |
```
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
import time
import os
from utils import calibrate_cam, weighted_img, warp
print("ready")
def warpTest(img, img_name):
imshape = img.shape
bot_x = 0.13*imshape[1] # offset from bottom corner
top_x =... | 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 |
```
%matplotlib inline
from pyvista import set_plot_theme
set_plot_theme('document')
```
Displaying eigenmodes of vibration using `warp_by_vector`
=========================================================
This example applies the `warp_by_vector` filter to a cube whose
eigenmodes have been computed using the Ritz met... | github_jupyter |
<center>
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%203/images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# K-Nearest Neighbors
Estimated time needed: **25** minutes
## Objectives
After compl... | github_jupyter |
# Welcome to Kijang Emas analysis!

I was found around last week (18th March 2019), our Bank Negara opened public APIs for certain data, it was really cool and I want to help people get around with the data and what actually they can do with the da... | github_jupyter |
```
import torch
from torch.distributions import Normal
import math
```
Let us revisit the problem of predicting if a resident of Statsville is female based on the height. For this purpose, we have collected a set of height samples from adult female residents in Statsville. Unfortunately, due to unforseen circumstance... | github_jupyter |
# Labs - Biopython and data formats
## Outline
- Managing dependencies in Python with environments
- Biopython
- Sequences (parsing, representation, manipulation)
- Structures (parsing, representation, manipulation)
### 1. Python environments
- handles issues with dependencies versions
- ensures reproducib... | github_jupyter |
# Throughtput Benchmarking Seldon-Core on GCP Kubernetes
The notebook will provide a benchmarking of seldon-core for maximum throughput test. We will run a stub model and test using REST and gRPC predictions. This will provide a maximum theoretical throughtput for model deployment in the given infrastructure scenario... | 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 |
# Streamlines tutorial
In this tutorial you will learn how to download and render streamline data to display connectivity data. In brief, injections of anterogradely transported viruses are performed in wild type and CRE-driver mouse lines. The viruses express fluorescent proteins so that efferent projections from the ... | github_jupyter |
```
!pip install plotly -U
import numpy as np
import matplotlib.pyplot as plt
from plotly import graph_objs as go
import plotly as py
from scipy import optimize
print("hello")
```
Generate the data
```
m = np.random.rand()
n = np.random.rand()
num_of_points = 100
x = np.random.random(num_of_points)
y = x*m + n + 0.15... | github_jupyter |
```
%pylab inline
wvl = 488 # wavelength [nm]
NA = 1.2 # numerical aperture
n = 1.33 # refractive index of propagating medium
pixel_size = 50 # effective camera pixel size [nm]
chip_size = 128 # pixels
def widefield_psf_2d(wvl, NA, n, pixel_size, chip_size, z=0.0):
"""
Construct... | github_jupyter |
# DB acute analysis
By Stephen Karl Larroque @ Coma Science Group, GIGA Research, University of Liege
Creation date: 2018-05-27
License: MIT
v1.0.3
DESCRIPTION:
Calculate whether patients were acute at the time of MRI acquisition (28 days included by default).
This expects as input a csv file with both the accident da... | github_jupyter |
This is the collection of codes that read food atlas datasets and CDC health indicator datasets from Github repository, integrate datasets and cleaning data
```
#merge food atlas datasets into one
import pandas as pd
Overall_folder='C:/Users/cathy/Capstone_project_1/'
dfs=list()
url_folder='https://raw.githubusercon... | 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 |
Files and Printing
------------------
** See also Examples 15, 16, and 17 from Learn Python the Hard Way**
You'll often be reading data from a file, or writing the output of your python scripts back into a file. Python makes this very easy. You need to open a file in the appropriate mode, using the `open` function, t... | github_jupyter |
# Algoritmoen Konplexutasuna eta Notazio Asintotikoa
<img src="../img/konplexutasuna.jpg" alt="Konplexutasuna" style="width: 600px;"/>
# Algoritmoen Konplexutasuna eta Notazio Asintotikoa
* Problema bat algoritmo ezberdinekin ebatzi daitezke
* Zeren araberea aukeratuko dugu?
* Ulergarritasuna
* Inplementatzeko... | github_jupyter |
# Cycle-GAN
## Model Schema Definition
The purpose of this notebook is to create in a simple format the schema of the solution proposed to colorize pictures with a Cycle-GAN accelerated with FFT convolutions.<p>To create a simple model schema this notebook will present the code for a Cycle-GAN built as a MVP (Minimum... | github_jupyter |
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a>
$$
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\abs}[1]{\left\lvert#1\right\rvert}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\inner}[2]{\left\langle#1,#2\right\rangle}
\newcomma... | github_jupyter |
# Neural Networks and Deep Learning for Life Sciences and Health Applications - An introductory course about theoretical fundamentals, case studies and implementations in python and tensorflow
(C) Umberto Michelucci 2018 - umberto.michelucci@gmail.com
github repository: https://github.com/michelucci/dlcourse2018_stu... | github_jupyter |
# **Imbalanced Data**
Encountered in a classification problem in which the number of observations per class are disproportionately distributed.
## **How to treat for Imbalanced Data?**<br>
Introducing the `imbalanced-learn` (imblearn) package.
### Data
```
import pandas as pd
import seaborn as sns
from sklearn.data... | github_jupyter |
```
# ~145MB
!wget -x --load-cookies cookies.txt -O business.zip 'https://www.kaggle.com/yelp-dataset/yelp-dataset/download/py6LEr6zxQNWjebkCW8B%2Fversions%2FlVP0fduiJJo8YKt2vKKr%2Ffiles%2Fyelp_academic_dataset_business.json?datasetVersionNumber=2'
!unzip business.zip
!wget -x --load-cookies cookies.txt -O review.zip '... | github_jupyter |
```
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
import numpy as np
from scipy import stats
import scipy as sp
import datetime as dt
from ei_net import *
# import cmocean as cmo
%matplotlib inline
##########################################
############ PLOTTING SETUP ##############
EI_c... | github_jupyter |
---
**Export of unprocessed features**
---
```
import pandas as pd
import numpy as np
import os
import re
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.feature_extraction.text import CountVectorizer
import random
import pickle
from scipy import sparse
import math
import p... | github_jupyter |
# Case 2.2
## How do users engage with a mobile app for automobiles?
_"It is important to understand what you can do before you learn how to measure how well you seem to have done it." – J. Tukey
As we saw in the previous case, careful data vizualization (DV) can guide or even replace formal statistical analysis and ... | github_jupyter |
```
import import_ipynb
import matplotlib.pyplot as plt
from FULL_DATA import final_df
import nltk
nltk.download('punkt')
from nltk.tokenize import sent_tokenize
from nltk.tokenize import word_tokenize
from nltk.probability import FreqDist
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_b... | github_jupyter |
#### Arbitrary Value Imputation
this technique was derived from kaggle competition
It consists of replacing NAN by an arbitrary value
```
import pandas as pd
df=pd.read_csv("titanic.csv", usecols=["Age","Fare","Survived"])
df.head()
def impute_nan(df,variable):
df[variable+'_zero']=df[variable].fillna(0)
df[v... | github_jupyter |
# Muscle modeling
> Marcos Duarte
> Laboratory of Biomechanics and Motor Control ([http://demotu.org/](http://demotu.org/))
> Federal University of ABC, Brazil
There are two major classes of muscle models that have been used in biomechanics and motor control: the Hill-type and Huxley-type models. They differ main... | github_jupyter |
```
!wget https://resources.lendingclub.com/LoanStats_2019Q1.csv.zip
!wget https://resources.lendingclub.com/LoanStats_2019Q2.csv.zip
!wget https://resources.lendingclub.com/LoanStats_2019Q3.csv.zip
!wget https://resources.lendingclub.com/LoanStats_2019Q4.csv.zip
!wget https://resources.lendingclub.com/LoanStats_2020Q1... | github_jupyter |
##### Internal Document
# DAND Project WeRateDogs: Wrangling report
WeRateDogs is a Twitter account that rates people's dogs with a humorous comment about the dog. We wrangle the WeRateDogs Tweets. We provide a cleaned dataset for further analysis.
We combine three datasets:
1. WeRateDogs Twitter archive download by ... | github_jupyter |
# Getting Started With Xarray
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Getting-Started-With-Xarray" data-toc-modified-id="Getting-Started-With-Xarray-1"><span class="toc-item-num">1 </span>Getting Started With Xarray</a></span><ul clas... | github_jupyter |
# Reporting on user journeys to a GOV.UK page
Calculate the count and proportion of sessions that have the same journey behaviour.
This script finds sessions that visit a specific page (`DESIRED_PAGE`) in their journey. From the first or last visit to
`DESIRED_PAGE` in the session, the journey is subsetted to include... | github_jupyter |
# Input and Output
```
from __future__ import print_function
import numpy as np
author = "kyubyong. https://github.com/Kyubyong/numpy_exercises"
np.__version__
from datetime import date
print(date.today())
```
## NumPy binary files (NPY, NPZ)
Q1. Save x into `temp.npy` and load it.
```
x = np.arange(10)
np.save('te... | github_jupyter |
```
%matplotlib inline
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime as dt
```
# Reflect Tables into SQLAlchemy ORM
```
# Python SQL toolkit and Object Relational Mapper
import sqlalchemy
from sqlalchemy.ext.automap imp... | github_jupyter |
[](http://colab.research.google.com/github/ai2es/WAF_ML_Tutorial_Part1/blob/main/colab_notebooks/Notebook10_AHyperparameterSearch.ipynb)
# Notebook 10: A hyperparameter search
### Goal: Show an example of hyperparameter tuning
#### Background... | github_jupyter |
```
# Load the tensorboard notebook extension
%load_ext tensorboard
cd /tf/src/data/gpt-2/
! pip3 install -r requirements.txt
! python3 download_model.py 117M
import fire
import json
import os
import numpy as np
import tensorflow as tf
import regex as re
from functools import lru_cache
from statistics import median
imp... | github_jupyter |
**KNN model of 10k dataset**
_using data found on kaggle from Goodreads_
_books.csv contains information for 10,000 books, such as ISBN, authors, title, year_
_ratings.csv is a collection of user ratings on these books, from 1 to 5 stars_
```
# imports
import numpy as pd
import pandas as pd
import pickle
fro... | github_jupyter |
# Importando o NLTK
Importar um módulo ou biblioteca significa informar para o programa que você está criando/executando que precisa daquela biblioteca específica.
É possível fazer uma analogia, imagine que você precisa estudar para as provas de Matemática e Português. Você pega seus livros para estudar. Nessa analog... | github_jupyter |
# Inaugural Project
**Team:** M&M
**Members:** Markus Gorgone Larsen (hbk716) & Matias Bjørn Frydensberg Hall (pkt593)
**Imports and set magics:**
```
import numpy as np
import copy
from types import SimpleNamespace
from scipy import optimize
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('seaborn... | github_jupyter |
# "Wine Quality."
### _"Quality ratings of Portuguese white wines" (Classification task)._
## Table of Contents
## Part 0: Introduction
### Overview
The dataset that's we see here contains 12 columns and 4898 entries of data about Portuguese white wines.
**Метаданные:**
* **fixed acidity**
* **volatile... | github_jupyter |
<a href="https://colab.research.google.com/github/RihaChri/PureNumpyBinaryClassification/blob/main/NeuronalNetworkPureNumpy_binaryClassification.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import scipy.io
import numpy as np
import matplotlib... | github_jupyter |
# Perturb-seq K562 co-expression
```
import scanpy as sc
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import itertools
from pybedtools import BedTool
import pickle as pkl
%matplotlib inline
pd.set_option('max_columns', None)
import sys
sys.pat... | github_jupyter |
```
#initialization
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
# import basic plot tools
from qiskit.tools.visuali... | github_jupyter |
# Final Project Required Coding Activity
Introduction to Python (Unit 2) Fundamentals
All course .ipynb Jupyter Notebooks are available from the project files download topic in Module 1, Section 1.
This activity is based on modules 1 - 4 and is similar to exercises in the Jupyter Notebooks **`Practice_MOD03_In... | github_jupyter |
# Wind Statistics
### Introduction:
The data have been modified to contain some missing values, identified by NaN.
Using pandas should make this exercise
easier, in particular for the bonus question.
You should be able to perform all of these operations without using
a for loop or other looping construct.
1. The... | github_jupyter |
# Mark and Recapture
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/)
```
# If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
im... | github_jupyter |
# UniProtClient
Python classes in this package allow convenient access to [UniProt](https://www.uniprot.org/) for protein ID mapping and information retrieval.
## Installation in Conda
If not already installed, install **pip** and **git**:
```
conda install git
conda install pip
```
Then install via pip:
```
pip ins... | github_jupyter |
# Writing Low-Level TensorFlow Code
**Learning Objectives**
1. Practice defining and performing basic operations on constant Tensors
2. Use Tensorflow's automatic differentiation capability
3. Learn how to train a linear regression from scratch with TensorFLow
## Introduction
In this notebook, we will start b... | github_jupyter |
# An analysis of the State of the Union speeches - Part 2
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from string import punctuation
from nltk import punkt, word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.stem import Snowb... | github_jupyter |
## Modeling the musical difficulty
```
import ipywidgets as widgets
from IPython.display import Audio, display, clear_output
from ipywidgets import interactive
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
distributions = {
"krumhansl_kessler": [
0.15195022732711172, 0.0533620483... | github_jupyter |
Implementation Task1
We implement the 1D example of least square problem for the IGD
```
# generate a vector of random numbers which obeys the given distribution.
#
# n: length of the vector
# mu: mean value
# sigma: standard deviation.
# dist: choices for the distribution, you need to implement at least normal
# ... | github_jupyter |
```
import numpy as np
import pandas as pd
from datetime import datetime as dt
import itertools
season_1=pd.read_csv("2015-16.csv")[['Date','HomeTeam','AwayTeam','FTHG','FTAG','FTR']]
season_2=pd.read_csv("2014-15.csv")[['Date','HomeTeam','AwayTeam','FTHG','FTAG','FTR']]
season_3=pd.read_csv("2013-14.csv")[['Date','Hom... | github_jupyter |
# WeatherPy
----
#### Note
* Instructions have been included for each segment. You do not have to follow them exactly, but they are included to help you think through the steps.
```
# Dependencies and Setup
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import requests
import time
from datetim... | github_jupyter |
```
#hide
#skip
! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab
# default_exp losses
# default_cls_lvl 3
#export
from fastai.imports import *
from fastai.torch_imports import *
from fastai.torch_core import *
from fastai.layers import *
#hide
from nbdev.showdoc import *
```
# Loss Functions
> C... | github_jupyter |
# Module 1: Dataset
## Import
```
# not all libraries are used
!pip install imdbpy
from bs4 import BeautifulSoup
import urllib.request
import urllib.parse
import re
import csv
import time
import datetime
import imdb
import ast
from tqdm import tnrange, tqdm_notebook
import sys
from urllib.request import HTTPError
imp... | github_jupyter |
# Load MXNet model
In this tutorial, you learn how to load an existing MXNet model and use it to run a prediction task.
## Preparation
This tutorial requires the installation of Java Kernel. For more information on installing the Java Kernel, see the [README](https://github.com/deepjavalibrary/djl/blob/master/jupyt... | github_jupyter |
# Tau_p effects
```
import pprint
import subprocess
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
%matplotlib inline
np.set_printoptions(supp... | github_jupyter |
# Navigation
---
In this notebook, you will learn how to use the Unity ML-Agents environment for the first project of the [Deep Reinforcement Learning Nanodegree](https://www.udacity.com/course/deep-reinforcement-learning-nanodegree--nd893).
### 1. Start the Environment
We begin by importing some necessary packages... | github_jupyter |
## Session 4 : Feature engineering - Home Credit Risk
##### Student: Katayoun B.
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import glob
```
### Understanding the tables and loading all
```
def load_data(path):
data_path = path
df... | github_jupyter |
## Exercise 2
In the course you learned how to do classificaiton using Fashion MNIST, a data set containing items of clothing. There's another, similar dataset called MNIST which has items of handwriting -- the digits 0 through 9.
Write an MNIST classifier that trains to 99% accuracy or above, and does it without a fi... | github_jupyter |
# Fairness and Explainability with SageMaker Clarify - JSONLines Format
1. [Overview](#Overview)
1. [Prerequisites and Data](#Prerequisites-and-Data)
1. [Initialize SageMaker](#Initialize-SageMaker)
1. [Download data](#Download-data)
1. [Loading the data: Adult Dataset](#Loading-the-data:-Adult-Dataset)
... | github_jupyter |
<a href="https://colab.research.google.com/github/victorog17/Soulcode_Projeto_Python/blob/main/Projeto_Python_Oficina_Mecanica_V2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
print('Hello World')
print('Essa Fera Bicho')
```
1) Ao executar o... | github_jupyter |

# _*Qiskit Finance: Pricing Fixed-Income Assets*_
The latest version of this notebook is available on https://github.com/Qiskit/qiskit-iqx-tutorials.
***
### Contributors
Stefan Woerner<sup>[1]</sup>, Daniel Egger<sup>[1]</sup>, Shaohan Hu<sup>[1]</sup>, Stephen Wo... | github_jupyter |
# Sentiment Analysis
## Using XGBoost in SageMaker
_Deep Learning Nanodegree Program | Deployment_
---
As our first example of using Amazon's SageMaker service we will construct a random tree model to predict the sentiment of a movie review. You may have seen a version of this example in a pervious lesson although ... | github_jupyter |
# Introduction to Programming in Python
In this short introduction, I'll introduce you to the basics of programming, using the Python programming language. By the end of it, you should hopefully be able to write your own HMM POS-tagger.
### First Steps
You can think of a program as a series of instructions for the ... | github_jupyter |
```
#hide
#skip
! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab
# default_exp losses
# default_cls_lvl 3
#export
from fastai.imports import *
from fastai.torch_imports import *
from fastai.torch_core import *
from fastai.layers import *
#hide
from nbdev.showdoc import *
```
# Loss Functions
> C... | github_jupyter |
# Getting dataset information
```
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
x_train = pd.read_csv("data/train.csv")
x_test = pd.read_csv("data/test.csv")
x_test.head()
y_train = x_train["label"].values
y_train.shape
y_train[:10]
x_train = x_train.drop("label", axis=1).values
x_train.s... | github_jupyter |
# Finding Outliers with k-Means
## Setup
```
import numpy as np
import pandas as pd
import sqlite3
with sqlite3.connect('../../ch_11/logs/logs.db') as conn:
logs_2018 = pd.read_sql(
"""
SELECT *
FROM logs
WHERE datetime BETWEEN "2018-01-01" AND "2019-01-01";
""",
... | github_jupyter |
# Detecting malaria in blood smear images
### The Problem
Malaria is a mosquito-borne disease caused by the parasite _Plasmodium_. There are an estimated 219 million cases of malaria annually, with 435,000 deaths, many of whom are children. Malaria is prevalent in sub-tropical regions of Africa.
Microscopy is the mos... | github_jupyter |
<img align="right" src="images/tf.png" width="128"/>
<img align="right" src="images/ninologo.png" width="128"/>
<img align="right" src="images/dans.png" width="128"/>
# Tutorial
This notebook gets you started with using
[Text-Fabric](https://annotation.github.io/text-fabric/) for coding in the Old-Babylonian Letter c... | github_jupyter |
# Transfer Learning Template
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import os, json, sys, time, random
import numpy as np
import torch
from torch.optim import Adam
from easydict import EasyDict
import matplotlib.pyplot as plt
from steves_models.steves_ptn import Steves_Prototypical_Network
... | github_jupyter |
# Distributed DeepRacer RL training with SageMaker and RoboMaker
---
## Introduction
In this notebook, we will train a fully autonomous 1/18th scale race car using reinforcement learning using Amazon SageMaker RL and AWS RoboMaker's 3D driving simulator. [AWS RoboMaker](https://console.aws.amazon.com/robomaker/home#... | github_jupyter |
```
#!pip install pytorch_lightning
#!pip install torchsummaryX
!pip install webdataset
# !pip install datasets
# !pip install wandb
#!pip install -r MedicalZooPytorch/installation/requirements.txt
#!pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torc... | github_jupyter |
# Chapter 6 - Data Sourcing via Web
## Part 1 - Objects in BeautifulSoup
```
import sys
print(sys.version)
from bs4 import BeautifulSoup
```
### BeautifulSoup objects
```
our_html_document = '''
<html><head><title>IoT Articles</title></head>
<body>
<p class='title'><b>2018 Trends: Best New IoT Device Ideas for Data ... | github_jupyter |
```
import os
import argparse
import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
import csv
# Useful if you want to perform stemming.
import nltk
stemmer = nltk.stem.PorterStemmer()
categories_file_name = r'/workspace/datasets/product_data/categories/categories_0001_abcat0010000_to_pcmcat993000... | github_jupyter |
<a href="https://colab.research.google.com/github/vs1991/ga-learner-dsmp-repo/blob/master/Capstone_project_EDA.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Loading from drive
```
from google.colab import drive
drive.mount('../Greyatom',force_r... | github_jupyter |
```
%load_ext blackcellmagic
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn.model_selection import train_test_split
from mpl_toolkits.mplot3d import Axes3D
from pathlib import Path
from sklearn import preprocessing
# code from 'aegis4048.github.io'... | github_jupyter |
```
import re
import pandas as pd
import spacy
from typing import List
from math import sqrt, ceil
# gensim
from gensim import corpora
from gensim.models.ldamulticore import LdaMulticore
# plotting
from matplotlib import pyplot as plt
from wordcloud import WordCloud
import matplotlib.colors as mcolors
# progress bars
f... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# Distributed CNTK using custom docker images
In this tutorial, you will train a CNTK model on the [MNIST](http://yann.lecun.com/exdb/mnist/) dataset using a custom docker image and distributed training.
## Prerequisites
* Unde... | github_jupyter |
```
#@title Copyright 2020 The Cirq Developers
# 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... | github_jupyter |
```
from keras.models import Sequential
from keras.layers import Dropout
from keras.layers import Input, Dense, Activation,Dropout
from keras import regularizers
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.normalization import BatchNormalization
import numpy as np
# fix random seed for re... | github_jupyter |
# Initial_t_rad Bug
The purpose of this notebook is to demonstrate the bug associated with setting the initial_t_rad tardis.plasma property.
```
pwd
import tardis
import numpy as np
```
## Density and Abundance test files
Below are the density and abundance data from the test files used for demonstrating this bug.
... | github_jupyter |
```
import pandas as pd
import numpy as np
import sklearn
import matplotlib.pyplot as plt
import matplotlib
from joblib import dump
from sklearn.ensemble import IsolationForest
```
# Load the data
```
X_train = pd.read_csv('./Datasets/train.csv')
X_test = pd.read_csv('./Datasets/test.csv')
X_train.shape
```
# Train ... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#In-This-Notebook" data-toc-modified-id="In-This-Notebook-1"><span class="toc-item-num">1 </span>In This Notebook</a></span></li><li><span><a href="#Final-Result" data-toc-modified-id="Final-Resul... | github_jupyter |
```
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import plotly.express as px
import seaborn as sns
os.chdir("E:\\PYTHON NOTES\\projects\\100 data science projeect\\choronic kidney")
data=pd.read_csv("kidney_disease.csv")
data
data.shape
data.describe()
columns=pd.read_csv("data_descr... | github_jupyter |
# Baseline
```
import os
from typing import Any, Dict
import numpy as np
import nltk
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score
```
## Utilities
```
def train_validate_test_logistic_regressi... | github_jupyter |
```
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
```
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
```
# Start: 1970-10-01
# End: 2020-09-31
stock_data = pd.read_csv(
"/content/dri... | github_jupyter |
```
import projector
import numpy as np
import dnnlib
from dnnlib import tflib
import pickle
import tensorflow as tf
import PIL
import os
import tqdm
network_pkl = "https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada/pretrained/ffhq.pkl"
def project(network_pkl: str, target_fname: str, outdir: str, save_video: bool, seed: i... | github_jupyter |
# Project: Part of Speech Tagging with Hidden Markov Models
---
### Introduction
Part of speech tagging is the process of determining the syntactic category of a word from the words in its surrounding context. It is often used to help disambiguate natural language phrases because it can be done quickly with high accu... | github_jupyter |
# Deep Neural Network with 5 Input Features
In this notebook we will train a deep neural network using 5 input feature to perform binary classification of our dataset.
## Setup
We first need to import the libraries and frameworks to help us create and train our model.
- Numpy will allow us to manipulate our input ... | github_jupyter |
```
#!/usr/bin/python
# DS4A Project
# Group 84
# using node/edge info to create network graph
# and do social network analysis
from os import path
import pandas as pd
from sklearn.linear_model import LogisticRegression
nominee_count_degree_data_path = '../data/nominee_degree_counts_data.csv'
def load_dataset(filep... | github_jupyter |
<a href="https://colab.research.google.com/github/MIT-LCP/sccm-datathon/blob/master/04_timeseries.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# eICU Collaborative Research Database
# Notebook 4: Timeseries for a single patient
This notebook ex... | github_jupyter |
```
import pandas as pd
from IPython.core.display import display, HTML
display(HTML("<style>.container {width:90% !important;}</style>"))
# Don't wrap repr(DataFrame) across additional lines
pd.set_option("display.expand_frame_repr", True)
# Set max rows displayed in output to 25
pd.set_option("display.max_rows", 25)... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.