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
require(spls) | |
require(MASS) | |
data(prostate) | |
pca <- prcomp(prostate$x) | |
plot(pca$x,main="Principal components mapping of Prostate data",xlab="Dim 1",ylab="dim 2") | |
plot(pca$x,main="Principal components mapping of Prostate data",xlab="Dim 1",ylab="dim 2",pch=prostate$y+1) | |
sam <- sammon(dist(prostate$x)) | |
plot(sam$points,main="Sammon mapping of Prostate data",xlab="Dim 1",ylab="Dim 2",pch=prostate$y+1) |
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
<!-- save to <Sublime Text path>/Packages/User/Snippets or anywhere in <Sublime Text path>/Packages/ --> | |
<!-- with Sublime Text 3 on OSX Mavericks, <Sublime Text path> would be "~/Library/Application Support/Sublime Text 3" --> | |
<snippet> | |
<content><![CDATA[ | |
functions{ | |
} |
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
Show hidden characters
{ | |
"cmd": ["ls -l *.html"], | |
"shell": true, | |
"working_dir": "${project_path:${folder}}", | |
"selector": ["source.html", "source.javascript", "source.css"], | |
"osx": { | |
"cmd": ["open ${file_base_name}.html"], | |
"shell": true |
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/env bash | |
## Process the "Housing" data set from the UCI Machine Learning Data Repository | |
## download the "housing" dataset; this will also tell you how big it is | |
curl https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data -O | |
## check if it has carriage returns in line endings | |
if [[ -z $(egrep -l $'\r$' < housing.data) ]]; then echo 'no CR line endings' | |
else echo 'has CR line endings' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>D3 - Line Chart - continuous function</title> | |
<!-- script type="text/javascript" src="https://raw.github.com/jquery/sizzle/master/sizzle.js"></script --> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.min.js"></script> | |
<style type="text/css"> | |
body { |
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
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
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
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
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
on run {input, parameters} | |
tell application "Finder" | |
set currentSelection to selection | |
set currentFolder to target of front Finder window as text | |
end tell | |
tell application "iTerm" -- this should work if you replace "iTerm" with "Terminal" (untested) | |
if currentSelection = {} then | |
set thePath to POSIX path of currentFolder |
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
import numpy as np | |
import pandas as pd | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.datasets import load_iris | |
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier | |
from sklearn.pipeline import Pipeline | |
seed = 43770 | |
rng = np.random.RandomState(seed) |
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 bash | |
# Copyright (c) 2015, 2020, and 2021 by Greg Werbin. | |
# | |
# Permission to use, copy, modify, and/or distribute this software for any purpose with | |
# or without fee is hereby granted, provided that the above copyright notice and this | |
# permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED “AS IS” AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS | |
# SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT |
OlderNewer