AWS: SageMaker clean
/////////////////////////
  After you testing SageMaker, it is a good idea to clean your 
    operation to avoid unnecessary charge. 

Method 1:  Solution page --> [go the bottom] 
               --> clcik 'Delete all resources'

Method 2: AWS Management Consol
          -> SageMaker -> Inference -> Endpoints
          -> notebook -> 

Method 3: Click S3, search today's date
          delete related materials
 
Method 4: go to CloudWatch
          -> logs -> log groups
          ->
/////////////////////////

Converting categorical variables
/////////////////////////
from sklearn.preprocessing import OneHotEncoder

enc = OneHotEncoder(sparse=False) # Create a OneHotEncoder instance

# list of categorical variables
vars=["Housing", "Saving accounts","Checking account", "Purpose", "Risk"]

encoded_data = enc.fit_transform(df[vars]) # Encode categorical variables using OneHotEncoder

# Create a DataFrame with the encoded variables
encoded_df=pd.DataFrame(encoded_data,columns = enc.get_feature_names(vars))

/////////////////////////

How to activate an R function
////////////////////////////////
Method #1: type it directly 

Method #2: copy and paste
           For example, we could use Notepad to write our program
           then, copy and paste the code to the R console

Method #3: Use the R editor
           Click "File" --> "New Script" and type your code
           a) click "Editor" -> "Run line or selection" 	<=> Ctrl-R
           b) click "Editor" -> "Run all" 	

Method #4 use the source() function 
          For example, we have an R file called test1.R under c:/temp
          source("c:/temp/test1.R")

////////////////////////////////

git bash commands 
/////////////////////////
Most used commands
--------------------------------------
 pwd       show the current working directory
 dir       show the conents of the current working directory
 mkdir tt  make a directory called tt
 cd    tt  go to the next directory called tt
 cd ..     move back to an upper directory 
 cd ../..  move back to twi upper level
 rmdir -r tt  
/////////////////////////