Skip to content

Instantly share code, notes, and snippets.

View jeffcav's full-sized avatar

Jefferson Cavalcante jeffcav

  • CESAR
  • Brazil
View GitHub Profile
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@michaelguia
michaelguia / poly.py
Created March 6, 2017 22:26
Polynomial features labeled in a dataframe
def PolynomialFeatures_labeled(input_df,power):
'''Basically this is a cover for the sklearn preprocessing function.
The problem with that function is if you give it a labeled dataframe, it ouputs an unlabeled dataframe with potentially
a whole bunch of unlabeled columns.
Inputs:
input_df = Your labeled pandas dataframe (list of x's not raised to any power)
power = what order polynomial you want variables up to. (use the same power as you want entered into pp.PolynomialFeatures(power) directly)
Ouput: