text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
### Coletando Dados <p>Existem vários formatos para um conjunto de dados: .csv, .json, .xlsx etc.<br> E esse conjunto pode estar armazenado em diferentes lugares, localmente ou online. Neste notebook, você aprenderá como carregar um conjunto de dados em formato csv (comma separated values), salvo localmente. Ire...
github_jupyter
# wav2vec-u CV-sv - prepare text > "Running prepare_text.sh for wav2vec-u on Common Voice Swedish" - toc: false - branch: master - badges: false - hidden: true - categories: [kaggle, wav2vec-u] Original [here](https://www.kaggle.com/jimregan/wav2vec-u-cv-swedish-text-prep) ``` %cd /opt %%capture !tar xvf /kaggle/in...
github_jupyter
``` import numpy as np from decision_tree.decision_tree_model import ClassificationTree class RandomForest(): """Random Forest classifier. Uses a collection of classification trees that trains on random subsets of the data using a random subsets of the features. Parameters: ----------- n_estimators...
github_jupyter
# Sparse graph based networks - some experiments for network type 1 ``` %load_ext autoreload %autoreload 2 import numpy as np import pandas as pd import tensorflow as tf import matplotlib.pyplot as plt import graph_utils as graph_utils import graph_neural_networks as graph_nn import data_preparation_utils as data_p...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') # from google.colab import drive # drive.mount('/content/drive') !pwd path = '/content/drive/MyDrive/Research/AAAI/cifar_new/k_0b/sixth_run1_' import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np import matplotlib....
github_jupyter
<table> <tr> <td width=15%><img src="./img/UGA.png"></img></td> <td><center><h1>Introduction to Python for Data Sciences</h1></center></td> <td width=15%><a href="http://www.iutzeler.org" style="font-size: 16px; font-weight: bold">Franck Iutzeler</a> </td> </tr> </table> <br/><br/> <center><a style="font-size: 40pt...
github_jupyter
# Face Mask Detection using PaddlePaddle In this tutorial, we will be using pretrained PaddlePaddle model from [PaddleHub](https://github.com/PaddlePaddle/PaddleHub/tree/release/v1.5/demo/mask_detection/cpp) to do mask detection on the sample image. To complete this procedure, there are two steps needs to be done: - ...
github_jupyter
Hi! This is a pytorch classification example built with inspiration from https://towardsdatascience.com/pytorch-tabular-binary-classification-a0368da5bb89 The link contains additional explanitory text and short 5-minute youtube video explaining core concepts. ``` ### PYTORCH CLASSIFICATION EXAMPLE # # Author: Rasmus...
github_jupyter
# Example: CanvasXpress density Chart No. 5 This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at: https://www.canvasxpress.org/examples/density-5.html This example is generated using the reproducible JSON obtained from the above page ...
github_jupyter
# 爬取今天到目前為止的所有文章 https://www.ptt.cc/bbs/Gossiping/index.html ``` import requests import re import json from bs4 import BeautifulSoup, NavigableString from datetime import datetime from pprint import pprint from urllib.parse import urljoin base_url = 'https://www.ptt.cc/bbs/Gossiping/index.html' ptt_today = datetime....
github_jupyter
# Money and death We return to the death penalty. ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline # Make plots look a little bit more fancy plt.style.use('fivethirtyeight') ``` In this case, we are going to analyze whether people with higher incomes are more likely to fa...
github_jupyter
``` import pandas as pd import numpy as np names = ['user_id', 'item_id', 'rating', 'timestamp'] df = pd.read_csv( './ml-100k/u.data', sep='\t', names=names) n_users = df.user_id.unique().shape[0] n_items = df.item_id.unique().shape[0] # Create r_{ui}, our ratings matrix ratings = np.zeros((n_users, n_items)) for r...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import matplotlib.style as style from matplotlib import collections as mc import seaborn as sns import pandas as pd import scipy.sparse as sps import scipy.sparse.linalg style.use('ggplot') def laplacian_fd(h): """Poisson on a 2x2 square, with neumann ...
github_jupyter
# Introduction to Linear Regression ## Learning Objectives 1. Analyze a Pandas Dataframe 2. Create Seaborn plots for Exporatory Data Analysis 2. Train a Linear Regression Model using Scikit-Learn ## Introduction This lab is in introduction to linear regression using Python and Scikit-Learn. This lab serves as...
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
``` videos = """ https://www.youtube.com/watch?v=cyU3Qgox3K4&t=131s&ab_channel=TanahMelayu https://www.youtube.com/watch?v=68bH2c04v7o&ab_channel=TanahMelayu https://www.youtube.com/watch?v=9ITPO6ooNSk&ab_channel=TanahMelayu https://www.youtube.com/watch?v=sw5h9hlityE&t=1284s&ab_channel=TanahMelayu https://www.youtube....
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Numpy-Tutorial" data-toc-modified-id="Numpy-Tutorial-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Numpy Tutorial</a></span><ul class="toc-item"><li><span><a href="#BASICS" data-toc-modified-id="BASICS-...
github_jupyter
``` """ @author: Ajay """ import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset, DataLoader from sklearn.preprocessing import StandardScaler, MinMaxScaler fr...
github_jupyter
<h1 style="color:blue">Predicting Car Prices</h1> <p>In this project I will try to predict the prices of some cars with the help K-Nearest Neighbor algorithm</p> ``` #importing libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.neighbors import KNeighborsRegressor from sklear...
github_jupyter
<a href="https://colab.research.google.com/github/violigon/Ocean_Python_03_11_2020/blob/main/Ocean_Python_03_11_2020.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # Posso colocar qualquer texto que ele não será interpretado pela linguagem pri...
github_jupyter
``` import os import cv2 import math import warnings import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix, fbeta_score from keras import optimizers from keras...
github_jupyter
## Using TLS with measurement uncertainties TLS is capable of using measurement uncertainties, when available, in its least-squares fit. Every measured data point has its own measurement uncertainty ("error"). - We here neglect uncertainties in time, as the time stamp of typical observations has millisecond accurac...
github_jupyter
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9oAAACNCAYAAABIdAKVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAO8OSURBVHhe7P0FoJ7neR6OX4eZmZlBzMxkkNlJGmrWJG3WFbam+2ddt3Vd/2uzbikuS9M2TZrETuyYbdliZj7n6DAzM8Pvvu7ve6VP0nekI1mWZfu5jl59Lzz84vXc5DL48u4ZGBgYGBgYGBgYGBgYGBgYPBC42n8NDAwMDAwMDAwM...
github_jupyter
### author: zabiralnazi@yahoo.com > 0.40 Dropout, Augmentation, Histogram Equalization pre-processing ``` import os # cleaning up unimportant files def del_file(f_name): try: os.remove(f_name) except: print('file not found') % cd /content/ ! ls # get the dataset !wget https://challenge.kitware.com/api/v1/i...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt #Plotting %matplotlib inline import warnings #What to do with warnings warnings.filterwarnings("ignore") #Ignore the warnings plt.rcParams["figure.figsize"] = (10,10) #Make th...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats import rankdata df = pd.read_csv("data.csv") df.index = pd.to_datetime(df['date'], format='%Y-%m-%d') df = df.drop('date', axis=1) close_columns = [] high_columns = [] low_columns = [] open_columns = [] volume_columns = [] ope...
github_jupyter
### Preamble ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import warnings with warnings.catch_warnings(): warnings.simplefilter("ignore") import scanpy as sc ## local paths etc. You'll want to change these DATASET_DIR = "/scratch1/rsingh/work/schema/data/tasic-nature" import sys;...
github_jupyter
``` # x_new = x - alpha * gradient(x) import numpy as np def gradient_descent(f, gradient, x0, alpha, eps, max_iter): x = x0 for i in range(max_iter): x_new = x - alpha * gradient(x) if np.abs(f(x_new) - f(x)) < eps: break x = x_new con...
github_jupyter
``` %matplotlib widget import os import sys sys.path.insert(0, os.getenv('HOME')+'/pycode/MscThesis/') import pandas as pd from amftrack.util import get_dates_datetime, get_dirname, get_plate_number, get_postion_number import ast from amftrack.plotutil import plot_t_tp1 from scipy import sparse from datetime impo...
github_jupyter
``` import numpy as np import pandas as pd import pickle import json import gensim import os import re from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix from pandas.plotting import scatter_matrix from keras.models import load_model from keras.preprocessing.text import T...
github_jupyter
``` #################################################################################################### # Copyright 2019 Srijan Verma and EMBL-European Bioinformatics Institute # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License...
github_jupyter
# <img style="float: left; padding-right: 10px; width: 45px" src="https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/iacs.png"> CS109A Introduction to Data Science ## Lecture 3, Exercise 1: Web Scraping and Parsing Intro **Harvard University**<br/> **Fall 2020**<br/> **Instructors**: P...
github_jupyter
# Example of Logistic regression ## Predict student admission based on exams result Data is taken from [Andrew Ng's CS229 course on Machine Learning at Stanford](http://cs229.stanford.edu/). ``` import pandas as pd data = pd.read_csv("datasets/ex2data1.txt", header=None, names=['Exam1', 'Exam2', ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt ``` # 2500 Batch Size ``` df2500 = pd.read_csv('../src/performance/testing/final-scores-2500.csv') df2500 plt.plot(df2500['Batch'], df2500['SGD Score'] * 100, label='SGD', linewidth=0.75) plt.plot(df2500['Batch'], df2500['NB Score'] * 100, lab...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-grouping/auto-ml-forecasting-grouping.png) # Automated Machin...
github_jupyter
# Session 16: Word Embeddings using the Word2Vec skip-gram model ------------------------------------------------------ *Introduction to Data Science & Machine Learning* *Pablo M. Olmos olmos@tsc.uc3m.es* ------------------------------------------------------ The goal of this notebook is to train a Word2Vec skip-gr...
github_jupyter
``` from nltk.corpus import wordnet as wn wn.synset('think.v.01').frame_ids() for lemma in wn.synset('think.v.01').lemmas(): print(lemma, lemma.frame_ids()) print(" | ".join(lemma.frame_strings())) wn.synset('stretch.v.02').frame_ids() for lemma in wn.synset('stretch.v.02').lemmas(): print(lemma, lemma.fram...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import datetime as dt import numpy as np from numpy import log import pandas as pd import os from statsmodels.tsa.stattools import adfuller from statsmodels.graphics.tsaplots import plot_acf, plot_pacf from statsmodels.tsa.arima_model import ARIMA from statsmodels....
github_jupyter
``` # System libraries from time import time import numpy as np import random # Custom libraries import dl_utils as utils import datasets # Helper libraries from tensorflow.keras.callbacks import EarlyStopping from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt from matplotlib import ...
github_jupyter
# Ejercicio 1. Transfer Learning con VGG16 Ejercicio 1 del tutorial de Transfer Learning. GPT2: Diseño y Gestión de Proyectos en Data Science II. [Máster en Data Science y Big Data](http://masterds.es/) de la [Universidad de Sevilla](http://www.us.es). 25/06/2020. Profesor: [Miguel Ángel Martínez del Amor](http://w...
github_jupyter
**[Machine Learning Course Home Page](https://kaggle.com/learn/machine-learning).** --- # Introduction Decision trees leave you with a difficult decision. A deep tree with lots of leaves will overfit because each prediction is coming from historical data from only the few houses at its leaf. But a shallow tree with ...
github_jupyter
**Consider the following Python dictionary data and Python list labels:** data = {'birds': ['Cranes', 'Cranes', 'plovers', 'spoonbills', 'spoonbills', 'Cranes', 'plovers', 'Cranes', 'spoonbills', 'spoonbills'], 'age': [3.5, 4, 1.5, np.nan, 6, 3, 5.5, np.nan, 8, 4], 'visits': [2, 4, 3, 4, 3, 4, 2, 2, 3,...
github_jupyter
# 5장 제어문 ## 5.1 조건에 따라 분기하는 if 문 ### 단일 조건에 따른 분기(if) **[5장: 72페이지]** ``` x = 95 if x >= 90: # 조건문이 참이면 실행 print("Pass") ``` ### 단일 조건 및 그 외 조건에 따른 분기(if ~ else) **[5장: 73페이지]** ``` x = 75 if x >= 90: # 조건문이 참이면 실행 print("Pass") else: # 거짓일때 실행 print("Fail") ``` ### 여러 조건에 따른 분기(...
github_jupyter
``` #We can create numpy arrays with more than one dimension #This section will focus only on 2D arrays, but you can use numpy to build arrays of much higher dimensions #In this video we will cover the basics and array creation in 2D #indexing and slicing in 2D, and basic operations in 2D #3D #The list contains thre...
github_jupyter
<a href="https://colab.research.google.com/github/Chuckboliver/Probability-and-Statistics/blob/main/HW2/ProbStat_HW2_ID62010615.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **Probability and Statistics** --- 62010615 พัฒน์ภูมิ หาแก้ว ## **Homew...
github_jupyter
# Distributed TensorFlow description: train tensorflow CNN model on mnist data distributed via tensorflow Train a distributed TensorFlow job using the `tf.distribute.Strategy` API on Azure ML. For more information on distributed training with TensorFlow, refer [here](https://www.tensorflow.org/guide/distributed_trai...
github_jupyter
## Define the Convolutional Neural Network After you've looked at the data you're working with and, in this case, know the shapes of the images and of the keypoints, you are ready to define a convolutional neural network that can *learn* from this data. In this notebook and in `models.py`, you will: 1. Define a CNN w...
github_jupyter
``` !pip install networkx !pip install rdflib !pip install numpy !pip install sparqlwrapper import rdflib import numpy as np from collections import Counter from SPARQLWrapper import SPARQLWrapper, JSON import networkx as nx import requests def query_wiki_article_title(query): params = { 'action':"query", '...
github_jupyter
# KoNLPy 한국어 처리 패키지 KoNLPy(코엔엘파이라고 읽는다)는 한국어 정보처리를 위한 파이썬 패키지이다. ``` import warnings warnings.simplefilter("ignore") import pandas as pd import matplotlib.pyplot as plt !pip install konlpy !pip install WordCloud pd.set_option('display.max_rows', 80) plt.rcParams["font.family"] = "NanumGothicCoding" import konlpy ...
github_jupyter
## Regression Challenge Predicting the selling price of a residential property depends on a number of factors, including the property age, availability of local amenities, and location. In this challenge, you will use a dataset of real estate sales transactions to predict the price-per-unit of a property based on its...
github_jupyter
# <center> Video Image Data </center> #### CMSE 495 Ford Group This tutorial teaches the user how to input a video file, such a mp4 and convert each frame of the video into a jpeg image using python, primarily in a Jupyter notebook. <b> Environment Setup (Makefile):</b> - Use the command 'make innit' automatically se...
github_jupyter
###### Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2021 Lorena A. Barba, Tingyu Wang # Multiple linear regression Welcome to Lesson 3 of our _Engineering Computations_ module on deep learning! So far, we have only modeled the relationship between one input variable...
github_jupyter
# A simple function with different types of input parameters which are optimized. ``` from mango.tuner import Tuner from scipy.stats import uniform param_dict = {"a": uniform(0, 1), # uniform distribution "b": range(1,5), # Integer variable "c":[1,2,3], # Integer variable "d...
github_jupyter
``` import pandas as pd import numpy as np import os, time, cv2, tqdm, warnings import matplotlib.pyplot as plt from tqdm import tqdm warnings.filterwarnings('ignore') tqdm.pandas() TARGET = 'dataset/Class1' NORMAL_PATH = 'dataset/Class2/' ORIGINAL_PATH = TARGET + '/' def create_dir(path): try: os.stat(pa...
github_jupyter
# Super-Convergence Learning Rate Schedule (TensorFlow Backend) In this example we will implement super-convergence learning rate (LR) schedule (https://arxiv.org/pdf/1708.07120.pdf) and test it on a CIFAR10 image classification task. Super-covergence is a phenomenon where neural networks can be trained an order of m...
github_jupyter
# Stack Overflow - Exploiting with Env Variable - often times buffer that has overflow vulnerability is not large enough to fit even the smallest shellcode - in sitation like this, one can stash the shellcode as an environment variable and overwrite the caller's return address with the address of the shellcode stored ...
github_jupyter
##### Copyright 2020 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
## Load libraries ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt !pip install imbalanced-learn ``` ## Load data ``` from sklearn.datasets import make_classification X, y = make_classification( n_samples=10000, n_features=2, n_redundant=0, n_clusters_per_class=1, weight...
github_jupyter
``` import sys sys.path.append("../") import os import math import numpy as np import cv2 import pandas as pd import tikzplotlib from torch.utils.data import DataLoader, ConcatDataset from pedrec.models.constants.action_mappings import ACTION from pedrec.configs.dataset_configs import get_sim_dataset_cfg_default from ...
github_jupyter
<a href="https://colab.research.google.com/github/socd06/openvino_colab/blob/master/interview_prep.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Interview Preparation using Intel OpenVINO Toolkit Pre-Trained Models ``` from google.colab import ...
github_jupyter
# Building Data Genome Project 2.0 ## Buildings normalized consumption Biam! (pic.biam@gmail.com) ``` # data and numbers import numpy as np import pandas as pd import datetime as dt # Visualization import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import ticker import matplotlib.dates as mdate...
github_jupyter
# Use pyquery-ql.py Send a graphql query to GitHub and pretty print output. Supports Python 3.6+ ``` import json import os import pprint import requests # get api token and set authorization api_token = os.environ['GITHUB_API_TOKEN'] headers = {'Authorization': f'token {api_token}'} # set url to a graphql endpoint ...
github_jupyter
###### Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2014 M.Z. Jorisch <h1 align="center">Orbital</h1> <h1 align="center">Perturbations</h1> In this lesson, we will discuss the orbits of bodies in space, and how those bodies can be affected by others as they fly by. We will ...
github_jupyter
``` from dpm.models import ( OrdinalLayer, OrdinalModel, OrdinalLoss, exp_cdf, erf_cdf, tanh_cdf, normal_cdf, laplace_cdf, cauchy_cdf ) from dpm.visualize import ( plot_ordinal_classes, plot_ordinal_classes_from_layer ) import torch import torch.nn as nn import torch.optim as optim import matplo...
github_jupyter
# Gendered perspectives on character. ``` import csv, math import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt import statsmodels.api as sm from adjustText import adjust_text %matplotlib inline data = pd.read_csv('chartable.tsv', sep = '\t') lexicon = pd.read_csv('lexicon.tsv...
github_jupyter
# 02 Huia Experience Training # Setup ## Install Tensorflow 2 Nightly and other Libraries ``` #!pip install opencv-python #!pip install scipy #!pip install sklearn #!pip install pathlib #!pip install matplotlib #!pip install fastai=1.0.52 #!conda install cudatoolkit=10.0 #!pip install scikit-learn # Tensorflow 2 Al...
github_jupyter
#1. Install Dependencies First install the libraries needed to execute recipes, this only needs to be done once, then click play. ``` !pip install git+https://github.com/google/starthinker ``` #2. Get Cloud Project ID To run this recipe [requires a Google Cloud Project](https://github.com/google/starthinker/blob/mast...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import pycountry import retry import seaborn as sns %matplotlib in...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Neural Collaborative Filtering (NCF) This notebook serves as an introduction to Neural Collaborative Filtering (NCF), which is an innovative algorithm based on deep neural networks to tackle the key problem in r...
github_jupyter
# Facies classification using Convolutional Neural Networks # ## Team StoDIG - Statoil Deep-learning Interest Group ## ### _[David Wade](https://no.linkedin.com/in/david-wade-79918023), [John Thurmond](https://www.linkedin.com/in/john-thurmond-098b774) & [Eskil Kulseth Dahl](https://www.linkedin.com/in/eskil-k-dahl-87...
github_jupyter
# Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural network that performs sentiment analysis. Using an RNN rather than a feedfoward network is more accurate since we can include information about the *sequence* of words. Here we'll use a dataset of movie reviews, accompanied by label...
github_jupyter
``` from fastai.text import * import numpy as np from sklearn.model_selection import train_test_split import pickle import sentencepiece as spm import re import pdb import fastai, torch fastai.__version__ , torch.__version__ torch.cuda.set_device(0) def random_seed(seed_value, use_cuda): np.random.seed(seed_value) ...
github_jupyter
# Introduction From the [PVSC44 TL sensitivity](PVSC44%20TL%20sensitivity.ipynb) we concluded that: * Overal MACC data is higher than corresponding static or optimized $T_L$ which leads to low dyanamic predictions. * For at least 3 SURFRAD stations: bon, psu and sxf high $T_L$ in summer caused a seasonal bias in ...
github_jupyter
# Imports ``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import re from sklearn import metrics # import cvxopt # <- installation via conda recommended from collections import defaultdict from tqdm import tqdm from sklearn.feature_extraction.text import CountVectorizer ...
github_jupyter
<h2> Matrices: Tensor Product</h2> Tensor product is defined between any two matrices. The result is a new bigger matrix. Before giving its formal definition, we define it based on examples. We start with a simple case. <i>A vector is also a matrix. Therefore, tensor product can be defined between two vectors or be...
github_jupyter
# TensorFlow-Slim [TensorFlow-Slim](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim) is a high-level API for building TensorFlow models. TF-Slim makes defining models in TensorFlow easier, cutting down on the number of lines required to define models and reducing overall clutter. In partic...
github_jupyter
``` library(repr) ; options(repr.plot.width = 4, repr.plot.height = 4) # Change plot sizes (in cm) ``` # Model Fitting using Non-linear Least-squares ## Introduction In this Chapter, you will learn to fit non-linear mathematical models to data using Non-Linear Least Squares (NLLS). Specifically, you will learn to ...
github_jupyter
# Filling Area on Line Plots ``` import pandas as pd from matplotlib import pyplot as plt import numpy as np data = pd.read_csv('data/data_dev.csv') data.head() ages = data['Age'] dev_salaries = data['All_Devs'] py_salaries = data['Python'] js_salaries = data['JavaScript'] plt.plot(ages, dev_salaries, color='#444444',...
github_jupyter
``` from pyspark.sql import SparkSession spark = SparkSession.builder.appName('nlp').getOrCreate() from pyspark.ml.feature import Tokenizer,RegexTokenizer from pyspark.sql.functions import col,udf from pyspark.sql.types import IntegerType sentence_df = spark.createDataFrame([ (0, 'Hello everyone and welcome to the t...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
``` %pylab inline import numpy as np import pandas as pd import seaborn as sns sns.set_style('ticks') sns.set_context('paper') import warnings warnings.filterwarnings('ignore') df = pd.read_csv('superfolders_ALL.csv') subset_df = df.loc[df['MainPlot']==1] sns.set_context('poster') figure(figsize=(20,9)) metrics = [...
github_jupyter
## Crypto Arbitrage In this Challenge, you'll take on the role of an analyst at a high-tech investment firm. The vice president (VP) of your department is considering arbitrage opportunities in Bitcoin and other cryptocurrencies. As Bitcoin trades on markets across the globe, can you capitalize on simultaneous price d...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import cv2 %matplotlib inline ``` ## Software and package versions ``` print("*** VERSIONS ***") import sys print("Python {}".format(sys.version)) print("OpenCV {}".format(cv2.__version__)) print("Numpy {}".format(np.__version__)) import matplotlib print("Matpl...
github_jupyter
<a href="https://colab.research.google.com/github/MoghazyCoder/Machine-Learning-Tutorials/blob/master/Tutorials/Basic_Exploratory_Data_Analysis_using_Python_libraries.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Data Engineering Tutorial ### I...
github_jupyter
# Finite Volume Discretisation In this notebook, we explain the discretisation process that converts an expression tree, representing a model, to a linear algebra tree that can be evaluated by the solvers. We use Finite Volumes as an example of a spatial method, since it is the default spatial method for most PyBaMM...
github_jupyter
# Capítulo 5 - Uso de Selenium para automatizar acciones en el navegador ___ ## Ejemplo práctico ___ importamos librerías clave: ``` ! pip install selenium from selenium import webdriver # hay que haber ejecutado `pip install selenium` para que funcione la importación ``` Para levantar el explorador deberá estar pr...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D5_DimensionalityReduction/W1D5_Tutorial4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 4: Nonlinear Dimensionality Reduction **...
github_jupyter
<img width="500" src="https://azurecomcdn.azureedge.net/cvt-18f087887a905ed3ae5310bee894aa53fc03cfffadc5dc9902bfe3469d832fec/less/images/section/azure-maps.png" /> # Azure Maps Geospatial Services [Microsoft Azure Maps ](https://azure.microsoft.com/en-us/services/azure-maps/) provides developers from all industries ...
github_jupyter
# Simulated X-ray Spectrum of Gas in CIE Simulated X-ray spectrum of solar abundance low-density ($n_e$=0.004), hot (T=10$^6$K) gas in collisional ionization equilibrium (CIE). Ionic species responsible for various emission lines are labeled. Wavelengths range from 150 to 250 Angstroms in steps of 0.5 Angstroms. This...
github_jupyter
# Using SFRmaker with NHDPlus High Resolution This notebook demostrates how to use `sfrmaker` to build an SFR package with an NHDPlus HR file geodatabase (or set of file geodatabases) obtained from the USGS National Map download client. ``` import os import numpy as np import pandas as pd import matplotlib.pyplot as p...
github_jupyter
## Gaussian Transformation #### In Machine learning algorithm like Linear and Logistic Regression, the algorithm assumes that the variable are normally distributed.So, gaussian distributed variables may boost the machine learning algorithm performance. ### <span style="color:red">So, gaussian transformation is applie...
github_jupyter
<img src="../images/aeropython_logo.png" alt="AeroPython" style="width: 300px;"/> # Problema de tiro parabólico ## Introducción Éste ejemplo no es más que una ayuda para introducir el ejemplo del salto de la rana, pues es un poco menos complejo. El ejemplo consiste simplemente en averiguar la velocidad necesaria pa...
github_jupyter
# Agrupando Datos __Group By__ se refiere al proceso que involucra uno o más de los siguientes pasos: * Dividir los datos en grupos basados en algún criterio. * Aplicar una función a cada uno de los grupos independientemente. * Combinar los resultados en una estructura de datos. La división es el paso principal. Usu...
github_jupyter
``` import gc import os import cv2 import sys import json import time import timm import torch import random import sklearn.metrics from PIL import Image from pathlib import Path from functools import partial from contextlib import contextmanager import numpy as np import scipy as sp import pandas as pd import torch....
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
``` import os import datetime import json import numpy as np import pandas as pd import pprint from IPython.display import display, HTML from pymongo import MongoClient # Connect to Mongo host & port client = MongoClient(os.environ['MONGODB_NAME'], 27017) # Input the name of the database you'd like to connect to. Exa...
github_jupyter
# Global Warming affects on Agriculture - India Global Warming and Agriculture are the two of the many things which always excites me, and I'm always curious about it. So why not collab both under the same roof. Global Warming can be the next biggest global crisis after the current COVID-19 pendamic. It has been affe...
github_jupyter
``` %load_ext nb_black %config InlineBackend.figure_format = 'retina' import pandas as pd def logs_to_dataframe(logs): rows = [] for line in logs.split("\n"): if len(line) == 0: continue path, elapsed = line.split(",") rows.append({"path": path, "elapsed": float(elapsed)}) ...
github_jupyter
# Stock Price Prediction In this notebook, we demonstrate a reference use case where we use historical stock price data to predict the future price. The dataset we use is the daily stock price of S&P500 stocks during 2013-2018 ([data source](https://www.kaggle.com/camnugent/sandp500/)). We demostrate how to do univari...
github_jupyter
## Converting the Cornell Movie-Dialogs Corpus into ConvoKit format This notebook is a demonstration of how custom datasets can be converted into Corpus with ConvoKit ``` from tqdm import tqdm from convokit import Corpus, User, Utterance ``` ### The Cornell Movie-Dialogs Corpus The original version of the Cornell ...
github_jupyter