Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Strelioff cstrelioff

View GitHub Profile
@cstrelioff
cstrelioff / README.md
Created April 2, 2015 18:35
a basic responsive page
View README.md
View README.md

decision trees: cross-validation

This script provides an example of using cross-validation to fine-tune parameters for learning a decision tree with scikit-learn.

A blog post about this code is available here, check it out!

Requirements

@cstrelioff
cstrelioff / README.md
Last active August 13, 2018 17:09
textmine + lda in python
View README.md

process corpus for lda

In a blog post I wrote about the python package lda, see here, I used the pre-processed data (included with the lda package) for the example. I have since received many questions regarding the document-term matrix, the titles, and the vocabulary-- where do they come from? This gist will use the textmining package to (hopefully) help answer these types of questions.

@cstrelioff
cstrelioff / README.md
Last active June 4, 2018 16:31
decision trees: scikit-learn + pandas
View README.md

decision trees: scikit-learn + pandas

This script provides an example of learning a decision tree with scikit-learn. Pandas is used to read data and custom functions are employed to investigate the decision tree after it is learned. Grab the code and try it out.

A blog post about this code is available here, check it out!

@cstrelioff
cstrelioff / README.md
Last active April 13, 2018 09:59
An example of writing LDA topic probabities to csv file
View README.md

write LDA topic probabilities to csv

This gist shows one way to write the topic distribution for each document to a csv file-- this can be loaded into Excel, or similar program, for viewing. The topic distribution considered here is created by the Python package lda. See my blog post on lda for more information.

@cstrelioff
cstrelioff / README.md
Last active February 14, 2018 09:15
Python + Bayes -- example 3
View README.md

A script that replicates all examples in my blog post on inferring probabilities using a Beta prior-- see bayes post for more information.

Run all the examples

    $ python ex003_bayes.py
@cstrelioff
cstrelioff / README.md
Last active November 16, 2017 04:36
Python + Latent Dirichlet Allocation -- example 2
View README.md

A script that replicates all examples in my blog post on using the lda Python package for Latent Dirichlet Allocation-- see my lda post for more information.

Run all the examples

    $ python ex002_lda.py
@cstrelioff
cstrelioff / index.html
Created April 10, 2015 20:55
responsive svg bar chart
View index.html
<!DOCTYPE html>
<html>
<head>
<title>responsive svg bar chart</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- styles: should have reset.css first -->
<link rel="stylesheet" href= "reset.css">
<link rel="stylesheet" href= "main.css">
@cstrelioff
cstrelioff / Infer_Markov_Chain_Ex.ipynb
Last active March 17, 2017 15:20
Use k-order Markov chains for infer models of data using CMPy
View Infer_Markov_Chain_Ex.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cstrelioff
cstrelioff / READEME.md
Last active January 8, 2016 23:20
counter example with external javascript files
View READEME.md

counter exampe with external js files

This is an example of using external javascript files and using the jquery ready() method to execute code when the DOM is loaded (ie, ready). To get this to work:

  1. Download index.html, mycode.js, and jquery-1.11.3.min.js to your computer.
    • Note that I have not include the jquery file here, you'll have to grab this from other examples at the course website.
  2. Put all of the files in the same directory or folder.
  3. Open index.html in your browser and things should work as before, except for the fact that we are using external javascript files