code
stringlengths
2.5k
150k
kind
stringclasses
1 value
### Research Question 1 <p><b>What is the exact demographic most at risk for covid19 in Toronto?</b></p> To find this we'll need to produce graphs of Age, Gender, and if they were hospitalized. ``` import pandas as pd import numpy as np import pandas_profiling import sys, os import seaborn as sns from matplotlib impo...
github_jupyter
``` # подгружаем все нужные пакеты import pandas as pd import numpy as np # игнорируем warnings import warnings warnings.filterwarnings("ignore") import seaborn as sns import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker %matplotlib inline # настройка внешнего вида графиков в seaborn sns.set_c...
github_jupyter
# K-means clustering When working with large datasets it can be helpful to group similar observations together. This process, known as clustering, is one of the most widely used in Machine Learning and is often used when our dataset comes without pre-existing labels. In this notebook we're going to implement the cla...
github_jupyter
# Transfer Learning In this notebook, you'll learn how to use pre-trained networks to solved challenging problems in computer vision. Specifically, you'll use networks trained on [ImageNet](http://www.image-net.org/) [available from torchvision](http://pytorch.org/docs/0.3.0/torchvision/models.html). ImageNet is a m...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W0D5_Statistics/student/W0D5_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 2: Statistical Inference **Week 0, Day 5: Stat...
github_jupyter
# Web Scraping: Selenium A menudo, los datos están disponibles públicamente para nosotros, pero no en una forma que sea fácilmente utilizable. Ahí es donde entra en juego el web scraping, podemos usar web scraping para obtener nuestros datos deseados en un formato conveniente que luego se puede usar. a continuación, m...
github_jupyter
<img src="NotebookAddons/blackboard-banner.png" width="100%" /> <font face="Calibri"> <br> <font size="7"> <b> GEOS 657: Microwave Remote Sensing<b> </font> <font size="5"> <b>Lab 9: InSAR Time Series Analysis using GIAnT within Jupyter Notebooks</b> </font> <br> <font size="4"> <b> Franz J Meyer & Joshua J C Knicely...
github_jupyter
# Linear regression ## Problem Build a model and predict pricing of the apartment rent in Graz based on data in the ad ## Goals - Manually write linear regression algorithm - Gradient descent function - Cost function implementation - Normal equation function - Feature enumeration and normalization fu...
github_jupyter
# List Comprehensions Complete the following set of exercises to solidify your knowledge of list comprehensions. ``` import os; ``` #### 1. Use a list comprehension to create and print a list of consecutive integers starting with 1 and ending with 50. ``` lst = [i for i in range(1,51)] print(lst) ``` #### 2. Use a...
github_jupyter
# [SOLUTION] Attention Basics In this notebook, we look at how attention is implemented. We will focus on implementing attention in isolation from a larger model. That's because when implementing attention in a real-world model, a lot of the focus goes into piping the data and juggling the various vectors rather than t...
github_jupyter
<a href="https://colab.research.google.com/github/Sudhir22/bert/blob/master/Pre_trained_BERT_contextualized_word_embeddings.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !rm -rf bert !git clone https://github.com/google-research/bert %tensorfl...
github_jupyter
# RDF graph processing against the integrated POIs #### Auxiliary function to format SPARQL query results as a data frame: ``` import pandas as pds def sparql_results_frame(qres): cols = qres.vars out = [] for row in qres: item = [] for c in cols: item.append(row[c]) ...
github_jupyter
# Keras Intro: Shallow Models Keras Documentation: https://keras.io In this notebook we explore how to use Keras to implement 2 traditional Machine Learning models: - **Linear Regression** to predict continuous data - **Logistic Regression** to predict categorical data ## Linear Regression ``` %matplotlib inline i...
github_jupyter
# 分类和逻辑回归 Classification and Logistic Regression 引入科学计算和绘图相关包: ``` import numpy as np from sklearn import linear_model, datasets import matplotlib.pyplot as plt import seaborn as sns sns.set_style('whitegrid') %matplotlib inline ``` 分类和回归的唯一区别在于,分类问题中我们希望预测的目标变量 $y$ 只会取少数几个离散值。本节我们将主要关注**二元分类 binary classification...
github_jupyter
``` import pandas as pd import numpy as np import pickle import matplotlib.pyplot as plt from scipy import stats import tensorflow as tf import seaborn as sns from pylab import rcParams from sklearn import metrics from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler %ma...
github_jupyter
# VAST 2017 MC-1 ## Задание Природный заповедник Бунсонг Лекагуль используется местными жителями и туристами для однодневных поездок, ночевок в кемпингах, а иногда и просто для доступа к основным магистралям на противоположных сторонах заповедника. Входные кабинки заповедника контролируются с целью получения дохода, ...
github_jupyter
# HOMEWORK NOTES - __Do the assignment or don't.__ - If you run into issues, ask questions. - If you run into issues at the last minue, explain what the issue is in your homework. - __Read the instructions.__ - For example, In this assignment the rules were to load *more than 10 variables, stored ac...
github_jupyter
``` import pandas as pd import json import seaborn as sns import matplotlib.pyplot as plt pd.set_option('display.max_columns', 50) ``` So in the last time we're able to "softly" label ~54% of the dataset based on 2 features which are `male_items` and `female_items`. However, other features might also contribute to th...
github_jupyter
``` from __future__ import absolute_import, division, print_function import numpy, os, pandas import tensorflow from tensorflow import keras print(tensorflow.__version__) AmesHousing = pandas.read_excel('../data/AmesHousing.xls') AmesHousing.head(10) cd .. from libpy import NS_dp from sklearn.model_selection import tra...
github_jupyter
# Elevation indices Here we assume that flow directions are known. We read the flow direction raster data, including meta-data, using [rasterio](https://rasterio.readthedocs.io/en/latest/) and parse it to a pyflwdir `FlwDirRaster` object, see earlier examples for more background. ``` # import pyflwdir, some dependenc...
github_jupyter
# Pure Python evaluation of vector norms Generate a list of random floats of a given dimension (dim), and store its result in the variable `vec`. ``` # This is used for plots and numpy %pylab inline #import random dim = int(1000) # YOUR CODE HERE #vec = [] #[vec.append(random.random() for i in range(dim))] #print(...
github_jupyter
# Numpy ``` import numpy as np ``` ## Create numpy arrays ``` np.array([1, 2]).shape np.array([ [1, 2], [3, 4] ]).shape np.array([ [1, 2], [3, 4], [5, 6] ]).shape np.zeros((2, 2)) np.ones((2, 2)) np.full((2, 2), 5) np.eye(3) ``` ## Generate data ``` np.random.random() np.random.randint(0, 10) lower_bound_value = 0...
github_jupyter
# Visualize Urban Heat Islands (UHI) in Toulouse - France #### <br> Data from meteo stations can be downloaded on the French open source portal https://www.data.gouv.fr/ ``` %matplotlib inline import matplotlib.pyplot as plt import pandas as pd import string from glob import glob from matplotlib.dates import DateForm...
github_jupyter
Note: range sliders and range selectors are available in version 1.9.7+ Run pip install plotly --upgrade to update your Plotly version ``` import plotly plotly.__version__ ``` ## Basic Range Slider and Range Selectors ``` from cswd import query_adjusted_pricing OHLCV = ['open','high','low','close','volume'] df = q...
github_jupyter
``` import rainbowhat as rh from enum import Enum import subprocess import re import time import itertools class RGBColors(Enum): RED = (50, 0, 0) YELLOW = (50, 50, 0) PINK = (50, 10, 12) GREEN = (0, 50, 0) PURPLE = (50, 0, 50) ORANGE = (50, 22, 0) BLUE = (0, 0, 50) def run_rainbow(it): for pix...
github_jupyter
## Agenda 1. Make sure everyone has the necesary programs: - Pyhton - Jupyter - Github 2. Intro tp Git 3. Clone Titanic book 4. Start cleaning data ## 5 basic steps to Machine Learning: #### 1. Data gathering/cleaning/feature development 2. Model Selection 3. Fittin...
github_jupyter
# Kernel density estimation ``` # Import all libraries needed for the exploration # General syntax to import specific functions in a library: ##from (library) import (specific library function) from pandas import DataFrame, read_csv # General syntax to import a library but no functions: ##import (library) as (give...
github_jupyter
``` import gevent import random import pandas as pd import numpy as np import math import time import functools as ft import glob, os, sys import operator as op import shelve import ipywidgets as widgets from ipywidgets import interact, interact_manual #from pandas.api.types import is_numeric_dtypen() from pathlib ...
github_jupyter
``` %pylab notebook import numpy as np import numpy.linalg as la np.set_printoptions(suppress=True) ``` Let's imagine a micro-internet, with just 6 websites (**A**vocado, **B**ullseye, **C**atBabel, **D**romeda, **e**Tings, and **F**aceSpace). Each website links to some of the others, and this forms a network like...
github_jupyter
``` import numpy as np import scipy as sp import pandas as pd import urllib.request import os import shutil import tarfile import matplotlib.pyplot as plt from sklearn import datasets, cross_validation, metrics from sklearn.preprocessing import KernelCenterer %matplotlib notebook ``` First we need to download the Cal...
github_jupyter
## KNN imputation The missing values are estimated as the average value from the closest K neighbours. [KNNImputer from sklearn](https://scikit-learn.org/stable/modules/generated/sklearn.impute.KNNImputer.html#sklearn.impute.KNNImputer) - Same K will be used to impute all variables - Can't really optimise K to bette...
github_jupyter
``` import os import matplotlib.pyplot as plt import numpy as np import pandas as pd from random import randint from numpy import array from numpy import argmax from numpy import array_equal import tensorflow as tf from tensorflow.keras.utils import to_categorical from keras.models import Model from keras.layers import...
github_jupyter
# R Bootcamp Part 5 ## stargazer, xtable, robust standard errors, and fixed effects regressions This bootcamp will help us get more comfortableusing **stargazer** and **xtable** to produce high-quality results and summary statistics tables, and using `felm()` from the **lfe** package for regressions (both fixed effe...
github_jupyter
``` %%javascript MathJax.Hub.Config({ TeX: { equationNumbers: { autoNumber: "AMS" } } }); from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); $('div.prompt').hide(); } else { $('div.input').show(); $('div.prompt').show();...
github_jupyter
# EXTRACCION, LIMPIEZA Y CARGA DATA REFERENTE A DELITOS VERSION 0.2 FECHA: 16/10/2020 ANALIZAR DELITOS VIGENTES Y NO VIGENTES ``` import os import pandas as pd import numpy as np from pyarrow import feather from tqdm import tqdm from unicodedata import normalize from src.data import clean_data tqdm.pandas() codigos...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/eirasf/GCED-AA2/blob/main/lab4/lab4_parte1.ipynb) # Práctica 4: Redes neuronales usando Keras con Regularización ## Parte 1. Early Stopping ### Overfitting El problema del sobreajuste (*overfitting*) co...
github_jupyter
# DSCI 525: Web and Cloud Computing ## Milestone 1: Tackling Big Data on Computer ### Group 13 Authors: Ivy Zhang, Mike Lynch, Selma Duric, William Xu ## Table of contents - [Download the data](#1) - [Combining data CSVs](#2) - [Load the combined CSV to memory and perform a simple EDA](#3) - [Perform a simple EDA i...
github_jupyter
# Computer Vision Nanodegree ## Project: Image Captioning --- In this notebook, you will use your trained model to generate captions for images in the test dataset. This notebook **will be graded**. Feel free to use the links below to navigate the notebook: - [Step 1](#step1): Get Data Loader for Test Dataset -...
github_jupyter
# FIFA Transfer Market Analysis of European Football Leagues ## Data 512 Project ## Tharun Sikhinam ## I. Introduction Transfer windows are as busy a time as any other in the football world. The game attracts so much attention that even when the ball is not rolling, the eyes of the entire world are on football. Trans...
github_jupyter
## The 1cycle policy ``` from fastai.gen_doc.nbdoc import * from fastai.vision import * from fastai.callbacks import * ``` ## What is 1cycle? This Callback allows us to easily train a network using Leslie Smith's 1cycle policy. To learn more about the 1cycle technique for training neural networks check out [Leslie S...
github_jupyter
# BIG DATA ANALYTICS PROGRAMMING : PySpark ### PySpark 맛보기 --- ``` import sys !{sys.executable} -m pip install pyspark # PYSPARK를 활용하기 위한 관련 설정 import os import sys os.environ["PYSPARK_PYTHON"]=sys.executable os.environ["PYSPARK_DRIVER_PYTHON"]=sys.executable ``` ## RDD 활용하기 - Resilient Disributed Data ``` # pyspar...
github_jupyter
# A Simple Autoencoder We'll start off by building a simple autoencoder to compress the MNIST dataset. With autoencoders, we pass input data through an encoder that makes a compressed representation of the input. Then, this representation is passed through a decoder to reconstruct the input data. Generally the encoder...
github_jupyter
``` # Observations Insights # As the timepoint passes the mice had seen their tumor size go down when using cap. # Study seems fair - there are equal parts male to female sitting at 49 - 50 % # there may be a correlation to weight and tumor size - possibly obesity playing a role? ``` ## Dependencies and starter cod...
github_jupyter
``` from keras.layers import Input, Dense, Activation from keras.layers import Maximum, Concatenate from keras.models import Model from keras.optimizers import adam_v2 from sklearn.tree import DecisionTreeClassifier from sklearn.linear_model import SGDClassifier from sklearn.ensemble import GradientBoostingClassifier f...
github_jupyter
<font color="red">训练直接将样本的分词+词性 改为 分词+命名实体类型即可</font> ## 目录 - [8. 命名实体识别](#8-命名实体识别) - [8.1 概述](#81-概述) - [8.2 基于隐马尔可夫模型序列标注的命名实体识别](#82-基于隐马尔可夫模型序列标注的命名实体识别) - [8.3 基于感知机序列标注的命名实体识别](#83-基于感知机序列标注的命名实体识别) - [8.4 基于条件随机场序列标注的命名实体识别](#84-基于条件随机场序列标注的命名实体识别) - [8.5 命名实体识别标准化评测](#85-命名实体识别标准化评测) - [8.6 自定义领域命名实体识别](#86-自...
github_jupyter
# Setting up vPython in Jupyterlab ## Version Compatibility At this time (10/20) vPython appears to be compatible with verisons of Jupyterlab through 1.2.6. You may need to remove your current install of Jupyterlab to do this. To install specific versions of Jupyterlab (and remove the application) go to the settings ...
github_jupyter
<img src="https://upload.wikimedia.org/wikipedia/commons/4/47/Logo_UTFSM.png" width="200" alt="utfsm-logo" align="left"/> # MAT281 ### Aplicaciones de la Matemática en la Ingeniería ## Módulo 04 ## Laboratorio Clase 04: Métricas y selección de modelos ### Instrucciones * Completa tus datos personales (nombre y rol...
github_jupyter
# Naive Bayes ## Bayes Theorem $P(A|B) = \frac{P(B|A) P(A)}{P(B)} $ In our case, given features $X = (x_1, ..., x_n)$, the class probability $P(y|X)$: $P(y|X) = \frac{P(X|y) P(y)}{P(X)}$ We're making an assumption all features are **mutually independent**. $P(y|X) = \frac{P(x_1|y) \cdot P(x_2|y) \cdot P(x_3|y) \cdo...
github_jupyter
<font size="+5">#03. Data Manipulation & Visualization to Enhance the Discipline</font> - Book + Private Lessons [Here ↗](https://sotastica.com/reservar) - Subscribe to my [Blog ↗](https://blog.pythonassembly.com/) - Let's keep in touch on [LinkedIn ↗](www.linkedin.com/in/jsulopz) 😄 # Load the Data > - By executing...
github_jupyter
``` import requests from IPython.display import Markdown from tqdm import tqdm, tqdm_notebook import pandas as pd from matplotlib import pyplot as plt import numpy as np import altair as alt from requests.utils import quote import os from datetime import timedelta from mod import alt_theme fmt = "{:%Y-%m-%d}" # Can op...
github_jupyter
<a href="https://colab.research.google.com/github/sproboticworks/ml-course/blob/master/Cats%20and%20Dogs%20Classification%20with%20Augmentation%20and%20Dropout.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Import Packages ``` import tensorflow ...
github_jupyter
# StyleGAN2 *Please note that this is an optional notebook that is meant to introduce more advanced concepts, if you're up for a challenge. So, don't worry if you don't completely follow every step! We provide external resources for extra base knowledge required to grasp some components of the advanced material.* In t...
github_jupyter
# Visual Analysis This notebook has been created to support two main purposes: * Based on an input image and a set of models, display the action-space probability distribution. * Based on an input image and a set of models, visualize which parts of the image the model looks at. ## Usage The workbook requires the fol...
github_jupyter
``` import numpy as np import pandas as pd from copy import deepcopy from matplotlib import pyplot as plt import calculations import agent import environment def train(env, agent, num_iterations, algo, learning_rate, lam): weights = [] new_weight = np.zeros(agent.num_features) z = np.zeros(agent.num_feature...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Deep Learning ## Project: Build a Traffic Sign Recognition Classifier In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included i...
github_jupyter
``` from azure.common import AzureMissingResourceHttpError from azure.storage.blob import BlockBlobService, PublicAccess from azure.storage.file import FileService from azure.storage.table import TableService, Entity #Blob Service... def get_block_blob_service(account_name, storage_key): return BlockBlobService(acc...
github_jupyter
# Project 1: Navigation ### Test 3 - DDQN model with Prioritized Experience Replay <sub>Uirá Caiado. August 23, 2018<sub> #### Abstract _In this notebook, I will use the Unity ML-Agents environment to train a DDQN model with PER for the first project of the [Deep Reinforcement Learning Nanodegree](https://www.udaci...
github_jupyter
# Convolutional Autoencoder Sticking with the MNIST dataset, let's improve our autoencoder's performance using convolutional layers. Again, loading modules and the data. ``` %matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt #from tqdm import tqdm from tensorflow.examples.t...
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
# Inverted Pendulum: Reinforcement learning Meichen Lu (meichenlu91@gmail.com) 26th April 2018 Source: CS229: PS4Q6 Starting code: http://cs229.stanford.edu/ps/ps4/q6/ Reference: https://github.com/zyxue/stanford-cs229/blob/master/Problem-set-4/6-reinforcement-learning-the-inverted-pendulum/control.py ``` from cart_...
github_jupyter
![image](resources/qgss-header.png) # Lab 5: Quantum error correction You can do actual insightful science with IBMQ devices and the knowledge you have about quantum error correction. All you need are a few tools from Qiskit. ``` !pip install -U -r grading_tools/requirements.txt from qiskit import * from IPython.dis...
github_jupyter
# Lab Three --- For this lab we're going to be making and using a bunch of functions. Our Goals are: - Searching our Documentation - Using built in functions - Making our own functions - Combining functions - Structuring solutions ``` # For the following built in functions we didn't touch on them in class. I want y...
github_jupyter
# Variable Relationship Tests (correlation) - Pearson’s Correlation Coefficient - Spearman’s Rank Correlation - Kendall’s Rank Correlation - Chi-Squared Test ## Correlation Test Correlation Measures whether greater values of one variable correspond to greater values in the other. Scaled to always lie between +1 and −1...
github_jupyter
## VotingClassifier - [ BaggingClassifier, RandomForestClassifier, XGBClassifier ] ``` import pandas as pd from xgboost import XGBClassifier, XGBRegressor from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from sklearn.metrics import f1_score from sklearn.ensemble impor...
github_jupyter
# Views - Views are nothing but widget only but having capability to hold widgets. ``` from webdriver_kaifuku import BrowserManager from widgetastic.widget import Browser command_executor = "http://localhost:4444/wd/hub" config = { "webdriver": "Remote", "webdriver_options": {"desired_capabilities":...
github_jupyter
``` import tensorflow as tf import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from sklearn.feature_extraction.text import CountVectorizer from nltk.stem import PorterStemmer from autocorrect import spell import os from six.moves...
github_jupyter
# Programming Assignment: Линейная регрессия: прогноз оклада по описанию вакансии ## Введение Линейные методы хорошо подходят для работы с разреженными данными — к таковым относятся, например, тексты. Это можно объяснить высокой скоростью обучения и небольшим количеством параметров, благодаря чему удается избежать пер...
github_jupyter
# 你的第一个神经网络 在此项目中,你将构建你的第一个神经网络,并用该网络预测每日自行车租客人数。我们提供了一些代码,但是需要你来实现神经网络(大部分内容)。提交此项目后,欢迎进一步探索该数据和模型。 ``` %matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt ``` ## 加载和准备数据 构建神经网络的关键一步是正确地准备数据。不同尺度级别的变量使网络难以高效地掌握正确的权重。我们在下方已经提供了加载和...
github_jupyter
<a href="https://colab.research.google.com/github/Amro-source/Deep-Learning/blob/main/Copy_of_keras_wide_deep.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> To run this model directly in the browser with zero setup, open it in [Colab here](https://...
github_jupyter
``` import requests # 585247235 # 245719505、 # 观视频工作室 房价 543149108 # https://api.bilibili.com/x/v2/reply/reply?callback=jQuery17206010832908607249_1608646550339&jsonp=jsonp&pn=1&type=1&oid=585247235& header = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0", "Cookie": ""} c...
github_jupyter
``` #入力 a,b=map(int, input().split()) c=list(map(int, input().split())) print(a,b,c) #初期化 a=[0]*5 b=a b2=a[:] a[1]=3 print('b:{}, b2:{}'.format(b,b2)) import copy a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*5]*5 b=copy.deepcopy(a) a[1][0]=5 print(b) #内包表記奇数のみ odd=[i for i in range(20) if i%2==1] print(a) #ソート w=[[1...
github_jupyter
<a href="https://colab.research.google.com/github/domsjcsn/Linear-ALgebra---Python/blob/main/LinALgPython_JOCSON.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 skil...
github_jupyter
<a href="https://colab.research.google.com/github/ppiont/tensor-flow-state/blob/master/onestop_data_clean.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("/gdrive", force_remount = True) %cd "/gdrive/My...
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
# Testinnsening av upersonlig skattemelding med næringspesifikasjon Denne demoen er ment for å vise hvordan flyten for et sluttbrukersystem kan hente et utkast, gjøre endringer, validere/kontrollere det mot Skatteetatens apier, for å sende det inn via Altinn3. ``` try: from altinn3 import * from skatteetaten_...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter
## Face detection using OpenCV One older (from around 2001), but still popular scheme for face detection is a Haar cascade classifier; these classifiers in the OpenCV library and use feature-based classification cascades that learn to isolate and detect faces in an image. You can read [the original paper proposing thi...
github_jupyter
# How do ratings behave after users have seen many captions? This notebook looks at the "vote decay" of users. The New Yorker caption contest organizer, Bob Mankoff, has received many emails like the one below (name/personal details left out for anonymity) > Here's my issue. > > First time I encounter something, I m...
github_jupyter
## MNIST Handwritten Digits Classification Experiment This demo shows how you can use SageMaker Experiment Management Python SDK to organize, track, compare, and evaluate your machine learning (ML) model training experiments. You can track artifacts for experiments, including data sets, algorithms, hyper-parameters, ...
github_jupyter
# Codage des nombres réels Il repose sur l'**écriture scientifique** des nombres réels: $${\Large \pm\ \text{Mantisse}\times\text{Base}^{\text{Exposant}} }$$ $$\text{où Mantisse}\in[1;\text{Base}[\\ \text{ et Exposant est un entier «signé»}$$ Exemples en base 10: - $-0,\!000000138$ s'écrit $-1,\!38\times 10^{-7}$, -...
github_jupyter
# 使用预训练的词向量完成文本分类任务 **作者**: [fiyen](https://github.com/fiyen)<br> **日期**: 2021.10<br> **摘要**: 本示例教程将会演示如何使用飞桨内置的Imdb数据集,并使用预训练词向量进行文本分类。 ## 一、环境设置 本教程基于Paddle 2.2.0-rc0 编写,如果你的环境不是本版本,请先参考官网[安装](https://www.paddlepaddle.org.cn/install/quick) Paddle 2.2.0-rc0。 ``` import paddle from paddle.io import Dataset import ...
github_jupyter
``` #本章需导入的模块 import numpy as np import pandas as pd import matplotlib.pyplot as plt from pylab import * import matplotlib.cm as cm import warnings warnings.filterwarnings(action = 'ignore') %matplotlib inline plt.rcParams['font.sans-serif']=['SimHei'] #解决中文显示乱码问题 plt.rcParams['axes.unicode_minus']=False from sklearn ...
github_jupyter
Basic math operations as well as a few warmup problems for testing out your functional programming chops in python. (Please ignore the @jit decorator for now. It will come back in later assignments.) ``` try: from .util import jit except: from util import jit import math @jit def mul(x, y): ":math:`f(x, y)...
github_jupyter
################################################################################ #Licensed Materials - Property of IBM #(C) Copyright IBM Corp. 2019 #US Government Users Restricted Rights - Use, duplication disclosure restricted #by GSA ADP Schedule Contract with IBM Corp. ##############################################...
github_jupyter
## Requirements Before using this tutorial, ensure that the following are on your system: - <b>SteganoGAN is installed</b>. Install via pip or source code. - <b>Training and Validation Dataset are available </b>. Download via data/download.sh or retrieve your own. It is also suggested that you have the following: ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline df = pd.read_csv(r'C:\Users\prasa\Desktop\advertising.csv') df.head() df.columns df.info() df.describe() sns.set_style('darkgrid') df['Age'].hist(bins=35) plt.xlabel('Age') pd.crosstab(df['Country'], df['...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Project: **Finding Lane Lines on the Road** *** In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j...
github_jupyter
<a href="https://colab.research.google.com/github/LorenzoTinfena/BestSpiderWeb/blob/master/BestSpiderWeb.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # BestSpiderWeb # Problem A city without roads has a wheat producer, an egg producer and a hotel...
github_jupyter
# Day 2 - Conditionals ``` x = 5 if x > 2: print('Bigger than 2') for i in range(5): print(i) if i > 2: print('Bigger than 2') x is None ``` # Labs ## Lab 1 Excercise 1 Write a program to prompt the user for hours and rate per hour and compute gross pay (i.e. gross pay = hrs x rate). <input p...
github_jupyter
``` from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By Be dataFrame= pd.DataFrame(columns=['Name', 'Values']) for i in range(1,...
github_jupyter
# Pandas Data Series [40 exercises] ``` import pandas as pd import numpy as np #1 Write a Pandas program to create and display a one-dimensional array-like object containing an array of data using Pandas module data = pd.Series([9,8,7,6,5,4,3,2,1,]) print(data) # 2. Write a Pandas program to convert a Panda module Ser...
github_jupyter
# Customer Churn Prediction with XGBoost _**Using Gradient Boosted Trees to Predict Mobile Customer Departure**_ --- --- ## Runtime This notebook takes approximately 8 minutes to run. ## Contents 1. [Background](#Background) 1. [Setup](#Setup) 1. [Data](#Data) 1. [Train](#Train) 1. [Host](#Host) 1. [Evaluate](#...
github_jupyter
``` # Necessary imports import re import emoji from gtrans import translate_text, translate_html import random import pandas as pd import numpy as np from multiprocessing import Pool import time # Function to remove emojis in text, since these conflict during translation def remove_emoji(text): return emoji.get_em...
github_jupyter
``` import pandas import matplotlib.pyplot import numpy import seaborn import sys import os from os.path import join from scipy import stats from sklearn.svm import SVC from sklearn.metrics import accuracy_score, f1_score from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClass...
github_jupyter
# Character level language model - Dinosaurus land Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of dinosaurs and bringing them to life on earth, and your job is to gi...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') from ipywidgets import interactive,FloatSlider import matplotlib def sigmoid(x,x_0,L,y_0,k): return (x-x_0)+(L/2)+y_0 - L/(np.exp(-k*(x-x_0))+1) def speed_sigmoid_func(x,x_0a,x_0b,L,k,y_0): output = np.zer...
github_jupyter
# REWARD-MODULATED SELF ORGANISING RECURRENT NEURAL NETWORK https://www.frontiersin.org/articles/10.3389/fncom.2015.00036/full ### IMPORT REQUIRED LIBRARIES ``` from __future__ import division import numpy as np from scipy.stats import norm import random import tqdm import pandas as pd from collections import Ordere...
github_jupyter
``` # Mount the drive from google.colab import drive drive.mount('/content/drive') # Import the necessary libraries import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf from IPython.display import display from keras.preprocessing.text import Tokenizer ...
github_jupyter
# Hybrid quantum-classical Neural Networks with PyTorch and Qiskit Machine learning (ML) has established itself as a successful interdisciplinary field which seeks to mathematically extract generalizable information from data. Throwing in quantum computing gives rise to interesting areas of research which seek to leve...
github_jupyter
``` !pip install transformers from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig tokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn') model = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn') sequence = ("In May, Churchill was still generally unpopular...
github_jupyter