Instantly share code, notes, and snippets.

• Sort options
Last active Jul 7, 2017 — forked from jnothman/bench_semi_supervised_n_iter
Benchmarking `sklearn.semi_supervised` `n_iter_` as a function of model and data characteristics
View bench_semi_supervised_n_iter.py
 import numpy as np from sklearn import datasets from sklearn.semi_supervised import LabelPropagation, LabelSpreading ###for n_samples in [20, 200, 2000, 20000]: ### X, y = datasets.make_classification(n_samples=n_samples, n_classes=3, n_informative=3) for (X, y) in [datasets.load_iris(return_X_y=True)]: for model in [LabelPropagation(max_iter=1000), #LabelSpreading(alpha=0.01), #LabelSpreading(alpha=0.1), #LabelSpreading(alpha=0.3)
Last active Mar 8, 2016 — forked from mbostock/.block
SunBurst with selection rotation

This example is an extension of the original example with the additional feature that clicking on a part of the graph will select it and rotate it to 90 deg.

A sunburst is similar to the treemap, except it uses a radial layout. The root node of the tree is at the center, with leaves on the circumference. The area (or angle, depending on implementation) of each arc corresponds to its value. Sunburst design by John Stasko. Data courtesy Jeff Heer.

Last active Feb 3, 2016 — forked from anonymous/Plotting_clustering_timeseries.R
Plot_cluster.R
View Plotting_clustering_timeseries.R
 par(mfrows=c(clustering\$cluster,1)) for(j in 1:max(clustering\$cluster)) { x <- 1:12 d <- d[clustering\$cluster == j,] plot.default(x = NA, xlim = c(1, 12), ylim = c(min(y), max(y)), xlab = "Time", ylab = "Expression changes", main = paste("Cluster", j), axes = FALSE)
Created Feb 2, 2016 — forked from anonymous/Example code
View Example code.R
 function (eset, cl, mfrow = c(1, 1), colo, min.mem = 0, time.labels, new.window = TRUE) { clusterindex <- cl[[3]] memship <- cl[[4]] memship[memship < min.mem] <- -1 colorindex <- integer(dim(exprs(eset))[[1]]) if (missing(colo)) { colo <- c("#FF8F00", "#FFA700", "#FFBF00", "#FFD700", "#FFEF00", "#F7FF00", "#DFFF00", "#C7FF00", "#AFFF00",
Last active Dec 31, 2015 — forked from korenmiklos/button.css
View button.css
 button { font: 14px Helvetica Neue; background-color: #222; background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11)); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11))); background-image: -webkit-linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.11)); color: #fff; text-rendering: optimizeLegibility; text-shadow: 0 -1px 1px #222; padding: 6px 10px 6px 10px;
Created Dec 10, 2013 — forked from parnelandr/Food.csv
View Food.csv
Food by Deliciousness Source: Andrew Parnell Metadata Notes: Things I think are yummy Food Rating Bananas 7 Green Beans 5 Egg Salad Sandwich 3 Ice Cream 5 Vegemite 8
Last active Dec 29, 2015 — forked from mbostock/.block
6 hour marks with d3's time axis.

The tick format provided by d3.time.scale is a multi-scale tick format, meaning that it formats times differently depending on the time. For example, the start of February is formatted as "February", while February second is formatted as "Feb 2". The format is implemented using an array of time formats, each with an associated filter. The first filter that returns true is used. (In the implementation below, the formats are processed in reverse order.) You can create your own custom multi-scale time format using the same technique with only a few lines of code.

This format prints only hours of days, rounding them to the nearest 6 hours mark.

Last active Dec 29, 2015 — forked from mbostock/.block
D3's time axis with 6 hour marks.

The tick format provided by d3.time.scale is a multi-scale tick format, meaning that it formats times differently depending on the time. For example, the start of February is formatted as "February", while February second is formatted as "Feb 2". The format is implemented using an array of time formats, each with an associated filter. The first filter that returns true is used. (In the implementation below, the formats are processed in reverse order.) You can create your own custom multi-scale time format using the same technique with only a few lines of code.

This format prints only hours of days, rounding them to the nearest 6 hours mark.

Last active Dec 28, 2015 — forked from mbostock/.block
Tree layout with root collapsed
View flare.json
 { "name": "flare", "children": [ { "name": "analytics", "children": [ { "name": "cluster", "children": [ {"name": "AgglomerativeCluster", "size": 3938},
Last active Dec 28, 2015 — forked from mbostock/.block
Set the initial zoom level of a brush.