start new:
tmux
start new with session name:
tmux new -s myname
| See comment https://github.com/jpmml/jpmml-sklearn/issues/38 (vruusmann commented on Apr 19) | |
| If you want to apply one-hot-encoding to string columns, then you should simply use the sklearn.preprocessing.LabelBinarizer transformer class for that. It has exactly the same effect as a sequence of LabelEncoder followed by OneHotEncoder. | |
| mapper = DataFrameMapper([ | |
| ("country_name", LabelBinarizer()) | |
| ]) | |
| The OneHotEncoder transformation makes sense if your input data contains categorical integer columns. | |
| Currently, sklearn_pandas.DataFrameMapper is unable to apply [LabelEncoder(), OneHotEncoder()] on a string column due to the above "matrix transpose" problem. You could additionally open an issue with the sklearn_pandas project, and ask for their opinion about it. | 
| #include <Python.h> // Must be first | |
| #include <vector> | |
| #include <stdexcept> | |
| #include "PyUtils.h" | |
| using namespace std; | |
| // ===== | |
| // LISTS | |
| // ===== | 
| import org.zouzias.spark.lucenerdd.LuceneRDD | |
| import org.zouzias.spark.lucenerdd._ | |
| val df = spark.read.parquet("spark-lucenerdd/quora_duplicate_questions.parquet") | |
| val linker = {r: Row => { val tokens = r.getString(r.fieldIndex("question1")).split(" ").map(_.replaceAll("[^a-zA-Z0-9]", "")).filter(_.length > 3).mkString(" AND ") | |
| if (tokens.nonEmpty) s"question1:(${tokens})" else "*:*"}} | |
| from distutils.core import setup | |
| from distutils.extension import Extension | |
| from Cython.Distutils import build_ext | |
| ext_modules = [ | |
| Extension("test_um", | |
| ["test_um.pyx"], | |
| include_dirs=["/usr/local/include/boost"], | |
| library_dirs=["/usr/local/lib"], | |
| language="c++") | 
| import org.apache.spark.sql.Row | |
| import org.apache.spark.sql.types.{StructField,StructType,IntegerType, LongType} | |
| val df = sc.parallelize(Seq((1.0, 2.0), (0.0, -1.0), (3.0, 4.0), (6.0, -2.3))).toDF("x", "y") | |
| // Append "rowid" column of type Long | |
| val newSchema = StructType(df.schema.fields ++ Array(StructField("rowid", LongType, false))) | |
| // Zip on RDD level | |
| val rddWithId = df.rdd.zipWithIndex | 
| val geometryToWKT = udf((a: Seq[Seq[Seq[Double]]]) => "POLYGON ((" + a.head.map(x => x.head + " " + x.last).mkString(", ") + "))") | 
| 1. Install kernelspec for python3 | |
| Make sure it is not there | |
| jupyter kernelspec list | |
| jupyter kernelspec install /usr/local/Cellar/python3/3.6.1/bin/ | 
| wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
| sudo apt-get install apt-transport-https | |
| echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
| sudo apt-get update && sudo apt-get install elasticsearch | |
| sudo update-rc.d elasticsearch defaults 95 10 | 
| 31. Ποιος κηρύσσεται ανυπότακτος και πως διακόπτεται η ανυποταξία; | |
| Ανυπότακτοι, σύμφωνα με το Νόμο περί Στρατολογίας των Ελλήνων, κηρύσσονται όσοι, μετά από γενική ή ειδική πρόσκληση για κατάταξη στις Ένοπλες Δυνάμεις, δεν κατατάσσονται στις ορισμένες ημερομηνίες ή προθεσμίες στις μονάδες κατάταξης, χωρίς να υπάρχει νόμιμος λόγος παραμονής τους εκτός των Ενόπλων Δυνάμεων (αναβολή ή απαλλαγή). Η ανυποταξία διακόπτεται στις παρακάτω περιπτώσεις: | |
| α. Με τη συμπλήρωση του τεσσαρακοστού πέμπτου (45ου )έτους της ηλικίας του ανυπότακτου. | |
| β. Με την κατάταξη στις Ένοπλες Δυνάμεις. | |
| γ. Με τη σύλληψη για την ανυποταξία. | |
| δ. Με την παρουσίαση του ανυπότακτου σε οποιαδήποτε στρατιωτική αρχή για την διακοπή της ανυποταξίας του. |