Skip to content

Instantly share code, notes, and snippets.

@dansbecker
dansbecker / predict_from_text.py
Created July 19, 2017 16:07 — forked from tyarkoni/predict_from_text.py
simple example predicting binary outcome from text features with sklearn
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
import pandas as pd
import numpy as np
# Grab just two categories from the 20 newsgroups dataset
categories=['sci.space', 'rec.autos']
@dansbecker
dansbecker / predict_from_text.py
Last active July 19, 2017 16:29 — forked from tyarkoni/predict_from_text.py
simple example predicting binary outcome from text features with sklearn (with extra comments for Alon)
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
# A pipeline "stitches together" the various steps of a modeling process into a single piece. You should either try to get a separate explanation of this, or try to do without it.
# In general pipelines are pretty cool. But, one more thing to learn.
from sklearn.pipeline import Pipeline
import pandas as pd
import numpy as np
@dansbecker
dansbecker / readme.md
Created May 16, 2016 06:17 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman