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
Crash type | All crashes | Nonfatal injury crashes (A or B) | Fatal crashes | Group | |
---|---|---|---|---|---|
Lane-changing/merging/turning | 97,000 | 6000 | 444 | All trucks | |
Angle (without lane-changing) | 35,000 | 6000 | 783 | All trucks | |
Front-to-rear (without lane-changing) | 84,000 | 9000 | 681 | All trucks | |
Single-vehicle (without lane-changing) | 102,000 | 8000 | 850 | All trucks | |
Front-to-front head-on (without lane-changing) | 3000 | 1000 | 492 | All trucks | |
Front-to-front other (without lane-changing) | 1000 | <1000 | 126 | All trucks | |
Sideswipe same direction (without lane-changing) | 48,000 | 3000 | 203 | All trucks | |
Sideswipe opposite direction (without lane-changing) | 13,000 | 3000 | 522 | All trucks | |
Other (e.g., rear-to-rear, end-swipe, unknown) | <1000 | <1000 | 48 | All trucks |
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
function tableout = quote_delim_table(tablein, delimiter, varargin) | |
%% wrap all strings in table that contain a delimiter with a quote character | |
% SYNTAX | |
% tableout = quote_delim_table(tablein, delimiter) | |
% tableout = quote_delim_table(tablein, delimiter, quotechar) | |
% | |
% DESCRIPTION | |
% tableout = quote_delim_table(tablein, delimiter) all character columns in | |
% tablein, and wraps strings containing delimiter with a double quote ('"') | |
% |
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
function auc = AUC(pred, act) | |
%% compute the AUC for Kaggle competitions | |
% auc = AUC(pred, act) returns the AUC value on [0, 1]. pred is the predicted | |
% class membership, {0, 1}, and act is the actual class membership, also {0, 1} | |
% | |
% Sources: | |
% http://link.springer.com/article/10.1023%2FA%3A1010920819831 | |
% http://www.kaggle.com/c/SemiSupervisedFeatureLearning/forums/t/919/auc-implementation/6130 | |
% | |
% Kristofer D. Kusano - 6/24/14 |
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
function table = tabulate_wgt(x, frequency) | |
%TABULATE Frequency table. | |
% TABLE = TABULATE(X, FREQUENCY) takes a vector X and returns a matrix, TABLE. | |
% The first column of TABLE contains the unique values of X. The | |
% second is the number of instances of each value. The last column | |
% contains the percentage of each value. If the elements of X are | |
% non-negative integers, then the output includes 0 counts for any | |
% integers that are between 1 and max(X) but do not appear in X. The counts | |
% (second column) and percentage (third column) use frequency. | |
% |
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
function p = chutes_and_ladders() | |
%% Chutes and ladder game | |
% Plays chutes and ladders game on a 10x10 board. All players start off the | |
% board (position 0). Players take turns rolling a 6-sided dice and moving up | |
% the board. There are 10 chutes and 9 ladders that can skip players ahead. | |
% Rolling a 6 allows the player to roll again. Rolling 3 consecutive 6's, | |
% however, sends the player back to space 1. The player is stuck at space 1 | |
% until they roll a 6 again. | |
% | |
% chutes_and_ladders.m |