code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Minatar integration
## The minatar wrapper.
In **standardized *Reinforcement Learning* (RL) environments and benchmarks**, one usually has:
- a `reset` method with signature `None -> Tensor` (resets and give 1st observation)
- a `step` method with signature `int -> (Tensor, float, bool, dict)` (takes an action st... | github_jupyter |
Daten importieren aus Excel
------
```
import pandas as pd
data_input = pd.read_excel('../data/raw/U bung kNN Klassifizierung Ecoli.xlsx', sheet_name=0)
data_output = pd.read_excel('../data/raw/U bung kNN Klassifizierung Ecoli.xlsx', sheet_name=1)
data_output
```
Train und Test Datensätze erstellen, normalisieren un... | 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 |
## MIDI Generator
```
## Uncomment command below to kill current job:
#!neuro kill $(hostname)
import random
import sys
import subprocess
import torch
sys.path.append('../midi-generator')
%load_ext autoreload
%autoreload 2
import IPython.display as ipd
from model.dataset import MidiDataset
from utils.load_model imp... | github_jupyter |
# Sandbox - Tutorial
## Building a fiber bundle
A [fiber bundle](https://github.com/3d-pli/fastpli/wiki/FiberModel) consit out of multiple individual nerve fibers.
A fiber bundle is a list of fibers, where fibers are represented as `(n,4)-np.array`.
This makes desining individually fiber of any shape possible.
Howev... | github_jupyter |
# Effect of House Characteristics on Their Prices
## by Lubomir Straka
## Investigation Overview
In this investigation, I wanted to look at the key characteristics of houses that could be used to predict their prices. The main focus was on three aspects: above grade living area representing space characteristics, ov... | github_jupyter |
```
import pickle
with open('ldaseq1234.pickle', 'rb') as f:
ldaseq = pickle.load(f)
print(ldaseq.print_topic_times(topic=0))
topicdis = [[0.04461942257217848,
0.08583100499534332,
0.0327237321141309,
0.0378249089831513,
0.08521717043434086,
0.03543307086614173,
0.054356108712217424,
0.04057658115... | github_jupyter |
# Getting Started with Azure ML Notebooks and Microsoft Sentinel
---
# Contents
1. Introduction<br><br>
2. What is a Jupyter notebook?<br>
2.1 Using Azure ML notebooks<br>
2.2 Running code in notebooks<br><br>
3. Initializing the notebook and MSTICPy<br><br>
4. Notebook/MSTICPy configuration<br><br>
4.1 Co... | github_jupyter |
```
######## snakemake preamble start (automatically inserted, do not edit) ########
import sys; sys.path.extend(['/cluster/ggs_lab/mtparker/.conda/envs/snakemake6/lib/python3.10/site-packages', '/cluster/ggs_lab/mtparker/papers/fiona/fiona_nanopore/rules/notebook_templates']); import pickle; snakemake = pickle.loads(... | github_jupyter |
```
%load_ext notexbook
%texify
```
# PyTorch `nn` package
### `torch.nn`
Computational graphs and autograd are a very powerful paradigm for defining complex operators and automatically taking derivatives; however for large neural networks raw autograd can be a bit too low-level.
When building neural networks we fr... | github_jupyter |
## 13.2 유가증권시장 12개월 모멘텀
최근 투자 기간 기준으로 12개월 모멘텀 계산 날짜 구하기
```
from pykrx import stock
import FinanceDataReader as fdr
df = fdr.DataReader(symbol='KS11', start="2019-11")
start = df.loc["2019-11"]
end = df.loc["2020-09"]
df.loc["2020-11"].head()
start
start_date = start.index[0]
end_date = end.index[-1]
print(start_dat... | github_jupyter |
```
import numpy
import pandas as pd
import sqlite3
import os
from pandas.io import sql
from tables import *
import re
import pysam
import matplotlib
import matplotlib.image as mpimg
import seaborn
import matplotlib.pyplot
%matplotlib inline
def vectorizeSequence(seq):
# the order of the letters is not arbitrary.
... | github_jupyter |
The following latitude and longitude formats are supported by the `output_format` parameter:
* Decimal degrees (dd): 41.5
* Decimal degrees hemisphere (ddh): "41.5° N"
* Degrees minutes (dm): "41° 30′ N"
* Degrees minutes seconds (dms): "41° 30′ 0″ N"
You can split a column of geographic coordinates into one column f... | github_jupyter |
```
from oda_api.api import DispatcherAPI
from oda_api.plot_tools import OdaImage,OdaLightCurve
from oda_api.data_products import BinaryData
import os
from astropy.io import fits
import numpy as np
from numpy import sqrt
import matplotlib.pyplot as plt
%matplotlib inline
source_name='3C 279'
ra=194.046527
dec=-5.789314... | github_jupyter |
<h2> 25ppm - somehow more features detected than at 4ppm... I guess because more likely to pass over the #scans needed to define a feature </h2>
Enough retcor groups, loads of peak insertion problem (1000's). Does that mean data isn't centroided...?
```
import time
import pandas as pd
import seaborn as sns
import mat... | github_jupyter |
# 0.0. IMPORTS
```
import pandas as pd
import inflection
import math
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import datetime
from IPython.display import Image
```
## 0.1. Helper Functions
## 0.2. Loading Data
```
df_sales_raw = pd.read_csv('data/train.csv', low_memory=False)
df_... | github_jupyter |
<h1>REGIONE CAMPANIA</h1>
Confronto dei dati relativi ai decessi registrati dall'ISTAT e i decessi causa COVID-19 registrati dalla Protezione Civile Italiana con i decessi previsti dal modello predittivo SARIMA.
<h2>DECESSI MENSILI REGIONE CAMPANIA ISTAT</h2>
Il DataFrame contiene i dati relativi ai decessi mensili ... | github_jupyter |
```
import pickle
import numpy as np
import awkward
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import uproot
import boost_histogram as bh
import mplhep
mplhep.style.use("CMS")
CMS_PF_CLASS_NAMES = ["none" "charged hadron", "neutral hadron", "hfem", "hfhad", "photon", "electron", "muon"]
EL... | github_jupyter |
## 1. Inspecting transfusion.data file
<p><img src="https://assets.datacamp.com/production/project_646/img/blood_donation.png" style="float: right;" alt="A pictogram of a blood bag with blood donation written in it" width="200"></p>
<p>Blood transfusion saves lives - from replacing lost blood during major surgery or a ... | github_jupyter |
# Implementing and traversing a linked list
In this notebook we'll get some practice implementing a basic linked list—something like this:
<img style="float: left;" src="assets/linked_list_head_none.png">
**Note** - This notebook contains a few audio walkthroughs of the code cells. <font color="red">If you face di... | github_jupyter |
```
import open3d as o3d
import numpy as np
import os
import sys
# monkey patches visualization and provides helpers to load geometries
sys.path.append('..')
import open3d_tutorial as o3dtut
# change to True if you want to interact with the visualization windows
o3dtut.interactive = not "CI" in os.environ
```
# Point... | github_jupyter |
# Quantum Spins
We are going consider a magnetic insulator,
a Mott insulator. In this problem we have a valence electron per
atom, with very localized wave-functions. The Coulomb repulsion between
electrons on the same orbital is so strong, that electrons are bound to
their host atom, and cannot move. For this reason... | github_jupyter |
# A Table based Q-Learning Reinforcement Agent in A Grid World
This is a simple example of a Q-Learning agent. The Q function is a table, and each decision is made by sampling the Q-values for a particular state thermally.
```
import numpy as np
import random
import gym
%matplotlib inline
%config InlineBackend.figur... | github_jupyter |
# WeatherPy
----
#### Note
* Instructions have been included for each segment. You do not have to follow them exactly, but they are included to help you think through the steps.
```
!pip install citipy
# Dependencies and Setup
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import requests
impo... | github_jupyter |
# Binary classification with Support Vector Machines (SVM)
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as widgets
from sklearn.linear_model import LogisticRegression
from sklearn.svm import LinearSVC, SVC
from ipywidgets import interact, interactive, fixed
from numpy.ran... | github_jupyter |
```
import pandas as pd
from finta import TA
import numpy as np
#yahoo finance stock data (for longer timeframe)
import yfinance as yf
def stock_df(ticker, start, end):
stock = yf.Ticker(ticker)
stock_df = stock.history(start = start, end = end)
return stock_df
start = pd.to_datetime('2015-01-01')
end = p... | github_jupyter |
We saw in this [journal entry](http://wiki.noahbrenowitz.com/doku.php?id=journal:2018-10:day-2018-10-24#run_110) that multiple-step trained neural network gives a very imbalanced estimate, but the two-step trained neural network gives a good answer. Where do these two patterns disagree?
```
%matplotlib inline
import m... | github_jupyter |
# Ejercicio - Busqueda de Alojamiento en Airbnb.
Supongamos que somos un agente de [Airbnb](http://www.airbnb.com) localizado en Lisboa, y tenemos que atender peticiones de varios clientes. Tenemos un archivo llamado `airbnb.csv` (en la carpeta data) donde tenemos información de todos los alojamientos de Airbnb en Lis... | github_jupyter |
# ACS Download
## ACS TOOL STEP 1 -> SETUP :
#### Uses: csa2tractcrosswalk.csv, VitalSignsCensus_ACS_Tables.xlsx
#### Creates: ./AcsDataRaw/ ./AcsDataClean/
### Import Modules & Construct Path Handlers
```
import os
import sys
import pandas as pd
pd.set_option('display.expand_frame_repr', False)
pd.set_option('... | github_jupyter |
# Logarithmic Regularization: Dataset 1
```
# Import libraries and modules
import numpy as np
import pandas as pd
import xgboost as xgb
from xgboost import plot_tree
from sklearn.metrics import r2_score, classification_report, confusion_matrix, \
roc_curve, roc_auc_score, plot_c... | github_jupyter |
<img src="logos/Icos_cp_Logo_RGB.svg" align="right" width="400"> <br clear="all" />
# Visualization of average footprints
For questions and feedback contact ida.storm@nateko.lu.se
To use the tool, <span style="background-color: #FFFF00">run all the Notebook cells</span> (see image below).
<img src="network_charac... | github_jupyter |
<a href="https://colab.research.google.com/github/strangelycutlemon/DS-Unit-1-Sprint-1-Dealing-With-Data/blob/master/module4-makefeatures/LS_DS_114_Make_Features_Assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<img align="left" src="https... | github_jupyter |
Teste foursquare
```
import requests # library to handle requests
import pandas as pd # library for data analsysis
import numpy as np # library to handle data in a vectorized manner
import random # library for random number generation
!conda install -c conda-forge geopy --yes
from geopy.geocoders import Nominatim # ... | 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 |
# Overview
Networks (a.k.a. graphs) are widely used mathematical objects for representing and analysing social systems.
This week is about getting familiar with networks, and we'll focus on four main aspects:
* Basic mathematical description of networks
* The `NetworkX` library.
* Building the network of GME reddito... | github_jupyter |
<a href="https://colab.research.google.com/github/ibzan79/daa_2021_1/blob/master/28Octubre.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
h1 = 0
h2 = 0
m1 = 0
m2 = 0 # 1440 + 24 *6
contador = 0 # 5 + (1440 + ?) * 2 + 144 + 24 + 2= 3057
oper... | github_jupyter |
# Networks: structure, evolution & processes
**Internet Analytics - Lab 2**
---
**Group:** W
**Names:**
* Olivier Cloux
* Thibault Urien
* Saskia Reiss
---
#### Instructions
*This is a template for part 2 of the lab. Clearly write your answers, comments and interpretations in Markodown cells. Don't forget that y... | github_jupyter |
```
from bs4 import BeautifulSoup
from urllib.request import urlopen
URLPRI = "http://www.losmundialesdefutbol.com"
url = "http://www.losmundialesdefutbol.com/mundiales.php"
def returnWebObject(url):
return BeautifulSoup(urlopen(url) , "lxml")
class Player:
def __init__(self, name ,position, wasCaptain):
... | github_jupyter |
```
Copyright 2021 IBM Corporation
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 applicable law or agreed to in writing, softwa... | 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 tensorflow.examples.tutorials.mnist import i... | github_jupyter |
This tutorial trains a 3D densenet for lung lesion classification from CT image patches.
The goal is to demonstrate MONAI's class activation mapping functions for visualising the classification models.
For the demo data:
- Please see the `bbox_gen.py` script for generating the patch classification data from MSD task0... | github_jupyter |
```
FN = '161103-run-plot'
```
Plot validation accuracy vs. noise level for different experiments
the results of the experiments are accumlated in:
```
FN1 = '160919-run-plot'
```
each experiment is run by `run.bash` which runs the same experiment with different training size (`down_sample=.2,.5,1`) and in each tim... | github_jupyter |
[Shikaku](https://en.wikipedia.org/wiki/Shikaku) je jedna z japonských logických her, kterou publikoval časopis Nikoli. Jako obvykle se jedná o deskovou hru, kterou je možné hrát na čtvercové nebo obdélníkové desce.
Úkolem je rozdělit desku na obdélníky, které jí plně pokrývají a vzájemně se nepřekrývají. Každý obdéln... | github_jupyter |
```
import pandas as pd
import numpy as np
import scanpy as sc
import os
from sklearn.cluster import KMeans
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import adjusted_mutual_info_score
from sklearn.metrics.cluster import homog... | github_jupyter |
<img src="http://cfs22.simplicdn.net/ice9/new_logo.svgz "/>
# Assignment 01: Evaluate the Ad Budget Dataset of XYZ Firm
*The comments/sections provided are your cues to perform the assignment. You don't need to limit yourself to the number of rows/cells provided. You can add additional rows in each section to add mor... | github_jupyter |
# Analytic center computation using a infeasible start Newton method
# The set-up
```
import numpy as np
import pandas as pd
import accpm
import accpm
from IPython.display import display
%load_ext autoreload
%autoreload 1
%aimport accpm
```
$\DeclareMathOperator{\domain}{dom}
\newcommand{\transpose}{\text{T}}
\newco... | github_jupyter |
```
import fluentpy as _
```
These are solutions for the Advent of Code puzzles of 2018 in the hopes that this might inspire the reader how to use the fluentpy api to solve problems.
See https://adventofcode.com/2018/ for the problems.
The goal of this is not to produce minimal code or neccessarily to be as clear as... | 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 |
# Color Detect Application
----
<div class="alert alert-box alert-info">
Please use Jupyter labs http://<board_ip_address>/lab for this notebook.
</div>
This notebook shows how to download and play with the Color Detect Application
## Aims
* Instantiate the application
* Start the application
* Play with the r... | github_jupyter |
# MMN 11 - Computability and Complexity
## Question 1
We define a Turing Machine (TM) which decides the palindrome language PAL(:= $\{w \in \{0, 1\}^* | w = w^R\})$.
### Overview
The TM reads the leftmost symbol of the tape, loops forward to the end of the input, reads the rightmost symbol,
compares and rejects i... | github_jupyter |
# To use this notebook
- Open in Azure Data Studio
- Ensure the Kernel is set to "PowerShell"
# You can run Flyway in a variety of ways
Community edition is free
You may download and install locally - [https://flywaydb.org/download/](https://flywaydb.org/download/)
You may use the flyway docker container - [ht... | github_jupyter |
## Constants, Sequences, Variables, Ops
```
import tensorflow as tf
```
## Constants
[https://www.tensorflow.org/api_docs/python/tf/constant](https://www.tensorflow.org/api_docs/python/tf/constant)
Constants are values that will never change through out your calculations. These stand fixed
```
# note that we are re... | github_jupyter |
```
from keras.applications.vgg16 import VGG16
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator
from keras.applications.vgg16 import preprocess_input
import keras as k
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Flatten
from keras.lay... | github_jupyter |
```
import matplotlib.pyplot as plt # pip install matplotlib
import seaborn as sns # pip install seaborn
import plotly.graph_objects as go # pip install plotly
import imageio # pip install imageio
import grid2op
env = grid2op.make(test=True)
from grid2op.PlotGrid import PlotMatplot
plot_helper = PlotMatplot(env.obse... | github_jupyter |
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/>
# Matplotlib - Create Waterfall chart
<a href="https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/Matplotlib/Matplotlib_Create_Waterfall_chart.i... | github_jupyter |
<a href="https://colab.research.google.com/github/mbk-dev/okama/blob/master/examples/07%20forecasting.ipynb"><img align="left" src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" title="Open and Execute in Google Colaboratory"></a>
```
!pip install okama
import matplotlib.pyplot as plt
p... | github_jupyter |
# Models
```
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from functools import reduce
import sys
import numpy
import math
numpy.set_printoptions(threshold=sys.maxsize)
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
from sklearn.model_selec... | 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 |
# Factor Operations with pyBN
It is probably rare that a user wants to directly manipulate factors unless they are developing a new algorithm, but it's still important to see how factor operations are done in pyBN. Moreover, the ease-of-use and transparency of pyBN's factor operations mean it can be a great teaching/l... | github_jupyter |
# Clustering
See our notes on [unsupervised learning](https://jennselby.github.io/MachineLearningCourseNotes/#unsupervised-learning), [K-means](https://jennselby.github.io/MachineLearningCourseNotes/#k-means-clustering), [DBSCAN](https://jennselby.github.io/MachineLearningCourseNotes/#dbscan-clustering), and [clusteri... | github_jupyter |
<a href="https://colab.research.google.com/github/ChanceDurr/AB-Demo/blob/master/DS_Unit_1_Sprint_Challenge_3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Data Science Unit 1 Sprint Challenge 3
## Exploring Data, Testing Hypotheses
In this sp... | github_jupyter |
## Hyperparameter Tuning Design Pattern
In Hyperparameter Tuning, the training loop is itself inserted into an optimization method to find the optimal set of model hyperparameters.
```
import datetime
import os
import numpy as np
import pandas as pd
import tensorflow as tf
import time
from tensorflow import keras
fr... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Setup" data-toc-modified-id="Setup-1"><span class="toc-item-num">1 </span>Setup</a></span><ul class="toc-item"><li><span><a href="#Load-data" data-toc-modified-id="Load-data-1.1"><span class="toc... | github_jupyter |
```
import cartopy.crs
import cmocean.cm
import matplotlib.pyplot as plt
import numpy
import xarray
import pandas
import pathlib
import yaml
```
##### file paths and names
```
mesh_mask = xarray.open_dataset("https://salishsea.eos.ubc.ca/erddap/griddap/ubcSSn2DMeshMaskV17-02")
water_mask = mesh_mask.tmaskutil.isel(ti... | github_jupyter |
<p align="center">
<img src="https://github.com/GeostatsGuy/GeostatsPy/blob/master/TCG_color_logo.png?raw=true" width="220" height="240" />
</p>
## Bootstrap-based Hypothesis Testing Demonstration
### Boostrap and Methods for Hypothesis Testing, Difference in Means
* we calculate the hypothesis test for differe... | github_jupyter |
# Individual Project
## Barber review in Gliwice
### Wojciech Pragłowski
#### Data scraped from [booksy.](https://booksy.com/pl-pl/s/barber-shop/12795_gliwice)
```
import requests
from bs4 import BeautifulSoup
booksy = requests.get("https://booksy.com/pl-pl/s/barber-shop/12795_gliwice")
soup = BeautifulSoup(books... | github_jupyter |
```
from sklearn.datasets import make_blobs
from sklearn.svm import SVC
import matplotlib.pyplot as plt
import numpy as np
X,y=make_blobs(n_samples=50,centers=2,random_state=0,cluster_std=0.6)
plt.scatter(X[:,0],X[:,1],c=y,s=50,cmap='rainbow')
plt.show()
print(X.shape)
# print(X)
clf=SVC(kernel="linear").fit(X,y)
# pl... | github_jupyter |
# Systems of Nonlinear Equations
## CH EN 2450 - Numerical Methods
**Prof. Tony Saad (<a>www.tsaad.net</a>) <br/>Department of Chemical Engineering <br/>University of Utah**
<hr/>
# Example 1
A system of nonlinear equations consists of several nonlinear functions - as many as there are unknowns. Solving a system of n... | github_jupyter |
[Table of contents](../toc.ipynb)
# Deep Learning
This notebook is a contribution of Dr.-Ing. Mauricio Fernández.
Institution: Technical University of Darmstadt, Cyber-Physical Simulation Group.
Email: fernandez@cps.tu-darmstadt.de, mauricio.fernandez.lb@gmail.com
Profiles
- [TU Darmstadt](https://www.maschinenbau... | github_jupyter |
# Quantum Simple Harmonic Oscillator
Motion of a quantum simple harmonic oscillator is guided by time independent Schr$\ddot{o}$dinger equation -
$$
\frac{d^2\psi}{dx^2}=\frac{2m}{\hbar^2}(V(x)-E)\psi
$$
In simple case, we may consider the potential function $V(x)$ to be square well one, which can be described by
$$... | github_jupyter |
(pandas_plotting)=
# Plotting
``` {index} Pandas: plotting
```
Plotting with pandas is very intuitive. We can use syntax:
df.plot.*
where * is any plot from matplotlib.pyplot supported by pandas. Full tutorial on pandas plots can be found [here](https://pandas.pydata.org/pandas-docs/stable/user_guide/visualiz... | github_jupyter |
# Fundamentos de *Python* para Computação Científica
## Python como calculadora de bolso
Nesta seção mostraremos como podemos fazer cálculos usando Python como uma calculadora científica. Como Python é uma *linguagem interpretada*, ela funciona diretamente como um ciclo *LAI (Ler-Avaliar-Imprimir)*. Isto é, ela lê um... | github_jupyter |
<a href="https://colab.research.google.com/github/leandrobarbieri/pydata-book/blob/2nd-edition/Pandas.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Pandas
```
# Importando os pacotes/modulos do pandas
import pandas as pd
from pandas import Seri... | github_jupyter |
# Machine Learning with PyTorch and Scikit-Learn
# -- Code Examples
## Package version checks
Add folder to path in order to load from the check_packages.py script:
```
import sys
sys.path.insert(0, '..')
```
Check recommended package versions:
```
from python_environment_check import check_packages
d = {
... | github_jupyter |
# Script to plot GALAH spectra, but also save them into python dictionaries
## Author: Sven Buder (SB, MPIA) buder at mpia dot de
This script is intended to plot the 4 spectra of the arms of the HERMES spectrograph
History:
181012 - SB created
```
try:
%matplotlib inline
%config InlineBackend.figure_for... | github_jupyter |
# What is the True Normal Human Body Temperature?
#### Background
The mean normal body temperature was held to be 37$^{\circ}$C or 98.6$^{\circ}$F for more than 120 years since it was first conceptualized and reported by Carl Wunderlich in a famous 1868 book. But, is this value statistically correct?
<div class="sp... | github_jupyter |
```
import pandas as pd
import numpy as np
# Matplotlib forms basis for visualization in Python
import matplotlib.pyplot as plt
# We will use the Seaborn library
import seaborn as sns
sns.set()
# Graphics in SVG format are more sharp and legible
get_ipython().run_line_magic('config', "InlineBackend.figure_format ... | github_jupyter |
```
import re
import os
import pandas as pd
import numpy as np
import scipy as sp
import seaborn as sns
from ipywidgets import interact
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
import matplotlib
import matplotlib.pyplot as plt
import json
%matplotlib inline
... | github_jupyter |
<a id='Top'></a>
# MultiSurv results by cancer type<a class='tocSkip'></a>
C-index value results for each cancer type of the best MultiSurv model trained on all-cancer data.
```
%load_ext autoreload
%autoreload 2
%load_ext watermark
import sys
import os
import numpy as np
import pandas as pd
import matplotlib
imp... | github_jupyter |
## **Initialize the connection**
```
import sqlalchemy, os
from sqlalchemy import create_engine
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
%reload_ext sql
%config SqlMagic.displaylimit = 5
%config SqlMagic.feedback = False
%config SqlMagic.autopandas = True
hxe_connect... | github_jupyter |
# Preprocessing for numerical features
In this notebook, we will still use only numerical features.
We will introduce these new aspects:
* an example of preprocessing, namely **scaling numerical variables**;
* using a scikit-learn **pipeline** to chain preprocessing and model
training;
* assessing the generalizati... | github_jupyter |
Notebook - análise exploratória de dados
Gabriela Caesar
29/set/2021
Pergunta a ser respondida
- Defina a sua UF e o ano no input e veja as estatísticas básicas da sua UF/ano quanto ao casamento LGBT
```
# importacao da biblioteca
import pandas as pd
# leitura do dataframe
lgbt_casamento = pd.read_csv('https://raw... | github_jupyter |
# `model_hod` module tutorial notebook
```
%load_ext autoreload
%autoreload 2
%pylab inline
import logging
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WARNING)
pil_logger = logging.getLogger('PIL')
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.size'] = 18
plt.rcParams['a... | github_jupyter |
```
#default_exp resnet_08
#export
from ModernArchitecturesFromScratch.basic_operations_01 import *
from ModernArchitecturesFromScratch.fully_connected_network_02 import *
from ModernArchitecturesFromScratch.model_training_03 import *
from ModernArchitecturesFromScratch.convolutions_pooling_04 import *
from ModernArchi... | github_jupyter |
```
#hide
#skip
! [ -e /content ] && pip install -Uqq self-supervised
#default_exp vision.swav
```
# SwAV
> SwAV: [Unsupervised Learning of Visual Features by Contrasting Cluster Assignments](https://arxiv.org/pdf/2006.09882.pdf)
```
#export
from fastai.vision.all import *
from self_supervised.augmentations import *... | github_jupyter |
# Premier league: How has VAR impacted the rankings?
There has been much debate about the video assistant referee (VAR) when it was introduced last year (in 2019).
The goal is to lead to fairer refereeing, but concerns are high on whether this will really be the case and the fact that it could break the rythm of the g... | github_jupyter |
載入SparkContext和SparkConf
```
from pyspark import SparkContext
from pyspark import SparkConf
conf = SparkConf().setAppName('appName').setMaster('local')
sc = SparkContext(conf=conf)
```
先建立M(i,j)的mapper1, 將index j取出來當成key;
再建立N(j,k)的mapper1, 將index j取出來當成key
```
def mapper1(line):
wordlist = line.split(",")
m... | github_jupyter |
```
#v1
#26/10/2018
dataname="epistroma" #should match the value used to train the network, will be used to load the appropirate model
gpuid=0
patch_size=256 #should match the value used to train the network
batch_size=1 #nicer to have a single batch so that we can iterately view the output, while not consuming too... | github_jupyter |
# Objective
Perform the exploratory data analysis (EDA) to find insights in the AWS pricing data
# Code
## Load libs
```
import sys
sys.path.append('..')
import random
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from src.data.helpers import load_aws_dataset
```
## Input params
```
int... | github_jupyter |
# CirComPara Pipeline
To demonstrate Dugong ́s effectiveness to distribute and run bioinformatics tools in alternative computational environments, the CirComPara pipeline was implemented in a Dugong container and tested in different OS with the aid of virtual machines (VM) or cloud computing servers.
CirComPara is a ... | 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 |
# Generic Integration With Credo AI's Governance App
Lens is primarily a framework for comprehensive assessment of AI models. However, in addition, it is the primary way to integrate assessment analysis with Credo AI's Governance App.
In this tutorial, we will take a model created and assessed _completely independen... | github_jupyter |
<a href="https://colab.research.google.com/github/araffin/rl-tutorial-jnrr19/blob/master/4_callbacks_hyperparameter_tuning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Stable Baselines Tutorial - Callbacks and hyperparameter tuning
Github repo... | github_jupyter |
# Introduction
<hr style="border:2px solid black"> </hr>
**What?** `__call__` method
# Definition
<hr style="border:2px solid black"> </hr>
- `__call__` is a built-in method which enables to write classes where the instances behave like functions and can be called like a function.
- In practice: `object()` is shor... | github_jupyter |
# TensorFlow
Installing TensorFlow: `conda install -c conda-forge tensorflow`
## 1. Hello Tensor World!
```
import tensorflow as tf
# Create TensorFlow object called tensor
hello_constant = tf.constant('Hello World!')
with tf.Session() as sess:
# Run the tf.constant operation in the session
output = sess.r... | github_jupyter |
# Supercritical Steam Cycle Example
This example uses Jupyter Lab or Jupyter notebook, and demonstrates a supercritical pulverized coal (SCPC) steam cycle model. See the ```supercritical_steam_cycle.py``` to see more information on how to assemble a power plant model flowsheet. Code comments in that file will guide y... | github_jupyter |
## Observations and Insights
```
# Dependencies and Setup
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as st
import numpy as np
from scipy.stats import linregress
# Study data files
mouse_metadata_path = "data/Mouse_metadata.csv"
study_results_path = "data/Study_results.csv"
# Read the mous... | github_jupyter |
# A canonical asset pricing job
Let's estimate, for each firm, for each year, the alpha, beta, and size and value loadings.
So we want a dataset that looks like this:
| Firm | Year | alpha | beta |
| --- | --- | --- | --- |
| GM | 2000 | 0.01 | 1.04 |
| GM | 2001 | -0.005 | 0.98 |
...but it will do this for every ... | github_jupyter |
# NYC PLUTO Data and Noise Complaints
Investigating how PLUTO data and zoning characteristics impact spatial, temporal and types of noise complaints through out New York City. Specifically looking at noise complaints that are handled by NYC's Department of Environmental Protection (DEP).
All work performed by Zoe Mar... | github_jupyter |
```
import os
import re
import random
import tensorflow as tf
import tensorflow.python.platform
from tensorflow.python.platform import gfile
import numpy as np
import pandas as pd
import sklearn
from sklearn import metrics
from sklearn import model_selection
import sklearn.linear_model
from sklearn.model_selection imp... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.