This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import absolute_import | |
| from __future__ import print_function | |
| import numpy as np | |
| from keras.datasets import reuters | |
| from keras.models import Sequential | |
| from keras.layers.embeddings import Embedding | |
| from keras.layers.convolutional import Convolution2D, MaxPooling2D | |
| from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape, Merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # vim:fenc=utf-8 | |
| """ Simple demo of using multiprocessing when parsing files """ | |
| import sys | |
| import os | |
| import codecs | |
| from multiprocessing import Pool, Process, Queue, cpu_count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Implementation of pairwise ranking using scikit-learn LinearSVC | |
| Reference: "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich, | |
| T. Graepel, K. Obermayer. | |
| Authors: Fabian Pedregosa <fabian@fseoane.net> | |
| Alexandre Gramfort <alexandre.gramfort@inria.fr> | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Implementation of pairwise ranking using scikit-learn LinearSVC | |
| Reference: | |
| "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich, | |
| T. Graepel, K. Obermayer 1999 | |
| "Learning to rank from medical imaging data." Pedregosa, Fabian, et al., | |
| Machine Learning in Medical Imaging 2012. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FILE SPACING: | |
| # double space a file | |
| sed G | |
| # double space a file which already has blank lines in it. Output file | |
| # should contain no more than one blank line between lines of text. | |
| sed '/^$/d;G' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stratified = function(df, group, size) { | |
| # USE: * Specify your data frame and grouping variable (as column | |
| # number) as the first two arguments. | |
| # * Decide on your sample size. For a sample proportional to the | |
| # population, enter "size" as a decimal. For an equal number | |
| # of samples from each group, enter "size" as a whole number. | |
| # | |
| # Example 1: Sample 10% of each group from a data frame named "z", | |
| # where the grouping variable is the fourth variable, use: | |
| # |
NewerOlder

