This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Example of job definition (as add job using crontab -e): | |
| # .---------------- minute (0 - 59) | |
| # | .------------- hour (0 - 23) | |
| # | | .---------- day of month (1 - 31) | |
| # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... | |
| # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat | |
| # | | | | | | |
| # * * * * * user-name command to be executed | |
| # 30 02 15,28 * * /root/opkg_updater.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Updates: | |
| 1. Using tensorboardX to replace tensorboard_logger as I prefer tensorboardX's API | |
| 2. Log the tree growth process, which would be displayed under "IMAGES" tab in Tensorboard | |
| ''' | |
| import pandas as pd | |
| import xgboost as xgb | |
| from sklearn.model_selection import train_test_split |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- When encoutner "SQL Error [42704]: ERROR: type "geography" does not exist", try the following | |
| CREATE EXTENSION Postgis; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Windows: | |
| knime.exe -consoleLog -noexit -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="PathToYourWorkflow.zip" -destFile="OutputPathToYourWorkflow.zip" | |
| # Mac | |
| /Applications/KNIME\ 3.5.3.app/Contents/MacOS/Knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="PathToYourWorkflow.zip" -destFile="OutputPathToYourWorkflow.zip" | |
| # Linux | |
| knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="PathToYourWorkflow.zip" -destFile="OutputPathToYourWorkflow.zip" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| paras = jsonlite::read_json("/path/to/config.json") | |
| do.call("func", paras) # analogue using dictionary as keywoard paramters `func(**paras)` in python | |
| do.call(func, paras) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| # var ~ grp | |
| ggplot(aes(x = grp, y = var)) + geom_boxplot() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Credit to Paul Klemm's post [Load rJava in RStudio using macOS 10.12](http://paulklemm.com/blog/2017-02-12-fix-onload-failed-rjava-macos/) | |
| dyn.load(paste0(system2('/usr/libexec/java_home', stdout = TRUE), '/jre/lib/server/libjvm.dylib')) | |
| # then load any packages associated to JVM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mixtools) | |
| mixmdl = normalmixEM(train$y) | |
| plot(mixmdl, which = 2) | |
| lines(density(train$y), lty=2, lwd=2) | |
| # credit to [Ron Pearson](https://www.r-bloggers.com/fitting-mixture-distributions-with-the-r-package-mixtools/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sklearn | |
| ###################### | |
| # Estimator | |
| ###################### | |
| # (Analogue to Keras) Initialization all-in-one | |
| # bind symbol | |
| # define loss function + optimizer | |
| # (optional) metrics for output evaluation |
NewerOlder