All Projects → christopherjenness → Bootstrap

christopherjenness / Bootstrap

Library for bootstrapping statistics

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Bootstrap

Atd Data And Performance
Open data and performance hub for the City of Austin Transportation Department
Stars: ✭ 17 (+30.77%)
Mutual labels:  bootstrap
1294 Website
The Official Website of the First Robotics FRC Team "1294" Top Gun Robotics
Stars: ✭ 7 (-46.15%)
Mutual labels:  bootstrap
Bootstrap Image Hover
Image hover effects that work with or without bootstrap
Stars: ✭ 858 (+6500%)
Mutual labels:  bootstrap
Webside
基于RBAC的完全响应式权限管理系统
Stars: ✭ 19 (+46.15%)
Mutual labels:  bootstrap
Ax5ui Uploader
jQuery file uploader, HTML5(IE9+, FF, Chrome, Safari) - http://ax5.io/ax5ui-uploader/
Stars: ✭ 25 (+92.31%)
Mutual labels:  bootstrap
Bower Bootstrap Css
Twitter Bootstrap for Bower
Stars: ✭ 7 (-46.15%)
Mutual labels:  bootstrap
Codeigniter Smartgrid
A simple PHP datagrid control for CodeIgniter framework with Bootstrap
Stars: ✭ 16 (+23.08%)
Mutual labels:  bootstrap
Librecms
Free Open Source Content Management System, based on PHP, Bootstrap and jQuery.
Stars: ✭ 12 (-7.69%)
Mutual labels:  bootstrap
Databook
A facebook for data
Stars: ✭ 26 (+100%)
Mutual labels:  bootstrap
Startbootstrap New Age
A web app landing page theme created by Start Bootstrap
Stars: ✭ 855 (+6476.92%)
Mutual labels:  bootstrap
Mailslurper
Local, web-based mail server application. Slurp mails into oblivion!
Stars: ✭ 920 (+6976.92%)
Mutual labels:  bootstrap
Gitit Bootstrap
A gitit theme based on Bootstrap
Stars: ✭ 24 (+84.62%)
Mutual labels:  bootstrap
Metro Ui Css
Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
Stars: ✭ 6,843 (+52538.46%)
Mutual labels:  bootstrap
Auto App
Crie um aplicativo com todas as tabelas de um dos seus bancos sem uma linha de código.
Stars: ✭ 18 (+38.46%)
Mutual labels:  bootstrap
Cider
Hassle-free bootstrapping with Homebrew.
Stars: ✭ 858 (+6500%)
Mutual labels:  bootstrap
Ui Kit
UI Kit: React + Bootstrap theme
Stars: ✭ 17 (+30.77%)
Mutual labels:  bootstrap
Select2 Bootstrap Theme
A Select2 v4 Theme for Bootstrap 3
Stars: ✭ 841 (+6369.23%)
Mutual labels:  bootstrap
Flatstrap
Bootstrap without all the extra stuff
Stars: ✭ 875 (+6630.77%)
Mutual labels:  bootstrap
Bootstrap Msg
The jQuery plugin for showing message with Bootstrap alert classes
Stars: ✭ 10 (-23.08%)
Mutual labels:  bootstrap
Tools
Arefly's Tools Source Code
Stars: ✭ 9 (-30.77%)
Mutual labels:  bootstrap

Bootstrap

TRAVIS Coverage Status

A library for bootstrapping statistics.

Features

While incomplete, the library already incudes a number of features:

  • Bootstrap samples
  • Bootstrap matrices
  • Bootstrap statistics
    • Provides SEM and confidence intervals for statistics
  • Jackknife samples and statistics
  • Two sample testing

Installation

python setup.py install

Usage

Here, we document some of the library features using the University of Wisconsin breast cancer data set. Available here. For simplicity, only the first dimension will be looked at.

import numpy as np
from sklearn.datasets import load_breast_cancer
data = load_breast_cancer()

First, we will look at how the data are distributed.

import matplotlib.pyplot as plt
import seaborn as sns
plt.hist(data.data[:,0], bins=40)
plt.title('Measurements')

Data

Next, we will bootstrap 10,000 samples, to bootstrap the mean and 95% confidence interval for the mean. Below, the mean of each bootstrapped sample is plotted, with the estimated mean and confidence intervals shown.

results = bootstrap_statistic(data.data[:,0], func=np.mean, n_samples=10000)

# Make plot of bootstrapped mean
plt.hist(results.statistics, bins=40)
plt.title('Bootstrapped Means')
plt.xlabel('Mean')
plt.ylabel('Counts')
ax = plt.gca()
ax.axvline(x=results.ci[0], color='red', linestyle='dashed', linewidth=2)
ax.axvline(x=results.ci[1], color='red', linestyle='dashed', linewidth=2)
ax.axvline(x=results.statistic, color='black', linewidth=5)

Mean

An advantage of the bootstrap method is its adaptability. For example, you can bootstrap an estimate of the 95th percentile of the data.

def percentile(data):
    """returns 95th percentile of data"""
    return np.percentile(data, 95)
    
# Bootstrap the 95th percentile
results = bootstrap_statistic(data.data[:,0], func=percentile, n_samples=10000)

# Make plot of bootstrapped 95th percentile
plt.hist(results.statistics, bins=40)
plt.title('Bootstrapped 95th Percentiles')
plt.xlabel('95th Percentile')
plt.ylabel('Counts')
ax = plt.gca()
ax.axvline(x=results.ci[0], color='red', linestyle='dashed', linewidth=2)
ax.axvline(x=results.ci[1], color='red', linestyle='dashed', linewidth=2)
ax.axvline(x=results.statistic, color='black', linewidth=5)

Percentile

Additionally, the library can perform two sample testing. First lets view the distribution of the same data, but broken up by tumor type.

benign = data.data[data.target == 0]
malignant = data.data[data.target == 1]

# Plot benign and malignant samples
plt.hist(benign[:,0], bins=30, alpha=0.5, label='benign')
plt.hist(malignant[:,0], bins=30, alpha=0.5, label='malignant')
plt.legend()
plt.xlabel('Measurement')
plt.ylabel('Counts')

split

It appears their is a different in the groups distribution. The level of significance can be computer via the bootstrap method.

significance = two_sample_testing(benign[:, 0], malignant[:, 0],
                                  statistic_func=compare_means,
                                  n_samples=5000)
print(significance) # prints 0.0

Hmmm, with 5,000 random bootstrapped samples, not a single one had the difference of means of the observed samples.

What about a feature that is less predictive? Below, we look at feature 9.

plt.hist(benign[:,9], bins=30, alpha=0.5, label='benign')
plt.hist(malignant[:,9], bins=30, alpha=0.5, label='malignant')
plt.legend()
plt.xlabel('Measurement')
plt.ylabel('Counts')

Feature9

If then bootstrap the difference between the two means, we get a non-significant difference.

significance = two_sample_testing(malignant[:, 9], benign[:, 9],
                                  statistic_func=compare_means,
                                  n_samples=5000)
print(significance) # prints 0.387
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].