This file contains 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 | |
''' | |
TODO | |
1. Invoke tearDown even if the test method fails | |
2. Catch and report setUp errors | |
3. Create TestSuite from a TestCase class | |
''' | |
class TestCase(object): | |
def __init__(self, name): |
This file contains 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
# Download data set via: | |
# http://archive.ics.uci.edu/ml/datasets/Statlog+%28German+Credit+Data%29 | |
import numpy as np | |
import pandas as pd | |
from sklearn import tree | |
from sklearn import preprocessing | |
from sklearn.metrics import accuracy_score | |
from sklearn.metrics import confusion_matrix | |
from sklearn_pandas import DataFrameMapper |
This file contains 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
# Download data set via: | |
# http://archive.ics.uci.edu/ml/datasets/Statlog+%28German+Credit+Data%29 | |
# | |
# Note, the example below uses the pre-processed data that is used in the book 'Machine Learning with R' by Brett Lantz | |
library(C50) | |
df <- read.csv("credit.csv", stringsAsFactors=TRUE) | |
set.seed(12345) | |
df_rand <- df[order(runif(1000)),] |
This file contains 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
# Download data set via: | |
# http://archive.ics.uci.edu/ml/datasets/SMS+Spam+Collection | |
import numpy as np | |
import pandas as pd | |
import string | |
from nltk import word_tokenize | |
from nltk.stem.porter import PorterStemmer |
This file contains 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
# Download data set via: | |
# http://archive.ics.uci.edu/ml/datasets/SMS+Spam+Collection | |
# import libraries | |
library(caret) | |
library(e1071) | |
library(tm) | |
library(SnowballC) | |
# read in the dataset |