repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
dataDogma/Computer-Science
Courses/DAT-208x/.ipynb_checkpoints/DAT208X - Week 5 - Section 1 - Plotting_with_MatplotLib-checkpoint.ipynb
gpl-3.0
# Print the last item from year and pop # print(year[-1]) # print(pop[-1]) # Import matplotlib.pyplot as plt # import matplotlib.pyplot as plt # Make a line plot: year on the x-axis, pop on the y-axis # plt.plot( year, pop) # plt.show() """ Explanation: Table of Content Why Visualization is important Exercise 1 ...
Hyperparticle/deep-learning-foundation
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
vravishankar/Jupyter-Books
pandas/09.Pandas - Applications to Finance.ipynb
mit
# import pandas, numpy and other libraries import pandas as pd import pandas_datareader.data as web import numpy as np import datetime import matplotlib.pyplot as plt # set some pandas options pd.set_option('display.notebook_repr_html',False) pd.set_option('display.max_columns', 6) pd.set_option('display.max_rows',10)...
zipeiyang/liupengyuan.github.io
chapter4/pandas_Tutorial_4(visualization).ipynb
mit
%matplotlib inline from pandas import Series, DataFrame import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt #import seaborn as sns #即使不适用seaborn内的功能,也可以使绘图自动带有seaborn风格 # df = pd.read_excel('https://github.com/liupengyuan/python_tutorial/blob/master/chapter4/countrys_freq.xlsx?r...
silburt/rebound2
ipython_examples/Churyumov-Gerasimenko.ipynb
gpl-3.0
import rebound sim = rebound.Simulation() sim.add("Sun") sim.add("Jupiter") sim.add("Saturn") """ Explanation: 67P/Churyumov–Gerasimenko This tutorial teaches you how to use the IAS15 integator (Rein and Spiegel, 2015) to simulate the orbit of 67P/Churyumov–Gerasimenko. We will download the data from NASA Horizons and...
ClementPhil/deep-learning
sentiment-network/Sentiment_Classification_Projects.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
tpin3694/tpin3694.github.io
python/ifelse_on_any_or_all_elements.ipynb
mit
# import pandas as pd import pandas as pd """ Explanation: Title: If Else On Any Or All Elements Slug: ifelse_on_any_or_all_elements Summary: If Else On Any Or All Elements Date: 2016-05-01 12:00 Category: Python Tags: Basics Authors: Chris Albon Preliminaries End of explanation """ # Create an example dataframe d...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_dipole_fit.ipynb
bsd-3-clause
from os import path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.forward import make_forward_dipole from mne.evoked import combine_evoked from mne.simulation import simulate_evoked data_path = mne.datasets.sample.data_path() subjects_dir = op.join(data_path, 'subjects') fname_ave = op....
taliamo/Final_Project
organ_pitch/Scripts/upload_env_data.ipynb
mit
# I import useful libraries (with functions) so I can visualize my data # I use Pandas because this dataset has word/string column titles and I like the readability features of commands and finish visual products that Pandas offers import pandas as pd import matplotlib.pyplot as plt import re import numpy as np %matp...
keras-team/autokeras
docs/ipynb/structured_data_classification.ipynb
apache-2.0
TRAIN_DATA_URL = "https://storage.googleapis.com/tf-datasets/titanic/train.csv" TEST_DATA_URL = "https://storage.googleapis.com/tf-datasets/titanic/eval.csv" train_file_path = tf.keras.utils.get_file("train.csv", TRAIN_DATA_URL) test_file_path = tf.keras.utils.get_file("eval.csv", TEST_DATA_URL) """ Explanation: A ...
armandosrz/UdacityNanoMachine
customer_segments/customer_segments.ipynb
apache-2.0
# Import libraries necessary for this project import numpy as np import pandas as pd from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the wholesale custo...
aakashsinha19/Aspectus
Image Classification/models/slim/slim_walkthough.ipynb
apache-2.0
import matplotlib %matplotlib inline import matplotlib.pyplot as plt import math import numpy as np import tensorflow as tf import time from datasets import dataset_utils # Main slim library slim = tf.contrib.slim """ Explanation: TF-Slim Walkthrough This notebook will walk you through the basics of using TF-Slim to...
ecalio07/enron-paper
deliver/.ipynb_checkpoints/010617-WJGH-art_struc-checkpoint.ipynb
gpl-3.0
## Functions import sys sys.path.append("../dev") import bib_mri as FW import numpy as np import scipy as scipy import scipy.misc as misc import matplotlib as mpl import matplotlib.pyplot as plt from numpy import genfromtxt import platform %matplotlib inline def sign_extract(seg, resols): #Function for shape signa...
ericmjl/tiki-tracker-analysis-2016
Data Analysis.ipynb
mit
tracker_ids_time = {'F4:B8:5E:C4:54:BE':datetime(2016, 1, 28, 12, 1, 0), 'F4:B8:5E:DD:42:D2':datetime(2016, 1, 28, 9, 52, 0), 'F4:B8:5E:C4:5F:8C':datetime(2016, 1, 28, 10, 12, 0), 'F4:B8:5E:C4:8F:EE':datetime(2016, 1, 26, 9, 59, 0), '68:9E:...
JanetMatsen/Neo4j_meta4
jupyter/prepare_whole_network.ipynb
gpl-3.0
! ls -lh ../waffle_network_dir/*.tsv ! wc -l ../waffle_network_dir/network.py.tsv ! head -n 5 ../waffle_network_dir/network.py.tsv | csvlook -t ! ls -lh ../waffle_network_dir/network.py.tsv """ Explanation: The network directory in this share (which is still uploading, btw) contains a pickle (data.pkl) and the cod...
crystalzhaizhai/cs207_yi_zhai
lectures/L17/L17.ipynb
mit
import sqlite3 """ Explanation: Lecture 17: Databases Monday, November 6th 2017 Introduction Why Learn Databases You will see many databases in your career. SQL (Structured Query Language) is still very popular and will remain so for a long time. Hence, you will need to code SQL. SQL is the language used to qu...
dtamayo/MachineLearning
Day2/Transit Classification - Before we start .ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets from sklearn.cross_validation import train_test_split from sklearn.metrics import confusion_matrix import matplotlib from matplotlib import pyplot as plt %matplotlib inline #load the dataset, introduce the structur...
xtr33me/deep-learning
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
sz2472/foundations-homework
homework12/311_time_series_homework.ipynb
mit
df=pd.read_csv("311-2014.csv",nrows=20000) df.head() df.columns df.info() dateutil.parser.parse('07/16/1990').month def parse_date (str_date): return dateutil.parser.parse(str_date)#dateutil is a module, import parser class, then transform a string into a python time object df['Created Date']= df['Created Date...
dchad/malware-detection
mmcc/feature-reduction.ipynb
gpl-3.0
train_data = pd.read_csv('data/train-malware-features-asm.csv') labels = pd.read_csv('data/trainLabels.csv') sorted_train_data = train_data.sort(columns='filename', axis=0, ascending=True, inplace=False) sorted_train_labels = labels.sort(columns='Id', axis=0, ascending=True, inplace=False) X = sorted_train_data.iloc[:,...
kaleoyster/nbi-data-science
Finding+Time+Interval+Before+Intervention+of+Bridge+Components.ipynb
gpl-2.0
from pymongo import MongoClient import time import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib.pyplot import * import datetime as dt import random as rnd import warnings import datetime as dt import csv %matplotlib inline warnings.filterwarnings(action="ignore"...
mbeyeler/opencv-machine-learning
notebooks/08.01-Understanding-k-Means-Clustering.ipynb
mit
import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') """ Explanation: <!--BOOK_INFORMATION--> <a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="width: 76px; height: 100px; background: white; ...
brclark-usgs/flopy
examples/Notebooks/flopy3_swi2package_ex4.ipynb
bsd-3-clause
%matplotlib inline import os import sys import platform import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import flopy print(sys.version) print('numpy version: {}'.format(np.__version__)) print('matplotlib version: {}'.format(mpl.__version__)) print('flopy version: {}'.format(flopy.__version_...
m2dsupsdlclass/lectures-labs
labs/10_unsupervised_generative_models/Variational_AutoEncoders.ipynb
mit
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm from tensorflow.keras.layers import Input, Dense, Lambda, Flatten, Reshape, Conv2D, Conv2DTranspose from tensorflow.keras.models import Model from tensorflow.keras import metrics from tensorflow.keras.datasets impo...
mne-tools/mne-tools.github.io
dev/_downloads/a786781c3c54739f0be7add5b76a068f/50_ssvep.ipynb
bsd-3-clause
# Authors: Dominik Welke <dominik.welke@web.de> # Evgenii Kalenkovich <e.kalenkovich@gmail.com> # # License: BSD-3-Clause import matplotlib.pyplot as plt import mne import numpy as np from scipy.stats import ttest_rel """ Explanation: Frequency-tagging: Basic analysis of an SSVEP/vSSR dataset In this tutoria...
norsween/data-science
springboard-answers-to-exercises/Mini_Project_Naive_Bayes-Answers.ipynb
gpl-3.0
%matplotlib inline import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.cm as cm import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from six.moves import range # Setup Pandas pd.set_option('display.width', 500) pd.set_option('display.max_columns', 100) pd.set_option('...
maxis42/ML-DA-Coursera-Yandex-MIPT
4 Stats for data analysis/Homework/10 test multiple hypothesis testing/Test Multiple hypothesis testing.ipynb
mit
from __future__ import division import numpy as np import pandas as pd from scipy import stats from statsmodels.sandbox.stats.multicomp import multipletests %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns from itertools import combinations from IPython.core.interactiveshell import Interac...
vzg100/Post-Translational-Modification-Prediction
old/Lysine Acetylation -MLP -dbptm.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] for i in par: print("y", i) y = Predictor() y.load_data(file="Data/Trainin...
torgebo/deep_learning_workshop
3-convnet/convolutional-network.ipynb
mit
# Plots will be displaying plots within the notebook %matplotlib notebook import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator # NumPy is a package for manipulating N-dimensional array objects import numpy as np # Pandas is a data analysis package import pandas as pd #Library To test/verify som...
brettavedisian/phys202-2015-work
assignments/assignment09/IntegrationEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy import integrate def X(x): return x**2 I,e=integrate.quad(X,0,3) I """ Explanation: Integration Exercise 2 Imports End of explanation """ def integrand(x, a): return 1.0/(x**2 + a**2) def integral_approx...
LogicWang/ml
deep/tf/deepdream/deepdream.ipynb
apache-2.0
# boilerplate code from __future__ import print_function import os from io import BytesIO import numpy as np from functools import partial import PIL.Image from IPython.display import clear_output, Image, display, HTML import tensorflow as tf """ Explanation: DeepDreaming with TensorFlow Loading and displaying the m...
tensorflow/docs-l10n
site/zh-cn/tutorials/text/transformer.ipynb
apache-2.0
#@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 agreed to in writing, software # distributed under...
rishuatgithub/MLPy
nlp/UPDATED_NLP_COURSE/04-Semantics-and-Sentiment-Analysis/00-Semantics-and-Word-Vectors.ipynb
apache-2.0
# Import spaCy and load the language library import spacy nlp = spacy.load('en_core_web_lg') # make sure to use a larger model! nlp(u'lion').vector """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Semantics and Word Vectors Sometimes called "opinion mining", Wikipedi...
osemer01/regression-w-unknown-feature-names
regression_wo_knowing_feature_names.ipynb
cc0-1.0
import matplotlib.pyplot as plt %matplotlib inline import numpy as np """ Explanation: Regression with Unknown Feature Names Author Information: Oguz Semerci<br> oguz.semerci@gmail.com<br> Summary of the investigation We have in hand a regression problem with 5000 observations and 254 features, whose names are not kno...
avicennax/jedi
.ipynb_checkpoints/Noise axons and the binary DFORCE-checkpoint.ipynb
mit
import pylab as plt import numpy as np %matplotlib inline from __future__ import division from scipy.integrate import odeint,ode from numpy import zeros,ones,eye,tanh,dot,outer,sqrt,linspace,cos,pi,hstack,zeros_like,abs,repeat from numpy.random import uniform,normal,choice %config InlineBackend.figure_format = 'retina'...
quantopian/research_public
notebooks/data/eventvestor.earnings_calendar/notebook.ipynb
apache-2.0
# import the dataset from quantopian.interactive.data.eventvestor import earnings_calendar as dataset # or if you want to import the free dataset, use: # from quantopian.data.eventvestor import earnings_calendar_free # import data operations from odo import odo # import other libraries we will use import pandas as pd...
nguy/AWOT
examples/awot_radar_cross_section.ipynb
gpl-2.0
# Load the needed packages from glob import glob import matplotlib.pyplot as plt import numpy as np import awot from awot.graph.common import create_basemap from awot.graph import RadarHorizontalPlot, RadarVerticalPlot, FlightLevel %matplotlib inline import warnings warnings.filterwarnings("ignore", category=Depreca...
rflamary/POT
notebooks/plot_WDA.ipynb
mit
# Author: Remi Flamary <remi.flamary@unice.fr> # # License: MIT License import numpy as np import matplotlib.pylab as pl from ot.dr import wda, fda """ Explanation: Wasserstein Discriminant Analysis This example illustrate the use of WDA as proposed in [11]. [11] Flamary, R., Cuturi, M., Courty, N., & Rakotomamonjy,...
queirozfcom/python-sandbox
python3/notebooks/files-directories-2021/Untitled.ipynb
mit
new_directory_path = "/path/to/new/directory" if not os.path.exists(new_directory_path): os.mkdir(new_directory_path) """ Explanation: Create directory if not exists End of explanation """ new_directory_path = "/path/to/new/directory" if not os.path.exists(new_directory_path): os.makedirs(new_directory_pat...
kecnry/autofig
docs/tutorials/limits.ipynb
gpl-3.0
import autofig import numpy as np #autofig.inline() t = np.linspace(0, 2*np.pi, 101) x = np.sin(t) y1 = np.cos(t) y2 = -0.5*y1 y3 = 1.5*y1 """ Explanation: Autofig Limits End of explanation """ fig1 = autofig.Figure() fig1.plot(x=t, y=y1, i='x', marker='None', color='b', linestyle='solid', uncover=True) fig1.plot(...
vvscloud/python-notes
python-data-structures.ipynb
mit
a = [1,2,3,4] b = a a[2] = 44 # b list also changes here b a is b # This shows a and b references are same """ Explanation: Python datastructures notes This contains operations on lists, dictionaries and tuples Also covers - Augumented assignment trick - Map, filter and lambda - Iterators - Generators List operati...
pyannote/pyannote-audio
tutorials/applying_a_model.ipynb
mit
# clone pyannote-audio Github repository and update ROOT_DIR accordingly ROOT_DIR = "/Users/bredin/Development/pyannote/pyannote-audio" AUDIO_FILE = f"{ROOT_DIR}/tutorials/assets/sample.wav" from pyannote.database.util import load_rttm REFERENCE = f"{ROOT_DIR}/tutorials/assets/sample.rttm" reference = load_rttm(REFERE...
citxx/sis-python
crash-course/lists.ipynb
mit
a = [1, 2, "Hi"] # Создать список и присвоить переменной `а` этот список print(a[0], a[1], a[2]) # Обращение к элементам списка, индексация с нуля b = list() # Создать пустой список c = [] # Другой способ создать пустой список """ Explanation: <h1>Содержание<span class="tocSki...
SubhankarGhosh/NetworkX
7. Bipartite Graphs (Student).ipynb
mit
G = cf.load_crime_network() G.edges(data=True)[0:5] G.nodes(data=True)[0:10] """ Explanation: Introduction Bipartite graphs are graphs that have two (bi-) partitions (-partite) of nodes. Nodes within each partition are not allowed to be connected to one another; rather, they can only be connected to nodes in the othe...
oxpeter/library_bioinformatics_service
Pandas/Pandas plotting.ipynb
apache-2.0
import pandas as pd df_asthma = pd.read_csv("data/asthma.csv") df_asthma.head() """ Explanation: Intermediate Pandas : Plotting with Pandas, Matplotlib and Seaborn A short workshop run by the Library Bioinformatics Service tinyurl.com/wcmpandas05 Based on the Data Carpentry curriculum for Data Visualization in Pytho...
elinahkk/Masters
GHCN_Data_Analysis.ipynb
mit
def get_date(date_number): """ Turn the int64 value from the DATE of GHCN into a pd.datetime """ dstring = str(date_number) return pd.datetime(int(dstring[0:4]),int(dstring[4:6]),int(dstring[6:8])) def get_df(fnm, var, no_missing = True): """ Create a dataframe for a single station, with a ...
SunnyBUPT/Awesome_Machine_Learning
Feature Engineering/KMeans Impute Missing Data.ipynb
mit
import numpy as np from sklearn.cluster import KMeans def kmeans_missing(X, n_clusters, max_iter=10): """Perform K-Means clustering on data with missing values. Args: X: An [n_samples, n_features] array of data to cluster. n_clusters: Number of clusters to form. max_iter: Maximum number of E...
h0s/c3py
docs/c3py_examples.ipynb
mit
import c3py from IPython.display import HTML """ Explanation: <h1>Contents</h1> <div id="table_of_contents"></div> <h1>c3py</h1> c3py is a Python wrapper around c3js (http://c3js.org/). <h2>Introduction</h2> c3js has a function named <a href="http://c3js.org/gettingstarted.html#generate">generate</a>, which takes ...
Yichuans/wilderness-wh
old_with_antarctica/wilderness_analysis_with_antarctica.ipynb
gpl-3.0
# load default libraries import os, sys import matplotlib.pyplot as plt import numpy as np import pandas as pd # make sure gdal is correctly installed from osgeo import gdal import gc %matplotlib inline """ Explanation: Wilderness World Heritage analysis for the marine environment Based on the discussion with Basti...
prasants/pyds
02.Python_Basics.ipynb
mit
print ("Hello World!") """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Welcome-to-Python" data-toc-modified-id="Welcome-to-Python-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Welcome to Python</a></div><div class="lev2 toc-item"><a href="#Exercise" data-toc-modified-id="Exercise-11"><sp...
leoferres/prograUDD
labs/ejercicios_for.ipynb
mit
passwd = input("Ingrese su contraseña: ") if len(passwd) < 8: print("Contraseña no valida, faltan caracteres") else: cantnum = 0 cantsimb = 0 for i in passwd: if i.isdigit(): cantnum += 1 elif not i.isalpha(): cantsimb += 1 if cantsimb != 1: print("Co...
bauman/bsonsearch
bsonsearch_project_bson_vs_json.ipynb
mit
import bson import re from bsonsearch import bsoncompare from datetime import datetime bc = bsoncompare() source_data = {"a":[bson.objectid.ObjectId(), datetime.now(), re.compile(r".*test string.*", re.IGNORECASE)]} echo_projection = bc.generate_matcher({"$project":{"a":True}}) source_data_doc_id = bc.generate_doc(sour...
TomTranter/OpenPNM
examples/extractions/Managing Geometrical Properties of Imported Networks.ipynb
mit
import numpy as np import openpnm as op ws = op.Workspace() ws.settings['loglevel'] = 50 # Supress warnings, but see error messages """ Explanation: Managing Geometry Properties of Imported Networks The Imported geometry class is used to store the geometrical properties of imported networks. When importing an extrac...
abelatnvidia/tfodapi
lab/intro_obj_detection.ipynb
apache-2.0
import os import io import sys import PIL import json import copy import random import zipfile import tarfile import operator import collections import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import six.moves.urllib as urllib import PIL.ImageDraw as ImageDraw import PIL.ImageFont as Image...
gaufung/Data_Analytics_Learning_Note
DesignPattern/ProxyPattern.ipynb
mit
info_struct=dict() info_struct['addr']=10000 info_struct['content']='' class Server(object): content='' def recv(self, info): pass def send(self, info): pass def show(self): pass class infoServer(Server): def recv(self,info): self.content=info return 'recv OK!...
pysal/pysal
notebooks/explore/giddy/Mobility measures.ipynb
bsd-3-clause
from pysal.explore.giddy import markov,mobility mobility.markov_mobility? """ Explanation: Measures of Income Mobility Author: Wei Kang &#119;&#101;&#105;&#107;&#97;&#110;&#103;&#57;&#48;&#48;&#57;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;, Serge Rey &#115;&#106;&#115;&#114;&#101;&#121;&#64;&#103;&#109;&...
theandygross/CancerData
Notebooks/Download_From_Firehose.ipynb
mit
import NotebookImport from Imports import * """ Explanation: <h1 class="alert alert-info">Initialization <small> <i class="icon-download"></i> Download and process all of the data fom Firehose</small></h1> Notebook Summary Here we are downloading and processing most of the necissary data to run this analysis pipeli...
avirmaux/parrainage
affectation.ipynb
gpl-3.0
# Nom de fichiers fichierParrain = "parrains.csv" fichierFilleul = "filleuls.csv" fichierResultat = "parrainage.csv" # Imports import csv import glob import pulp # LP # pulp.pulpTestAll() # Test """ Explanation: Parrainage Usage: Deux fichiers situé dans le même repertoire que cette feuille: - parrains.csv - fill...
tanmay987/deepLearning
intro-to-tflearn/TFLearn_Digit_Recognition.ipynb
mit
# Import Numpy, TensorFlow, TFLearn, and MNIST data import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist """ Explanation: Handwritten Number Recognition with TFLearn and MNIST In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9. This...
tensorflow/tensorflow
tensorflow/lite/g3doc/models/modify/model_maker/text_classification.ipynb
apache-2.0
#@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 agreed to in writing, software # distributed under...
tukkyr/nlp100
nlp100.ipynb
mit
import random string = "I couldn't believe that I could actually understand what I was reading : the phenomenal power of the human mind ." def typoglycemia(string): ans = "" for word in string.split(" "): if len(word) > 4: indexs = range(1,len(word)-1) random.shuffle(indexs) ...
mathnathan/notebooks
dissertation/tests_for_colloquium.ipynb
mit
p = GMM([1.0], np.array([[0.5,0.05]])) num_samples = 1000 beg = 0.0 end = 1.0 t = np.linspace(beg,end,num_samples) num_neurons = len(p.pis) colors = [np.random.rand(num_neurons,) for i in range(num_neurons)] p_y = p(t) p_max = p_y.max() np.random.seed(110) num_neurons = 1 neuron = Neuron((1,1),[[0.6]], bias=0.0006, ...
irockafe/revo_healthcare
notebooks/MTBLS315/exploratory/Old_notebooks/MTBLS315_uhplc_pos_classifer-25ppm.ipynb
mit
import time import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from sklearn import preprocessing from sklearn.ensemble import RandomForestClassifier from sklearn.cross_validation import StratifiedShuffleSplit from sklearn.cross_validation import cross_val_score #from sklearn....
fantasycheng/udacity-deep-learning-project
tutorials/autoencoder/Convolutional_Autoencoder.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
raschuetz/foundations-homework
14/14 - TF-IDF Homework.ipynb
mit
# If you'd like to download it through the command line... !curl -O http://www.cs.cornell.edu/home/llee/data/convote/convote_v1.1.tar.gz # And then extract it through the command line... !tar -zxf convote_v1.1.tar.gz """ Explanation: Homework 14 (or so): TF-IDF text analysis and clustering Hooray, we kind of figured ...
Hyperparticle/deep-learning-foundation
lessons/tensorboard/Anna_KaRNNa_Hyperparameters.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
yongtang/tensorflow
tensorflow/compiler/xla/g3doc/tutorials/autoclustering_xla.ipynb
apache-2.0
#@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 agreed to in writing, software # distributed under...
Yu-Group/scikit-learn-sandbox
jupyter/backup_deprecated_nbs/10_RIT_initial_setup.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import pydotplus import numpy as np import pprint from sklearn import metrics from sklearn import tree from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn import tree from sklearn.tree import _tree from...
metpy/MetPy
v0.5/_downloads/Advanced_Sounding.ipynb
bsd-3-clause
from datetime import datetime import matplotlib.pyplot as plt import metpy.calc as mpcalc from metpy.io import get_upper_air_data from metpy.io.upperair import UseSampleData from metpy.plots import SkewT with UseSampleData(): # Only needed to use our local sample data # Download and parse the data dataset =...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/Automata.ipynb
gpl-3.0
import vcsn vcsn.automaton(''' context = "lal_char(ab), z $ -> p <2> p -> q <3>a,<4>b q -> q a q -> $ ''') """ Explanation: Automata Editing Automata Vcsn provides different means to enter automata. One, which also applies to plain Python, is using the automaton constructor: End of explanation """ %%automaton a co...
darcamo/pyphysim
notebooks/Alamouti.ipynb
gpl-2.0
%matplotlib inline import numpy as np from IPython.display import clear_output from matplotlib import pyplot as plt """ Explanation: Alamouti Space-time block code This notebook illustrates the simulation of an Alamouti MIMO scheme transmission through a flat fading Rayleight channel. It also illustrates how to read c...
vanheck/blog-notes
Analyzes/Volatile movements/01 Volatile movements in python and pandas 1.ipynb
mit
import pandas as pd import pandas_datareader.data as web import datetime start = datetime.datetime(2015, 1, 1) end = datetime.datetime(2018, 8, 31) spy_data = web.DataReader('SPY', 'yahoo', start, end) spy_data = spy_data.drop(['Volume', 'Adj Close'], axis=1) # sloupce 'Volume' a 'Adj Close' nebudu potřebovat spy_dat...
bourneli/deep-learning-notes
DAT236x Deep Learning Explained/.ipynb_checkpoints/Lab3_MultiLayerPerceptron-checkpoint.ipynb
mit
# Figure 1 Image(url= "http://3.bp.blogspot.com/_UpN7DfJA0j4/TJtUBWPk0SI/AAAAAAAAABY/oWPMtmqJn3k/s1600/mnist_originals.png", width=200, height=200) """ Explanation: Lab 3 - Multi Layer Perceptron with MNIST This lab corresponds to Module 3 of the "Deep Learning Explained" course. We assume that you have successfully ...
girving/tensorflow
tensorflow/contrib/lite/tutorials/post_training_quant.ipynb
apache-2.0
! pip uninstall -y tensorflow ! pip install -U tf-nightly import tensorflow as tf tf.enable_eager_execution() ! git clone --depth 1 https://github.com/tensorflow/models import sys import os if sys.version_info.major >= 3: import pathlib else: import pathlib2 as pathlib # Add `models` to the python path. mo...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/formulas.ipynb
bsd-3-clause
import numpy as np # noqa:F401 needed in namespace for patsy import statsmodels.api as sm """ Explanation: Formulas: Fitting models using R-style formulas Since version 0.5.0, statsmodels allows users to fit statistical models using R-style formulas. Internally, statsmodels uses the patsy package to convert formulas...
abulbasar/machine-learning
Scikit - 31 Credit Card Fraud Classification Problem.ipynb
apache-2.0
df.Amount.values[training_size:][(y_test == 0) & (y_test_predict == 0)].sum() """ Explanation: Sum of amounts in the TN bucket of the test dataset. End of explanation """ df.Amount.values[training_size:][(y_test == 1) & (y_test_predict == 0)].sum() 100 * 8336.05/7224977.58 """ Explanation: Sum of amounts in the FN...
lhcb/opendata-project
LHCb_Open_Data_Project.ipynb
gpl-2.0
from __future__ import print_function from __future__ import division %pylab inline execfile('Data/setup_main_analysis.py') """ Explanation: Measuring Matter Antimatter Asymmetries at the Large Hadron Collider Introduction Press the grey arrow to expand each section <b> Welcome to the first guided LHCb Open Data Po...
IST256/learn-python
content/lessons/07-Files/SmallGroup-Files.ipynb
mit
!curl https://httpbin.org/ -o httpbin-org.html !curl https://ischool.syr.edu/directory/?cat=all -o ischool-directory.html !curl https://ist256.com -o ist256-com.html !curl https://en.wikipedia.org/wiki/President_of_the_United_States -o wikipedia-president-of-the-united-states.html """ Explanation: Now You Code In ...
ubcgif/gpgLabs
notebooks/seismic/Seis_NMO.ipynb
mit
%pylab inline from geoscilabs.seismic.NMOwidget import ViewWiggle, InteractClean, InteractNosiy, NMOstackthree from SimPEG.utils import download # Define path to required data files synDataFilePath = 'http://github.com/geoscixyz/geosci-labs/raw/main/assets/seismic/syndata1.npy' obsDataFilePath = 'https://github.com/ge...
cdt15/lingam
examples/VARMALiNGAM.ipynb
mit
import numpy as np import pandas as pd import graphviz import lingam from lingam.utils import make_dot, print_causal_directions, print_dagc import warnings warnings.filterwarnings('ignore') print([np.__version__, pd.__version__, graphviz.__version__, lingam.__version__]) np.set_printoptions(precision=3, suppress=Tru...
ES-DOC/esdoc-jupyterhub
notebooks/nims-kma/cmip6/models/sandbox-3/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: NIMS-KMA Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Tracers. Pro...
ssunkara1/bqplot
examples/Marks/Object Model/Bins.ipynb
apache-2.0
# Create a sample of Gaussian draws np.random.seed(0) x_data = np.random.randn(1000) """ Explanation: Bins Mark This Mark is essentially the same as the Hist Mark from a user point of view, but is actually a Bars instance that bins sample data. The difference with Hist is that the binning is done in the backend, so it...
ajgpitch/qutip-notebooks
development/development-smesolve-milstein-speed-test.ipynb
lgpl-3.0
%pylab inline from qutip import * from numpy import log2, cos, sin from scipy.integrate import odeint from qutip.cy.spmatfuncs import cy_expect_rho_vec, spmv """ Explanation: Speed test of stochastic solvers Based on development-smesolve-milstein notebook Denis V. Vasilyev 30 september 2013 Modified by Eric Giguere, ...
dolittle007/dolittle007.github.io
notebooks/lda-advi-aevb.ipynb
gpl-3.0
%matplotlib inline import sys, os import theano theano.config.floatX = 'float64' from collections import OrderedDict from copy import deepcopy import numpy as np from time import time from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.datasets import fetch_20newsgroups import ma...
kgrodzicki/machine-learning-specialization
course-1-machine-learning-foundations/notebooks/week3/Analyzing product sentiment.ipynb
mit
import graphlab """ Explanation: Predicting sentiment from product reviews Fire up GraphLab Create End of explanation """ products = graphlab.SFrame('amazon_baby.gl/') """ Explanation: Read some product review data Loading reviews for a set of baby products. End of explanation """ products.head() """ Explanation...
WillenZh/deep-learning-project
tutorials/autoencoder/Simple_Autoencoder.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
muraliparimi/Python
The_Notebook.ipynb
mit
from google.colab import drive drive.mount('/content/drive') """ Explanation: <a href="https://colab.research.google.com/github/muraliparimi/Python/blob/master/The_Notebook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Welcome to the Notebook Let'...
bobmyhill/burnman
tutorial/tutorial_01_material_classes.ipynb
gpl-2.0
#!pip install -q -e .. import burnman """ Explanation: <h1>The BurnMan Tutorial</h1> Part 1: Material Classes This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU GPL v2 or later. Introductio...
srcole/qwm
burrito/Burrito_correlations.ipynb
mit
%config InlineBackend.figure_format = 'retina' %matplotlib inline import numpy as np import scipy as sp import matplotlib.pyplot as plt import pandas as pd import seaborn as sns sns.set_style("white") """ Explanation: San Diego Burrito Analytics: Correlations Scott Cole 21 May 2016 This notebook investigates the cor...
encima/Comp_Thinking_In_Python
Session_7a/7a_Math_Binary.ipynb
mit
13 % 5 == 3 12 ** 2 == 144 146 % 67 == 12 19 % 8.5 == 2 4 ** (3 % 11) """ Explanation: Math, Representation and Binary Arithmetic Dr. Chris Gwilliams gwilliamsc@cardiff.ac.uk Contents Mathematic Operations Binary Conversion Boolean Logic Binary Arithmetic Operations We have covered (+, -, / and *), but there are mo...
CoderDojoTC/python-minecraft
classroom-code/exercises/Exercise 4 -- Change the Minecraft world using Python.ipynb
mit
import mcpi.minecraft as minecraft import mcpi.block as block from time import sleep """ Explanation: Change the Minecraft world using Python The Pyramid This program links Python to Minecraft and uses that link to change things in the Minecraft world. In the game, move your player to an open area, then work your way ...
google/trax
trax/examples/illustrated_wideresnet.ipynb
apache-2.0
%%capture !pip install --upgrade trax """ Explanation: Author SauravMaheshkar- @MaheshkarSaurav End of explanation """ import trax from trax import layers as tl from trax.supervised import training # Trax offers the WideResnet architecture in it's models module from trax.models.resnet import WideResnet trax.fastma...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/cnrm-cm6-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'cnrm-cm6-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: CNRM-CM6-1 Topic: Atmoschem Sub-Topics: Tra...
bird-house/birdy
notebooks/examples/emu-example.ipynb
apache-2.0
from birdy import WPSClient """ Explanation: Birdy WPSClient example with Emu WPS End of explanation """ emu = WPSClient(url='http://localhost:5000/wps') emu_i = WPSClient(url='http://localhost:5000/wps', progress=True) """ Explanation: Use Emu WPS https://github.com/bird-house/emu End of explanation """ emu.hell...
saashimi/code_guild
wk9/notebooks/.ipynb_checkpoints/ch.1-getting-started-with-django-checkpoint.ipynb
mit
# Make a directory called examples #!mkdir ../examples %cd ../examples !ls # Write functional_tests.py #%%writefile functional_tests.py from selenium import webdriver browser = webdriver.Firefox() browser.get('http://localhost:8000') assert 'Django' in browser.title """ Explanation: Wk9.0 Ch. 1 Getting Django Set...
alanwilter/acpype
Acpype_API_Jupyter.ipynb
gpl-3.0
import acpype from acpype.topol import ACTopol, MolTopol from glob import glob """ Explanation: For calculating topologies via antechamber End of explanation """ print(acpype.__version__) glob("tests/*.pdb") molecule = ACTopol("tests/dmp.pdb", chargeType="gas") molecule.createACTopol() molecule.createMolTopol() ...
opentraffic/reporter-quality-testing-rig
notebooks/map_matching_part_III.ipynb
lgpl-3.0
import os import sys; sys.path.insert(0, os.path.abspath('..')); import validator.validator as val import numpy as np from random import choice import pandas as pd %matplotlib inline """ Explanation: Since we announced our collaboration with the World Bank and more partners to create the Open Traffic platform, we’ve b...
PySCeS/PyscesToolbox
documentation/notebooks/Symca.ipynb
bsd-3-clause
mod = pysces.model('lin4_fb') sc = psctb.Symca(mod) """ Explanation: Symca Symca is used to perform symbolic metabolic control analysis [3,4] on metabolic pathway models in order to dissect the control properties of these pathways in terms of the different chains of local effects (or control patterns) that make up the...
brian-rose/env-415-site
notes/EBM_albedo_feedback.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import climlab # for convenience, set up a dictionary with our reference parameters param = {'D':0.55, 'A':210, 'B':2, 'a0':0.3, 'a2':0.078, 'ai':0.62, 'Tf':-10.} model1 = climlab.EBM_annual( num_lat=180, D=0.55, A=210., B=2., Tf=-10., a0=0.3, a2=0...
matplotlib/mpl-probscale
docs/tutorial/getting_started.ipynb
bsd-3-clause
%matplotlib inline import warnings warnings.simplefilter('ignore') import numpy from matplotlib import pyplot from scipy import stats import seaborn clear_bkgd = {'axes.facecolor':'none', 'figure.facecolor':'none'} seaborn.set(style='ticks', context='talk', color_codes=True, rc=clear_bkgd) """ Explanation: Getting ...