code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
<a href="https://colab.research.google.com/github/Shailyshaik2021/python/blob/main/PythonCodes.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<h1>Welcome to Colab!</h1>
If you're already familiar with Colab, check out this video to learn about int... | github_jupyter |
<a href="https://colab.research.google.com/github/VRB01/capstone/blob/main/Tranformer_librispeech.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import IPython.display as ipd
# % pylab inline
import os
import pandas as pd
import librosa
import ... | 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 |
### Set Data Path
```
from pathlib import Path
base_dir = Path("data")
train_dir = base_dir/Path("train")
validation_dir = base_dir/Path("validation")
test_dir = base_dir/Path("test")
```
### Image Transform Function
```
from torchvision import transforms
transform = transforms.Compose([
transforms.Resize((22... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W1D2_LinearDeepLearning/student/W1D2_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Tutorial 2: Learning Hyperparameters
**Week 1,... | github_jupyter |
# Partitioning feature space
**Make sure to get latest dtreeviz**
```
! pip install -q -U dtreeviz
! pip install -q graphviz==0.17 # 0.18 deletes the `run` func I need
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression, Ridge, Lasso, LogisticRegression
from sklearn.ensemble impo... | github_jupyter |
# String equation example
## Analytic problem formulation
We consider a vibrating string on the segment $[0, 1]$, fixed on both sides, with input $u$ and output $\tilde{y}$ in the middle:
$$
\begin{align*}
\partial_{tt} \xi(z, t)
+ d \partial_t \xi(z, t)
- k \partial_{zz} \xi(z, t)
& = \delta(z - \tfr... | github_jupyter |
## Dataset
The CIFAR-10 dataset (Canadian Institute For Advanced Research) is a collection of images that are commonly used to train machine learning and computer vision algorithms. It is one of the most widely used datasets for machine learning research. The CIFAR-10 dataset contains 60,000 32x32 color images in 10 d... | github_jupyter |
# Self Supervised Learning Fastai Extension
> Implementation of popular SOTA self-supervised learning algorithms as Fastai Callbacks.
You may find documentation [here](https://keremturgutlu.github.io/self_supervised) and github repo [here](https://github.com/keremturgutlu/self_supervised/tree/master/)
## Install
`p... | github_jupyter |
<a href="https://colab.research.google.com/github/itsCiandrei/LinearAlgebra_2ndSem/blob/main/Assignment10_BENITEZ_FERNANDEZ.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Linear Algebra for ECE
## Laboratory 10 : Linear Combination and Vector Spa... | github_jupyter |
# Compute norm from function space
```
from dolfin import *
import dolfin as df
import numpy as np
import logging
df.set_log_level(logging.INFO)
df.set_log_level(WARNING)
mesh = RectangleMesh(0, 0, 1, 1, 10, 10)
#mesh = Mesh(Rectangle(-10, -10, 10, 10) - Circle(0, 0, 0.1), 10)
V = FunctionSpace(m... | github_jupyter |
## Create Data
```
import numpy as np
import matplotlib.pyplot as plt
from patsy import dmatrix
from statsmodels.api import GLM, families
def simulate_poisson_process(rate, sampling_frequency):
return np.random.poisson(rate / sampling_frequency)
def plot_model_vs_true(time, spike_train, firing_rate, conditional_... | github_jupyter |
```
%matplotlib inline
```
**Read Later:**
Document about ``autograd.Function`` is at
https://pytorch.org/docs/stable/autograd.html#function
**Notes:**
needs to set requires_grad == True when define the tensor if you wanna autograd.
assume z = f(x,y)
z.backward() initiates the backward pass and computed all the g... | github_jupyter |
```
# Dependencies
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import timedelta
import time
from datetime import date
# Import SQL Alchemy
from sqlalchemy import create_engine, ForeignKey, func
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
... | github_jupyter |
## Global Air Pollution Measurements
* [Air Quality Index - Wiki](https://en.wikipedia.org/wiki/Air_quality_index)
* [BigQuery - Wiki](https://en.wikipedia.org/wiki/BigQuery)
In this notebook data is extracted from *BigQuery Public Data* assesible exclusively only in *Kaggle*. The BigQurey Helper Object will convert ... | github_jupyter |
# Breast Cancer Wisconsin (Diagnostic) Data Set
* **[T81-558: Applications of Deep Learning](https://sites.wustl.edu/jeffheaton/t81-558/)**
* Dataset provided by [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+%28Diagnostic%29)
* [Download Here](https://raw.githubuserco... | github_jupyter |
# Digital Signal Processing
This collection of [jupyter](https://jupyter.org/) notebooks introduces various topics of [Digital Signal Processing](https://en.wikipedia.org/wiki/Digital_signal_processing). The theory is accompanied by computational examples written in [IPython 3](http://ipython.org/). The sources of the... | github_jupyter |
# Downloading GNSS station locations and tropospheric zenith delays
**Author**: Simran Sangha, David Bekaert - Jet Propulsion Laboratory
This notebook provides an overview of the functionality included in the **`raiderDownloadGNSS.py`** program. Specifically, we outline examples on how to access and store GNSS statio... | github_jupyter |
### Let's load a Handwritten Digit classifier we'll be building very soon!
```
import cv2
import numpy as np
from keras.datasets import mnist
from keras.models import load_model
classifier = load_model('/home/deeplearningcv/DeepLearningCV/Trained Models/mnist_simple_cnn.h5')
# loads the MNIST dataset
(x_train, y_tra... | github_jupyter |
# tutorial for reading a Gizmo snapshot
@author: Andrew Wetzel <arwetzel@gmail.com>
```
# First, move within a simulation directory, or point 'directory' below to a simulation directory.
# This directory should contain either a snapshot file
# snapshot_???.hdf5
# or a snapshot directory
# snapdir_???
# In gene... | github_jupyter |
<a href="https://colab.research.google.com/github/mostaphafakihi/Simulation/blob/main/PRsimulation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# **Projet de simulation d'un super marché**
```
import numpy as np
from pandas import DataFrame
impo... | github_jupyter |
# MACHINE LEARNING LAB - 4 ( Backpropagation Algorithm )
**4. Build an Artificial Neural Network by implementing the Backpropagation algorithm and test the same using appropriate data sets.**
```
import numpy as np
X = np.array(([2, 9], [1, 5], [3, 6]), dtype=float) # X = (hours sleeping, hours studying)
y = np... | github_jupyter |
# BYOA Tutorial - Prophet Forecasting en Sagemaker
The following notebook shows how to integrate your own algorithms to Amazon Sagemaker.
We are going to go the way of putting together an inference pipeline on the Prophet algorithm for time series.
The algorithm is installed in a docker container and then it helps us t... | github_jupyter |
```
import urllib2
from bs4 import BeautifulSoup
import csv
import time
import re
import urllib2
import csv
import time
import sys
import xml.etree.ElementTree as ET
import os
import random
import traceback
from IPython.display import clear_output
def createUserDict(user_element):
#userDict = []
id = getval(u... | github_jupyter |
Este código crea una función que me permite estimar la varianza de una distribución y lo chequea con las distribuciones de Poisson y Gauss. Además, usa el método boostrap resampling que se basa en, a partir de una muestra, se crea una población y luego se toman muestras de la misma.
Ésto permite medir un estadístico, ... | github_jupyter |
# VarEmbed Tutorial
Varembed is a word embedding model incorporating morphological information, capturing shared sub-word features. Unlike previous work that constructs word embeddings directly from morphemes, varembed combines morphological and distributional information in a unified probabilistic framework. Varembed... | github_jupyter |
# FMskill assignment
You are working on a project modelling waves in the Southern North Sea. You have done 6 different calibration runs and want to choose the "best". You would also like to see how your best model is performing compared to a third-party model in NetCDF.
The data:
* SW model results: 6 dfs0 files t... | github_jupyter |
## Instalación de numpy
```
! pip install numpy
import numpy as np
```
### Array creation
```
my_int_list = [1, 2, 3, 4]
#create numpy array from original python list
my_numpy_arr = np.array(my_int_list)
print(my_numpy_arr)
# Array of zeros
print(np.zeros(10))
# Array of ones with type int
print(np.ones(10, dtype... | github_jupyter |
# Lets-Plot in 2020
### Preparation
```
import numpy as np
import pandas as pd
import colorcet as cc
from PIL import Image
from lets_plot import *
from lets_plot.bistro.corr import *
LetsPlot.setup_html()
df = pd.read_csv("https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/lets_plot_git_history.c... | github_jupyter |
# Cross-validation
This notebook contains the function that performs cross validation tests. This is a dummy function that can be tested with the model/s.
```
def cross_val(df, k, model, split_method='random'):
"""
Performs cross-validation for different train and test sets.
Parameters
-----------
... | github_jupyter |
```
from tpot import TPOTClassifier
import os
from tqdm import tqdm_notebook as tqdm
# Ignore the warnings
import warnings
warnings.filterwarnings('always')
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import warnings
import matplotlib.pyplot as plt
from matplotlib.pyplot import subplot... | github_jupyter |
# LSV Data Analysis and Parameter Estimation
##### First, all relevent Python packages are imported
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.optimize import curve_fit
from scipy.signal import savgol_filter, find_peaks, find_peaks_cwt
import pandas as pd
import math
import g... | github_jupyter |
# Now You Code 1: Address
Write a Python program to input elements of your postal address and then output them as if they were an address label. The program should use a dictionary to store the address and complete two function defintions one for inputting the address and one for printing the address.
**NOTE:** While... | github_jupyter |
#Weak-Strong Cluster問題
2015年にGoogleとNASAが共同でD-Waveマシンは既存マシンの1億倍高速という発表を行いました。その際に利用されたのが量子ビットのクラスタを作ってフリップさせるWeak-Strong Cluster問題です。今回は簡単なweak clusterとstrong clusterを作って見て計算を行います。
論文は下記を参照します。
What is the Computational Value of Finite Range Tunneling?
https://arxiv.org/abs/1512.02206
##背景
量子アニーリングは量子トンネル効果を利用した最適... | github_jupyter |
# Disparate Impact by Providers' Gender
## the best model: XGBoost
```
import pandas as pd
import time
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import glob
import copy
from collections import Counter
from numpy import where
import statsmodels.api as sm
from sklearn.preprocessing import... | github_jupyter |
```
# Python3 program to solve N Queen
# Problem using backtracking
global N
N = 4
def printSolution(board):
for i in range(N):
for j in range(N):
print (board[i][j], end = " ")
print()
# A utility function to check if a queen can
# be placed on board[row][col]. Note that... | github_jupyter |
# Test: Minimum error discrimination
In this notebook we are testing the evolution of the error probability with the number of evaluations.
```
import sys
sys.path.append('../../')
import itertools
import numpy as np
import matplotlib.pyplot as plt
from numpy import pi
from qiskit.algorithms.optimizers import SPSA... | github_jupyter |
# Terminologies
<img src="https://github.com/dorisjlee/remote/blob/master/astroSim-tutorial-img/terminology.jpg?raw=true",width=20%>
- __Domain__ (aka Grids): the whole simulation box.
- __Block__(aka Zones): group of cells that make up a larger unit so that it is more easily handled. If the code is run in parallel, y... | github_jupyter |
# Single layer Neural Network
In this notebook, we will code a single neuron and use it as a linear classifier with two inputs. The tuning of the neuron parameters is done by backpropagation using gradient descent.
```
from sklearn.datasets import make_blobs
import numpy as np
# matplotlib to display the data
import... | github_jupyter |
# From raw *.ome.tif file to kinetic properties for immobile particles
This notebook will run ...
* picasso_addon.localize.main()
* picasso_addon.autopick.main()
* spt.immobile_props.main()
... in a single run to get from the raw data to the fully evaluated data in a single stroke. We therefore:
1. Define the full ... | github_jupyter |
# What are Tensors?
```
# -*- coding: utf-8 -*-
import numpy as np
# N is batch size; D_in is input dimension;
# H is hidden dimension; D_out is output dimension.
N, D_in, H, D_out = 64, 1000, 100, 10
# Create random input and output data
x = np.random.randn(N, D_in)
y = np.random.randn(N, D_out)
# Randomly initial... | github_jupyter |
#### New to Plotly?
Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).
<br>You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-fo... | github_jupyter |
Lambda School Data Science
*Unit 2, Sprint 3, Module 3*
---
# Permutation & Boosting
You will use your portfolio project dataset for all assignments this sprint.
## Assignment
Complete these tasks for your project, and document your work.
- [ ] If you haven't completed assignment #1, please do so first.
- [ ] C... | github_jupyter |
```
import glob
import time
# Divide up into cars and notcars
images = glob.glob('dataset/**/*.png', recursive=True)
cars = []
notcars = []
for image in images:
if 'non-vehicles' in image:
notcars.append(image)
else:
cars.append(image)
from hog import *
color_space='YCrCb'
spatial_size=(32, 32... | github_jupyter |
<small><small><i>
All the IPython Notebooks in **[Python Seaborn Module](https://github.com/milaan9/12_Python_Seaborn_Module)** lecture series by **[Dr. Milaan Parmar](https://www.linkedin.com/in/milaanparmar/)** are available @ **[GitHub](https://github.com/milaan9)**
</i></small></small>
<a href="https://colab.resea... | github_jupyter |
```
## imports ##
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle as pkl
####
## global ##
dataPath='/Users/ziegler/repos/mayfly/output/templatePeaks1252021.pkl'
templatePitchAngles=np.linspace(85,90,51)
templatePos=np.linspace(0,5e-2,21)
radius=0.0
nPeaks=5
keysAmp=[]
keysInd=[]
k... | github_jupyter |
```
import pandas as pd
import numpy as np
import mxnet as mx
from mxnet import nd, autograd, gluon, init
from mxnet.gluon import nn, rnn
import gluonnlp as nlp
import pkuseg
import multiprocessing as mp
import time
from d2l import try_gpu
import itertools
import jieba
from sklearn.metrics import accuracy_score, f1_sco... | github_jupyter |
TSG088 - Hadoop datanode logs
=============================
Steps
-----
### Parameters
```
import re
tail_lines = 500
pod = None # All
container = "hadoop"
log_files = [ "/var/log/supervisor/log/datanode*.log" ]
expressions_to_analyze = [
re.compile(".{23} WARN "),
re.compile(".{23} ERROR ")
]
log_analyz... | github_jupyter |
# Working with data files
Reading and writing data files is a common task, and Python offers native support for working with many kinds of data files. Today, we're going to be working mainly with CSVs.
### Import the csv module
We're going to be working with delimited text files, so the first thing we need to do is ... | github_jupyter |
## Project 2: Exploring the Uganda's milk imports and exports
A country's economy depends, sometimes heavily, on its exports and imports. The United Nations Comtrade database provides data on global trade. It will be used to analyse the Uganda's imports and exports of milk in 2015:
* How much does the Uganda export an... | github_jupyter |
# Finding the best market to adverts in e-learning
The aim of this project is to give examples of how to use basic concepts in Statistics, such as mean values, medians, ranges, and standard deviations, to answer questions using real-world data.
To be concrete, we will focus on Programming courses markets.
Using a re... | github_jupyter |
<a href="https://colab.research.google.com/github/AliKarasneh/create-react-app/blob/master/TwitterSentimentAnalysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install langdetect
!pip install tweepy
from PIL import Image
from nltk.senti... | github_jupyter |
## Visualizing and Comparing hours enrolled by UT students during the Fall 2020 semester
This project aims to see what are the different hours that UT students were enrolled in during the Fall 2020 semester. It will try to see if there any trends or differences based on the gender
### Libraries used for the vis... | github_jupyter |
# Final project: StackOverflow assistant bot
Congratulations on coming this far and solving the programming assignments! In this final project, we will combine everything we have learned about Natural Language Processing to construct a *dialogue chat bot*, which will be able to:
* answer programming-related questions ... | github_jupyter |
Lambda School Data Science
*Unit 4, Sprint 3, Module 3*
---
# Autoencoders
> An autoencoder is a type of artificial neural network used to learn efficient data codings in an unsupervised manner.[1][2] The aim of an autoencoder is to learn a representation (encoding) for a set of data, typically for dimensionality r... | github_jupyter |
# Analyzing colon tumor gene expression data
Data source:
- https://dx.doi.org/10.1038%2Fsdata.2018.61
- https://www.ncbi.nlm.nih.gov/gds?term=GSE8671
- https://www.ncbi.nlm.nih.gov/gds?term=GSE20916
### 1. Initialize the environment and variables
Upon launching this page, run the below code to initialize the analysi... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import numpy as np
import nibabel as nb
import scipy as sp
import matplotlib.pyplot as pl
import os
opj = os.path.join
%matplotlib notebook
pl.ion()
import sys
sys.path.append("..")
from prfpy.stimulus import PRFStimulus2D
from prfpy.grid import Iso2DGaussianGridder, Norm_Iso2DG... | github_jupyter |
# Graphical Solutions
## Introduction to Linear Programming
```
#Import some required packages.
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```
Graphical solution is limited to linear programming models containing only two decision variables (can be used with three variables but only with ... | github_jupyter |
```
#################
# Preprocessing #
#################
# Scores by other composers from the Bach family have been removed beforehand.
# Miscellaneous scores like mass pieces have also been removed; the assumption here is that
# since different interpretations of the same piece (e.g. Ave Maria, etc) exist, including... | github_jupyter |
# How to work with Ruby
* **Difficulty level**: easy
* **Time need to lean**: 10 minutes or less
## Ruby
Basic data types recognised in Ruby are similar with Python's data types and there is a one-to-one correspondence for these types.
The convertion of datatype from SoS to Ruby (e.g. `%get` from Ruby) is as follow... | github_jupyter |
# Multilayer Perceptron
Some say that 9 out of 10 people who use neural networks apply a Multilayer Perceptron (MLP). A MLP is basically a feed-forward network with 3 layers (at least): an input layer, an output layer, and a hidden layer in between. Thus, the MLP has no structural loops: information always flows from ... | github_jupyter |
# A Whale off the Port(folio)
---
In this assignment, you'll get to use what you've learned this week to evaluate the performance among various algorithmic, hedge, and mutual fund portfolios and compare them against the S&P TSX 60 Index.
## Assumptions and limitations
1. Limitation: Only dates that overlap betwe... | github_jupyter |
```
from sklearn.datasets import load_iris # iris dataset
from sklearn import tree # for fitting model
# for the particular visualization used
from six import StringIO
import pydot
import os.path
# to display graphs
%matplotlib inline
import matplotlib.pyplot
# get dataset
iris = load_iris()
iris.keys()
import pand... | github_jupyter |
# <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 7</font>
## Download: http://github.com/dsacademybr
```
# Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
```
## Missão: Analisar o Comportament... | github_jupyter |
## 1. Volatility changes over time
<p>What is financial risk? </p>
<p>Financial risk has many faces, and we measure it in many ways, but for now, let's agree that it is a measure of the possible loss on an investment. In financial markets, where we measure prices frequently, volatility (which is analogous to <em>standa... | github_jupyter |
```
# Copyright 2019 The Kubeflow Authors. 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 appli... | github_jupyter |
# トークトリアル 4
# リガンドベーススクリーニング:化合物類似性
#### Developed in the CADD seminars 2017 and 2018, AG Volkamer, Charité/FU Berlin
Andrea Morger and Franziska Fritz
## このトークトリアルの目的
このトークトリアルでは、化合物をエンコード(記述子、フィンガープリント)し、比較(類似性評価)する様々なアプローチを取り扱います。さらに、バーチャルスクリーニングを実施します。バーチャルスクリーニングは、ChEMBLデータベースから取得し、リピンスキーのルールオブファイブでフィルタリングをか... | github_jupyter |
<a href="https://colab.research.google.com/github/adasegroup/ML2021_seminars/blob/master/seminar13/gp.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Gaussian Processes (GP) with GPy
In this notebook we are going to use GPy library for GP modeli... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import scipy
from scipy.signal import convolve
from scipy import ndimage
import getBayer
% matplotlib inline
import io
import time
import copy
from numpy.lib.stride_tricks import as_strided
Im = getBayer.getBayer('pic2.jpeg')
bayer = getBayer.... | github_jupyter |
```
# General imports
import numpy as np
import pandas as pd
import os, sys, gc, time, warnings, pickle, psutil, random
# custom imports
from multiprocessing import Pool # Multiprocess Runs
warnings.filterwarnings('ignore')
########################### Helpers
###################################################... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from importlib import reload
from deeprank.dataset import DataLoader, PairGenerator, ListGenerator
from deeprank import utils
seed =... | 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 |
[](https://www.pythonista.io)
# El lenguaje de plantillas de *Jinja*.
## Etiquetas de *Jinja*.
*Jinja* ejecuta las expresiones y declaraciones que se encuentran encerrados entre signos de llaves "```{```" "```}```".
### Declaraciones.
Las declaraciones deben estar encerrada... | github_jupyter |
```
from IPython.display import Image
```
This is a follow on from Tutorial 1 where we browsed the Ocean marketplace and downloaded the imagenette dataset. In this tutorial, we will create a model that trains (and overfits) on the small amount of sample data. Once we know that data interface of the input is compatible... | github_jupyter |
```
from matplotlib import pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
tf.__version__
model = tf.keras.models.load_model("runs/machine_translation/2")
```
https://www.tensorflow.org/beta/tutorials/text/transformer#evaluate
```
tokenizer_pt = tfds.features.text.SubwordTe... | github_jupyter |
```
import os
import pandas as pd
from bs4 import BeautifulSoup
import sys
import re
from nltk.stem import PorterStemmer
from nltk.tokenize import sent_tokenize, word_tokenize
ps = PorterStemmer()
print os.getcwd();
# if necessary change the directory
#os.chdir('c:\\Users\..')
data = pd.read_csv("nightlife_sanfrancisco... | github_jupyter |
```
import datetime
import time
import functools
import pandas as pd
import numpy as np
import pytz
import nba_py
import nba_py.game
import nba_py.player
import nba_py.team
import pymysql
from sqlalchemy import create_engine
from password import hoop_pwd
pwd = hoop_pwd.password
conn = create_engine('mysql+pymysql:/... | github_jupyter |
```
import pandas as pd
data = pd.read_csv('Astronomy_institutes_list - Institute_with_location.csv')
# file is/will be included in github.
data.info()
# Auto-fill longitude and latitude (Not accurate due to language and map source)
from geopy.geocoders import Nominatim
import time
latitude = []
longitude = []
geoloc... | github_jupyter |
# Tutorial Part 2: Learning MNIST Digit Classifiers
In the previous tutorial, we learned some basics of how to load data into DeepChem and how to use the basic DeepChem objects to load and manipulate this data. In this tutorial, you'll put the parts together and learn how to train a basic image classification model in... | github_jupyter |
# QST CGAN with thermal noise in the channel (convolution)
```
import numpy as np
from qutip import Qobj, fidelity
from qutip.wigner import qfunc
from qutip.states import thermal_dm
from qutip import coherent_dm
from qutip.visualization import plot_wigner_fock_distribution
import tensorflow_addons as tfa
import te... | github_jupyter |
# T008 · Protein data acquisition: Protein Data Bank (PDB)
Authors:
- Anja Georgi, CADD seminar, 2017, Charité/FU Berlin
- Majid Vafadar, CADD seminar, 2018, Charité/FU Berlin
- Jaime Rodríguez-Guerra, Volkamer lab, Charité
- Dominique Sydow, Volkamer lab, Charité
__Talktorial T008__: This talktorial is part of the... | github_jupyter |
# Интерфейсы
Интерфейс - контракт, по которому класс, его реализующий, предоставляет какие-то методы.
Написание кода с опорой на интерфейсы, а не на конкретные типы позволяет:
- **Переиспользовать код, абстрагируясь от реализации.** Один раз написанный алгоритм сортировки элементов, опирающийся только на интерфейс IC... | github_jupyter |
```
from utils.t5 import *
input_data_name = "claim_LOF_base_0.11_data_explanation_prep_4.pickle" #"LOF_base_0.45_0.53_removed_inlier_outlier_23.782_full.pickle" # "LOF_base_0.46_0.54_removed_inlier_outlier_0.51_full.pickle"
data_inpit_dir = "./Data/Selection/" ... | github_jupyter |
# Image classification training on a DEBIAI project with a dataset generator
This tutorial shows how to classify images of flowers after inserting the project contextual into DEBIAI.
Based on the tensorflow tutorial : https://www.tensorflow.org/tutorials/images/classification
```
# Import TensorFlow and other librar... | github_jupyter |
# Anomaly Detection on Enron Dataset
In this notebook, we aim to build and train models based on machine learning algorithms commonly used for unsupervised anomaly detection; namely one-class Support Vector Machine (SVM), Isolation Forest and Local Outlier Factor (LOF). The dataset used is a modified version of the Enr... | github_jupyter |
```
import os
import sys
import json
import tempfile
import pandas as pd
import numpy as np
import datetime
from CoolProp.CoolProp import PropsSI
from math import exp, factorial, ceil
import matplotlib.pyplot as plt
%matplotlib inline
cwd = os.getcwd()
sys.path.append(os.path.normpath(os.path.join(cwd, '..', '..', ... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import re
import glob
import lzma
import pickle
import pandas as pd
import numpy as np
import requests as r
import seaborn as sns
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
from joblib import hash
from collections import Counter
from sklearn.metrics ... | github_jupyter |
```
import time
import numpy as np
np.random.seed(1234)
from functools import reduce
import scipy.io
from scipy.interpolate import griddata
from sklearn.preprocessing import scale
# from utils import augment_EEG, cart2sph, pol2cart
######### import DNN for training using GPUs #########
from keras.utils.training_uti... | github_jupyter |
# 2018.10.27: Multiple states: Time series
## incremental update
```
import sys,os
import numpy as np
from scipy import linalg
from sklearn.preprocessing import OneHotEncoder
import matplotlib.pyplot as plt
%matplotlib inline
# setting parameter:
np.random.seed(1)
n = 10 # number of positions
m = 3 # number of values... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel(r'C:\Users\kundi\Moji_radovi\MVanalysis\datasetup\MV_DataFrame.xlsx')
df['Sat'] = df['Uplaćeno'].astype(str).str.slice(-8,-6)
df['Datum'] = df['Uplaćeno'].astype(str).str.slice(-19,-13)
df.info()
df
df.drop(columns = ['Uplaćeno'], inplace = Tr... | github_jupyter |
# Introduction
- nb45の編集
- nb50 の結果を参考にExtraTreesRegressor回帰を行う
# 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 ... | github_jupyter |
## P5.2 Topic Modeling
---
### Content
- [Topic Modelling using LDA](#Topic-Modelling-using-LDA)
- [Topic Modeling (Train data)](#Topic-Modeling-(Train-data))
- [Optimal Topic Size](#Optimal-Topic-Size)
- [Binary Classification (LDA topic features)](#Binary-Classification-(LDA-topic-features))
- [Binary Classificatio... | github_jupyter |
# Artificial Intelligence Nanodegree
## Machine Translation Project
In this notebook, sections that end with **'(IMPLEMENTATION)'** in the header indicate that the following blocks of code will require additional functionality which you must provide. Please be sure to read the instructions carefully!
## Introduction
I... | github_jupyter |
# Convolutional Neural Network
## Import Dependencies
```
%matplotlib inline
from imp import reload
import itertools
import numpy as np
import utils; reload(utils)
from utils import *
from __future__ import print_function
from sklearn.metrics import confusion_matrix, classification_report, f1_score
from keras.prepr... | github_jupyter |
# Comparison of the data taken with a long adaptation time
(c) 2019 Manuel Razo. This work is licensed under a [Creative Commons Attribution License CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). All code contained herein is licensed under an [MIT license](https://opensource.org/licenses/MIT)
---
```
impo... | github_jupyter |
<table width="100%"> <tr>
<td style="background-color:#ffffff;">
<a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="35%" align="left"> </a></td>
<td style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
prepared by Abuzer Yak... | github_jupyter |
```
import sinesum as ss
import matplotlib.pyplot as plt
import numpy as np
```
#### Fourier Series of the Step function
In this Homework assignment, we built a partial series calculator that would give us an approximation of the sign($x$) function. The Method we used to approximate this function is by making use of ... | github_jupyter |
<a href="https://colab.research.google.com/github/BautistaDavid/Proyectos_ClaseML/blob/corte_1/Proyecto2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install wooldridge
```
## **Proyecto 2**
Se va a construir un objeto para poder halla... | github_jupyter |
```
import os
import csv
import cv2
import numpy as np
from PIL import Image
import sklearn
from random import shuffle
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True # dynamically grow the memory used on the GPU
config.l... | github_jupyter |
# DCGAN - Create Images from Random Numbers!
### Generative Adversarial Networks
Ever since Ian Goodfellow and colleagues [introduced the concept of Generative Adversarial Networks (GANs)](https://arxiv.org/abs/1406.2661), GANs have been a popular topic in the field of AI. GANs are an application of unsupervised lear... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.