code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
##### Copyright 2020 Google
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | github_jupyter |
Synergetics<br/>[Oregon Curriculum Network](http://4dsolutions.net/ocn/)
<h3 align="center">Computing Volumes in XYZ and IVM units</h3>
<h4 align="center">by Kirby Urner, July 2016</h4>

A cube is composed of 24 identical no... | github_jupyter |
Here you have a collection of guided exercises for the first class on Python. <br>
The exercises are divided by topic, following the topics reviewed during the theory session, and for each topic you have some mandatory exercises, and other optional exercises, which you are invited to do if you still have time after the... | github_jupyter |
# Chapter 9
*Modeling and Simulation in Python*
Copyright 2021 Allen Downey
License: [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
# check if the libraries we need are installed
try:
import pint
except ImportError:
!pip ins... | github_jupyter |
```
!pip install yacs
!pip install gdown
import os, sys, time
import argparse
import importlib
from tqdm.notebook import tqdm
from imageio import imread
import torch
import numpy as np
import matplotlib.pyplot as plt
```
### Download pretrained
- We use HoHoNet w/ hardnet encoder in this demo
- Download other version ... | github_jupyter |
```
###################################################################################################
# #
# Primordial Black Hole Evaporation + DM Production #
# ... | github_jupyter |
# GPyOpt: dealing with cost fuctions
### Written by Javier Gonzalez, University of Sheffield.
## Reference Manual index
*Last updated Friday, 11 March 2016.*
GPyOpt allows to consider function evaluation costs in the optimization.
```
%pylab inline
import GPyOpt
# --- Objective function
objective_true = GPyOpt.... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv("test2_result.csv")
df
df2 = pd.read_excel("Test_2.xlsx")
# 只含特征值的完整数据集
data = df2.drop("TRUE VALUE", axis=1)
# 只含真实分类信息的完整数据集
labels = df2["TRUE VALUE"]
# data2是去掉真实分类信息的数据集(含有聚类后的结果)
data2 = df.drop("TRUE VALUE", axis=1)
data... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Water/usgs_watersheds.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank... | github_jupyter |
<img align="right" src="images/ninologo.png" width="150"/>
<img align="right" src="images/tf-small.png" width="125"/>
<img align="right" src="images/dans.png" width="150"/>
# Start
This notebook gets you started with using
[Text-Fabric](https://github.com/Nino-cunei/uruk/blob/master/docs/textfabric.md) for coding in ... | github_jupyter |
# Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free to explore the data and... | github_jupyter |
```
import zmq
import msgpack
import sys
from pprint import pprint
import json
import numpy as np
import ceo
import matplotlib.pyplot as plt
%matplotlib inline
port = "5556"
```
# SETUP
```
context = zmq.Context()
print "Connecting to server..."
socket = context.socket(zmq.REQ)
socket.connect ("tcp://localhost:%s" %... | github_jupyter |
# **Tutorial 11: Working with Files (Part 02)** 👀
<a id='t11toc'></a>
#### Contents: ####
- **[Parsing](#t11parsing)**
- [`strip()`](#t11strip)
- [Exercise 1](#t11ex1)
- [`split()`](#t11split)
- [Exercise 2](#t11ex2)
- **[JSON](#t11json)**
- [Reading JSON from a String](#t11loads)
- [R... | github_jupyter |
<div align="center"><img src='http://ufq.unq.edu.ar/sbg/images/top.jpg' alt="SGB logo"> </div>
<h1 align='center'> TALLER “PROGRAMACIÓN ORIENTADA A LA BIOLOGÍA”</h1>
<h3 align='center'>(En el marco del II CONCURSO “BIOINFORMÁTICA EN EL AULA”)</h3>
La bioinformática es una disciplina científica destinada a la aplicaci... | github_jupyter |
```
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = 'all'
from flask import Flask, jsonify, render_template
import sqlalchemy
from sqlalchemy import create_engine, func, inspect
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
impor... | github_jupyter |
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Challenge Notebook
## Problem: Format license keys.
See the [LeetCode](https://leetcode.com/problems/license-key-formatting/) problem p... | github_jupyter |
##### Copyright 2018 The TensorFlow Probability Authors.
Licensed under the Apache License, Version 2.0 (the "License");
```
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | github_jupyter |
# Problem Statement
The Indian Premier League (IPL) is a professional Twenty20 cricket league in India contested during March or April and May of every year by eight teams representing eight different cities in India.The league was founded by the Board of Control for Cricket in India (BCCI) in 2008. The IPL has an exc... | github_jupyter |
## Blood Donor Management System
```
#Tkinter is the standard GUI library for Python
from tkinter import *
from tkinter import ttk
import pymysql
#class creation
class Donor:
def __init__(self,root):
self.root=root
#Title of the application
self.root.title("Blood Donor Management System")
... | github_jupyter |
<a href="https://colab.research.google.com/github/ElizaLo/Practice-Python/blob/master/Data%20Compression%20Methods/Huffman%20Code/Huffman_code.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Huffman Coding
## **Solution**
```
import heapq
from c... | github_jupyter |
```
import csv
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
def draw_map_background(m, ax):
ax.set_facecolor('#729FCF')
m.fillcontinents(color='#FFEFDB', ax=ax, zorder=0)
m.drawcounties(ax=ax)
m.draws... | github_jupyter |
```
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import datetime
dataset = pd.read_csv(r'C:\Users\ANOVA AJAY PANDEY\Desktop\SEM4\CSE 3021 SIN\proj\stock analysis\Google_Stock_Price_Train.csv',index_col="Date",parse_dates=True)
dataset = pd.read_csv(r'C:\Users\ANOVA AJ... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/colab/healthcare/de_identification/DeIdentification_model_overview.ipynb)
All the models avai... | github_jupyter |
```
# change into the root directory of the project
import os
if os.getcwd().split("/")[-1] == "notebooks":
os.chdir('..')
import logging
logger = logging.getLogger()
#import warnings
#warnings.filterwarnings("ignore")
logger.setLevel(logging.INFO)
#logging.disable(logging.WARNING)
#logging.disable(logging.WARN)
... | github_jupyter |
```
import os
import sys
import itertools
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.regression.linear_model as sm
from scipy import io
from mpl_toolkits.axes_grid1 import make_axes_locatable
path_root = os.environ.get('DECIDENET_PATH')
path_code... | github_jupyter |
```
from datascience import *
%matplotlib inline
path_data = '../../../../data/'
import matplotlib.pyplot as plots
plots.style.use('fivethirtyeight')
import numpy as np
```
### Deflategate ###
On January 18, 2015, the Indianapolis Colts and the New England Patriots played the American Football Conference (AFC) champio... | github_jupyter |
```
# This is Main function.
# Extracting streaming data from Twitter, pre-processing, and loading into MySQL
import credentials # Import api/access_token keys from credentials.py
import setting # Import related setting constants from settings.py
import re
import tweepy
import mysql.connector
import pandas as pd
from... | github_jupyter |
<a href="https://colab.research.google.com/github/ajayjg/omipynb/blob/master/omSpeech.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
OM **IPYNB**
---
#Imports
```
!pip install Keras==2.2.0
!pip install pandas==0.22.0
!pip install pandas-ml==0... | github_jupyter |
<img src="images/kiksmeisedwengougent.png" alt="Banner" width="1100"/>
<div>
<font color=#690027 markdown="1">
<h1>CLASSIFICATIE STOMATA OP BEZONDE EN BESCHADUWDE BLADEREN</h1>
</font>
</div>
<div class="alert alert-box alert-success">
In deze notebook zal je bezonde en beschaduwde bladeren van elk... | github_jupyter |
# Loading and Checking Data
## Importing Libraries
```
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import math
import numpy as np
import matplotlib.pyplot as plt
%matp... | github_jupyter |
## <center>Mempermudah para peneliti dan dokter dalam meneliti persebaran Covid-19 di US
Kelompok-1 :
1. Gunawan Adhiwirya
2. Reyhan Septri Asta
3. Muhammad Figo Mahendra
#### Langkah pertama kami me-import package yang di butuhkan

```
#import pandas
import pandas as pd
#import nu... | github_jupyter |
# Analyzing HTSeq Data Using Two Differential Expression Modules
<p>The main goals of this project are:</p>
<ul>
<li>Analyze HTSeq count data with tools that assume an underlying <a href="https://en.wikipedia.org/wiki/Negative_binomial_distribution" target="_blank">negative binomial distribution</a> on the data</li>... | github_jupyter |
## Apprentissage supervisé: Forêts d'arbres aléatoires (Random Forests)
Intéressons nous maintenant à un des algorithmes les plus popualires de l'état de l'art. Cet algorithme est non-paramétrique et porte le nom de **forêts d'arbres aléatoires**
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as p... | github_jupyter |
### Clipping
En un juego a menudo tenemos la necesidad de dibujar solo en una pate
de la pantalla. Por ejemplo, en un juego de estrategia, al estilo
del [Command and Conquer](https://es.wikipedia.org/wiki/Command_%26_Conquer), podemos
querer dividir la pantalla en dos. Una parte superior grande donse se muestra un ma... | github_jupyter |
# Matrix Factorization for Recommender Systems - Part 2
As seen in [Part 1](https://online-ml.github.io/examples/matrix-factorization-for-recommender-systems-part-1), strength of [Matrix Factorization (MF)](https://en.wikipedia.org/wiki/Matrix_factorization_(recommender_systems)) lies in its ability to deal with spars... | github_jupyter |
<a href="https://colab.research.google.com/github/AlbertoRosado1/desihigh/blob/main/nbody.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import drive
drive.mount('/content/drive')
from IPython.display import clear_output
from ... | github_jupyter |
# Import necessary dependencies and settings
```
import pandas as pd
import numpy as np
import re
import nltk
import matplotlib.pyplot as plt
pd.options.display.max_colwidth = 200
%matplotlib inline
# Sample corpus of text documents
corpus = ['The sky is blue and beautiful.',
'Love this blue and beautiful s... | github_jupyter |
[Sascha Spors](https://orcid.org/0000-0001-7225-9992),
Professorship Signal Theory and Digital Signal Processing,
[Institute of Communications Engineering (INT)](https://www.int.uni-rostock.de/),
Faculty of Computer Science and Electrical Engineering (IEF),
[University of Rostock, Germany](https://www.uni-rostock.de/en... | github_jupyter |
```
# !pip install scikeras
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn.model_selection import train_test_split, GridSearchCV, RandomizedSearchCV
from sklearn.compose import make_column_selector, make_column_transformer
from sklearn.preprocessing import ... | github_jupyter |
# Mandatory Assignment 1
This is the first of two mandatory assignments which must be completed during the course. First some practical information:
* When is the assignment due?: **23:59, Sunday, August 19, 2018.**
* How do you grade the assignment?: You will **peergrade** each other as primary grading.
* Can i wor... | github_jupyter |
```
import os
import argparse
from keras.preprocessing.image import ImageDataGenerator
from keras import callbacks
import numpy as np
from keras import layers, models, optimizers
from keras import backend as K
from keras.utils import to_categorical
import matplotlib.pyplot as plt
from utils import combine_images
from P... | 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 |
# Basic Circuit Identities
```
from qiskit import QuantumCircuit, Aer, execute
from qiskit.circuit import Gate
from math import pi
qc = QuantumCircuit(2)
c = 0
t = 1
```
When we program quantum computers, our aim is always to build useful quantum circuits from the basic building blocks. But sometimes, we might not ha... | github_jupyter |
```
%pylab inline
import numpy as np
import math
```
Condiciones iniciales del problema.
```
q=-1.602176565E-19
v_0=3.0E5
theta_0=0
B=-10**(-4)
m=9.1093829E-31
N=1000
```
Cálculo del tiempo que tarda la partícula en volver a cruzar el eje $x$ teóricamente t definición del intervalo de tiempo a observar.
```
def tie... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from astropy import units as u
from astropy import constants as const
import matplotlib as mpl
from jupyterthemes import jtplot #These two lines can be skipped if you are not using jupyter themes
jtplot.reset()
from astropy.cosmology import FlatLambdaCDM
cosmo = F... | github_jupyter |
# Issue: the GO Term tags and names are mismatched on the output of the maaslin2 term files
## Objective: Identify and repair the mismatached go tags and names
```
library(phyloseq)
setwd("/media/jochum00/Aagaard_Raid3/microbial/GO_term_analysis/R_Maaslin2/") # Change the current working directory
```
import the base... | github_jupyter |
```
#El Mehdi CHOUHAM version 1
# mehdichouham@gmail.com for Tictactrip
import pandas as pd
import numpy as np
import datetime as dt
import plotly.graph_objects as go
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn.linear_model import ARDRegressi... | github_jupyter |
```
#default_exp data.load
#export
from fastai2.torch_basics import *
from torch.utils.data.dataloader import _MultiProcessingDataLoaderIter,_SingleProcessDataLoaderIter,_DatasetKind
_loaders = (_MultiProcessingDataLoaderIter,_SingleProcessDataLoaderIter)
from nbdev.showdoc import *
bs = 4
letters = list(string.ascii_... | github_jupyter |
**Chapter 2 – End-to-end Machine Learning project**
*Welcome to Machine Learning Housing Corp.! Your task is to predict median house values in Californian districts, given a number of features from these districts.*
*This notebook contains all the sample code and solutions to the exercices in chapter 2.*
<table alig... | github_jupyter |
```
import pandas as pd
import numpy as np
import requests
import psycopg2
import json
import simplejson
import urllib
import config
import ast
from operator import itemgetter
from sklearn.cluster import KMeans
from sqlalchemy import create_engine
!pip install --upgrade pip
!pip install sqlalchemy
!pip install psycopg... | github_jupyter |
```
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from functools import lru_cache
from numba import jit
import community
import warnings; warnings.simplefilter('ignore')
@jit(nopython = True)
def generator(A):
B = np.zeros((len(A)+2, len(A)+2), np.int_)
B[1:-1,1:-1] = A
for i in r... | github_jupyter |
# SkillFactory
## Введение в ML, введение в sklearn
В этом задании мы с вами рассмотрим данные с конкурса [Задача предсказания отклика клиентов ОТП Банка](http://www.machinelearning.ru/wiki/index.php?title=%D0%97%D0%B0%D0%B4%D0%B0%D1%87%D0%B0_%D0%BF%D1%80%D0%B5%D0%B4%D1%81%D0%BA%D0%B0%D0%B7%D0%B0%D0%BD%D0%B8%D1%8F_%D0... | github_jupyter |
# Classification
**Data - Social network Ads**
## Importing the Libraries
```
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
```
## Importing the dataset
```
dataset = pd.read_csv('Social_Network_Ads.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
```
## Splitting the ... | github_jupyter |
# [Best viewed in NBviewer](https://nbviewer.jupyter.org/github/ETCBC/heads/blob/master/tutorial.ipynb)
# Heads Tutorial
## Introduction
This notebook provides a basic introduction to the `heads` edge and node features for BHSA, produced in `etcbc/heads`. Syntactic phrase heads are important because they provide t... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
import sys
os.chdir(sys.path[0]+"/../data")
import urllib.request
from bs4 import BeautifulSoup
import pandas as pd
import re
from tqdm import tqdm
categories = [
"100 metres, Men",
"200 metres, Men",
"400 metres, Men",
"800 ... | github_jupyter |
```
#pip install xgboost
import xgboost as xgb
from sklearn.metrics import mean_squared_error
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
df = pd.read_csv('2019_data.csv')
df.head(-5)
df.dropna(subset=['LSOA code', 'Month', 'Location', 'Crime type', 'Longitude', 'Latitude... | github_jupyter |
```
# Jovian Commit Essentials
# Please retain and execute this cell without modifying the contents for `jovian.commit` to work
!pip install jovian --upgrade -q
import jovian
jovian.set_project('pandas-practice-assignment')
jovian.set_colab_id('1EMzM1GAuekn6b3mjbgjC83UH-2XgQHAe')
```
# Assignment 3 - Pandas Data Analy... | github_jupyter |
```
import numpy as np
import S_Dbw as sdbw
from sklearn.cluster import KMeans
from sklearn.datasets.samples_generator import make_blobs
from sklearn.metrics.pairwise import pairwise_distances_argmin
np.random.seed(0)
S_Dbw_result = []
batch_size = 45
centers = [[1, 1], [-1, -1], [1, -1]]
cluster_std=[0.7,0.3,1.2]
n_... | github_jupyter |
# Relatório de Análise VII
## Criando Argumentos
```
import pandas as pd
dados = pd.read_csv('dados/aluguel_residencial.csv', sep = ';')
dados.head(10)
```
##### https://pandas.pydata.org/pandas-docs/stable/reference/frame.html
```
dados['Valor'].mean()# Média Geral
dados.Bairro.unique()
bairros = ['Copacabana', 'J... | github_jupyter |
```
from xml.etree import ElementTree
from xml.dom import minidom
from xml.etree.ElementTree import Element, SubElement, Comment, indent
def prettify(elem):
"""Return a pretty-printed XML string for the Element.
"""
rough_string = ElementTree.tostring(elem, encoding="ISO-8859-1")
reparsed = minidom.par... | github_jupyter |
```
!pip install praw
import praw
from time import sleep
import datetime
from datetime import timedelta
```
I am going to start out using the Reddit app, and pulling from the subreddit, Wallstreet bets. There has been a lot of news about this subreddit and the stock market in coordination with Gamestop, AMC and BB... | github_jupyter |
# Multi-variate Rregression Metamodel with DOE based on random sampling
* Input variable space should be constructed using random sampling, not classical factorial DOE
* Linear fit is often inadequate but higher-order polynomial fits often leads to overfitting i.e. learns spurious, flawed relationships between input an... | github_jupyter |
```
# Dependencies and Setup
import pandas as pd
# import dataframe_image as dfi
# File to Load (Remember to change the path if needed.)
school_data_to_load = "Resources/schools_complete.csv"
student_data_to_load = "Resources/students_complete.csv"
# Read the School Data and Student Data and store into a Pandas DataF... | github_jupyter |
# Batch predicting using Cloud Machine Learning Engine
A Kubeflow Pipeline component to submit a batch prediction job against a trained model to Cloud ML Engine service.
## Intended use
Use the component to run a batch prediction job against a deployed model in Cloud Machine Learning Engine. The prediction output will... | github_jupyter |
## <div align="center"> 10 Steps to Become a Data Scientist +20Q</div>
<div align="center">**quite practical and far from any theoretical concepts**</div>
<div style="text-align:center">last update: <b>15/01/2019</b></div>
<img src="http://s9.picofile.com/file/8338833934/DS.png"/>
--------------------------------... | github_jupyter |
```
#!/usr/bin/env python
# coding: utf-8
# ------
# **Dementia Patients -- Analysis and Prediction**
### ***Author : Akhilesh Vyas***
### ****Date : Januaray, 2020****
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
import pickle
import re
# define path
data_path = '../../.... | github_jupyter |
## Extracting Important Keywords from Text with TF-IDF and Python's Scikit-Learn
Back in 2006, when I had to use TF-IDF for keyword extraction in Java, I ended up writing all of the code from scratch as Data Science nor GitHub were a thing back then and libraries were just limited. The world is much different today. ... | github_jupyter |
# Population Segmentation with SageMaker
In this notebook, you'll employ two, unsupervised learning algorithms to do **population segmentation**. Population segmentation aims to find natural groupings in population data that reveal some feature-level similarities between different regions in the US.
Using **principal... | github_jupyter |
# Histograms of time-mean surface temperature
## Import the libraries
```
# Data analysis and viz libraries
import aeolus.plot as aplt
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
# Local modules
from calc import sfc_temp
import mypaths
from names import names
from commons import MODELS
impo... | github_jupyter |
# Near to far field transformation
See on [github](https://github.com/flexcompute/tidy3d-notebooks/blob/main/Near2Far_ZonePlate.ipynb), run on [colab](https://colab.research.google.com/github/flexcompute/tidy3d-notebooks/blob/main/Near2Far_ZonePlate.ipynb), or just follow along with the output below.
This tutorial wi... | github_jupyter |

# Qiskit Runtime on IBM Cloud
Qiskit Runtime is now part of the IBM Quantum Services on IBM Cloud. To use this service, you'll need to create an IBM Cloud account and a quantum service instance. [This guide](https://cloud.ibm.com/docs/account?topic=account-account-ge... | github_jupyter |
```
import numpy as np
import pandas as pd
import pathlib as pl
from datetime import datetime
import matplotlib.pyplot as plot
from pandas import DataFrame, Series
# read from csv files
datapath=pl.Path("../csvdata")
file_list=[]
dfs=[]
for x in datapath.glob("*H.csv"):
print("Reading "+x.name)
f=pd.read_csv(... | github_jupyter |
# Data Visualization
The RAPIDS AI ecosystem and `cudf.DataFrame` are built on a series of standards that simplify interoperability with established and emerging data science tools.
With a growing number of libraries adding GPU support, and a `cudf.DataFrame`’s ability to convert `.to_pandas()`, a large portion of th... | github_jupyter |
# Bgt2Vec
Original code is generated from © Yuriy Guts, 2016
## Imports
```
from __future__ import absolute_import, division, print_function
import codecs
import glob
import logging
import multiprocessing
import os
import pprint
import re
import nltk
import gensim.models.word2vec as w2v
import sklearn.manifold
impor... | github_jupyter |
# Demo
Minimal working examples with Catalyst.
- ML - Projector, aka "Linear regression is my profession"
- CV - mnist classification, autoencoder, variational autoencoder
- GAN - mnist again :)
- NLP - sentiment analysis
- RecSys - movie recommendations
```
! pip install -U torch==1.4.0 torchvision==0.5.0 torchtext=... | github_jupyter |
# Weight Initialization
In this lesson, you'll learn how to find good initial weights for a neural network. Weight initialization happens once, when a model is created and before it trains. Having good initial weights can place the neural network close to the optimal solution. This allows the neural network to come to ... | github_jupyter |
<a href="https://colab.research.google.com/github/AWH-GlobalPotential-X/AWH-Geo/blob/master/notebooks/AWH-Geo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Welcome to AWH-Geo
This tool requires a [Google Drive](https://drive.google.com/drive/my-d... | github_jupyter |
# Scraping Geofenced Anti Vax Tweets across Australia
Firstly, a new environment is created and activated.
In my initial attempt, the scraping didn't work. After some research on Stack Overflow I determined that a particular version of TWINT was currently needed to get around Twitter's suppression of the library:
pi... | github_jupyter |
# Programming Assignment
## CNN classifier for the MNIST dataset
### Instructions
In this notebook, you will write code to build, compile and fit a convolutional neural network (CNN) model to the MNIST dataset of images of handwritten digits.
Some code cells are provided you in the notebook. You should avoid editin... | github_jupyter |
# Chapter 7
```
import arviz as az
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pymc3 as pm
import statsmodels.api as sm
import statsmodels.formula.api as smf
from patsy import dmatrix
from scipy import stats
from scipy.special import logsumexp
%config Inline.figure_format = 'retina'
... | github_jupyter |
```
import numpy as np
import pickle
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloading external modules
# see http://stackoverflow.com/ques... | github_jupyter |
```
from mpl_toolkits.axes_grid1 import make_axes_locatable
import random
import numpy as np
from src.codeGameSimulation.GameUr import GameSettings
from theory.helpers import labelLine,draw_squares,draw_circles,draw_stars,draw_path,draw_fives,draw_4fives,draw_4eyes,draw_steps
import gameBoardDisplay as gbd
from scipy ... | github_jupyter |
# Introduction to Decision Theory using Probabilistic Graphical Models
<img style="float: right; margin: 0px 0px 15px 15px;" src="https://upload.wikimedia.org/wikipedia/commons/b/bb/Risk_aversion_curve.jpg" width="400px" height="300px" />
> So far, we have seen that probabilistic graphical models are useful for model... | github_jupyter |
```
# Copyright 2021 NVIDIA Corporation. 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 applica... | github_jupyter |
# MaxEnt Gridworld
> Implementation of MaxEnt-IRL model for FBER recommendation system, based on the approach of Ziebart et al. 2008 paper: Maximum Entropy Inverse Reinforcement Learning.
```
import copy
import warnings
warnings.filterwarnings('ignore')
"""
Find the value function associated with a policy. Based on ... | github_jupyter |
MIT License
Copyright (c) 2017 Erik Linder-Norén
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, modify, merge, publish,... | github_jupyter |
# Training and hosting SageMaker Models using the Apache MXNet Gluon API
When there is a person in front of you, your human eyes can immediately recognize what direction the person is looking at (e.g. either facing straight up to you or looking at somewhere else). The direction is defined as the head-pose. We are goin... | github_jupyter |
# Numpy
```
import numpy as np
```
## 1) Array Creation
### 1.1 From function
```
lst = list(range(1,100,5))
print(lst)
arr = np.arange(1,100,5)
print(arr)
print(type(arr))
```
### 1.2 From list
```
l1 = [1,2,3,4]
arr1 = np.array(l1)
print(l1)
print(arr1)
list2d = [[1,2],[3,4],[5,6]]
arr2d = np.array(list2d)
prin... | github_jupyter |
```
# Main code
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import re
def parse_order_info(order_info, player_name):
order_list = re.findall(r"\[(.*?)\]", order_info)[0].split(", ")
position = 1
for i in range(len(order_list)):
if player_name in... | github_jupyter |
# Kaggle San Francisco Crime Classification
## Berkeley MIDS W207 Final Project: Sam Goodgame, Sarah Cha, Kalvin Kao, Bryan Moore
### Environment and Data
```
# Additional Libraries
%matplotlib inline
import matplotlib.pyplot as plt
# Import relevant libraries:
import time
import numpy as np
import pandas as pd
from... | github_jupyter |
```
from Toolv1 import MotionGenerator, GenerateTraj,random_rot,traj_to_dist
from Toolv1 import diffusive,subdiffusive,directed,accelerated,slowed,still
from Toolv1 import diffusive_confined,subdiffusive_confined, continuous_time_random_walk
from Toolv1 import continuous_time_random_walk_confined
import numpy as np
ndi... | github_jupyter |
# Data Cleaning
For each IMU file, clean the IMU data, adjust the labels, and output these as CSV files.
```
%load_ext autoreload
%autoreload 2
%matplotlib notebook
import numpy as np
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import RepeatedStratifiedKFold
from sklearn.ensembl... | github_jupyter |
```
import csv
import numpy as np
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from google.colab import files
```
The data for this exercise is available at: https://www.kaggle.com/datamunge/sign-language-mnist/home
Sign up and download to find 2 CSV files: sign_mnist_te... | github_jupyter |
# Getting Started with *pyFTracks* v 1.0
**Romain Beucher, Roderick Brown, Louis Moresi and Fabian Kohlmann**
The Australian National University
The University of Glasgow
Lithodat
*pyFTracks* is a Python package that can be used to predict Fission Track ages and Track lengths distributions for some given thermal-his... | github_jupyter |
```
%matplotlib inline
import pandas as pd
import cycluster as cy
import os.path as op
import numpy as np
import palettable
from custom_legends import colorLegend
import seaborn as sns
from hclusterplot import *
import matplotlib
import matplotlib.pyplot as plt
import pprint
import openpyxl
sns.set_context('paper')
pat... | github_jupyter |
```
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
import torchvision
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
path = 'data/mnist/'
raw_train = pd.read_csv(path + 'train.csv')
raw_test = pd.read_csv(pa... | github_jupyter |
# Building and Visualizing word frequencies
In this lab, we will focus on the `build_freqs()` helper function and visualizing a dataset fed into it. In our goal of tweet sentiment analysis, this function will build a dictionary where we can lookup how many times a word appears in the lists of positive or negative twe... | github_jupyter |
```
# all_slow
#default_exp medical.imaging
```
# Medical Imaging
> Helpers for working with DICOM files
```
#export
from fastai.basics import *
from fastai.vision.all import *
from fastai.data.transforms import *
import pydicom,kornia,skimage
from pydicom.dataset import Dataset as DcmDataset
from pydicom.tag impo... | github_jupyter |
<center>
<img src="https://gitlab.com/ibm/skills-network/courses/placeholder101/-/raw/master/labs/module%201/images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# **Data Visualization Lab**
Estimated time needed: **45 to 60** minutes
In this assignment you will be focusing on the visualiz... | github_jupyter |
4th order runge kutta with adapted step size
- small time step to improve accuracy
- integration more efficient (partition)
## a simple coupled ODE
d^2y/dx^2 = -y
for all x the second derivative of y is = -y (sin or cos curve)
- specify boundary conditions to determine which
- y(0) = 0 and dy/dx (x = 0) = 1 --> ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.