text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|

# The IBM Quantum Experience Account
In Qiskit we have an interface for backends and jobs that is useful for running circuits and extending to third-party backends. In this tutorial, we will review the core components of Qiskit’s base backend framework, using the IBM... | github_jupyter |
# Lab 3: Gaussian process regression
### Machine Learning 1, September 2015
* The lab exercises should be made in groups of two, three or four people.
* The deadline is October 25th (Sunday) 23:59.
* Assignment should be sent to Philip Versteeg (p.j.j.p.versteeg@uva.nl). The subject line of your email should be "lab\... | github_jupyter |
# Power Generation Emission Calculation Methods
This notebook contains the methodologies in calculating the emission from Power Generation in order to develop Life Cycle Inventories for Power Generation.
The different methodologies are from:
No. | Country | Pub. Yr |
-- | ------- | --------- |
1 | Japan | 2000 |... | github_jupyter |
## Example of using CatBoost on text data with word2vec embedding.
[](https://colab.research.google.com/github/catboost/tutorials/blob/master/competition_examples/quora_w2v.ipynb)
```
import catboost
import collections
import gensim
import os
i... | github_jupyter |
*Note: You are currently reading this using Google Colaboratory which is a cloud-hosted version of Jupyter Notebook. This is a document containing both text cells for documentation and runnable code cells. If you are unfamiliar with Jupyter Notebook, watch this 3-minute introduction before starting this challenge: http... | github_jupyter |
```
%matplotlib inline
from fastai.vision import *
import pandas as pd
import numpy as np
from pathlib import Path
import omicronscala
import spym
import xarray
import os
import torch
import numpy as np
import random
from kmeans_pytorch import kmeans
def save_pickle(obj, filename):
with open('{}.pkl'.format(filenam... | github_jupyter |
# Bandpass calibration demonstration
```
%matplotlib inline
import os
import sys
sys.path.append(os.path.join('..', '..'))
from data_models.parameters import arl_path
results_dir = arl_path('test_results')
from matplotlib import pylab
import numpy
from astropy.coordinates import SkyCoord
from astropy import uni... | github_jupyter |
<img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="35%" align="right" border="0"><br><br><br>
# Listed Volatility and Variance Derivatives
**Wiley Finance (2017)**
Dr. Yves J. Hilpisch | The Python Quants GmbH
http://tpq.io | [@dyjh](http://twitter.com/dyjh) | http://books.tpq.io
<img src="... | github_jupyter |
<div class="contentcontainer med left" style="margin-left: -50px;">
<dl class="dl-horizontal">
<dt>Title</dt> <dd> TriMesh Element</dd>
<dt>Dependencies</dt> <dd>Bokeh</dd>
<dt>Backends</dt> <dd><a href='./TriMesh.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/TriMesh.ipynb'>Bokeh</a></dd>
</dl>
</div>
```
imp... | github_jupyter |
# Open Space Toolkit ▸ Physics ▸ Time
## Setup
```
import datetime
import ostk.physics as physics
Scale = physics.time.Scale
Date = physics.time.Date
Time = physics.time.Time
DateTime = physics.time.DateTime
Instant = physics.time.Instant
Duration = physics.time.Duration
Interval = physics.time.Interval
```
---
##... | github_jupyter |
```
# Import libraries and packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import re
from datetime import datetime
# Plotting
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
import matplotlib.gridspec as gridspec
# Plot styling
sns.set(style='white', context='n... | github_jupyter |
```
import pandas as pd
import numpy as np
import joblib
import os
import benchmark_common as bcommon
import config as cfg
import benchmark_test as btest
import argparse
import tools.funclib as funclib
import tools.embedding_esm as esmebd
import time
import benchmark_evaluation as eva
from pandarallel import pandaralle... | github_jupyter |
```
import pandas as pd
import numpy as np
data=np.array([[10,5,12,0,7],[0,12,23,8,8],[11,9,4,10,6],[0,0,8,0,12],[1,10,7,12,3]])
max_dirt=data.sum()
environment=pd.DataFrame(data)
maxtime=100
environment
def tracker(x,y,environment,dirt_collected):
time_count=0
travel_time=10
if x==0 and y==0:
... | github_jupyter |
```
import os
import pandas as pd
import cobra
import medusa
from cobra.core import Reaction
from medusa.reconstruct.expand.expand import iterative_gapfill_from_binary_phenotypes
def load_universal_modelseed():
seed_rxn_table = pd.read_csv('../data/reactions_seed_20180809.tsv',sep='\t')
seed_rxn_table['id'] = ... | github_jupyter |
##### Copyright 2019 Google LLC.
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 the License at
#
# https:/... | github_jupyter |
```
print("Hello there")
a= eval(input("A is : "))
b= eval(input("B is : "))
if a>b :
global z
z=a
else :
z=b
print("the value of z is :",z)
a = [2, 3, 4]
b = [2, 7, 3.5, "Hello"]
c=a+b
print(set(c))
b[1:3]
f=(1,2,3,4)
print(f)
g=(0,)
print(g)
t = (2,3,4,(2,3,4),[77,66,55])
print(t)
x =t[3]
pr... | github_jupyter |
# Making the Best of the Worst
```
# Install Pyomo and solvers for Google Colab
import sys
if "google.colab" in sys.modules:
!wget -N -q https://raw.githubusercontent.com/jckantor/MO-book/main/tools/install_on_colab.py
%run install_on_colab.py
```
## Problem
A common formulation for to maximize profit of a ... | github_jupyter |
# [New York City Taxi Fare Prediction](https://www.kaggle.com/c/new-york-city-taxi-fare-prediction)
## Import packages
```
import numpy as np
import pandas as pd
```
## Import data
```
%%time
train = pd.read_csv("data/train5.csv", nrows=100)
test = pd.read_csv("data/test5.csv")
train.head()
```
## Convert data ty... | github_jupyter |
```
import torch
import numpy as np
import pandas as pd
from tqdm import tqdm
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import fastText
from fastText import load_model... | github_jupyter |
```
import numpy as np
import pandas as pd
from pandas import read_csv
import math
import seaborn as sns
import matplotlib.pyplot as plt
df1 = pd.read_csv('labels2.csv')
df2 = pd.read_csv('recon2.csv')
df3 = pd.concat([df1,df2], axis=1, join="inner")
df3.drop('n_x', axis=1, inplace=True)
df3.drop('n_y', axis=1, inplace... | github_jupyter |
```
# Boto3 SageMaker Invoke Endpoint
# This example shows how to invoke SageMaker Endpoint from outside of AWS environment using Boto3 SDK
# Boto is the Amazon Web Services (AWS) SDK for Python
# https://boto3.amazonaws.com/v1/documentation/api/latest/index.html
# Endpoint: XGBoost - Kaggle Bike Rental - Regressor Tr... | github_jupyter |
# Text Classification: Sentiment
Trains a model to classify user text as positive (5), negative (1), or in between.
Below we do the following:
1. Load labeled text training data.
2. Build a sentiment classification model.
3. Convert the model to CoreML and upload to Skafos.
The example is based on [Turi Create's Tex... | github_jupyter |
```
from matplotlib import pyplot as io
import numpy as np
from PIL import Image
from collections import defaultdict
np.random.seed(42)
```
## Compress Image
```
class ImageCompressor(object):
def __init__(self, k_cluster):
"""
Args:
img : str
Path to image
"""
... | github_jupyter |
```
from simple_pid import *
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Range1d
from ipywidgets import interact
from bokeh.io import push_notebook, show, output_notebook
output_notebook()
##############################################################
def get_positions(car_history):
... | github_jupyter |
```
from matplotlib import pyplot as plt
import numpy as np
from tqdm import tqdm
import sys
from collections import Counter
import pandas as pd
import matplotlib.patches as patches
import seaborn as sns
import copy
import torch
import os
import xmltodict
from dotmap import DotMap
import seaborn as sns
sys.path.append(... | github_jupyter |
```
import json
import re
import pandas as pd
raw_esif = pd.read_excel('input/ESF-Call-1-Successful-applications-by-Constituency-and-Council.XLS', skiprows=3)
raw_esif.shape
raw_esif.columns
# Just look at the columns we're interested in, rename them and remove null rows. Also clean Org name
ni_funding_call1_2014 = ra... | github_jupyter |
# Initial relations for $M_n$ using $\mathrm{cel}$
In this notebook we'll validate the analytic expressions for M_n with n=0 to 3 using the cel elliptic integrals:
```
import numpy as np
from scipy.integrate import quad
from scipy.special import ellipe,ellipk
import matplotlib.pyplot as pl
%matplotlib notebook
epsabs... | github_jupyter |
# Federated Next Word Prediction with Director example
## Using low-level Python API
```
# install requirements
!pip install -r requirements.txt
import numpy as np
import os
# disable GPUs due to Tensoflow not supporting CUDA 11
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
```
# Connect to the Federation
```
# Create ... | github_jupyter |
## Graph Experiments - **pytwanalysis** - (**TwitterAnalysis**)
##### Save results on the experiments spreasheet
#### Initialize packages
```
import pytwanalysis as ta
from pymongo import MongoClient
import time
```
#### Set your mongoDB connection
```
#db connection
mongoDBConnectionSTR = "mongodb://localhost:27... | github_jupyter |
<h1>2b. Machine Learning using tf.estimator </h1>
In this notebook, we will create a machine learning model using tf.estimator and evaluate its performance. The dataset is rather small (7700 samples), so we can do it all in-memory. We will also simply pass the raw data in as-is.
```
!sudo chown -R jupyter:jupyter /... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import numpy as np
from math import ceil
from sklearn.metrics import accuracy_score, log_loss
import torch
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
%matplotlib inline
import sys
sys.path.append('..')
from utils.input_pipeline import get_image_folde... | github_jupyter |
```
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file... | github_jupyter |
##### Copyright 2020 The Cirq Developers
```
#@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 agre... | github_jupyter |
# What's this TensorFlow business?
You've written a lot of code in this assignment to provide a whole host of neural network functionality. Dropout, Batch Norm, and 2D convolutions are some of the workhorses of deep learning in computer vision. You've also worked hard to make your code efficient and vectorized.
For t... | github_jupyter |
```
import os
import xml.etree.ElementTree as ET
from pathlib import Path
print("cwd: " , os.getcwd())
HOME = str(Path.home())
# checkout from https://github.com/petermr/dictionary
# this is your local name
OPEN_DICT = os.path.join(HOME, "dictionary")
currentDictionaryTop = "openVirus202011"
# currentDictionaryTop = "... | github_jupyter |
# **Classify the Emails into Spam or Not.**
# Importing Libraries
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn
```
# Reading the Data
```
df = pd.read_csv('/content/spam_or_not_spam.csv')
df
```
# Understanding the Data
```
df.dtypes
df.shape
df.s... | github_jupyter |
<a href="https://colab.research.google.com/github/DingLi23/s2search/blob/pipelining/pipelining/exp-cspf/exp-cspf_cspf_shapley_value.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
### Experiment Description
> This notebook is for experiment \<exp-... | github_jupyter |
# Setup
First things first, let's check our working directory.
```
pwd # some bash commands will work without additional characters in Jupyter notebooks if automagic is on
```
To build our pipeline, we'll need to make sure we have access to some dependencies first. You have a few options here:
1. Use the JupyterLa... | github_jupyter |
The first line ensures that we use floating-point division instead of the default integer divide. Line 3 establishes the figure and axis bindings using subplots. Keeping these separate is useful for very complicated plots. The arange function creates a Numpy array of numbers. Then, we compute the sine of this array and... | github_jupyter |
Parametric non Parametric inference
===================
Suppose you have a physical model of an output variable, which takes the form of a parametric model. You now want to model the random effects of the data by a non-parametric (better: infinite parametric) model, such as a Gaussian Process as described in [Bayesian... | github_jupyter |
# Trade Smarter w/ Reinforcement Learning
## A deep dive into TensorTrade - the Python framework for trading and investing using deep reinforcement learning

Winning high stakes poker tournaments, beating world-class StarCraft players, and autonomously driving Tesla's futuristic sports cars.... | github_jupyter |
# Content-Based Filtering model
Content-based filtering approaches leverage **description or attributes** from items the user has interacted to recommend similar items. It depends only on the user **previous choices**, making this method robust to **avoid the cold-start problem**. For textual items, like articles, ne... | github_jupyter |
# 📝 Exercise M5.01
In the previous notebook, we showed how a tree with a depth of 1 level was
working. The aim of this exercise is to repeat part of the previous
experiment for a depth with 2 levels to show how the process of partitioning
is repeated over time.
Before to start, we will:
* load the dataset;
* split ... | github_jupyter |
<a href="https://colab.research.google.com/github/warwickdatascience/beginners-python/blob/master/session_three/session_three_exercises.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<center>Spotted a mistake? Report it <a href="https://github.com/... | github_jupyter |
<a href="https://colab.research.google.com/github/aniketmaurya/blog/blob/master/_notebooks/2020-11-16-DCGAN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# DCGAN Tutorial - Generate Fake Celebrity image
> A beginner-friendly tutorial on DCGAN with... | github_jupyter |
# Spatial Declustering in Python for Engineers and Geoscientists
### Michael Pyrcz, Associate Professor, University of Texas at Austin
#### Contacts: [Twitter/@GeostatsGuy](https://twitter.com/geostatsguy) | [GitHub/GeostatsGuy](https://github.com/GeostatsGuy) | [www.michaelpyrcz.com](http://michaelpyrcz.com) | [Go... | github_jupyter |
```
import h2o
from h2o.estimators.gbm import H2OGradientBoostingEstimator
h2o.init()
from h2o.utils.shared_utils import _locate # private function. used to find files within h2o git project directory.
# Airlines dataset
air = h2o.import_file(path=_locate("smalldata/airlines/AirlinesTrain.csv.zip"))
# Construct valida... | github_jupyter |
```
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import numpy as np
np.set_printoptions(precision=3)
np.set_printoptions(suppress=True)
```
# Neural Network implementation with Matrices #4: Parametrised Algorhytm (step by step)
So far, we have been describing the implementation of a ... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive')
!pip uninstall nltk -y
!pip install texthero
import os
import numpy as np
import pandas as pd
import dill
from sklearn.feature_extraction.text import TfidfVectorizer
import gc
from tqdm import tqdm
import time
import gensim
from gensim.models import Wo... | github_jupyter |
# 추천 시스템의 기초
추천 시스템(recommender system)이란 사용자(user)가 상품(item)에 대해 어떻게 평가하는지를 예측하는 예측 시스템의 일종이다.
Amazon과 같은 인터넷 쇼핑 사이트나 Netflix 등의 온라인 비디오 콘텐츠 제공 사이트는 사용자가 각각의 상품에 대해 평가한 평점(rate)을 가지고 있다. 이 기록을 기반으로 해서 사용자가 아직 평가하지 않은 상품에 대한 점수를 예측함으로써 그 사용자에게 어떤 상품을 추천할 지 결정할 수 있다.
## Surprise 패키지
여기에서는 파이썬의 Surprise패키지를 사용하여 추천 시... | github_jupyter |
# Lesson 1 Exercise 1: Creating a Table with PostgreSQL
<img src="images/postgresSQLlogo.png" width="250" height="250">
### Walk through the basics of PostgreSQL. You will need to complete the following tasks:<li> Create a table in PostgreSQL, <li> Insert rows of data <li> Run a simple SQL query to validate the infor... | github_jupyter |
<a href="https://colab.research.google.com/github/PacktPublishing/Hands-On-Computer-Vision-with-PyTorch/blob/master/Chapter08/Training_SSD.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import os
if not os.path.exists('open-images-bus-trucks'):... | 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 |
```
# Copyright 2021 Google LLC
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
# Notebook authors: Kevin P. Murphy (murphyk@gmail.com)
# and Mahmoud Soliman (mjs@aucegypt.edu)
# This notebook reproduces figures for chap... | github_jupyter |
## Materials
Materials are the primary container for radionuclides. They map nuclides to **mass weights**,
though they contain methods for converting to/from atom fractions as well.
In many ways they take inspiration from numpy arrays and python dictionaries. Materials
have two main attributes which define them.
1. ... | github_jupyter |
```
import os
import pynq
import numpy as np
# os.environ['EMCONFIG_PATH'] = os.environ['PWD']
ol=pynq.Overlay("krnl_matmulbertl.xclbin")
from pynq import allocate
Nbanks=8
Nmat=3
Tsize=1024
Nvec=14
low = 1 # -2^15
high = 200# 2^15-1
source_v_np = np.random.randint(low, high, dtype=np.int16, size=(Tsize,Nvec))
source_... | github_jupyter |
# Demonstration of Automatic Data Processing
## Clean data set example
8/25/20
### Notebook setup and library imports
```
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# PVInsight Code Imports
from solardatatools import DataHandler
from solardatatools.dataio import get_pvdaq_data
```
###... | github_jupyter |
```
import pandas as pd
import numpy as np
pd.options.display.max_columns = 50
def read_in_csv(file_path='./parking-geo.csv'):
# let's be memory efficient when loading our data
dtypes_dict = \
{
'ticket_number': np.int32,
'violation_location': str,
'license_plate_number': str,
... | github_jupyter |
# Import Libraries
```
import sys
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.decomposition import PCA
from sklearn import random_projection
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import fbeta_score, roc_curve, auc
from sklearn import svm
from s... | github_jupyter |
# Chapter 2: Machine Learning Basics
This chapter is intended as a review of the basic mathematical tools and techniques that are essential to understanding what’s under the hood in artificial intelligence; contained below is the code that corresponds to Chapter 2, Machine Learning Basics. We’ll review linear algebra... | github_jupyter |
# Machine Reading: Advanced Topics in Word Vectors
## Part II. Word Vectors via Word2Vec (50 mins)
This is a 4-part series of Jupyter notebooks on the topic of word embeddings originally created for a workshop during the Digital Humanities 2018 Conference in Mexico City. Each part is comprised of a mix of theoretical ... | github_jupyter |
<a href="https://colab.research.google.com/github/xBrymer/COVID19-AI-CT-Scan-Detection/blob/master/dataset_preparation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import os
import shutil
import cv2
import random
from tqdm.notebook import tqd... | github_jupyter |
```
%pylab inline
import csv
import scipy
from scipy import sparse as sps
from scipy import io
import numpy as np
import pickle
import json
tree_p2c={}
tree_c2p={}
with open("../data/imagenet_data/imagenet_tree.txt") as csv_file:
spamreader = csv.reader(csv_file, delimiter=" ", quotechar='|')
for row in spamrea... | github_jupyter |
# Removing and splitting pandas DataFrame columns
When you are preparing to train machine learning models, you often need to delete specific columns, or split certain columns from your DataFrame into a new DataFrame.
We need the pandas library and a DataFrame to explore
```
import pandas as pd
```
Let's load a bigg... | github_jupyter |
# Motivation
The goal is to embed node features, edge features, and structural characteristics of a graph into a format appropriate for language models. A demonstration of the technique follows.
```
import networkx as nx
import pandas as pd
import numpy as np
from graphwave import graphwave
from graphwave.utils import... | github_jupyter |
# Working with Real data
## Load Data
```
import pandas as pd
import os
def load_housing_data():
csv_path = os.path.join('datasets','housing', 'housing.csv')
return pd.read_csv(csv_path)
housing = load_housing_data()
housing.head()
housing.info()
housing.describe()
housing['ocean_proximity'].value_counts()
%m... | github_jupyter |
```
"""
You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab.
Instructions for setting up Colab are as follows:
1. Open a new Python 3 notebook.
2. Import this notebook from GitHub (File -> Upload Notebook -> "GITHUB" tab -> copy/paste GitHub URL)
3. Connect to an in... | github_jupyter |
# Deep Learning - Manning
```
weight = 0.1
def neural_network(input, weight):
prediction = input * weight
return prediction
number_of_toes = [8.5, 9.5, 10, 9]
input = number_of_toes[0]
pred = neural_network(input,weight)
print(pred)
weights = [0.1, 0.2, 0]
def w_sum(a,b):
assert(len(a) == len(b))
outpu... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
# default_exp indexers.notelist.notelist
# export
from pyintegrators.data.schema import *
from pyintegrators.indexers.notelist.util import *
# export
TODO, TOWATCH, TOREAD, TOLISTEN, TOBUY, UNKOWN = "todo","towatch", "toread", "tolisten", "tobuy", "unknown"
LIST_CLASSES = [TODO, T... | github_jupyter |
# Displaying information through the execution stack
Plugins are very powerful and versatile objects that can be used for various applications.
In this notebook we present a simple way to live-plot optimization processes via some Plugin.
To demonstrate this, we will run a simple QAOA-MAXCUT algorithm using the QLM l... | github_jupyter |
# Testing Variational Autoencoder on synthetic data
```
import numpy as np
import pandas as pd
import seaborn as sns
import statistics as s
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import contrib
from tensorflow.contrib import layers
from tensorflow.contrib.slim import fully_connected
cl... | github_jupyter |
# Python for ArcGIS Exercises
---
These exercises are designed to help you learn Python in ArcGIS by focusing on the problem solving aspect of creating Python scripts. Some exercises may have more than one solution, as could be the case in any problem. Some tips may be included to help you along.
## Exercise 1
---
... | github_jupyter |
```
import os
TEXT_DIR = os.path.join(os.getcwd(), 'text/')
import os, os.path, codecs
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import decomposition
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.feature_extraction.stop_words import ENGLISH_STO... | github_jupyter |
# A First `xlwings` Project
## Overview
An `xlwings` project consists of at least two files: the Excel workbook and a Python file. These two files must have the same file name, besides the extension. The extension for the Excel file will be `.xlsm` as it is a macro-enabled workbook. The extension for the Python file ... | github_jupyter |
1. [`Language`](#language)
1. [`Doc`](#doc)
1. [`Process`](#process)
1. [`Pipeline`](#pipeline)
1. [`MorphosyntacticFeature`](#morpho)
1. [`MorphosyntacticFeatureBundle`](#morpho-bundle)
1. [`Form`](#form)
1. [`DecisionTree`](#dt)
# `Language` <a name="language"></a>
`Language` are used to identify each language and ... | github_jupyter |
### Siamese Triplets with majority class downsampled
Siamese triplet loss training creates embedding spaces where similar items are pulled closer to one another, and dissimilar items are pushed away from one another. Siamese networks were independently introduced by both Bromley et al.(1993) and Baldi and Chauvin (199... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/shravankumar9892/coloi/blob/master/coloi.ipynb)
# COLOI
You can visit the project webiste through this link: [COLOI](https://sites.google.com/view/coloi/)
```
!pip install -U -q PyDrive
from pydrive.auth import GoogleAuth
from pydrive.drive import Google... | github_jupyter |
<a href="https://colab.research.google.com/github/palashsharma891/DeepLearning.AI-TensorFlow-Developer-Coursera/blob/master/1.%20Introduction%20to%20TensorFlow%20for%20Artificial%20Intelligence%2C%20Machine%20Learning%2C%20and%20Deep%20Learning/Colab%20Notebooks/%20Copy_of_Exercise_4_Question.ipynb" target="_parent"><i... | github_jupyter |
# Forecasting - using Cycle Times
Let's first define what _Cycle Time_ means or how it's defined for the purpose of this notebook:
__Cycle Time__:
> "...the time between two items emerging from a process"
This notebook illustrates an analysis and forecasting for data based on _Cycle Time_ as defined above.
In part... | github_jupyter |
## Panda 数据分析常用函数(上)
### 1. 导入模块
```
import pandas as pd
import numpy as np
```
### 2. 创建数据集并读取
**创建数据集**
```
data = pd.DataFrame({
"id":np.arange(101,111), # np.arange会自动输出范围内的数据,这里会输出101~110的id号。
"date":pd.date_range(start="20200310",periods=10), # 输出日期数据,设置周期为10,注意这里的周... | github_jupyter |
# Tutorial 2: Entanglement Forged VQE for the $H_2O$ molecule
In this tutorial, we apply Entanglement Forged VQE to a $H_2O$ molecule. We follow the same format as Tutorial 1 for the $H_2$ molecule, but we also simplify the problem by freezing (removing) some orbitals.
**What new here?**
- Freezing orbitals by specif... | github_jupyter |
```
import gensim
assert gensim.models.word2vec.FAST_VERSION > -1
import codecs
stop='../stopwords.txt'
emojiSynonyms='../emojiWords.txt'
stopList=[]
emojiMap={}
emojis=[]
f=codecs.open(stop,'r', encoding='utf-8')
for line in f.readlines():
stopList.append(line.strip())
f=codecs.open(emojiSynonyms,'r', encoding=... | github_jupyter |
<a id='top-page'></a>
# <img src="../images/PCAfold-logo.svg" style="height:100px"> Demo for data clustering
In this tutorial, we present the clustering functionalities from the `preprocess` module.
## Data clustering
Firstly, we visualize the result of clustering on synthetic 2D and 3D data sets:
- [**Visualizing ... | github_jupyter |
# T014 · Binding site detection
**Note:** This talktorial is a part of TeachOpenCADD, a platform that aims to teach domain-specific skills and to provide pipeline templates as starting points for research projects.
Authors:
* Adapted from Abishek Laxmanan Ravi Shankar, 2019, internship at Volkamer lab
* Andrea Volka... | github_jupyter |
## 功能简介
本py文件主要用于特征选择方法的确定和特征选择参数的确定,具体如下:
### 一、使用方差选择(Filter方法)
1、特征选择
2、使用网格搜索确定特征选择参数
3、使用xgboost训练模型
### 二、使用递归特征消除法(Wrapper方法)
1、使用RFE和RFECV进行特征选择
2、网格搜索确定保留特征数
3、使用xgboost训练模型
### 三、使用正则化(Embedded方法)
1、使用L1正则化
2、网格搜索确定正则项系数
3、使用LinearSVC训练模型
```
import pymysql
import pandas as pd
import numpy as np... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Two-state-promoter-(protein)" data-toc-modified-id="Two-state-promoter-(protein)-1"><span class="toc-item-num">1 </span>Two-state promoter (protein)</a></span><ul class="toc-item"><li><span><a hr... | github_jupyter |
<a href="https://colab.research.google.com/github/biswa-13/DataScience/blob/master/DS0_Misc.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
This notebook is going to contain various utility functions and code snippests that can be used in diffrent D... | github_jupyter |
# Alibi Overview Example
This notebook aims to demonstrate each of the explainers Alibi provides on the same model and dataset. Unfortunately, this isn't possible as white-box neural network methods exclude tree-based white-box methods. Hence we will train both a neural network(TensorFlow) and a random forest model on... | github_jupyter |
# Preamble
```
import numpy as np
import pandas as pd
import glob
import ast
import geopandas as gpd
# import beis_indicators.utils.nuts_utils
```
# Data Collection
"Postcode to coordinates" data
```
#Collecting mulptiple postcode to lat/lon datasets to lessen the chance of missing data
postcode_lat_lon_1 = pd.rea... | github_jupyter |
<h1 align="center">Curso Introducción a Python</h1>
<h2 align="center">Universidad EAFIT - Bancolombia</h2>
<h3 align="center">MEDELLÍN - COLOMBIA </h3>
<h2 align="center">Sesión 12 - Programación Orientada a Objetos - POO</h2>
## Instructor:
> <strong> *Carlos Alberto Álvarez Henao, I.C. Ph.D.* </strong>
**Nota:*... | github_jupyter |
# Optional: Scikit-learn primer.
In this additional assignment, you will learn to use the scikit-learn library. It is highly recommended to go through this notebook before starting with the final assignment.
## Introduction
All algorithms, both learning and pre-processing, in scikit-learn have been implemented with th... | github_jupyter |
```
import os
import pandas as pd
import boto3
from botocore.exceptions import ClientError
import shutil
import numpy as np
from multiprocessing import Pool
def get_zip_file(bucket, remote_path, local_path):
try:
bucket.download_file(remote_path, local_path)
if os.system('unzip ' + local_pa... | github_jupyter |
# Starting a new Python project from scratch
This guide will show you how to obtain and run all of the files we are working with in this class. It will also walk you through the process of creating a new Python project with `Jupyter` and `pandas`.
If you don't have Python 3 installed on your computer already, do that... | github_jupyter |
# Notebook for preparing and saving TSP graphs
```
import numpy as np
import torch
import pickle
import time
import os
%matplotlib inline
import matplotlib.pyplot as plt
```
# Download TSP dataset
```
if not os.path.isfile('TSP.zip'):
print('downloading..')
!curl https://www.dropbox.com/s/1wf6zn5nq7qjg0e/TSP... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import torch
device = 'cuda' if torch.cuda.is_available() else 'cpu'
import os,sys
opj = os.path.join
from copy import deepcopy
import pickle as pkl
sys.path.append('../../src')
sys.path.append('../../src/dsets... | github_jupyter |
# Gravity Model with PolityV Scores
---
### Basic Specification:
$$ y_{ijt} = \alpha + \beta_1 GDP_i + \beta_2 GDP_j + \beta_3 Dist_{ij} + \theta_t + \epsilon_{ijt} $$
### Modified Specification:
$$ y_{ijt} = \alpha + \beta_1 GDP_i + \beta_2 GDP_j + \beta_3 Dist_{ij} + \beta_4 PolityDist_{ijt} + \theta_t + \epsilon_{... | github_jupyter |
```
%pylab inline
from SuchTree import SuchTree, SuchLinkedTrees, pearson
import pandas as pd
import numpy as np
import seaborn
T1 = SuchTree( '../fishpoo/mcgee_trimmed.tree' )
T2 = SuchTree( 'http://edhar.genomecenter.ucdavis.edu/~russell/fishpoo/fishpoo2_p200_c2_unique_2_clustalo_fasttree.tree' )
links = pd.read_csv(... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_06_2_cnn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# T81-558: Applications of Deep Neural Networks
**Module 6: Convolutional Neural Ne... | github_jupyter |
# **GRU (GATED RECURRENT UNIT)**
## What are GRUs?
A Gated Recurrent Unit (GRU), as its name suggests, is a variant of the RNN architecture, and uses gating mechanisms to control and manage the flow of information between cells in the neural network. GRUs were introduced only in 2014 by Cho, et al. and can be consider... | github_jupyter |
## Loading the data
First we set up our imports:
```
import yt
import numpy as np
import yt.units as units
import pylab
```
First we load the data set, specifying both the unit length/mass/velocity, as well as the size of the bounding box (which should encapsulate all the particles in the data set)
At the end, we f... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.