Skip to content

Instantly share code, notes, and snippets.

@fwhigh
fwhigh / 01_heights_weights_genders.csv
Created August 17, 2013 19:57
Plotting the separating line generated by a logistic regression in R.
Gender Height Weight
Male 73.847017017515 241.893563180437
Male 68.7819040458903 162.310472521300
Male 74.1101053917849 212.7408555565
Male 71.7309784033377 220.042470303077
Male 69.8817958611153 206.349800623871
Male 67.2530156878065 152.212155757083
Male 68.7850812516616 183.927888604031
Male 68.3485155115879 167.971110489509
Male 67.018949662883 175.92944039571
@fwhigh
fwhigh / gist:5602401
Created May 17, 2013 22:30
Example of solving an overdetermined system of linear equations in R. http://fwhigh.github.io/highonscience/2013/05/15/solve-a-system-of-linear-equations-in-R/
### Library
library(limSolve)
### Functions
# Make the matrix A from the puzzle data table
training.to.matrix.A <- function(train)
{
output<-matrix(nrow=nrow(train),ncol=10)
for (i in 1:nrow(train))