code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# Overview Ensemble combined with LDA is effective in predicting age based on gene expression data. However, this method is prone to batch problem. The batch problem may caused by the different techniques in breeding cells that lead to difference in the mean gene expression level of cells between batches. kTSP is a ...
github_jupyter
# `layers.loss` ``` %reload_ext autoreload %autoreload 2 # %load ../../HPA-competition-solutions/bestfitting/src/layers/loss.py #default_exp layers.loss #export import math from torch import nn import torch.nn.functional as F from kgl_humanprotein.config.config import * from kgl_humanprotein.layers.hard_example impo...
github_jupyter
## Load Library And Data ``` # importing the library import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # to know the ecoding type import chardet with open('E:\\Recommendation System\\book.csv', 'rb') as rawdata: result = chardet.detect(rawdata.read(100000)) result ``` - ...
github_jupyter
# Example Feature-Based Cluster Queries ``` %load_ext autoreload %autoreload 2 %matplotlib inline import os import sys module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) import h5py import math import numpy as np chrom = 'chr7' bin_size = 100000 cluste...
github_jupyter
## Eng+Wales well-mixed example model This is the inference notebook with increased inference window. There are various model variants as encoded by `expt_params_local` and `model_local`, which are shared by the notebooks in a given directory. Outputs of this notebook: (same as `inf` notebook with added `tWin` labe...
github_jupyter
``` #Use this command to run it on floydhub: floyd run --gpu --env tensorflow-1.4 --data emilwallner/datasets/imagetocode/2:data --data emilwallner/datasets/html_models/1:weights --mode jupyter from os import listdir from numpy import array from keras.preprocessing.text import Tokenizer, one_hot from keras.preprocessin...
github_jupyter
# import required library ``` # Import numpy, pandas for data manipulation import numpy as np import pandas as pd # Import matplotlib, seaborn for visualization import matplotlib.pyplot as plt import seaborn as sns import warnings warnings.filterwarnings('ignore') # Import the data weather_data = pd.read_csv('weather...
github_jupyter
# Seattle Airbnb My significant foci are listing and calendar to display data from my business understanding. * Read dataset - read csv files to pandas dataframe. * Data manipulation - data cleaning and data wrangling to make quality data to visualization . * Exploratory data analysis (EDA) - Data visualization...
github_jupyter
``` #Relevant video: #http://www.youtube.com/watch?v=VIt2z6zJrMs&t=1m52s #My output from code: #https://www.youtube.com/watch?v=E_yE2Q0ArpM import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np import scipy.integrate as ing d2r = np.pi/180. #deg to radian k2f = 1.68781 #knots ...
github_jupyter
# Pandeia for WFIRST Imaging How to cite this code: > Klaus M. Pontoppidan ; Timothy E. Pickering ; Victoria G. Laidler ; Karoline Gilbert ; Christopher D. Sontag, et al. "Pandeia: a multi-mission exposure time calculator for JWST and WFIRST", Proc. SPIE 9910, Observatory Operations: Strategies, Processes, and System...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W2D2_LinearSystems/student/W2D2_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 3: Combining determinism and stochasticity ...
github_jupyter
# String ## `print()` Fungsi `print()` mencetak seluruh argumennya sebagai *string*, dipisahkan dengan spasi dan diikuti dengan sebuah *line break*: ``` name = "Budi" print("Hello World") print("Hello", 'World') print("Hello", name) ``` > Catatan: Fungsi untuk mencetak di Python 2.7 dan Python 3 berbeda. Di Python 2...
github_jupyter
<style>div.container { width: 100% }</style> <img style="float:left; vertical-align:text-bottom;" height="65" width="172" src="../assets/holoviz-logo-unstacked.svg" /> <div style="float:right; vertical-align:text-bottom;"><h2>Tutorial 5. Interactive Pipelines</h2></div> The plots built up over the first few tutorials...
github_jupyter
``` import matplotlib.pyplot as plt %matplotlib inline import numpy as np x = np.linspace(0, 5, 11) y = x ** 2 x y #Functional plt.plot(x,y,"r") plt.xlabel("X Axis") plt.ylabel("Y Axis") plt.title("Title") plt.show() plt.subplot(1,2,1) plt.plot(x,y,"r-") plt.subplot(1,2,2) plt.plot(y,x,"g*-") # OOP Method fig = plt.fig...
github_jupyter
# Cell Basic Filtering ## Content The purpose of this step is to get rid of cells having **obvious** issues, including the cells with low mapping rate (potentially contaminated), low final reads (empty well or lost a large amount of DNA during library prep.), or abnormal methylation fractions (failed in bisulfite conv...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') ``` `cd /content/drive/My\ Drive/Transformer-master/` -> `cd /content/drive/My\ Drive/Colab\ Notebooks/Transformer` ``` cd /content/drive/My\ Drive/Colab\ Notebooks/Transformer ``` # ライブラリ読み込み ``` !apt install aptitude !aptitude install mecab libmec...
github_jupyter
``` %matplotlib inline import numpy as np import scipy.stats as stats import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import random import statsmodels.api as sm sns.set(style="whitegrid") ``` # Example We're now in a position to return to our housing data for King County, Washington to make...
github_jupyter
``` # i 可能的取值:0、2、4、6、len(A) from collections import Counter class Solution: def canReorderDoubled(self, A): if not A: return True a_freq = Counter(A) seen = set() for a in A: if a in seen: continue if a_freq[a] == 0: seen.add(a) ...
github_jupyter
# Recommendations with IBM In this notebook, you will be putting your recommendation skills to use on real data from the IBM Watson Studio platform. You may either submit your notebook through the workspace here, or you may work from your local machine and submit through the next page. Either way assure that your ...
github_jupyter
# Part 1: Data Wrangling ## Introduction This project is a self-made end to end machine learning project in which I scrape a website called 'Jendela 360'. The scraped dataset is saved in a csv file named 'Apartment Data Raw'. The dataset contains the details of apartment units available to be rented in Jakarta and it...
github_jupyter
# Reference To run this code you will need to install [Matplotlib](https://matplotlib.org/users/installing.html) and [Numpy](https://www.scipy.org/install.html) If you like to run the example locally follow the instructions provided on [Keras website](https://keras.io/#installation) It's __strongly__ suggested to us...
github_jupyter
# ELG Signal-to-Noise Calculations This notebook provides a standardized calculation of the DESI emission-line galaxy (ELG) signal-to-noise (SNR) figure of merit, for tracking changes to simulation inputs and models. See the accompanying technical note [DESI-3977](https://desi.lbl.gov/DocDB/cgi-bin/private/ShowDocume...
github_jupyter
``` #hide #default_exp cli from nbdev.showdoc import show_doc ``` # Command line functions > Console commands added by the nbdev library ``` #export from nbdev.imports import * from chisel_nbdev.export_scala import * from chisel_nbdev.sync_scala import * from nbdev.merge import * from chisel_nbdev.export_scala2html ...
github_jupyter
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/book1/intro/pandas_intro.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Manipulating and visualizing tabular data using pandas [Pandas](https://pandas.pydata.org/) is...
github_jupyter
# Maxpooling Layer In this notebook, we add and visualize the output of a maxpooling layer in a CNN. A convolutional layer + activation function, followed by a pooling layer, and a linear layer (to create a desired output size) make up the basic layers of a CNN. <img src='notebook_ims/CNN_all_layers.png' height=50%...
github_jupyter
``` # default_exp filter #hide from nbdev.showdoc import * #hide # stellt sicher, dass beim verändern der core library diese wieder neu geladen wird %load_ext autoreload %autoreload 2 ``` # 01_06_Pivot_BS_Data In this notebook, we will transform the verticalized data rows of the BalanceSheet into a horizontalized dat...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import random #using the monte carlo method to approximate the value of pi N_array = np.arange(1,5000) pi_array = [] x_array_points = [] y_array_points = [] for n in N_array: num_in = 0 num_out = 0 for i in range(n): x =...
github_jupyter
Analysing GPS data from Jaume University Defining functions ``` import json import math import numpy as np import matplotlib.pyplot as plt def getmeasurementTimestamp(item): return int(item['measurementTimestamp']) def getProcessingTimestamp(item): return int(item['processingTimestamp']) def get_x_error(it...
github_jupyter
# Face Generation In this project, you'll define and train a DCGAN on a dataset of faces. Your goal is to get a generator network to generate *new* images of faces that look as realistic as possible! The project will be broken down into a series of tasks from **loading in data to defining and training adversarial net...
github_jupyter
``` %matplotlib inline import pymc3 as pm import numpy as np import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt import seaborn as sns palette = 'muted' sns.set_palette(palette); sns.set_color_codes(palette) np.set_printoptions(precision=2) ``` # Simple example ``` clusters = 3 n_cluster ...
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
# 빠른 학습을 위한 tfrecords 데이터셋 생성 - 컴페티션 기본 데이터는 data/public 하위 폴더에 있다고 가정합니다. (train.csv, sample_submission.csv, etc) - 또한 train.zip, test.zip 역시 data/public 하위에 압축을 풀어놓았다고 가정하고 시작하겠습니다. ``` import os import os.path as pth import json import shutil import pandas as pd from tqdm import tqdm data_base_path = pth.join('dat...
github_jupyter
# Batch Normalization – Solutions Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a convolutional neural network with 20 convolutional layers, followed by a fully connected layer. We'll use it to classify handwritten digits in the MNIST dataset, which should be ...
github_jupyter
## In situ data and trajectories incl. Bepi Colombo, PSP, Solar Orbiter https://github.com/cmoestl/heliocats Author: C. Moestl, IWF Graz, Austria twitter @chrisoutofspace, https://github.com/cmoestl last update: 2021 August 24 needs python 3.7 with the conda helio environment (see README.md) uses heliopy for ge...
github_jupyter
``` import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns import torch from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from xgboost import XGBRegressor from lightgbm import LGBMRegressor from sklearn.metrics import mean_...
github_jupyter
this notebook will be used to show the performance of the first attempt at learning reward. first load the trained reward network anbd setup methods. ``` from baselines.common.vec_env import VecFrameStack from LearningModel.AgentClasses import * from baselines.common.cmd_util import make_vec_env import tensorflow as ...
github_jupyter
# 深度学习工具 PyTorch 简介 在此 notebook 中,你将了解 [PyTorch](http://pytorch.org/),一款用于构建和训练神经网络的框架。PyTorch 在很多方面都和 Numpy 数组很像。毕竟,这些 Numpy 数组也是张量。PyTorch 会将这些张量当做输入并使我们能够轻松地将张量移到 GPU 中,以便在训练神经网络时加快处理速度。它还提供了一个自动计算梯度的模块(用于反向传播),以及另一个专门用于构建神经网络的模块。总之,与 TensorFlow 和其他框架相比,PyTorch 与 Python 和 Numpy/Scipy 堆栈更协调。 ## 神经网络 深度学习以人工神经网络为...
github_jupyter
# Project 3: Implement SLAM --- ## Project Overview In this project, you'll implement SLAM for robot that moves and senses in a 2 dimensional, grid world! SLAM gives us a way to both localize a robot and build up a map of its environment as a robot moves and senses in real-time. This is an active area of research...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from bokeh.plotting import * from sklearn.cluster.bicluster import SpectralCoclustering from bokeh.models import HoverTool, ColumnDataSource from itertools import product whisky = pd.read_csv('whiskies.txt') whisky["Region"] = pd.read_csv('regio...
github_jupyter
``` import datetime as dt import panel as pn pn.extension() ``` The ``DateRangeSlider`` widget allows selecting a date range using a slider with two handles. For more information about listening to widget events and laying out widgets refer to the [widgets user guide](../../user_guide/Widgets.ipynb). Alternatively y...
github_jupyter
### Imports ``` import pandas as pd import os import numpy as np from category_encoders import TargetEncoder from sklearn.pipeline import Pipeline from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import Lasso from sklearn.impute import SimpleImputer from sklearn.preprocessing import Standar...
github_jupyter
**Important**: Click on "*Kernel*" > "*Restart Kernel and Clear All Outputs*" *before* reading this chapter in [JupyterLab <img height="12" style="display: inline-block" src="static/link_to_jp.png">](https://jupyterlab.readthedocs.io/en/stable/) # An Introduction to Python and Programming This course is a *thorough* ...
github_jupyter
``` import os import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties from tensorflow.keras import datasets from pyvizml import CreateNBAData import requests from sklearn.linear_model import LinearRegression from sklearn.model_se...
github_jupyter
# MBZ-XML-TO-EXCEL First pubished version May 22, 2019. This is version 0.0004 (revision July 26, 2019) Licensed under the NCSA Open source license Copyright (c) 2019 Lawrence Angrave All rights reserved. Developed by: Lawrence Angrave Permission is hereby granted, free of charge, to any person obtaining a copy ...
github_jupyter
# **DBSCAN** ## **Implementacion** ``` import numpy as np import matplotlib.pyplot as plt from math import e, inf from random import randint, uniform from sklearn.datasets import make_circles ``` ### KNN ``` class Node: def __init__(self, parent, x, area): self.parent = parent self.x = x self.childs ...
github_jupyter
# HOMEWORK 2 - ADM ``` import pandas as pd import matplotlib.pyplot as plt import methods import datetime ``` ## READ THE DATA ``` df_names = ["./datasets/2019-Nov.csv", "./datasets/2019-Oct.csv"] ``` ## UNDERSTAND THE DATA The data that we handle for this homework come from an online store. We are going to analyz...
github_jupyter
# Histograms This notebook demonstrates simple use of histograms in wn. ### Set up libraries and load exemplar dataset ``` # load libraries import os import opendp.whitenoise.core as wn import numpy as np import math import statistics # establish data information data_path = os.path.join('.', 'data', 'PUMS_californi...
github_jupyter
``` import os import matplotlib.pyplot as plt %matplotlib inline import torch import torchvision.transforms as T import numpy as np from PIL import Image ``` ## Verifying image loading is the right format ``` path = '/home/yamins/.local/lib/python3.7/site-packages/model_tools/check_submission/images' from model_tools...
github_jupyter
``` !pip install econml # Some imports to get us started import warnings warnings.simplefilter('ignore') # Utilities import os import urllib.request import numpy as np import pandas as pd from networkx.drawing.nx_pydot import to_pydot from IPython.display import Image, display # Generic ML imports from sklearn.prepro...
github_jupyter
![qiskit_header.png](attachment:qiskit_header.png) # _*Qiskit Finance: Loading and Processing Stock-Market Time-Series Data*_ The latest version of this notebook is available on https://github.com/qiskit/qiskit-tutorial. *** ### Contributors Jakub Marecek<sup>[1]</sup> ### Affiliation - <sup>[1]</sup>IBMQ ### Intr...
github_jupyter
##### Copyright 2021 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
# Here we will learn topics like 1. Universal function 2. aggreagate function 3. Broadcasting ## Universal function 1. A big difference between python array and numpy array is execution speed. 2. python array iterate through each element and then process it. 3. numpy array use the concept of vectorized operation, wh...
github_jupyter
Azure ML & Azure Databricks notebooks by Parashar Shah. Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. We support installing AML SDK as library from GUI. When attaching a library follow this https://docs.databricks.com/user-guide/libraries.html and add the below string as y...
github_jupyter
# 🔢 Vectorizing Guide Firstly, we must import what we need from Relevance AI ``` from relevanceai import Client from relevanceai.utils.datasets import ( get_iris_dataset, get_palmer_penguins_dataset, get_online_ecommerce_dataset, ) client = Client() ``` ## Example 1 For this first example we going to w...
github_jupyter
# **Amazon Lookout for Equipment** - Getting started *Part 6 - Cleanup* ## Initialization --- This repository is structured as follow: ```sh . lookout-equipment-demo | ├── data/ | ├── interim # Temporary intermediate data are stored here | ├── processed # Finalized ...
github_jupyter
# Convert a SolidMesh into its BoundaryRepresentation The goal is to transform a volumetric mesh into a model as defined here: https://docs.geode-solutions.com/datamodel The core of the problem is to identify and to extract the topological information from the mesh. There are two ways to realize this identification: -...
github_jupyter
``` import pandas as pd # To convert data into pandas dataframe import numpy as np # For data and large type of arrays manipulation import matplotlib.pyplot as plt #For data visualisation import seaborn as sns # For data visualisation import plotly.express as px #For data visualisation ``` # Data Preprocessing ``` # ...
github_jupyter
1. Recap == In the last mission, we explored how to use a simple k-nearest neighbors machine learning model that used just one feature, or attribute, of the listing to predict the rent price. We first relied on the <span style="background-color: #F9EBEA; color:##C0392B">accommodates</span> column, which describes the ...
github_jupyter
``` import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline import numpy as np import sklearn import pandas as pd import os import sys import time import tensorflow as tf from tensorflow import keras print(tf.__version__) print(sys.version_info) for module in mpl, np, pd, sklearn, tf, keras: p...
github_jupyter
# Problem set 5 ### Copied database from /blue/bsc4452/share/Class_Files ``` # Import only the modules needed from sqlalchemy from sqlalchemy import create_engine from sqlalchemy import MetaData from sqlalchemy import Table, Column from sqlalchemy import Integer, String from sqlalchemy import sql, select, join, desc f...
github_jupyter
``` #convert ``` # babilim.model.layers.roi_ops > Operations for region of interest extraction. ``` #export from babilim.core.annotations import RunOnlyOnce from babilim.core.module_native import ModuleNative #export def _convert_boxes_to_roi_format(boxes): """ Convert rois into the torchvision format. ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys import pathlib sys.path.append(str(pathlib.Path().cwd().parent)) from typing import Tuple from load_dataset import Dataset from plotting import plot_ts dataset = Dataset('../data/dataset/') ``` ### В чем заключаются недостатки полносвязных сетей? * невозможность ула...
github_jupyter
# Milestone2 Document ## Feedback - Introduction: A nice introduction! - Background -0.5: It would be hard for users to understand automatic differentiation, computational graph, and evaluation trace if you don't give the corresponding illustrations in the Background section **Revision: provided a concrete ex...
github_jupyter
``` import pandas as pd from joblib import dump, load import os #set up directory #os.chdir() #Drug dic #open file df_drugs=pd.read_csv(r"C:\Users\mese4\Documents\The Data incubator\project\Drugmap\drugbank vocabulary.csv", encoding='ISO-8859-1') synonyms = [] drug_names = df_drugs['Common_name'].tolist() drug_names...
github_jupyter
# Introduction to reproducibility and power issues ## Some Definitions * $H_0$ : null hypothesis: The hypotheis that the effect we are testing for is null * $H_A$ : alternative hypothesis : Not $H_0$, so there is some signal * $T$ : The random variable that takes value "significant" or "not significant" * $T_S$ : ...
github_jupyter
``` import os import torch import numpy as np import pickle import matplotlib.pyplot as plt from torch.optim.lr_scheduler import LambdaLR, StepLR #@title import gzip import html import os from functools import lru_cache import ftfy import regex as re @lru_cache() def bytes_to_unicode(): """ Returns list of ...
github_jupyter
## Libraries ``` import pandas as pd import numpy as np import scipy.stats as stat from math import sqrt from mlgear.utils import show, display_columns from surveyweights import normalize_weights, run_weighting_iteration def margin_of_error(n=None, sd=None, p=None, type='proportion', interval_size=0.95): z_look...
github_jupyter
# Live Twitter Sentiments for Cryptocurrencies Plot the evolution in time of the tweets sentiment for a cryptocurrency. We will use the *tweepy*'s streaming to see the live evolution of the Twitter sentiments for the cryptocurrencies. * *Inputs*: currency keywords to seach in Twitter, number of tweets to analyse the ...
github_jupyter
# CNN MNIST ``` #importing functions from python3 to python2 from __future__ import absolute_import from __future__ import division from __future__ import print_function #importing numpy and tensorflow import numpy as np import tensorflow as tf #ignore all the warnings and don't show them in the notebook import warn...
github_jupyter
### AD470 - Module 7 Introduction to Deep LearningProgramming Assignment #### Andrew Boyer #### Brandan Owens ``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import scipy.io from sklearn.preprocessing import StandardScaler import tensorflow from tensorflow import keras...
github_jupyter
# OptNet/qpth Example Sudoku Notebook *By [Brandon Amos](https://bamos.github.io) and [J. Zico Kolter](http://zicokolter.com/).* --- This notebook is released along with our paper [OptNet: Differentiable Optimization as a Layer in Neural Networks](https://arxiv.org/abs/1703.00443). This notebook shows an example of...
github_jupyter
``` #IMPORT SEMUA LIBARARY #IMPORT LIBRARY PANDAS import pandas as pd #IMPORT LIBRARY UNTUK POSTGRE from sqlalchemy import create_engine import psycopg2 #IMPORT LIBRARY CHART from matplotlib import pyplot as plt from matplotlib import style #IMPORT LIBRARY BASE PATH import os import io #IMPORT LIBARARY PDF from fpdf im...
github_jupyter
# Index对象的创建,、查、改、增、删和使用 想要用好pandas,必须了解其核心对象之一的**索引**。 - 索引类似于元组,其本身是不能赋值修改的; - 其在数据进行整体运算时,辅助自动对齐,这是pandas不同于其他数据处理库的一大特征; - 多层索引可以帮助改变表的形态,如透视表等。 所以,这一章要仔细学习。 ``` import numpy as np import pandas as pd ``` # 1. 单层索引 ## 1.1 创建 ##### `pd.Index(data, dtype=Object, name=None)` - name:一维列表 - dtype:索引元素的类型,默认为object型 ...
github_jupyter
``` %matplotlib inline import numpy as np import pandas as pd import os import sys sys.path.append('..') import geopandas as gpd from shapely.geometry import Point from shapely.geometry import LineString from shapely.geometry import MultiPoint GAS_STATIONS_PATH = os.path.join('..', 'data', 'raw', 'input_data', 'Eingabe...
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
# Jupyter UX Survey 2015 - Initial Sandbox * Goal: Start looking at how we can surface insights from the data. * Description: https://github.com/jupyter/surveys/tree/master/surveys/2015-12-notebook-ux * Data: https://raw.githubusercontent.com/jupyter/surveys/master/surveys/2015-12-notebook-ux/20160115235816-SurveyExpo...
github_jupyter
# Objective Build a binary classifier that given a sequence of lap times will predict if a pit-stop will happen or not the next lap .. in other words I call this project End-of-Stint-or-NOT Data Source: - Ergast Developer API: https://ergast.com/mrd/ ## Table of Content: * [Data Preparation](#Section1) * [Import ...
github_jupyter
<a href="https://colab.research.google.com/github/Nadda1004/Intro_Machine_learning/blob/main/W1_D1_ML_HeuristicModel.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Predicting Rain in Seattle Seattle is one of the rainiest places in the world. Ev...
github_jupyter
--- _You are currently looking at **version 1.0** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-text-mining/resources/d9pwm) course resource._ --- *Note: Some of the cell...
github_jupyter
<b>Detection of Sargassum on the coast and coastal waters</b> Notebook for classifying and analyzing Sargassum in Bonaire with Sentinel-2 images * Decision Tree Classifier (DTC) and Maximum Likelihood Classifier (MLC) are employed * Training sites covering 8 different classes are used to extract pixel values (traini...
github_jupyter
``` import pandas as pd and_data = pd.read_csv('ANDHRA_PD.csv') and_data.head() del_data = pd.read_csv('DELHI.csv') del_data.head() kar_data = pd.read_csv('KARNATAKA.csv') kar_data.head() mah_data = pd.read_csv('MAHARASHTRA.csv') mah_data.head() tam_data = pd.read_csv('TAMIL_NADU.csv') tam_data.head() utt_data = pd.rea...
github_jupyter
# Anisha Parikh ## Research question/interests My research question is what are the top 10 most remembered songs and the bottom 10 least remembered songs. As well as how does recollection of the songs compare across generations. Imports ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt impor...
github_jupyter
# Hands-on 2: How to create a fMRI analysis workflow The purpose of this section is that you setup a fMRI analysis workflow. # 1st-level Analysis Workflow Structure In this notebook we will create a workflow that performs 1st-level analysis and normalizes the resulting beta weights to the MNI template. In concrete s...
github_jupyter
``` import scipy.io as sio mat = sio.loadmat("./imdb/imdb.mat") from IPython.core.display import Image idx = 11114 path ='./imdb_crop/' + mat['imdb'].item()[2][0][idx][0] print(mat['imdb'].item()[4][0][idx][0]) print(mat['imdb'].item()[2][0][idx][0]) Image(filename=path) import numpy embeddings = numpy.load('./embeddi...
github_jupyter
## UCI SMS Spam Collection Dataset * **Input**: sms textual content. **Target**: ham or spam * **data representation**: each sms is repesented with a **fixed-length vector of word indexes**. A word index lookup is generated from the vocabulary list. * **words embedding**: A word embedding (dense vector) is learnt for ...
github_jupyter
# Assignment 1: Neural Networks Implement your code and answer all the questions. Once you complete the assignment and answer the questions inline, you can download the report in pdf (File->Download as->PDF) and send it to us, together with the code. **Don't submit additional cells in the notebook, we will not check...
github_jupyter
``` import warnings warnings.filterwarnings('ignore') %matplotlib inline import numpy as np import scipy.stats as stats import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import random import patsy sns.set(style="whitegrid") ``` # Logistic Regression In the last section, we looked at how we ca...
github_jupyter
# More Pandas ``` # Load the necessary libraries import pandas as pd %matplotlib inline ``` ## Vectorized String Operations * There is a Pandas way of doing this that is much more terse and compact * Pandas has a set of String operations that do much painful work for you * Especially handling bad data! ``` data = [...
github_jupyter
<a href="https://colab.research.google.com/github/lmiroslaw/DeOldify/blob/master/VideoColorizerColab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### **<font color='blue'> Video Colorizer </font>** #◢ DeOldify - Colorize your own videos! _FYI:...
github_jupyter
# $\lambda$对CMA性能影响研究 <link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css"> <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script type="...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D1_BayesianDecisions/W3D1_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Bonus Tutorial : Fitting to data **Week 3, Day 1: Bayesi...
github_jupyter
This material should help you get the ideas clearer from the first meeting: ``` names=["Tomás", "Pauline", "Pablo", "Bjork","Alan","Juana"] woman=[False,True,False,False,False,True] ages=[32,33,28,30,32,27] country=["Chile", "Senegal", "Spain", "Norway","Peru","Peru"] education=["Bach", "Bach", "Master", "PhD","Bach",...
github_jupyter
# Graphing network packets This notebook currently relies on HoloViews 1.9 or above. Run `conda install -c ioam/label/dev holoviews` to install it. ## Preparing data The data source comes from a publicly available network forensics repository: http://www.netresec.com/?page=PcapFiles. The selected file is https://dow...
github_jupyter
# Tutorial 1: Part 2 Objectives: - Learn how to define a simple lattice and compute the TWISS functions using MAD-X. - Thick vs thin lens approximation TWISS comparison for a lattice with only quadrupoles. - Tune and $\beta$-function dependence on K1. **My first accelerator: a FODO cell** 1. Make a simple lattice FO...
github_jupyter
# QuickSort - Based on Divide and Conquer Technique - The array is divided into **Partitions Recursively** - The technique to create the partitions is the **backbone** of this Algorithm ### QuickSort - What it is In Short: - 1. Define a Pivot element ( can be first element, last element or any random element from...
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
``` # 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
``` import pandas as pd df = pd.DataFrame({'num_legs': [2, 4, 8, 0], 'num_wings': [2, 0, 0, 0], 'num_specimen_seen': [10, 2, 1, 8]}, index=['falcon', 'dog', 'spider', 'fish']) from ipyaggrid import Grid grid_options_1 = { 'enableSorting': 'false', 'enabl...
github_jupyter
# Lab 11 Download Census Data into Python ``` from urllib import request import json from pprint import pprint census_api_key = 'f84452395038a4790772cc768cb13ecbe0e6a636' #get your key from https://api.census.gov/data/key_signup.html url_str = 'https://api.census.gov/data/2019/acs/acs5?get=B01001_001E,NAME&for=cou...
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: ## Homework 2: Linear and k-NN Regression **Harvard University**<br/> **Fall 2019**<br/> **Instructors**: Pavlos Protopap...
github_jupyter