Skip to content

Instantly share code, notes, and snippets.

View lanaseto's full-sized avatar

Lana Seto lanaseto

  • San Francisco, CA
View GitHub Profile
@stober
stober / softmax.py
Created March 1, 2012 03:05
Softmax in Python
#! /usr/bin/env python
"""
Author: Jeremy M. Stober
Program: SOFTMAX.PY
Date: Wednesday, February 29 2012
Description: Simple softmax function.
"""
import numpy as np
npa = np.array
@lprowell
lprowell / linear_regression
Last active November 9, 2022 16:03
Code for linear regression, cross validation, gridsearch, logistic regression, etc.
# Linear Regression without GridSearch
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score, cross_val_predict
from sklearn import metrics
X = [[Some data frame of predictors]]
y = target.values (series)