Skip to content

Instantly share code, notes, and snippets.

@sc268
sc268 / classification
Created July 11, 2014 17:41
final - simplified
{
"metadata": {
"name": "classfication.ipynb"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sc268
sc268 / synthetic_data.R
Created June 20, 2014 16:40
synthetic data for logistic regression
# --- synthetic data for logistic regression #
# Sean Chang 2014
# sean.chang@duke.edu
# sample size
n = 1e4
x <- rnorm(n, -1, 0.5) + rnorm(n,0.5,0.5)
# transfer x to [0,1]
x = exp(x)/(1+exp(x))