code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# `kmeans(data)` #### `def kmeans_more(data, nk=10, niter=100)` - `returns 3 items : best_k, vector of corresponding labels for each given sample, centroids for each cluster` #### `def kmeans(data, nk=10, niter=100)` - `returns 2 items: best_k, vector of corresponding labels for each given sample` # Requirement...
github_jupyter
``` %load_ext autoreload %autoreload import numpy as np import matplotlib import matplotlib.pyplot as plt import math import sys sys.path.append("..") import physics sys.path.append("../..") from spec.spectrum import * import spec.spectools as spectools import xsecs class Rates(object): def __init__(self, E_sp...
github_jupyter
# Savor Data > Taking advantage of my own big data. A data-driven project by [Tobias Reaper](https://github.com/tobias-fyi/) ## Part 2: CSV Pipeline Here are the general steps in the pipeline: 1. Load CSV data exported from Airtable's GUI 2. Apply any needed transformations * Fixing column datatypes 3. Insert ...
github_jupyter
# Applied Process Mining Module This notebook is part of an Applied Process Mining module. The collection of notebooks is a *living document* and subject to change. # Lecture 1 - 'Event Logs and Process Visualization' (R / bupaR) ## Setup <img src="http://bupar.net/images/logo_text.PNG" alt="bupaR" style="width: 2...
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
<div style="text-align:center;"> <h1 style="font-size: 50px; margin: 0px; margin-bottom: 5px;">Maximum Radial Extent Plot</h1> <h2 style="margin:0px; margin-bottom: 5px;">COMPAS methods paper Figure 6</h2> <p style="text-align:center;">A notebook for reproducing the maximum radial extent plot in the COMPAS ...
github_jupyter
* # Largest palindrome product A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. ### Let's break the trouble in more steps, at least meanwhile: * Find palindro...
github_jupyter
# カメラの位置姿勢を求める ``` import cv2 import numpy as np import matplotlib.pyplot as plt from skvideo.io import vread import moviepy.editor as mpy from tqdm import tqdm from mpl_toolkits.mplot3d import axes3d, Axes3D from IPython.display import Image def npy_to_gif(npy, filename): clip = mpy.ImageSequenceClip(list(npy),...
github_jupyter
# AOT Autograd - How to use and optimize? <a href="https://colab.research.google.com/github/pytorch/functorch/blob/main/notebooks/colab/aot_autograd_optimizations.ipynb"> <img style="width: auto" src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> ## Background In this tutorial...
github_jupyter
# Attach nearest network nodes to CHTS homes and workplaces ``` import numpy as np import pandas as pd from sklearn.neighbors import BallTree # identify bay area counties by fips code bayarea = {'Alameda':'001', 'Contra Costa':'013', 'Marin':'041', 'Napa':'055', 'San Francis...
github_jupyter
# Eaton method with well log Pore pressure prediction with Eaton's method using well log data. Steps: 1. Calculate Velocity Normal Compaction Trend 2. Optimize for Eaton's exponent n 3. Predict pore pressure using Eaton's method ``` import warnings warnings.filterwarnings(action='ignore') # for python 2 and 3 co...
github_jupyter
# Matrix Addition In this exercises, you will write a function that accepts two matrices and outputs their sum. Think about how you could do this with a for loop nested inside another for loop. ``` ### TODO: Write a function called matrix_addition that ### calculate the sum of two matrices ### ### INPUTS: ### ...
github_jupyter
### Details on the hardware used to gather the performance data ``` import pandas as pd from collections import OrderedDict as odict #name, cache-size (in kB) hardware = odict({}) hardware['i5'] = ('Intel Core i5-6600 @ 3.30GHz (2x 8GB DDR4, 4 cores)',6144, '1 MPI task x 4 OpenMP threads (1 per cor...
github_jupyter
``` import tensorflow as tf from tensorflow import keras from keras.preprocessing.image import ImageDataGenerator import scipy import os import cv2 import random from skimage import io import seaborn as sns from matplotlib import pyplot import pandas as pd import tensorflow.keras.backend as K import numpy as np np.ra...
github_jupyter
<div class="alert alert-block alert-info"><b></b> <h1><center> <font color='black'> Homework 01 </font></center></h1> <h2><center> <font color='black'> Introduction and first look at the data </font></center></h2> <h2><center> <font color='black'> BDA - University of Tartu - Spring 2020</font></center></h3> </div>...
github_jupyter
``` import omnitool from omnitool.literature_values import * import matplotlib matplotlib.rcParams['text.usetex']=False import pandas as pd import matplotlib.pyplot as plt import seaborn as sns ``` We'll use the asteroseismic data from Yu et al. 2018 ``` #Read in Jie Yu print('Reading in Yu+2018') sfile = '/home/oli...
github_jupyter
## setup and notebook configuration ``` # scientific python stack import numpy as np import scipy as sp import sympy as sym import orthopy, quadpy # matplotlib, plotting setup import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.tri as mtri # delaunay triangulation from mpl_toolkits...
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
# **Legal BERT-th (FineTuning)** ``` %cd bert_finetuning pwd ``` > Install and import libraries ``` !pip install tensorflow-gpu==1.15 import tensorflow print(tensorflow.__version__) # Install sentencepiece >> used for tokenizing Thai senetences !pip install sentencepiece # Install gdown for downloading files from g...
github_jupyter
## Spatial data visualization with `tidycensus` **Location! Location! Location!** The location people live in tells us a lot about the space itself as well as the people who live in there. This demo is about spatial data visualization with `tidycensus` R package with two variables of interest -- population and race...
github_jupyter
``` import os import numpy as np from tqdm import tqdm from src.data.loaders.ascad import ASCADData from src.dlla.berg import make_mlp from src.dlla.hw import prepare_traces_dl, dlla_known_p from src.pollution.gaussian_noise import gaussian_noise from src.tools.cache import cache_np from src.trace_set.database import...
github_jupyter
# Machine Vision<br>Assignment 8 - Triangulation ## Personal details * **Name(s):** `` * **Student ID(s):** `` ## 1. Introduction In this assignment we will use a pair of stereo images to triangulate points in 3D. Let us first display the test images and 2D point correspondences. We also load 3D points mainly for t...
github_jupyter
# Import necessary depencencies ``` import pandas as pd import numpy as np import text_normalizer as tn import model_evaluation_utils as meu np.set_printoptions(precision=2, linewidth=80) ``` # Load and normalize data ``` dataset = pd.read_csv(r'movie_reviews.csv') reviews = np.array(dataset['review']) sentiments ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set_style("whitegrid") # Applying gradient descent algorithm theta= 3 alpha = 0.1 data = [] for i in range(0,10): res = alpha * 2 * theta # update rule print("{0:.4f} {1:.4f}".format(the...
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 retry import seaborn as sns %matplotlib inline current_work...
github_jupyter
# Plotting the Correlation between Air Quality and Weather ``` # If done right, this program should # Shoutout to my bois at StackOverflow - you da real MVPs # Shoutout to my bois over at StackOverflow - couldn't've done it without you import pandas as pd import numpy as np from bokeh.plotting import figure from bok...
github_jupyter
# Identifying special matrices ## Instructions In this assignment, you shall write a function that will test if a 4×4 matrix is singular, i.e. to determine if an inverse exists, before calculating it. You shall use the method of converting a matrix to echelon form, and testing if this fails by leaving zeros that can’t...
github_jupyter
# Prosper Loan Data Exploration ## By Abhishek Tiwari # Preliminary Wrangling This data set contains information on peer to peer loans facilitated by credit company Prosper ``` # import all packages import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline df = p...
github_jupyter
# Setup ``` %matplotlib inline import numpy as np import scipy.signal as sig import scipy.stats as stat import matplotlib.pyplot as plt import seaborn as sns import os import h5py import datetime import pandas as pd from pandas import DataFrame,Series,read_table ``` General info ``` savePlots = True # whether o...
github_jupyter
``` client_id = '' client_secret = '' import base64 import requests import datetime from urllib.parse import urlencode class SpotifyAPI(object): access_token = None access_token_expires = datetime.datetime.now() access_token_did_expire = True client_id = None client_secret = None token_url = "ht...
github_jupyter
## Exercise 04: Plotting the Movement of an Aircraft with a Custom Layer In this exercise, we will take a look at how to create custom layers that allow you to not only display geo-spatial data but also animate your datapoints over time. We'll get a deeper understanding of how geoplotlib works and how layers are cre...
github_jupyter
## Compile per MOA p value for shuffled comparison ``` import pathlib import numpy as np import pandas as pd import scipy.stats # Load L2 distances per MOA cp_l2_file = pathlib.Path("..", "cell-painting", "3.application", "L2_distances_with_moas.csv") cp_l2_df = pd.read_csv(cp_l2_file).assign(shuffled="real") cp_l2_d...
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
# Image similarity estimation using a Siamese Network with a contrastive loss **Author:** Mehdi<br> **Date created:** 2021/05/06<br> **Last modified:** 2021/05/06<br> **ORIGINAL SOURCE:** https://github.com/keras-team/keras-io/blob/master/examples/vision/ipynb/siamese_contrastive.ipynb<br> **Description:** Similarity ...
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 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
github_jupyter
## Plots of SST for S-MODE region ``` cd C:\users\jtomf\Documents\Python\S-MODE_analysis\code import xarray as xr import numpy as np import matplotlib.pyplot as plt import matplotlib import cftime import cartopy.crs as ccrs # import projections import cartopy import gsw # For great circle distance b...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import gc import os import re import pickle import sklearn import sys import string from sklearn.decomposition import LatentDirichletAllocation from sklearn.metrics import f1_score, precision_score, recall_score from sklearn.metrics.pairwise im...
github_jupyter
# Assignment 11 Consider the reservoir shown below with the given properties that has been discretized into 4 equal grid blocks. ![image](images/grid.png) Below is a skeleton of a Python class that can be used to solve for the pressures in the reservoir. The class is actually written generally enough that it can ac...
github_jupyter
<a href="https://colab.research.google.com/github/thomascong121/SocialDistance/blob/master/model_camera_colibration.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` from google.colab import drive drive.mount('/content/drive') %%capture !pip insta...
github_jupyter
<a href="https://colab.research.google.com/github/scifiswapnil/DeepLearningExperiments/blob/master/CNN/Exercise3_transferlearning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title Licensed under the Apache License, Version 2.0 (the "Licens...
github_jupyter
# Azure Machine Learning Setup To begin, you will need to provide the following information about your Azure Subscription. **If you are using your own Azure subscription, please provide names for subscription_id, resource_group, workspace_name and workspace_region to use.** Note that the workspace needs to be of type ...
github_jupyter
<a href="https://colab.research.google.com/github/jereyel/LinearAlgebra/blob/main/Assignment2_DelosReyes.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Welcome to Python Fundamentals In this module, we are going to establish our skills in Python ...
github_jupyter
#### This notebook is used to train a character recongition from input image using MobileNets ``` # ignore warning import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from keras.preprocessing.image import ImageDataGenerator from keras.applications import MobileNetV2 from keras.layers import AveragePooling2D from kera...
github_jupyter
SAM001a - Query Storage Pool from SQL Server Master Pool (1 of 3) - Load sample data ==================================================================================== Description ----------- In this 3 part tutorial, load data into the Storage Pool (HDFS) using `azdata`, convert it into Parquet (using Spark) and th...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/composite_bands.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href="...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/webinars_conferences_etc/python_web_conf/NLU_crashcourse_py_web.ipynb) <div> <img src="https...
github_jupyter
# Florida Single Weekly Predictions, trained on historical flu data and temperature > Once again, just like before in the USA flu model, I am going to index COVID weekly cases by Wednesdays ``` import tensorflow as tf physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(p...
github_jupyter
### Background and Overview: The [MIMIC-III](https://mimic.mit.edu/about/mimic/) (Medical Information Mart for Intensive Care) Clinical Database is comprised of deidentified health-related data associated with over 40,000 patients (available through request). Its 26 tables have a vast amount of information on the patie...
github_jupyter
# Guide for Authors ``` print('Welcome to "The Debugging Book"!') ``` This notebook compiles the most important conventions for all chapters (notebooks) of "The Debugging Book". ## Organization of this Book ### Chapters as Notebooks Each chapter comes in its own _Jupyter notebook_. A single notebook (= a chapter...
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
# LODES Data Analysis ## Prepare Workbook ``` import numpy as np from pandas import Series, DataFrame import pandas as pd import urllib from urllib2 import urlopen from StringIO import StringIO import gzip import requests import json import os from copy import deepcopy from pandas.io.json import json_normalize # Set...
github_jupyter
# Implementing the Gradient Descent Algorithm In this lab, we'll implement the basic functions of the Gradient Descent algorithm to find the boundary in a small dataset. First, we'll start with some functions that will help us plot and visualize the data. ``` import matplotlib.pyplot as plt import numpy as np import ...
github_jupyter
# MALDI acquisition of predefined areas author: Alex Mattausch version: 0.1.0 ``` %load_ext autoreload %autoreload 2 # "%matplotlib widget" is slightly better, but sometimes doesn't work # "%matplotlib notebook" or "%matplotlib inline" can be used as alternatives %matplotlib widget import matplotlib.pyplot as plt i...
github_jupyter
# World's Fastest Growing Economies as of 2018 This project seeks to find out countries with eceonomy growth. This data was gotten from <a>"https://en.wikipedia.org/wiki/List_of_countries_by_real_GDP_growth_rate"<a> by web scraping and loading the table from the website. ## Let's dive in. ``` from bs4 import Beautif...
github_jupyter
<a href="https://practicalai.me"><img src="https://raw.githubusercontent.com/practicalAI/images/master/images/rounded_logo.png" width="100" align="left" hspace="20px" vspace="20px"></a> <img src="https://raw.githubusercontent.com/practicalAI/images/master/basic_ml/06_Multilayer_Perceptron/nn.png" width="200" vspace="1...
github_jupyter
``` import pandas as pd import swifter import numpy as np df = pd.read_csv("data/gc-1m.csv", sep=";")#,nrows=1000) df.columns=["Date","Time", "Open", "High", "Low", "Close", "Volume"] #Wilder’s Smoothing function def Wilder(data, periods): start = np.where(~np.isnan(data))[0][0] #Check if nans present in beginning ...
github_jupyter
<a href="https://colab.research.google.com/github/aayush9628/cs480student/blob/main/06/Copy_of_CS480_Assignment_6.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ![CS480_w.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAADtCAYAAAAvOMSOAAAf83...
github_jupyter
![data-x-logo.png](attachment:data-x-logo.png) --- # Pandas Introduction **Author list:** Ikhlaq Sidhu & Alexander Fred Ojala **References / Sources:** Includes examples from Wes McKinney and the 10 min intro to Pandas **License Agreement:** Feel free to do whatever you want with this code ___ ### Topics: 1. D...
github_jupyter
<b>General Tips</b> <i> <li>When the best course for visualizing certain data is unclear, start with a blank piece of paper.</li> <li>Sketch out potential views to see them side‐by‐side and determine what will work best for getting your message across to your audience.</li> <li>Create a version of the graph (let’s cal...
github_jupyter
``` #used an environment with directml # with the help of https://www.youtube.com/watch?v=gjVFH7NHB9s #ref to choose the env in jupyter notebook: https://towardsdatascience.com/get-your-conda-environment-to-show-in-jupyter-notebooks-the-easy-way-17010b76e874 import tensorflow as tf from tensorflow import keras import ...
github_jupyter
``` import json import bz2 import regex from tqdm import tqdm from scipy import sparse import pandas as pd import numpy as np import nltk import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline %pylab inline responses = [] with bz2.BZ2File('banki_responses.json.bz2', 'r') as thefile: for row in tq...
github_jupyter
# Dive into Deep Learning, Classifying images The goal of this blog post is to explain the process of training a deep learning model to classify images (pixels) of insects: beetles, cockroaches, and dragonflies. The neural network (model) will be evaluated on how it classfied the images using Shapley Additive Explanat...
github_jupyter
# 更多字符串和特殊方法 - 前面我们已经学了类,在Python中还有一些特殊的方法起着非常重要的作用,这里会介绍一些特殊的方法和运算符的重载,以及使用特殊方法设计类 ## str 类 - 一个str对象是不可变的,也就是说,一旦创建了这个字符串,那么它的内容在认为不改变的情况下是不会变的 - s1 = str() - s2 = str('welcome to Python') ## 创建两个对象,分别观察两者id - id为Python内存地址 ``` a = id(100) b = id(12) a is b ``` ## 处理字符串的函数 - len - max - min - 字符串一切是按照ASCII码值进行比较...
github_jupyter
``` _= """ ref https://www.reddit.com/r/algotrading/comments/e44pdd/list_of_stock_tickers_from_yahoo/ https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download AMEX https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=amex&render=download NYSE https://old...
github_jupyter
``` import numpy as np import pandas as pd import random def bootstrapdf(df): df = df.sample(frac=1, replace=True) return df def check_for_leaf(df,counter, min_samples, max_depth): unique_classes = np.unique(df) if len(unique_classes) == 1 or len(df)<=min_samples or counter==max_depth: labelcol ...
github_jupyter
_Lambda School Data Science — Tree Ensembles_ # Decision Trees — with ipywidgets! ### Notebook requirements - [ipywidgets](https://ipywidgets.readthedocs.io/en/stable/examples/Using%20Interact.html): works in Jupyter but [doesn't work on Google Colab](https://github.com/googlecolab/colabtools/issues/60#issuecomment-...
github_jupyter
### Video Games Dataset: EDA #### 1. Describe Dataset - **Who:** The data was acquired from Kaggle and supplied by the user Gregory Smith (https://www.kaggle.com/gregorut/videogamesales). The data was scraped from www.vgchartz.com. - **What:** The dataset contains a list of video games with sales greater than 100,000 ...
github_jupyter
# Nature of signals In the context of this class, a signal is the data acquired by the measurement system. It contains much information that we need to be able to identify to extract knowledge about the system being tested and how to optimize the measurements. A signal caries also messages and information. We will u...
github_jupyter
# Navigation --- You are welcome to use this coding environment to train your agent for the project. Follow the instructions below to get started! ### 1. Start the Environment Run the next code cell to install a few packages. This line will take a few minutes to run! ``` !pip -q install ./python ``` The environ...
github_jupyter
``` !pip install mysql-connector-python import mysql.connector as connection try: mydb = connection.connect(host="localhost",user="root", passwd="mysql",use_pure=True) # check if the connection is established query = "SHOW DATABASES" cursor = mydb.cursor() #create a cursor to execute queries curs...
github_jupyter
# Sentiment Analysis ## Using XGBoost in SageMaker _Deep Learning Nanodegree Program | Deployment_ --- As our first example of using Amazon's SageMaker service we will construct a random tree model to predict the sentiment of a movie review. You may have seen a version of this example in a pervious lesson although ...
github_jupyter
# Objects *Python* is an object oriented language. As such it allows the definition of classes. For instance lists are also classes, that's why there are methods associated with them (i.e. `append()`). Here we will see how to create classes and assign them attributes and methods. ## Definition and initialization A ...
github_jupyter
# IntegratedML applied to biomedical data, using PyODBC This notebook demonstrates the following: - Connecting to InterSystems IRIS via PyODBC connection - Creating, Training and Executing (PREDICT() function) an IntegratedML machine learning model, applied to breast cancer tumor diagnoses - INSERTING machine learning ...
github_jupyter
# Advanced Data Wrangling with Pandas ``` import pandas as pd import numpy as np ``` ## Formas não usuais de se ler um dataset Você não precisa que o arquivo com os seus dados esteja no seu disco local, o pandas está preparado para adquirir arquivos via http, s3, gs... ``` diamonds = pd.read_csv("https://raw.github...
github_jupyter
01: Building a pandas Cheat Sheet, Part 1 Use the csv I've attached to answer the following questions Import pandas with the right name ``` # !workon dataanalysis import pandas as pd ``` Having matplotlib play nice with virtual environments The matplotlib library has some issues when you’re using a Python 3 virtua...
github_jupyter
<img src="images/kiksmeisedwengougent.png" alt="Banner" width="1100"/> <div style='color: #690027;' markdown="1"> <h1>FUNCTIES EN STRUCTUREN</h1> </div> <div class="alert alert-block alert-success"> Python kent heel wat ingebouwde functies, zoals <span style="background-color:whitesmoke; font-family:consolas; fo...
github_jupyter
``` # Code to load the data etc. import pandas as pd # Read the data credit_card_file_path = 'data/AER_credit_card_data.csv' # Set file path of the data. data = pd.read_csv(credit_card_file_path, true_values = ['yes'], false_values = ['no']) # Read the data and store in a data frame. # Select target y = data.card ...
github_jupyter
# Modelo para la Ciudad de Medellín ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt ##Sección de código para ejecutar el ejercicio en COLAB sin realizar ningún cambio adicional. #from google.colab import drive #drive.mount('/content/drive') #baseUrl = '/content/drive/Shared drives/Analitica ...
github_jupyter
<a href="https://colab.research.google.com/github/edgarbc/my_autosleep_analysis/blob/main/my_autosleep_analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import pandas as pd import matplotlib.pyplot as plt # get data from my google drive f...
github_jupyter
# Saving and Loading Tutorial ## Preparing a virtual environment First, you need to have `Python3` and `openmpi` installed and running on your machine. In a new directory, here are the steps I took to create a virtual environment for this Jupyter notebook: echo "" echo "Preparing a virtual environment for NetPyN...
github_jupyter
``` import numpy import random import math import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline address = "" data = pd.read_csv(address); #To read csv file df = pd.DataFrame(data) df #z-score normalization df['signal_strength']=((df['signal_strength']-df['signa...
github_jupyter
``` # Libraries needed for NLP import nltk nltk.download('punkt') from nltk.stem.lancaster import LancasterStemmer stemmer = LancasterStemmer() # Libraries needed for Tensorflow processing import tensorflow as tf import numpy as np import tflearn import random import json from google.colab import files files.upload() ...
github_jupyter
## Predicting Missing links in a citation network ``` # global imports import random import numpy as np import pandas as pd import jgraph ## this was previously known as igraph import csv import matplotlib.pyplot as plt # machine learning imports from sklearn import svm from sklearn.feature_extraction.text impor...
github_jupyter
## Dependencies ``` import json, warnings, shutil, glob from jigsaw_utility_scripts import * from scripts_step_lr_schedulers import * from transformers import TFXLMRobertaModel, XLMRobertaConfig from tensorflow.keras.models import Model from tensorflow.keras import optimizers, metrics, losses, layers SEED = 0 seed_ev...
github_jupyter
``` import pandas as pd import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt import pandas.util.testing as tm from sklearn.preprocessing import LabelEncoder from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import cross_val_score from sklearn.model_selection import ...
github_jupyter
# 07.00 - Modeling - Prophet Model & Select Cross Validation Rolling Window Size + We have data for each summer from 1994 to 2018 + We initially decided that the minimum size of the hold out test data is 5 years from 2014 to 2018 + We want to select a rolling window that extracts as much value as possible fom the d...
github_jupyter
**Aim: Implement Decsion Tree classifier** - Implement Decision Tree classifier using scikit learn library - Test the classifier for Weather dataset Step 1: Import necessary libraries. ``` from sklearn import preprocessing from sklearn.tree import DecisionTreeClassifier ``` Step 2: Prepare dataset. ``` #P...
github_jupyter
https://fenderist.tistory.com/168 타자 AVG(Batting Average) : 타율 G (Game) : 참여경기수(경기) PA(Plate Appearances) : 타석수( 타자가 타석에 선 횟수 ), 한게임 평균 3~4타석 슴 AB(At Bat) : 타수 ( 타격을 완료한 횟수, 볼넷, 희생번트, 타격 방해등은 포함 X) R(Runs) : 득점 ( 홈플레이트를 밟아 팀에 점수가 올랐을때 기록됨 ) H(Hits) : 안타 2B(double) : 2루타 3B(Triple) : 3루타 HR(Home Run) : 홈런 TB(Total Bas...
github_jupyter
# Linear Algebra Review ![image.png](attachment:image.png) - **Scalar:** Any single numerical value. - **Vector:** An array of numbers(data) is a vector. - **Matrix:** A matrix is a 2-D array of shape (m×n) with m rows and n columns. - **Tensor:** Generally, an n-dimensional array where n>2 is called a Tensor. But ...
github_jupyter
## 1. 데이터 불러오기 ``` import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import random data1 = pd.read_csv('C:/Users/Soyoung Cho/Desktop/NMT Project/dataset/train.csv') data2 = pd.read_csv('C:/Users/Soyoung Cho/Desktop/NMT Project/dataset/test.csv') data3 = pd.read_csv('C:/Users/Soyoung Cho/Desktop...
github_jupyter
> **Tip**: Welcome to the Investigate a Dataset project! You will find tips in quoted sections like this to help organize your approach to your investigation. Before submitting your project, it will be a good idea to go back through your report and remove these sections to make the presentation of your work as tidy as ...
github_jupyter
``` import data_loader as dl import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd np.random.seed(0) train_df, valid_df = dl.load_train_data("adult.data") test_df = dl.load_test_data("adult.test") column_names = ['age', 'workclass', 'fnlwgt', 'education', 'education.num', 'martia...
github_jupyter
``` #import all the dependencies import os import csv import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #read the csv files to view the data google_apps = pd.read_csv("googleplaystore.csv") google_apps.shape ``` # Data Cleaning ``` #Check for number of apps in total no_apps = google_apps["App"...
github_jupyter
<center><h2>Assignment</h2></center> <h3>2.1. Problem Statement: PYTHON 1</h3> <b>1. Install Jupyter notebook and run the first program and share the screenshot of the output.</b> ``` str = "Hello Python. This is my First Program"; print(str); ``` <b>2. Write a program which will find all such numbers which are div...
github_jupyter
###### ECE 283: Homework 2 ###### Topics: Classification using neural networks ###### Due: Monday April 30 - Neural networks; Tensorflow - 2D synthetic gaussian mixture data for binary classification ### Report ---------------------------------------- ##### 1. Tensorflow based neural network - 2D Gaussian mixture ...
github_jupyter
``` import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KDTree from sklearn.decomposition import PCA #### Visulization imports import pandas_profiling import plotly.express as px import seaborn as sns import p...
github_jupyter
<a href="https://colab.research.google.com/github/Shaheer-Khan/AISem3/blob/master/HW/Home_Credit_default_risk_HW.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install xgboost #data.set_index("SK_ID_CURR", # drop=True, # ...
github_jupyter
# Measuring PROV Provenance on the Web of Data * Authors: * [Paul Groth](http://pgroth.com), [Elsevier Labs](http://labs.elsevier.com) * [Wouter Beek](http://www.wouterbeek.com), Vrije Universiteit Amsterdam * Date: May 11, 2016 One of the motivations behind the original charter for the [W3C Provenance Incub...
github_jupyter
``` try: # %tensorflow_version only exists in Colab. %tensorflow_version 2.x except Exception: !pip install -q tensorflow-gpu>=2.0.0 !pip install --quiet neural-structured-learning from __future__ import absolute_import, division, print_function, unicode_literals import neural_structured_learning as nsl import ...
github_jupyter